Update: Copyright years now reflect the year that the file was first
committed.
Refs: PLAT-3200
Test Plan: jenkins is still happy and specs pass!!
Change-Id: Ic26463defe41fc52cf4da8020976394c641f51d5
Reviewed-on: https://gerrit.instructure.com/143545
Tested-by: Jenkins
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Stewie aka Nicholas Stewart <nstewart@instructure.com>
closes: CNVS-32365
Test Plan:
1. As a student, submit to an assignment late.
2. In rails console, observe that the submission created in step 1
returns `minutes_late` that accurately represents the number of
minutes late the submission was. This value should be 0 for
not-late submissions.
3. As the student, resubmit to the assignment. In a rails console,
verify the minutes_late has been updated.
4. Repeat steps 1-3 with a quiz instead of an assignment. To get the
submission for a quiz, it will look like:
quiz = Quizzes::Quiz.find_by(title: "My Quiz")
s = quiz.quiz_submissions.find_by(user_id: 173).submission
For quiz submissions, the student should be given one minute of
leeway, meaning if you submit a minute or less after the quiz is
due, minutes_late should be 0. A way you can test it via rails
console:
# make the student's submitted at exactly 1 minute after it was due
irb(main):103:0> s.submitted_at = 1.minute.from_now(s.cached_due_date)
=> Thu, 04 May 2017 06:00:59 UTC +00:00
# verify minutes_late is 0, since quiz submissions get 1 minute of leeway
irb(main):105:0> s.minutes_late
=> 0.0
# make the student's submitted at exactly 2 minutes after it was due
irb(main):106:0> s.submitted_at = 2.minutes.from_now(s.cached_due_date)
=> Thu, 04 May 2017 06:01:59 UTC +00:00
# verify minutes late is 1, since quiz submissions get 1 minute of leeway
irb(main):108:0> s.minutes_late
=> 1.0
Change-Id: I170f798a38d827a0699682cb557c1aa81c73201e
Reviewed-on: https://gerrit.instructure.com/107955
Tested-by: Jenkins
Reviewed-by: Jeremy Neander <jneander@instructure.com>
Reviewed-by: Shahbaz Javeed <sjaveed@instructure.com>
QA-Review: Matt Taylor <mtaylor@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>