Closes CNVS-15880
- a new model, QuizSubmissionEvent, for tracking events done during a
quiz-taking session
- utilizes the quiz question answer serializers to maintain JSON
representations of the students' answers, which are stored in the
:answers DB column (also in JSON)
- events can be optimized to track only what has really changed between
snapshots of a quiz submission
- all exported records are tagged with the "answered" event type (this
is currently all we have without josh's patch)
- a few fixes were needed for the serializers to function, primarily
adding (no)support for FileUpload and TextOnly questions so they don't
blow up
Extras:
- a new convenience rake task, canvas:quizzes:dump_events that can be
used by support to produce a JSON dump of all the events in a single
quiz submission (for tracking student behavior)
- another rake task, canvas:quizzes:generate_events_from_snapshots, for
use by developers for migrating data in QuizSubmissionSnapshots to
QuizSubmissionEvents for a single quiz (or many). This will hit the DB
TEST PLAN
---- ----
There's no UI in this commit, only touches the DB. You can still test if
you like:
- make sure you got some data logged before you check out this patch:
+ create a quiz and take it by a student, choose different answers
so you log some actions, and then:
- check out the patch
- run `bundle exec rake db:migrate`
- run the command below[1] to generate a JSON dump of the events and
view it for integrity
[1] bundle exec rake canvas:quizzes:dump_events[quiz_submission_id,out]
- replace "quiz_submission_id" with the ID of the student submission
- replace "out" with some path to store the JSON in, like
"./events.json"
Change-Id: Ifd8a43a66aba99780428623b956d868d87e53215
Reviewed-on: https://gerrit.instructure.com/41999
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Reviewed-by: Ryan Taylor <rtaylor@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
fixes CNVS-15716
test plan:
- with DA on
- make a sel_rel'd quiz
- on the quiz show page, click message_students_who
- students without visibility should not show up
- send a message
- make sure only students with visibility get it
- on the show page, click "Show Student Quiz Results"
in the gear menu
- students without visibility should not show up
- with DA off
- repeat the above steps but ensure all students
show up/get the message
Change-Id: I202599a9a0c26430075c2056b553c03a908b0dfd
Reviewed-on: https://gerrit.instructure.com/41545
Reviewed-by: Cameron Sutter <csutter@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
QA-Review: Sean Lewis <slewis@instructure.com>
Product-Review: Mike Nomitch <mnomitch@instructure.com>
fixes CNVS-14094
test plan:
- course with DA as students and teacher
- api show & index
- quizzes index page shows only assigned quizzes
- quizzes show page url redirects to index if
quiz isnt visible to user
- grade calculation
- gradebook/grades page
- calendar events events
- modules filter out quizzes correctly
- observers see same things as their students
- if a student takes a quiz and it is not graded and then
loses visibility, make sure that the GB greys out the cell
rather than showing a submission icon
- same course with DA off works normally
Change-Id: I10b936f1516d6d24f11d74c0bb572051f0b1d1c4
Reviewed-on: https://gerrit.instructure.com/39897
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Mike Nomitch <mnomitch@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Product-Review: Mike Nomitch <mnomitch@instructure.com>
Outstanding quiz submission management is now contained in a dedictated
model, and this controller action provides access to the quiz scoped
actions of #search and #grade. The API endpoint provides JSON access to
these actions.
Closes CNVS-15501
Test Plan:
- Create quizzes with outstanding (unclosed, but overdue) quiz submissions
- Hit the endpoint
/api/v1/courses/:course_id/quizzes/:quiz_id/outstanding_quiz_submissions
- GET JSON to retrieve quiz_submissions which are outstanding
- POST JSON with something like {"quiz_submission_ids": [1,2,3,4]} to grade the QS
Change-Id: I7fe0341379d4dbd70ed25c667bd1c4dc7969b077
Reviewed-on: https://gerrit.instructure.com/41229
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Ryan Taylor <rtaylor@instructure.com>
LDB can not be required to view the results if it's not required to
actually take the quiz, as is consistent with what the setting page
shows.
Closes CNVS-4832
TEST PLAN
---- ----
- enable LDB plugin if you need to
- create a quiz with the LDB options checked (both to take and view
results), and make sure it allows multiple attempts
- save and go to the quiz page (as a teacher)
+ verify you see the LDB columns reading "Yes"
- edit the quiz, turn off the LDB requirement to view the results
+ verify you see only the first LDB column reading "Yes"
- turn them off completely
+ verify you see both columns reading "No"
> Student experience test
- turn back both LDB options on
- visit the quiz as a student in a regular browser
+ verify you can not take the quiz
- turn both options off
+ verify you can take the quiz now
+ take it
- verify you can see the results
- turn back on the option to require LDB for taking the quiz
+ verify you can no longer re-take it, but can still view the
results
- turn back on the option to require LDB for viewing the results
+ verify you can no longer view the results either
Change-Id: Ie82a75b4d028c05d2feddaea14f638e2a82cc697
Reviewed-on: https://gerrit.instructure.com/41235
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Taylor <rtaylor@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Product-Review: Matt Fairbourn <mfairbourn@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
The big change: on browsers that support it (everything except IE8 and
9), we now use a Web Worker for time-limit checks. This is much more
reliable cross-browser than plain setInterval() when tabs are
inactivated as the workers are spawned in an actual background thread
and run until the parent page is killed.
This not only has the benefit of updating every X seconds consistently,
but it will also make sure the quiz is submitted when time is out, even
if the student isn't looking at the Canvas page.
The second change is a secondary defense line: when we submit, we use
either the current time, or the time at which the quiz session should've
timed out, to not confuse support that the student seems to have had
extra time when it was really just JS code being stalled.
Closes CNVS-8463
NEW STUFF
--- -----
- r.js plugin for loading web-workers, if browser support exists,
otherwise returns null so you can define fallback code
TEST PLAN
---- ----
- create a quiz with 1 minute time limit
- in Chrome, open the console tab, right click and enable the "Log
XMLHttpRequests" option so you can see the requests we're making to
the Canvas API
- start taking the quiz by a student, and keep watching the console
- tab away to some other page
+ after like 10 seconds, go back to the quiz page and verify you see
the timer has reached 50 seconds or so
- sleep for a while until the countdown has reached like -7 seconds
+ tab back and verify you see the "Auto-submitting in ..." dialog
+ tab away!!!
- in 7-10 seconds, if you watch the console, you will see that the
quiz is auto-submitting
- if you go back to the tab, you will also see that you are no
longer on the quiz-taking page, but are instead redirected back
to the quiz page just as if you were on that tab
Change-Id: I640b1124de1c397dc7d7b8a2317f66917aa9328c
Reviewed-on: https://gerrit.instructure.com/41236
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
Closes CNVS-9167
TEST PLAN
---- ----
- create a quiz with the question types listed in the ticket
- take the quiz as a student and fill in answers like these:
+ <em>fill in the blank</em>
+ <em>fill in multiple blanks</em>
+ ...
- visit statistics page and generate student analysis report CSV
- open the sheet and verify the answers do not include the <em />
tags, only the text within
Change-Id: I1523578801e27beeb4b29394fdcba93fdbda9bd4
Reviewed-on: https://gerrit.instructure.com/41234
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Taylor <rtaylor@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
Closes CNVS-4342
TEST PLAN
---- ----
- create a quiz with:
+ a matching question and 3 pairs of answers/matches and a bunch of
distractors
+ infinite multiple attempts
+ shuffle answers option turned OFF
- take the quiz by a student:
+ look at the order of the matches
+ submit and re-take
+ verify that the order of the matches has changed (if not, you
may just been hit by the RNG wand, try again)
- turn on the option to shuffle answers and verify the matches still
shuffle like they did without the option
Change-Id: I492fa15f168ff26c50b1300d79ff0c589e626fe2
Reviewed-on: https://gerrit.instructure.com/41237
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Taylor <rtaylor@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
When a quiz is in progress, it should be marked late if the student is
still taking the quiz when the due date is reached. If the lock date
comes up, the quiz should autosubmit at that point. If there is a quiz
timer and a lock date, the lock date overrules the quiz timer.
Closes CNVS-13689
Test Plan:
- Create 4 types of quiz scenarios:
- Lock date only
- submits at lock date
- never marked late
- Lock date and due date
- autosubmits at lock date
- late if submitted after due date
- No due date
- Never late
- Autosubmits at course completion
- Lock date and timer which runs beyond lock date
- Gives the student time until lock, not normal timer
- autosubmits at lock date
- Monitor all these for sane prompts and alerts
- deadline approaching flash messages for LATENESS (occur at T-30
minutes, T-5 minutes, and T-1 minute)
- autosubmission flash prompts (and popup @ T-10 seconds)
Change-Id: I5af9eb360a5f13527b32e7f84c205149bea1935b
Reviewed-on: https://gerrit.instructure.com/40609
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Ryan Taylor <rtaylor@instructure.com>
When quiz submissions are overdue and unsubmitted, we need to provide a
teacher with the means to find and fix those problems. Here we've built
the model access features to enable finding and grading of these
submissions, by quiz_id.
Closes CNVS-15274
Test Plan:
- Confirm passing specs
- No real QA testable features here
- Confirm normal quiz submission behavior
Change-Id: I72c6bd2fc740c31c901e29d26eba9fe87a6baba2
Reviewed-on: https://gerrit.instructure.com/40821
Reviewed-by: Ahmad Amireh <ahmad@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Ryan Taylor <rtaylor@instructure.com>
Closes CNVS-15402
TEST PLAN
---- ----
- create 2+ quizzes in a course
- make some submissions, don't turn them in
- go to quizzes index
- verify your submissions are now graded (you may have to wait a bit
since it's done in a background job)
Change-Id: I80af5523f7549120ca81a5029d9681ddd511bb2b
Reviewed-on: https://gerrit.instructure.com/40862
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Taylor <rtaylor@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
ProServe wants an API endpoint for their LTI which allows for editing of all quizzes
contained in a course similar to that provided by the Quiz Extensions
API endpoint. This provides the ability to edit all quizzes at the
course level with the same type of parameters.
Closes: CNVS-14950
Test Plan:
- Access /api/v1/courses/:course_id/quiz_extensions with POST
- Pass quiz extensions parameters
- Confirm that all quizzes are edited with the appropriate parameters
Change-Id: Ifca1a4937ab356665627ef3f0aa829aeeaddedc7
Reviewed-on: https://gerrit.instructure.com/40331
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Ryan Taylor <rtaylor@instructure.com>
Closes CNVS-15109, CNVS-15173
CHANGES
-------
- "auto-grading" of due submissions that was previously done
synchronously in the index action is now done in a DJ
- when viewing the index page, you don't get to see due/available
dates on load, instead the dates are fetched on the client-side and
load progressively
- new API endpoint for retrieving assignment overrides for a bunch of
quizzes at [GET] /courses/:course_id/quizzes/assignment_overrides
- we now cache the user's quiz permissions
- Canvas AMS API serializer now accepts a new option, see docs
- QuizSerializer behavior changed radically:
- "takeable", "submitted_students", "unsubmitted_students" disabled
- all associations disabled including the submission, assignment
group, and any student participants
- it can now utilize preloaded permissions
Rationale behind disabling things in the serializer is that these were
exclusive for the "show" action, so the next step forwards is to
allow the serializer to recognize different "modes" for output (e.g, for
index and one for show) and tailor the associations/fields accordingly.
Using "#filter" right now isn't cutting it, because assocs get loaded
anyway.
REFACTORING
-----------
- broke down index into three actions for visibility:
1. default, Draft-State version
2. legacy non-DS version that's not reachable in the UI, kept around
until we upgrade the tests
3. ember version
- legacy non-DS ERB code goes into its own file
- moved code that used to grade due submissions inside index to
SubmissionGrader in preparation to remove it from there entirely
- cleaned up internal docs for the Canvas AMS api serializer
TEST PLAN
---- ----
- create ~30 quizzes
+ make one of them have many questions
+ make a good number of submissions (i tested with 420 and 20
students)
- create multiple sections
+ specify date overrides for certain sections, and have at least one
student enrolled in that section
- as a teacher and/or an observer, go to quizzes index
+ verify the page renders fine
+ verify that you see "loading indicators" in the due/available
field which get replaced with actual dates when they're loaded
+ verify it's faster than the version in master (should be at least
60% faster)
- as a student in the general section, go to quizzes index
+ verify the page renders
+ verify you see the same loading behavior for dates as in teacher
view
- as a student in one of the section with overrides, go to index:
+ verify you see the overridden date
Change-Id: I741d89625da1b858148baa95e881fcc75c1802e5
Reviewed-on: https://gerrit.instructure.com/40350
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
Regrade events are not shown in the gradebook history. Adding this
feature will provide a simple and convenient way to see ALL grading
events in one place.
Fixes CNVS-8590
Test Plan:
- Create a quiz event
- Take the quiz with a student
- Regrade the quiz as an instructor
- Confirm that regrades are shown in the gradebook history
Change-Id: I3925f0fefaf80f0426427c774b0fc63835d1f317
Reviewed-on: https://gerrit.instructure.com/39977
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Ryan Taylor <rtaylor@instructure.com>
fixes CNVS-15098, CNVS-15079
test plan:
- as a teacher
- create a quiz
- publish the quiz
- as a student
- take the quiz
- as a teacher
- delete the quiz
- attempt to restore the quiz
- the quiz should restore successfully
Change-Id: I5111e5beeb6debbb43a587689251e2fb62a8d3bc
Reviewed-on: https://gerrit.instructure.com/40159
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ahmad Amireh <ahmad@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
While we can't reproduce locally, this code change will cause an
exception in the future which should provide additional information
about what is happening.
Closes CNVS-14864
Change-Id: I80fb1297a1d76c7fdc51715b09dde345e4ab47fc
Reviewed-on: https://gerrit.instructure.com/40117
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Ryan Taylor <rtaylor@instructure.com>
fixes CNVS-6983
When submitting a quiz question that's too long,
the response that is "unknown error" which isn't
helpful. This provides a useful error message.
test plan:
- Login as a teacher
- EDIT AN EXISTING quiz question
- make the question text more than 16384 characters
- save the question
- you should get an error that tells you why it can't save
- CREATE A NEW quiz question
- make the question text more than 16384 characters
- save the question
- you should get an error that tells you why it can't save
Change-Id: Ida3438a9648c6b8c61f9e4a19c9414f3595a67e8
Reviewed-on: https://gerrit.instructure.com/39748
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
Hide quiz answers for courses with concluded term and restrict_quiz_questions is true
Fixes CNVS-13075
Test Plan
- At the account level, check the option to restrict students from
viewing quiz questions after course end date.
- Set a term to end in the near future.
- Set a course to this term. (NOTE: Do not set course end date within
the course)
- Log into this course as the student and take at least one quiz.
- As the student, go to the completed quiz after the course has
concluded naturally by term end date passing.
- You should not see the quiz questions or answers
Change-Id: Ib06c0e2ab94b297ec0d50f0af5af9697bf2ee132
Reviewed-on: https://gerrit.instructure.com/39351
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Brian Finney <bfinney@instructure.com>
Closes CNVS-3856
TEST PLAN
---- ----
- create a quiz with 3 questions with points possible: 0.42, 0.23, 1
- preview the quiz and get all the questions correctly
- verify you see "1.65 out of 1.65"
- retry with failing some questions
- verify you get the correct score shown
Change-Id: Ib7e830adce26b2c2346eb3a4149e4bc0406a9d35
Reviewed-on: https://gerrit.instructure.com/39295
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Ryan Taylor <rtaylor@instructure.com>
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
A few changes to how the "Let Students See Their Quiz Responses" form
section works:
- if the "Let Students See Their CAs" checkbox is on:
+ we show the date-pickers like usual
+ if the "Only Once" checkbox is turned on:
- we still show them, but they're disabled (teacher can't use,
dates don't go through to the backend)
- if it's off:
+ we totally hide the date-pickers
The primary fix was that the "Only Once" checkbox is no longer tied to
the correct-answer visibility fields, but instead to the
result-visibility fields (which is consistent with how the form looks
like). The back-end will also ignore the showAt/hideAt dates if that
option is turned on.
Closes CNVS-14641
TEST PLAN
---- ----
- go to edit quiz
- verify the UI behavior is as described in the top of this message
- uncheck the "Let Students See Their Correct Answers" option
- check the "Only Once After Each Attempt" option
- save
+ verify your options were saved properly
Change-Id: I4587bcb748e238bf351e90e6707e6244aa3289b7
Reviewed-on: https://gerrit.instructure.com/39190
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
test plan:
* import the package referenced in the ticket into a
draft-state enabled course
* should not have extra assignments created in the
default "Assignments" group
closes #CNVS-13345
Change-Id: I7debc455014b5a44fe2026d85de8b58ad4ae89fb
Reviewed-on: https://gerrit.instructure.com/38673
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
Fudge points were not considered because we were manually summing up the
points for each individual question. The patch makes it so that we use
the pre-calculated #score field for the submission.
Closes CNVS-13645
TEST PLAN
---- ----
- create a quiz with 1 question with 2 points possible
- take it by a student and answer it correctly
- visit quiz stats, verify the numbers are now 2
- add a -1 fudge point
- visit quiz stats, verify that the low/high/avg scores are 1
- manually grade the question up to 2.5 from 2
- visit quiz stats, verify the numbers are now 1.5
Change-Id: I4341a6241b2c94b654b2ddce4439e4cbb71344e8
Reviewed-on: https://gerrit.instructure.com/38668
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
QuizSubmission now supports a new scope "for_students" that will grab
all submissions that are:
- not a teacher preview
- not a teacher-initiated "Student View" one
- submitted by students who really are rolled in a course
Closes CNVS-13694
TEST PLAN
---- ----
- create a quiz with one question
- enter Student View via the course settings
+ take the quiz
+ get out of Student View
- visit the statistics page (or hit the API)
+ verify the attempt is not factored
- generate the CSV of Item-Analysis to verify that IA does not factor
these attempts either
- test the change with Survey quizzes - need to make sure "logged out"
users are still OK where applicable
Change-Id: Ic58569be31576734eb6e309d548a7415c07e08a7
Reviewed-on: https://gerrit.instructure.com/38174
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
fixes CNVS-14403
test plan:
- create a quiz with a due date far in the future (and no time limit)
- take the quiz as a student
- look at the grade_history api for that user
- the graded_at for the quiz assignment should be when it was submitted, not
when it was due (in other words, it should be in the recent past, not the far
future)
Change-Id: I37754b4be5238e240bbc6a9826ea9d7599c9a61f
Reviewed-on: https://gerrit.instructure.com/38154
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
fixes CNVS-9766
test plan:
* turn on the Differentiated Assignments feature flag
* from the quiz edit page
- add a due date for some of the sections, but not all
- save (update quiz)
> the only_visible_to_overrides flag on the quiz should be true
> edit the quiz again and there should not be an
empty due date row for 'Everyone else'
- add a due date for all the sections
- update the quiz
> the only_visible_to_overrides flag should not be there
- edit the quiz so that there are only due dates
for some sections but not all
* on the normal quiz show page and
* on the new Quiz Statistics show page
> there should not be a row in the due date area
for 'Everyone else'
- turn off the DA flag and make sure the quiz show page works
with the 'New Quiz Stats page' flag and without it
- make sure the edit page works with the DA flag off as well
Change-Id: Ifb090a195ff3283d963df12ae7a9eb503f32ee86
Reviewed-on: https://gerrit.instructure.com/34085
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
Product-Review: Cameron Sutter <csutter@instructure.com>
The scope QuizSubmission#logged_out now excludes teacher previews. This
should solve all occurrences of logged-out users mixing up with teacher
preview submissions.
Closes CNVS-7851
TEST PLAN
---- ----
- create a quiz
- preview it, submit your attempt
- click on the "Show Student Quiz Results" and verify that your
preview attempt does not show up
- create a survey quiz and verify that we still get to see the
"Logged Out User" submissions correctly
- verify we don't have any regressions on quiz stats with teacher
previews (a simple API should suffice, they're now configured to
share the same code, so it should work in both places)
Change-Id: I9803a127dd0be6975504e4fe55ccb2acea13d9af
Reviewed-on: https://gerrit.instructure.com/37622
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
Adds an option to Quiz that prevents the students from seeing their
results more than once after their submission.
Closes CNVS-13877
CHANGES
-------
- New option in quiz settings:
"Let Student See Their Responses" => "Only Once After Each Attempt"
- Teacher can always see the student's results
- Moderate dialog allows teacher to manually reset the result-locking
flag, allowing the student one more glimpse
- The flag is reset whenever a new attempt is taken
TEST PLAN
---- ----
- create a quiz
- toggle the new option: "Let Student See Their Responses" then "Only
Once After Each Attempt"
Turn off Ember/quiz stats:
- take the quiz by a student, turn it in:
- verify that you see your results
- reload the page
- verify that you no longer see the results
- take the quiz again:
- verify you see the results once, then not
- go to the moderate page as the teacher
- open the moderate dialog for that student
- check the new option "Let the student see the results one more
time"
- click Save
- reload the page as the student, verify that you see the
results
Turn on Ember/quiz stats:
- repeat the process
Other things to test:
- verify the new field "has_seen_results" is visible in the
submissions API and is documented
- verify the new field "one_time_results" is visible in the quizzes
API and is documented properly
- verify that the new option has no effect if the Quiz option is not
set
- verify that you can always see the student's results as a teacher
(the setting should not affect teachers)
Change-Id: I6eb4909f777e038acf6afc9ef2823352f5ea78be
Reviewed-on: https://gerrit.instructure.com/37544
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
Closes CNVS-14021
TEST PLAN
---- ----
- create a quiz with a question
- try answering the quiz using the QSQ API (see docs)
- verify that your answer is recorded
Change-Id: I667671f639ac0b5c6bc469477b638e70f90f37ff
Reviewed-on: https://gerrit.instructure.com/37372
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
fixes CNVS-13791
with non-eagerloading, the constants might not be present, so we just
have to try to get it, instead of checking if we have it
test plan:
* in development mode, make sure cache_classes is false
* create a quiz with a fill in multiple answers question
* save it
* preview the quiz
* it should not page error
Change-Id: Iacdebd972e4b0d6f404e8f0a6a91a8adecb77ca8
Reviewed-on: https://gerrit.instructure.com/37172
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ahmad Amireh <ahmad@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Closes CNVS-13730
This patch enables the (re)publishing functionality in DS mode. The
issue was that the internals were relying on "workflow_state_changed?"
to be truthy in order to re-publish the quiz, which is not the usual
case in DS where the quiz's WState is always "available" and doesn't
really change between authoring updates.
A side change: Canvas::DraftStateValidations is now covered and
responsible for adding the required validations to classes that mix it
in.
TEST PLAN
---- ----
- create a quiz with draft-state on
- add a question
- save the quiz, publish it
- open a tab on the quiz show page and keep it
- in another tab, edit the quiz, modify the question, hit "Update
Question" and switch back to the show quiz tab
- refresh the page, verify you get the "Save it Now" button
- push the button
- refresh again
- verify that the button no longer re-appears, and that your changes
were actually published (you can do this by taking the quiz as a
student)
Change-Id: Idf3b4302b23d6abc483b80796fee753b0e6fba85
Reviewed-on: https://gerrit.instructure.com/37303
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
refs CNVS-13790
the serializers aren't all loaded in development mode, so you can't
rely on them auto-registering themselves. just constantize what the
class name should be.
also fix a module method not being in the correct file, also for
autoloading goodness
Change-Id: Id7da60757c1b7d816fe94e39d57b521e9efb730d
Reviewed-on: https://gerrit.instructure.com/37173
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ahmad Amireh <ahmad@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
This patch makes the API reject generating stats for large quizzes. A
quiz is large based on two configurable settings:
- quiz_statistics_max_questions (defaults to 100)
- quiz_statistics_max_submissions (defaults to 1000)
They can be tuned using the console. Something similar to this:
Setting.set('quiz_statistics_max_questions', 500)
The defaults can be changed by modifying constants in
Quizzes::QuizStatistics.
Closes CNVS-13330
TEST PLAN
---- ----
- create a quiz with like 10 questions
- change the setting for the max questions to something like 5
- verify that you can't get the stats from the API
- visit ember quiz stats:
- verify you get a different page, similar to the blank state one
but with a different message
- tune it back up to something like 15
- verify you can now get the stats from the API and can see them in
ember
Change-Id: I1b0626c1b460974976eec5b184e1b5989f50d210
Reviewed-on: https://gerrit.instructure.com/35561
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
fixes CNVS-13561
test plan:
- enable draft state and quiz stats
- as a teacher
- create a quiz that allows multiple attempts, and keep highest score
- publish the quiz
- as a student
- take the quiz a first time, and get a perfect score
- take the quiz a second time and get a worse score
- as a teacher
- view the quiz stats
- it should show results from the kept score, not the latest
- try this with keeping the highest score as well. Stats should use the
correct kept score.
Change-Id: I8fb9998e800bfd91f9297a3bc30178f5f31aa59c
Reviewed-on: https://gerrit.instructure.com/36300
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
Exclude preview quiz submission from student analysis (item analysis was
already accounting for this) based on the "was_preview" field.
Closes CNVS-8203
TEST PLAN
---- ----
- create a quiz
- take it as a preview by the teacher
- request the stats from the API (or visit ember quiz stats)
- verify that your attempt does not show up
- take it by a student
- verify everything is ok
- now preview it again as a teacher
- verify your attempt still doesn't add to the stats
Change-Id: I62bf1dd6c0bedb26ee55d029ac0f015b2ad48e91
Reviewed-on: https://gerrit.instructure.com/35954
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
Changes:
- drops unused attributes from the api output, the only things we
expose now are question id, type, text, and position (for sorting)
- drops logic in ember that is no longer necessary
- stringifies IDs in the serializer output
Closes CNVS-13388
TEST PLAN
---- ----
- BEFORE YOU CHECK THIS OUT:
- create a quiz with all question types
- hit the stats API and save the JSON output in some text file
- now check this patch out:
- use the same quiz, hit the stats api
- verify that each question document in "question_statistics" has
the following fields beside the metrics:
"id", "question_type", "question_name", and "position"
- verify that MChoice/TF questions still contain the "item analysis"
report data (like point_biserials, etc.)
- check out the ember quiz stats and make sure everything is OK
Note: i found a small tool that can help you see the differences in the
API output if you push the old JSON and the new one into it: try it out
maybe it will make things easier: http://tlrobinson.net/
Note 2: the docs are really out-of-date now and need to be adjusted.
There is CNVS-13387 for that.
Change-Id: I2d2e8c4dcb0e406378b50cd63f5aba14efe8c2ef
Reviewed-on: https://gerrit.instructure.com/35739
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
fixes CNVS-13391
test plan:
- turn off draft state
- as a teacher
- create a new quiz
- publish the quiz
- make changes to the quiz questions
- make sure the notification shows that you have unpublished changes
- republish the quiz
- the quiz changes should be published
- make sure there are no regressions with CNVS-13003
- make sure that publish/unpublish of a quiz with DS continues to work
as expected
- mess around with any way you can think to publish the quiz via modules
etc.
Change-Id: I1365609f8c4fc10056de42a806a3629155e6643e
Reviewed-on: https://gerrit.instructure.com/35754
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
fixes CNVS-12448
test plan:
- as a teacher
- enable fabulous quizzes
- enroll a few students in the course
- create a quiz with a time limit
- publish the quiz
- visit the quiz moderate page
- in a different browser / session as a student
- start the quiz as a student
- don't submit the quiz yet!
- as a teacher
- refresh the moderate page
- you should be shown a clock icon for the students with currently running
quizzes.
- you can now click on this icon!
- this will bring up a modal dialog to extend time for the current attempt
- try out extending the quiz by a few minutes from now
- try out extending the quiz by a few minutes from the end date
- also try these out with multiple students taking the quiz at once.
- changing the options in the modal should persist until you choose a different
student, at which point it will reset the form in the dialog
Change-Id: I0adf1ed2133b6adaf8501b5131bd70365b06c249
Reviewed-on: https://gerrit.instructure.com/35343
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ahmad Amireh <ahmad@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
this was fixed by changing two things.
1. all objects except quizzes are published by setting workflow_state to
'published'. Quizzes differ in that it also needs to generate the question
data and set the published at time. We have the Quiz#publish! method to do
exactly this, but nobody uses it. So the code now just checks the workflow
state and always triggers the correct code if someone changes it directly
2. Quizzes use 'available' instead of 'published' for the published workflow
state. Content tags was checking for 'active' first and since quizzes
responded to that method it was setting the state to active, which was
messing things up. I switched the logic to check for responds_to :available
first, so that quizzes get set correctly.
fixes CNVS-13003
test plan:
- turn off draft state
- as a teacher
- create a new quiz with questions (leave unpublished)
- create a new module (leave unpublished)
- add the quiz to the module
- publish the module
- as a student
- take the quiz
- the questions should show up fine when taking the quiz
- make sure that publish/unpublish of a quiz with DS continues to work
as expected
- mess around with any way you can think to publish the quiz via modules
etc.
Change-Id: I734e2499d58891fda952b608a13e856d469ebca2
Reviewed-on: https://gerrit.instructure.com/35479
Reviewed-by: Ahmad Amireh <ahmad@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
fixes CNVS-12449
test plan:
- as a teacher
- enable fabulous quizzes
- enroll a few students in the course
- there is a new quizzes api attribute called 'quiz_extensions_url'
- check out the jsonapi quizzes api to make sure this attribute only shows
up for teachers (and not students)
- create a quiz with no time limit and unlimited attempts
- visit the quiz moderate page
- click the "edit" icon for a student
- the modal dialog should only allow you to "manually unlock"
- create a quiz with a time limit
- visit the quiz moderate page
- click the "edit" icon for a student
- the modal dialog should only allow you to "manually unlock"
- the modal dialog should only allow you to add "extra time"
- create a quiz with a limited number of attempts (1 or more)
- visit the quiz moderate page
- click the "edit" icon for a student
- the modal dialog should only allow you to "manually unlock"
- the modal dialog should only allow you to add "extra attempts"
- create a quiz with both a time limit and a limited number of attempts
- visit the quiz moderate page
- click the "edit" icon for a student
- the modal dialog should only allow you to "manually unlock"
- the modal dialog should only allow you to add "extra attempts"
- the modal dialog should only allow you to add "extra time"
- change the settings for extra attempts, extra time, and manually unlock
- hit submit
- it should save these new settings if you reopen the dialog
- it should show the extra minutes allowed on the attempt under the username
- it should add the extra attempts to the 'attempts left' column value
Change-Id: I0e10942ff7a3a80cec200468216ba0641decee2c
Reviewed-on: https://gerrit.instructure.com/35089
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Ahmad Amireh <ahmad@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
Add support for generating stats for File Upload and Formula questions.
Similar to Essay metrics but adjusted to calculate properly.
Closes CNVS-13169
TEST PLAN
---- ----
- create a quiz with those question types
- take the quiz:
- answer both question types by at least one student, but leave it
unanswered by another so we can test the "responses" metric
- test the stats:
GET /api/v1/courses/:course_id/quizzes/:quiz_id/statistics
- the "responses" metric should count the number of students who
provided an answer
- the "graded" metric should read the number of students whose
answers you've graded so far
- the "full_credit" one should read 0 until you grade it and give
them a score higher than, or equal to, the maximum points possible
- "point_distribution" is similar to that of Essays; it is an array
of objects that track every score you gave the students and the
number of students who received those scores
- grade the scores and re-test to verify the metrics update correctly
- verify that the API documentation is updated to include those
question types
PS: the "responses" field will read "the number of students who uploaded
a file" for File Upload, and "the number of students who wrote any
answer" for Formula.
Change-Id: I890eafe018e000eef88de782bd7e86b5259df5d5
Reviewed-on: https://gerrit.instructure.com/35112
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
fixes CNVS-13237
test plan:
- generate the documentation for the api
- the description for the endpoint to set extensions has been corrected
- the copyright block is no longer in the docs
- user_id is now correctly described as 'Required' instead of 'Optional'
- The attributes of the QuizExtension object description have been changed
to not show the extend_from_now and extend_from_end_at, and instead
reflect the actual object returned when you make updates - which instead
includes the end_at date
- fixed description of extra_attempts to be more clear
- The example response should now correctly show quiz_extensions and not
quiz_submissions
- updated the description of extra_time in quiz submissions api to correctly
describe it in 'minutes' instead of 'seconds'
- I have updated the behavior of the manually_locked attribute.
- Sending 1, '1', true, or 'true' will result in the attribute being
set to true. Every other value will set the value to false.
Change-Id: Id6071632a8eb9d01d61cf21287955fb5e44c2f3f
Reviewed-on: https://gerrit.instructure.com/35305
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
quiz submissions can have their time limit or number of attempts extended.
we can extend both existing quiz submissions, and also those that don't exist
yet. adding this functionality to the existing quiz submissions api would
muddle up responsibilities. So instead we post all extensions to a the
quiz extensions api which is specifically meant for adding extensions to a
submission whether it has been started yet or not.
Also add 'manually_unlocked' to the quiz submissions api. this field lets us
know if a student can take a quiz after it has been locked for everyone else.
fixes CNVS-13165
test plan
- There is a new attribute added to quiz_submissions objects in the api
called 'manually_unlocked'. This attribute will now show up when returning
results back from
- GET /api/v1/courses/:course_id/quizzes/:quiz_id/submissions (index)
- GET /api/v1/courses/:course_id/quizzes/:quiz_id/submissions/:id (show)
- There is a new endpoint to create quiz extensions. This should work to
create quiz extensions for users that both have existing quiz submissions
started, and users who have not yet started a quiz:
- POST /api/v1/courses/:course_id/quizzes/:quiz_id/extensions (create)
- Check Permissions on the new quiz extension endpoint. Only teachers should
be able to extend the quizzes.
- Check that all the documentation looks okay for quiz extensions.
Change-Id: Ie23113c1f30e139a1e376475fb35a2cf3ce0212c
Reviewed-on: https://gerrit.instructure.com/35111
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ahmad Amireh <ahmad@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
This patch makes it so that if you want to get the new stats from the
back-end, you'll have to explicitly pass a "legacy=false" parameter to
the report generator routine. Old code will use the old output, new code
will use the CanvasQuizStatistics gem for stats.
Closes CNVS-13198
TEST PLAN
---- ----
- create a quiz with a bunch of questions and take it by multiple
students
- visit the ERB stats page at
/courses/:course_id/quizzes/:quiz_id/statistics
- verify that the page renders and looks just like how it was before
the work on its ember counterpart
- visit the ember stats page at
/courses/:course_id/quizzes/fabulous_quizzes#:quiz_id/statistics
- verify the ember page is still functional
Change-Id: I0a9e8d69eacc64a8727f238fc0c2e2acd44c0451
Reviewed-on: https://gerrit.instructure.com/35167
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
Ensure all input hashes are using symbol keys.
Closes CNVS-13158
TEST PLAN
---- ----
Code changes. Test plan is similar to
https://gerrit.instructure.com/#/c/35096/
Change-Id: Ie1db45e2a5875e410a758c0b2f14594345212b5d
Reviewed-on: https://gerrit.instructure.com/35098
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
- removed the question analyzer
- each answer analyzer is now expected to calculate its own
"responses" field as opposed to doing it in a generic manner
- made the Essay analyzer generate its "responses" field
- a self-documenting DSL for defining analyzer output metrics
Closes CNVS-13157
TEST PLAN
---- ----
It's all code movement/refactor so nothing new to test. The plan is to
verify the Essay question stats are unaffected (which is basically all
the gem supports at this point:)
- create a quiz with an essay question
- take the quiz by a few students
- grade a submission
- retrieve the stats via the API:
GET /api/v1/courses/:course_id/quizzes/:quiz_id/statistics
- verify the essay stats in the API are still functional, the
"responses" field in particular
Change-Id: I42b9552c60ccb56f7c6912fed7cc1173da71852d
Reviewed-on: https://gerrit.instructure.com/35096
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
fixes CNVS-12143
allow polymorphic names in ActiveRecord has_many
associations; when retrieving association, use these
names to retrieve records with different (but synonymous)
foreign_types
currently this gem only addresses has_many relationships
to achieve feature-parity with the existing Quizzes
monkeypatching. A future commit will address adding
similar functionality to other types of associations
test plan:
1) Create a quiz with id Q
2) Attempt the quiz twice, so you can see
both attempts on submission_history/ gradebook
3) In the rails console, get the set of attempts:
versions = Quizzes::QuizSubmission.where(quiz_id: Q).first.versions
4) Change the versionable_type of one of the attempts, but not the other:
versions.where(id: versions.first.id).update_all(versionable_type:
"Quiz")
5) Check the submission_history/gradebook to verify
that you still see both attempts
Change-Id: Ia9611a35705ba2929a92757f586a916dce90a4ee
Reviewed-on: https://gerrit.instructure.com/33505
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Anthus Williams <awilliams@instructure.com>
fixes CNVS-12975
test plan:
- create a quiz with two questions (save but don't publish)
- turn on fabulous quizzes
- view the number of questions for the quiz on the ember quiz index page
- it should show you the correct number
- publish the quiz
- refresh the page
- it should continue to show you the correct number of questions
Change-Id: If9cd041f47b339771f8ffa3e9e3953195efc540d
Reviewed-on: https://gerrit.instructure.com/34835
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
test plan:
* course migration regressions (canvas cc, course copy)
* in addition:
use the content migrations api to queue a content migration
for an account ("/accounts/:account_id/content_migrations")
to import a qti/cc package.
* confirm that the question banks from the package
that would have been normally imported into a course are now
imported into the account
closes #CNVS-12529
Change-Id: I2ef306341d2f7defe03c63a981679a3987f1aaa0
Reviewed-on: https://gerrit.instructure.com/34303
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
Refactoring the generation of quiz question statistics into its own gem.
This patch adds support for Essay question statistics.
Closes CNVS-12725
TEST PLAN
---- ----
- create a quiz with an essay question
- perform an API request to retrieve the quiz statistics
- ensure that the following metrics are generated and correct:
- "graded": number of students whose answers have been graded by the
teacher
- "full_credit": number of students who received a full score
- "point_distribution": a list of scores and the number of students
who received them (so if 2 students got graded for 3 points, it
should have a key of 2 and a value of 3), un-graded submissions
should be keyed under null
- "responses": number of students who answered the question
(wrote anything)
- "user_ids": IDs of those students
- documentation for QuizStatistics -> Essay should be updated with the
new stats
> Other things to test
- verify that the old statistics page still renders:
/courses/:course_id/quizzes/:quiz_id/statistics
- verify that you can still generate both student and item analysis
CSV reports
API endpoint for quiz stats:
/api/v1/courses/:courseid/quizzes/:quiz_id/statistics [GET]
Change-Id: Ib15434ff4cef89ac211c1f4602d1ee609ef48ec4
Reviewed-on: https://gerrit.instructure.com/33990
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
fixes CNVS-11814
and be sure to identify the account somehow
test plan:
* set up a trust between account A to account B
* add a user to account B with an SIS pseudonym
* enroll the user in a course in account A
* course gradebook csv and quiz statistics csv should show the
pseudonym from account B, and account B's domain
* an API call to list students in the course shoud show the
pseudonym from account B, and account B's domain
Change-Id: Id656d06b8119bdcb31cc3e567d49cd6ce7c8428f
Reviewed-on: https://gerrit.instructure.com/31812
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
test plan:
- import the evil_angel.zip Angel package into Canvas
- you should not have a migration issue referring to
a SQL syntax error encountered when importing a
quiz question
- test quiz and question bank imports and re-imports
fixes CNVS-12899
fixes CNVS-12901
Change-Id: I26dcf5ffd4c6b6320232a7603ae2688f7c860fac
Reviewed-on: https://gerrit.instructure.com/34434
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
instead of passing an :exportable option to
ActiveRecord::Associations, simply define a constant
on the class containing exportable associations and
attributes. This is due to :exportable breaking
ActiveRecord, and we can't simply monkey-patch in
config/initializers because models are included in
migrations before the initializers are run
Change-Id: I11f1a6b4570c397d8e01010c517bc6efdac7afca
Reviewed-on: https://gerrit.instructure.com/33235
Reviewed-by: Braden Anderson <banderson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Anthus Williams <awilliams@instructure.com>
QA-Review: Anthus Williams <awilliams@instructure.com>
test plan:
* migration regressions
Change-Id: Ibed8d4820c05b9c69101b215932af32055c3e006
Reviewed-on: https://gerrit.instructure.com/33728
QA-Review: Clare Strong <clare@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
A starting point for the implementation of Ember quiz statistics that
includes a route with the required data properly loaded, the necessary
serializers and adapters, and base stylesheet/template to start from.
This patch also adds a new submission statistic called
"submission_scores" that's basically a map between a score percentile
and the count of students who received it.
Closes CNVS-12171
TEST PLAN
---- ----
- with fabulous quizzes on, go to a quiz show page
- click the Statistics tab
- verify that you see the blank page, and the tab is activated
- verify that no errors are thrown in the console
Testing the new metric:
- create a quiz with a certain number of points possible
- take it by a number of students and score diversely
- also let more than one student have the same score
- perform an API request to retrieve the statistics and:
- verify you get the new score distribution statistic and that it is
correct
- the metric should contain an entry for each distinct percentile
- the metric entry should really reflect how many students got that
score
- check out the Quiz Statistics API docs and:
- verify the new "scores" statistic under SubmissionStatistics is
documented
- verify that the documentation is clear enough
Change-Id: I1f00bd4c18a0767d6a50767c5d8868f1d6e561ac
Reviewed-on: https://gerrit.instructure.com/32732
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
test plan:
* regress module progression workflow for students
- student progress should always be up-to-date
fixes CNVS-11818
Change-Id: Ib6b4ccf7b93bc490726fe2bf75333d75f1572ee0
Reviewed-on: https://gerrit.instructure.com/31575
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
fixes CNVS-11209
test plan:
- turn on draft state
- create and publish a quiz
- go to the main dashboard and courses dashboard
- the quiz that was created shoulda ppear on the mains stream items list
Change-Id: Iadc3f41f2baa6b35114e267fbea6fd4e5e7feff6
Reviewed-on: https://gerrit.instructure.com/33805
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
fixes: CNVS-12598
test plan:
- create a quiz as an instructor
- as a student
- take quiz
- exercise all paths by which a quiz submission is generated
- verify that quiz submissions continue to work as before
Change-Id: I9fd71679e6c9a45686861609ff481f5f4250cca1
Reviewed-on: https://gerrit.instructure.com/33735
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Jason Madsen <jmadsen@instructure.com>
fixes: CNVS-12587
test plan:
- create a quiz as an instructor
- as a student
- take quiz
- exercise all paths by which a quiz submission is generated
- verify that quiz submissions continue to work as before
Change-Id: Ia768a54bcca19750b0e8c701368099cdeb055664
Reviewed-on: https://gerrit.instructure.com/33724
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
Product-Review: Jason Madsen <jmadsen@instructure.com>
fixes: CNVS-12565
test plan:
- as a student take a quiz
- verify that:
- background submissions are working
- end of time / date submissions are working
- manual submsissons are working
- verify various question types are graded correctly
- verify outcomes work as previously defined
Change-Id: Ia85141559e8026993c0e270267947128a5a0466b
Reviewed-on: https://gerrit.instructure.com/33669
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Jason Madsen <jmadsen@instructure.com>
closes CNVS-12538
test plan:
- as a student take a quiz
- verify that:
- background submissions are working
- end of time / date submissions are working
- manual submsissons are working
- verify various question types are graded correctly
- verify outcomes work as previously defined
Change-Id: Ibdab88a4bf57f953330f576cb9b73c0ddb795d55
Reviewed-on: https://gerrit.instructure.com/33618
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Jason Madsen <jmadsen@instructure.com>
closes CNVS-12576
test plan:
- create a quiz as an instructor
- as a student
- take quiz
- exercise all paths by which a quiz submission is generated
- verify that quiz submissions continue to work as before
Change-Id: I4c97162589b5fb9cceb0c6cbe9e4fb68dd1f8093
Reviewed-on: https://gerrit.instructure.com/33691
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Jason Madsen <jmadsen@instructure.com>
Test plan:
- As a teacher, create a quiz.
- Visit the quizzes API using JSONAPI headers. For that quiz,
"submitted_students" should be null. You should get a URL back to
the "unsubmitted_students" endpoint, which you can query and find
the unsubmitted students.
- As a student submit the quiz. As a different student, don't submit
the quiz.
- As a teacher, visit the quiz show endpoint for that quiz again. You
should have "submitted_students" and "unsubmitted_students" under
the "links" hash. Query these APIs using those URLs. The students
returned from the link that looks like "?submitted=true"
- As a student, you should not see "submitted_students" or
"unsubmitted_students" under the "links" hash when querying
the show API in JSONAPI format
- In non-jsonapi format as any user, you should not see
"unsubmitted_students" or "submitted_students"
closes CNVS-11687
Change-Id: I7094dfc37b0dde501e5a2c1f12ade983cd2a150a
Reviewed-on: https://gerrit.instructure.com/31223
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
fixes CNVS-10613
test plan:
- create a quiz with a matching question
- have one answer on the right side be a duplicate
- take the quiz and answer correctly
- when viewing the results the answers should all show up correctly
- try this same with multiple duplicates
- do general regression testing around matching questions
Change-Id: I711c9df59c17f99e2d4ddb25b79b9e9679e1be8c
Reviewed-on: https://gerrit.instructure.com/33467
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
closes CNVS-12397
test plan:
- verify that existing specs pass
- import a quiz with various question types
- verify import works as previously defined
Change-Id: I25b778aea06ffbd1ad23a7076cd597e9123c32bf
Reviewed-on: https://gerrit.instructure.com/33294
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Jason Madsen <jmadsen@instructure.com>
Closes CNVS-8989
CHANGES
-------
- ItemAnalysis can now be generated to a Hash as well as CSV
TEST PLAN
---- ----
- create a quiz with a number of questions (true/false and
multiple-choice a must-have)
- take the quiz by 2-3 students
- perform an API request as described below and verify that you get a
statistics object that matches the API docs
- do it once in legacy JSON format, e.g:
"Accept: application/json"
- do it once in JSON-API format, e.g:
"Accept: application/vnd.api+json"
- read the API docs and report any mistakes or stuff that's not clear,
the stuff is written in the QuizStatistics module
Endpoint: [GET] /api/v1/courses/:course_id/quizzes/:quiz_id/statistics
Change-Id: I1588e1cdc8955b890c739df4c730507dad7118d1
Reviewed-on: https://gerrit.instructure.com/31141
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
An endpoint for retrieving all quiz reports for a given quiz.
Closes CNVS-12172
CHANGES
-------
The biggest effort in this patch was to normalize the way QuizReport
objects are interfaced with, and the generation of their CSV attachments
in particular:
- Quiz#current_statistics_for() now ALWAYS returns a persisted object
while still considering the freshness of the stats
- Quiz#statistics_csv() is no longer responsible for testing whether
the attachment should be generated or not, but instead ensures
that the CSV will be generated ASAP
- QuizStatistics#generate_csv() now guards against generating multiple
attachments
- QuizStatistics#generate_csv_in_background() now guards against
queueing multiple generation jobs (by testing the status of the
Progress object)
QuizReport API changes:
- new property: "generatable"
- new property: "readable_type"
- new property: "url"
- now accepts JSON-API format for all endpoints:
- JSON-API allows you to embed file and progress objects directly in
the QuizReport document, just pass ?include=file,progress
Quizzes API changes:
- new property (JSON): "quiz_reports_url"
- new property (JSON-API): "links.quiz_reports"
Some AMS changes:
- added support for accepting side-loading requests from controllers
by passing an :includes array to the serializer initializer
- added support for embedding objects in root, using `embed: :object
and embed_in_root: true` for has_one associations
- also, in that same scenario, AMS's default behavior is to wrap
single objects (has_one) in an array, which didn't work for me, so I
added a new option called "wrap_in_array" which you can set to false
when defining the association to override this behavior
Other changes:
- covered the front-end/javascript that utilizes the reports and
allows teachers to generate them
- QuizReport in the front-end no longer relies on magical course_id
exposed in window.ENV, but instead uses its URL to construct the
generation URL (see QuizReport#baseURL)
- Attachment now has a shallow-AMSerializer that proxies to the legacy
one in lib/api/v1 which allows us to at least side-load them
- Progress now has an AMS
- QuizReport legacy serializer in lib/api/v1 removed entirely,
replaced by the new AMS one
TEST PLAN
---- ----
Endpoint: [GET] /api/v1/courses/:course_id/quizzes/:quiz_id/reports
- as a teacher, make a request to the endpoint above:
- it should return a set of two quiz report objects
- add a parameter "includes_all_versions=true" to the query parameters
and verify that the "student_analysis" report in the returned set
now reflects the new value (the reports have a field called
"includes_all_versions" which should be true in this case, false
otherwise)
- as a student, make the request and verify that it rejects you
Endpoint: [GET] /api/v1/courses/:course_id/quizzes/:quiz_id/reports/:id
- turn on JSON-API mode
- as a teacher:
- don't generate the report from the UI yet
- make the request, and verify that you get only the report
- generate
- repeat the request, verify that you still get only the report
- add a ?include=file query parameter
- you should read the file document now
- add a ?include=progress query parameter
- you should read the progress document now
- turn off JSON-API mode
- as a teacher:
- make the request, and verify you get the "progress_url" field and
that the file document is embedded automatically without having to
specify the ?include= parameter
Front-end testing:
- go to the statistics page
- generate all reports:
- verify that the progress bar updates
- verify that you can download them
- verify that auto-download occurs unless you refresh the page
before the report is generated
- toggle on the "Count All Attempts" button and repeat the above:
- verify that Item Analysis is not generatable anymore since it's
not affected by that parameter
Please note that "item_analysis" reports will always have
"includes_all_versions" as true.
Change-Id: I0dc6d5108cbcef78b2fa17ba0476f470d33d402d
Reviewed-on: https://gerrit.instructure.com/32731
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
The back-end will now accept answer ranges in a more flexible manner, so
providing a range of [50,10] or [-3,-8] will work.
Closes CNVS-11282
TEST PLAN
---- ----
- create a quiz with a numerical question:
- choose "answer in range" for an answer type
- play with something similar to the combinations listed below and
verify that you get the proper results
- answer the quiz question by the student every-time you try a new
combination and verify the grading is correct
Combinations:
- from: -5, to: 10, answer: 7 (correct)
- from: 10, to: -5, answer: 7, or 0, or -3 (correct)
- from: -2.5, to: -3.5, answer: -3 (correct)
- from: -3.5, to: -2.5, answer: 3 (incorrect)
Or just use your imagination :) The point is, the ranges should be
accepted and work properly regardless of if you specify the smaller
number first (this was an issue for negative ranges)
Change-Id: I3c3f8638f8244d6417effeec4b4f0e29198ea845
Reviewed-on: https://gerrit.instructure.com/32935
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
fixes CNVS-5359
test plan:
- with draft state off
- create a quiz with 'shuffle answers' option OFF
- save the quiz
- when taking the quiz, answers should not shuffle
- edit the quiz and turn 'shuffle answers' option ON
- save the quiz
- you should *NOT* need to republish here
- when taking the quiz, answers should shuffle correctly
- edit the quiz and turn 'shuffle answers' back OFF
- save the quiz
- you should get a notification that you need to 'republish'
- republish the quiz
- when taking the quiz, answers should not shuffle
- with draft state on
- create a quiz with 'shuffle answers' option OFF
- save the quiz
- when taking the quiz, answers should not shuffle
- edit the quiz and turn 'shuffle answers' option ON
- save the quiz
- when taking the quiz, answers should shuffle correctly
Change-Id: I1878683b8f4b5210584bf7dc2e3c05def5bbc947
Reviewed-on: https://gerrit.instructure.com/33109
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
fixes CNVS-10868
test plan:
- as a teacher
- create a quiz with both multiple choice and multiple fill in the
blank questions
- publish the quiz
- as a student
- take the quiz
- as a teacher
1:
- attempt to change the answer for the multiple choice question
- regrade should be successful
- view the results for the student's quiz - the answer should be regraded
successfully
2:
- attempt to change the answer for the multiple fill in the blank
- there shouldn't be an option to regrade
- attempt to change the question type for the mfiib question to be a
multiple choice question.
- now try to change the answer
- it should show you a message that regrade is disabled because you
changed the question type
- view the results for the student's quiz - all answers should show up
and regrade should not be performed on the question
3:
- attempt to remove a question from the multiple choice question
- attempt to change the answer and regrade
- it should show you a message that regrade is disabled because you
removed answers
- view the results for the student's quiz - all answers should show up
and regrade should not be performed on the question
Change-Id: I50f15a0f1485bb6e152a90d9bb9eefcffe1bd2e1
Reviewed-on: https://gerrit.instructure.com/32469
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Stanley Stuart <stanley@instructure.com>
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
fixes CNVS-11518
On quizzes with larger groups of participants, the alpha
generated by QuizStatistics has been reported as being
off by quite a bit. This was because of a faulty
float value that was used to determine the 'middle' range.
Test plan
- Not easily testable by QA.
Change-Id: I0a9d925b2770eb224de6bbbf43bd2453177e4377
Reviewed-on: https://gerrit.instructure.com/31124
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Josh Simpson <jsimpson@instructure.com>
Product-Review: Josh Simpson <jsimpson@instructure.com>
fixes: CNVS-11890
Test Plan:
Canvas Should not be broken, test requests that use the SortLast and SortFirst
class. One is account settings. Make sure its sorted correctly. Another is
submissions_controller show method and make sure the visible rubric assesments
are sorted correctly.
Change-Id: I75a61475a928e069d6566fcc51305a6c442ec5a0
Reviewed-on: https://gerrit.instructure.com/32014
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Test Plan:
- Before checking out this commit, take a quiz as a student.
- Check out this commit and go to the quiz show page where you can see
quiz results.
- You should see "Question 1" instead of the question title for the
question as the student.
- As the teacher, you should see the question title instead of
"Question 1" when editing the quiz.
- Question names should show up as "Question 1" etc when previewing
the quiz as the teacher.
fixes CNVS-11547
Change-Id: I57937c9943cabc7ba27a97ed828df6d410a38ba1
Reviewed-on: https://gerrit.instructure.com/32774
QA-Review: Myller de Araujo <myller@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
fixes CNVS-12074
If a student takes a quiz with a time limit, and quits the quiz
without explicitly submitting it, the quiz will get stuck in a state
where it won't be automatically graded. This commit fixes the #needs_grading?
method on QuizSubmission to prevent this.
Test plan
- As a teacher, create a quiz with a time limit
- As a student, take the quiz, but close the browser before the quiz
auto submits.
- As the teacher, navigate to the moderate page, and click on the
student's submission
- The student's submission should show up and be graded.
Change-Id: I161937365f01d0f87e2cb56c8579c060337a8dd9
Reviewed-on: https://gerrit.instructure.com/32538
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Josh Simpson <jsimpson@instructure.com>
fixes CNVS-10638
test plan:
* open outcome gradebook
* select a section
* click on "export report"
* download and open the export
* verify that the export format matches the Jira documentation
* verify that the export data matches the data from your browser
Change-Id: I35bd78719880026b71b30da5794c9afe7dd31868
Reviewed-on: https://gerrit.instructure.com/31774
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Reviewed-by: Jon Willesen <jonw@instructure.com>
Product-Review: Braden Anderson <banderson@instructure.com>
fix namespace issue for quizzes/quiz.
will now have new keys, and need new translations, but this will fix
generated YAML file
closes CNVS-12006, CNVS-12089
Change-Id: I895978b38a22b21a3d2a1c503ed7c1c174e449a6
Reviewed-on: https://gerrit.instructure.com/32524
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Jason Madsen <jmadsen@instructure.com>
regression testing with due dates and lock dates
fixes CNVS-12048
test plan:
- Create a quiz with a time-limit (1 minute will do)
- As a student, start taking the quiz
- only answer a few questions and then close the window
- the quiz should not be auto-submitted in the background anymore
Change-Id: Ib91286466dc83aa2ad66d7206449a0956d8c0fe8
Reviewed-on: https://gerrit.instructure.com/32430
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
test plan:
* run specs
Change-Id: Ic2a76e3c6290c06f68f06796babbdc5ff3b405d9
Reviewed-on: https://gerrit.instructure.com/29733
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
fixes CNVS-11986, CNVS-11672
test plan:
the problem on this one comes up when we are trying to view an attachment that
was created before the namespace change. So we have to massage the data in the
console to reproduce what's going on here, or test it with data that was created
before the namespace changes.
- as a teacher
- create a quiz with a file upload question type
- as a student
- take the quiz and upload the file
- in the console
Attachment.update_all("context_type='QuizSubmission'", "context_type='Quizzes::QuizSubmission'")
- as a teacher
- visit the moderate page for this student's quiz, and the attachment link
should be visible to download the file.
Change-Id: I329bb422770e0d22fa33be189c0229298c12f759
Reviewed-on: https://gerrit.instructure.com/32319
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Clare Strong <clare@instructure.com>
also fix undeleting practice quizzes
fixes CNVS-11955
test plan:
- in a course, delete a quiz
- go to /courses/:id/undelete
- click the button to undelete the quiz
- it should work
- quick regression on undeleting quizzes/discussion_topics both linked and not
linked to assignments
Change-Id: I88d30d1baa5685e6c4f16280c9aa34c8965b31fe
Reviewed-on: https://gerrit.instructure.com/32217
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
although nobody creates quizzes through it, they still call
other association methods such as loaded?, so apply all the
association where-clause hacks to this one
fixes CNVS-11759
Change-Id: Ic6326399157284be75e94a1ce3d50709f9fefbbc
Reviewed-on: https://gerrit.instructure.com/31639
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Clare Strong <clare@instructure.com>
test plan:
- have a quiz that was added to a module prior to the
Quizzes::Quiz refactor
(or manually update the ContentTag's content_type to 'Quiz')
- set up a completion requirement (must submit, or must score)
- verify that a student can complete the requirement
fixes CNVS-11613
Change-Id: I2bb5271e6b263173d98c9df8913044640698e7fb
Reviewed-on: https://gerrit.instructure.com/31424
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
setting self.assignment_id to nil also resets
self.assignment in rails 3 (but not in rails 2)
Change-Id: I679c0ebb8a26a6a4cb5ce5a69b688f094c75143d
Reviewed-on: https://gerrit.instructure.com/29646
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
it was getting saved indirectly through a touch, which no longer
saves in rails 3
Change-Id: Ibeb405fab6de3548d76c92ae7994fd6a7bf99d8a
Reviewed-on: https://gerrit.instructure.com/30691
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
Since Quiz has been namespaced under Quizzes, the asset user access code
changed from 'quizzes:quiz_id' to 'quizzes/quiz_id' which is out of sync
with the asset codes for the rest of the resources.
Closes CNVS-11191
CR NOTES
-- -----
See config/initializers/active_record.rb:128#asset_string to get an idea
why Quiz#reflection_type_name was overridden. It seemed to me this is
the point that is queried by that and relevant methods.
TEST PLAN
---- ----
- create a quiz, and view it as a student
- go to the user access report and verify that the quiz entry displays
its title instead of quizzes/quiz_%id
Change-Id: I0e6eb3cc1c9ad069ef86db1e106c672bfe402df6
Reviewed-on: https://gerrit.instructure.com/30216
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
Undoes what CNVS-9605 did and brings back the behavior introduced by
CNVS-2337.
Closes CNVS-9689
TEST PLAN
---- ----
See test plan in https://gerrit.instructure.com/#/c/25400 as it's
basically the same effect.
Change-Id: Ie54e262df6d917922934d423299b594a9dddfaa4
Reviewed-on: https://gerrit.instructure.com/30211
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
test plan (non-draft-state):
- as a teacher
* create each of the following:
- assignment
- discussion
- page (hidden from students)
- page (not hidden from students)
- quiz (leaving it unpublished)
* add each of the above items to a module
* refresh the modules page
- each of the above items should be listed
- as a student
* navigate to the modules page
- the hidden page and quiz should not be listed
- all other items should be listed
* click on the first item in the module
* click through each of the 'Next' buttons
- only items listed in the module should be presented
test plan (draft-state):
- as a teacher
* create each of the following:
- assignment
- discussion
- page
- quiz
* add each of the above items to a module
* refresh the modules page
- each of the above items should be listed
- as a student
* navigate to the modules page
- only published items should be visible
* click on the first item in the module
* click through each of the 'Next' buttons
- only published items should be presented
* publishing items (as a teacher) should make them available to the
student in the module progression as well as the modules page
closes CNVS-10831
Change-Id: Ia84e56f42438ff531a4e15784eefaec2ead8ecdd
Reviewed-on: https://gerrit.instructure.com/30312
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
This commit namespaces the rest of quiz related code into a Quizzes
namespace: controllers, views, models, and classes that previously lived
under lib/ that are Quiz-related.
Test plan:
Full regression test on all quiz related items
refs CNVS-10457
Change-Id: If54b61213945056539e03271a936d233abb66188
Reviewed-on: https://gerrit.instructure.com/29351
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
Product-Review: Josh Simpson <jsimpson@instructure.com>
Adds the require_lockdown_browser_monitor and lockdown_browser_monitor
data Quiz attributes and makes them accessible through the Quiz API.
Test Plan:
* With lockdown browser enabled:
* Should be able to read/set lockdown properties through quiz api:
require_lockdown_browser, require_lockdown_browser_for_results,
require_lockdown_browser_monitor, lockdown_browser_monitor_data
* if use_lti_tool plugin setting is set (enabled in different commit)
then the LB options are hidden in quizzes UI
closes PLAT-291
Change-Id: Ic45a4946d5632a01f32709b76ce2907b1141f351
Reviewed-on: https://gerrit.instructure.com/29648
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
touch no longer runs save callbacks
Change-Id: I1a0e703cfc196c77cba91d233f10a1e8ee138196
Reviewed-on: https://gerrit.instructure.com/29575
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
fix places where we manually build up an html snippet w/ a translation
embedded in it. note that this commit does not fix any such issues in
js_blocks, since those are all being removed in other commits.
test plan:
1. regression test of canvas, in particular the areas indicated by the
files that were updated
Change-Id: I6f966ab5ca9908a21d7a1baef24ce243e7b1e675
Reviewed-on: https://gerrit.instructure.com/29246
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
fixes CNVS-10679
this commit refactors quiz into a quizzes namespace. it contains various
shims to facilitate the data migration of polymorphic relationships
('Quiz' -> 'Quizzes::Quiz'). JIRA contains several tickets linked to
the above tickets in regards to removing these shims after the data
migration, as well as the strategies on reverting the shims once the
data migration is complete.
Change-Id: I30c566d60a87af6ee83e9d0041fdcb909ead6a89
Reviewed-on: https://gerrit.instructure.com/28573
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Josh Simpson <jsimpson@instructure.com>