Skip to content

Commit 73c26ec

Browse files
author
Davis McClellan
committed
Fix missed created_at and replace it with client_timestamp
fixes CNVS-26913 test plan - Create a quiz and add a question of any type to the quiz. - Open the quiz in safari as a student. - Ensure that the quiz loads correctly Change-Id: I31aecfd63f5753aaa0251377371a732b603a8481 Reviewed-on: https://gerrit.instructure.com/71164 Reviewed-by: Josh Simpson <jsimpson@instructure.com> QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com> Tested-by: Jenkins Product-Review: Davis McClellan <dmcclellan@instructure.com>
1 parent e909760 commit 73c26ec

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

app/coffeescripts/quizzes/log_auditing/event.coffee

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ define (require) ->
88
# @internal Create an Event from the JSON version stored in localStorage.
99
@fromJSON: (descriptor) ->
1010
event = new QuizEvent(descriptor.event_type, descriptor.event_data)
11-
event.recordedAt = new Date(descriptor.created_at)
11+
event.recordedAt = new Date(descriptor.client_timestamp)
1212
event
1313

1414
constructor: (type, data) ->
@@ -54,4 +54,4 @@ define (require) ->
5454
}
5555

5656
toString: ->
57-
JSON.stringify(this.toJSON())
57+
JSON.stringify(this.toJSON())

spec/coffeescripts/quizzes/log_auditing/event_spec.coffee

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,15 @@ define [
1818

1919
test 'QuizEvent.fromJSON', ->
2020
descriptor = {
21-
created_at: (new Date()).toJSON(),
21+
client_timestamp: (new Date()).toJSON(),
2222
event_type: 'some_type',
2323
event_data: {
2424
foo: 'bar'
2525
}
2626
}
2727

2828
event = QuizEvent.fromJSON(descriptor)
29+
ok (event.recorded_at == descriptor.client_timestamp)
2930

3031
equal event.type, descriptor.event_type,
3132
'it parses the type'
@@ -34,4 +35,4 @@ define [
3435
'it parses the custom data'
3536

3637
deepEqual event.recordedAt, new Date(descriptor.created_at),
37-
'it parses the recording timestamp'
38+
'it parses the recording timestamp'

0 commit comments

Comments
 (0)