Skip to content

Commit

Permalink
fix(Timestamp): Save annotations, events, student work with milliseco…
Browse files Browse the repository at this point in the history
…nds (#1878)
  • Loading branch information
geoffreykwan authored Aug 11, 2024
1 parent 652a59b commit 0bf3a36
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
9 changes: 5 additions & 4 deletions src/assets/wise5/services/annotationService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ export class AnnotationService {
annotations: Annotation[] = [];
dummyAnnotationId: number = 1; // used in preview mode when we simulate saving of annotation
private annotationSavedToServerSource: Subject<Annotation> = new Subject<Annotation>();
public annotationSavedToServer$: Observable<Annotation> = this.annotationSavedToServerSource.asObservable();
public annotationSavedToServer$: Observable<Annotation> =
this.annotationSavedToServerSource.asObservable();
private annotationReceivedSource: Subject<Annotation> = new Subject<Annotation>();
public annotationReceived$: Observable<Annotation> = this.annotationReceivedSource.asObservable();

Expand Down Expand Up @@ -318,7 +319,7 @@ export class AnnotationService {
const localNotebookItemId = null;
const notebookItemId = null;
const annotationType = 'autoScore';
const clientSaveTime = Date.parse(new Date().toString());
const clientSaveTime = new Date().getTime();
const annotation = this.createAnnotation(
annotationId,
runId,
Expand Down Expand Up @@ -354,7 +355,7 @@ export class AnnotationService {
const localNotebookItemId = null;
const notebookItemId = null;
const annotationType = 'autoComment';
const clientSaveTime = Date.parse(new Date().toString());
const clientSaveTime = new Date().getTime();
const annotation = this.createAnnotation(
annotationId,
runId,
Expand Down Expand Up @@ -399,7 +400,7 @@ export class AnnotationService {
const localNotebookItemId = null;
const notebookItemId = null;
const annotationType = 'inappropriateFlag';
const clientSaveTime = Date.parse(new Date().toString());
const clientSaveTime = new Date().getTime();
const annotation = this.createAnnotation(
annotationId,
runId,
Expand Down
2 changes: 1 addition & 1 deletion src/assets/wise5/services/studentDataService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ export class StudentDataService extends DataService {
runId: this.ConfigService.getRunId(),
periodId: this.ConfigService.getPeriodId(),
workgroupId: this.ConfigService.getWorkgroupId(),
clientSaveTime: Date.parse(new Date().toString())
clientSaveTime: new Date().getTime()
};
}

Expand Down
5 changes: 3 additions & 2 deletions src/assets/wise5/services/teacherDataService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ export class TeacherDataService extends DataService {
private currentPeriodChangedSource: Subject<any> = new Subject<any>();
public currentPeriodChanged$: Observable<any> = this.currentPeriodChangedSource.asObservable();
private currentWorkgroupChangedSource: Subject<any> = new Subject<any>();
public currentWorkgroupChanged$: Observable<any> = this.currentWorkgroupChangedSource.asObservable();
public currentWorkgroupChanged$: Observable<any> =
this.currentWorkgroupChangedSource.asObservable();

constructor(
private http: HttpClient,
Expand Down Expand Up @@ -158,7 +159,7 @@ export class TeacherDataService extends DataService {
projectId: this.ConfigService.getProjectId(),
runId: this.ConfigService.getRunId(),
workgroupId: this.ConfigService.getWorkgroupId(),
clientSaveTime: Date.parse(new Date().toString()),
clientSaveTime: new Date().getTime(),
context: context,
nodeId: nodeId,
componentId: componentId,
Expand Down
2 changes: 1 addition & 1 deletion src/messages.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -14039,7 +14039,7 @@ Click &quot;Cancel&quot; to keep the invalid JSON open so you can fix it.</sourc
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/services/teacherDataService.ts</context>
<context context-type="linenumber">575</context>
<context context-type="linenumber">576</context>
</context-group>
</trans-unit>
<trans-unit id="6933068701447776492" datatype="html">
Expand Down

0 comments on commit 0bf3a36

Please sign in to comment.