closes OUT-2898
test plan:
- in a course, create a student user
- create a course outcome
- create an unpublished assignment, and align to the outcome
- create a quiz bank with a single question, aligned to the outcome
- create an unpublished quiz, pulling from the quiz bank
- as a teacher, confirm that the student LMGB shows the assignment
and quiz alignments for the outcome
- as a student, confirm that the student LMGB does not show
the alignments
- as a teacher, publish the assignment and quiz
- confirm that the alignments appear for the student now
Change-Id: If110f52179ea5acbbe513dcb019fa21a1e369bf0
Reviewed-on: https://gerrit.instructure.com/184092
Tested-by: Jenkins
Reviewed-by: Neil Gupta <ngupta@instructure.com>
QA-Review: Frank Murphy III <fmurphy@instructure.com>
Product-Review: Augusto Callejas <acallejas@instructure.com>
the "as needed" refers to two cases:
* when late policy changes
* when an assignment's points_possible changes
closes CNVS-36656
test plan:
* Create a course with two assignments, two grading periods and
two students enrolled
* Ensure one assignment is due in a closed grading period and the
other in an open grading period
* Submit homework from both students so for each assignment one
student submits the homework on time and the other submits it
late
* Go to gradebook and grade the students
* Add a late policy to the course using the Rails console:
course = Course.find(my_course_id)
late_policy = LatePolicy.create(
course: course,
late_submission_deduction_enabled: true,
late_submission_deduction: 50.0
)
* Reload the gradebook and you should see the score of the late
submission for the assignment in the open grading period to
have changed (lowered)
* Verify that none of the other submissions had their scores
changed
* Now edit the assignment in the open grading period and change
its points possible to a higher number and save this change
* Reload the gradebook and you should see the score of the late
submission for the assignment in the open grading period to
have changed again
* Verify that none of the other submissions had their scores
changed
* Now try this using three quiz submissions (early and late and
just 45 seconds past the deadline).
* Verify in the gradebook that late policy deductions are applied
only to quiz submissions that are later than 60 seconds after
the quiz due date
Change-Id: I58ed3e3d0665870cf46d1b1e3ddf00f5f2f7008c
Reviewed-on: https://gerrit.instructure.com/110598
Tested-by: Jenkins
Reviewed-by: Jeremy Neander <jneander@instructure.com>
Reviewed-by: Derek Bender <djbender@instructure.com>
QA-Review: KC Naegle <knaegle@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
refs #CNVS-32574
Change-Id: Ifd139bf1e8296370d1d793ceed7c8e2e50440059
Reviewed-on: https://gerrit.instructure.com/94684
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
it's kind of crazy that you could do stuff like:
"lol".user
i don't know why we didn't do this years ago ¯\_(ツ)_/¯
Change-Id: I0d3f8644729382d6bee889352557792bc353927c
Reviewed-on: https://gerrit.instructure.com/92583
Tested-by: Jenkins
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
Fixes CNVS-25911
Test plan:
Align an outcome to a question bank
Create a quiz
Import question bank into quiz
Have student take quiz
Go to outcome show page
Click on the quiz result within "Artifacts"
Should redirect to quiz submission, not show error
Change-Id: Ibb25d4fae21ccce29d49325bd593de3eafd866e3
Reviewed-on: https://gerrit.instructure.com/70093
Reviewed-by: John Corrigan <jcorrigan@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Tested-by: Jenkins
Product-Review: McCall Smith <mcsmith@instructure.com>
Test Plan:
- pass Jenkins
- check for errors
- make sure DA (selective release) spec setup
matches those specified in the DA Preconditions
in TestRail (http://bit.ly/1mVXHOt)
Change-Id: I6b3d4a432c37b3bfb652a75d71bd78af1792afb8
Reviewed-on: https://gerrit.instructure.com/69920
Tested-by: Jenkins
Reviewed-by: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Caleb Guanzon <cguanzon@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Adds edit ui for "Answer with Precision" as a "Numerical Answer" subtype.
Precision answers are rounded to a precision of 16 to handle floating
point errors and then truncated to the specified precision for grading
and comparison.
If any of the potential answers to a numerical question is a precision
answer then the student form will accept precision answers. If none of
the possible answers are precision answers then the student form will
continue to round to 4 decimal places.
Refs CNVS-10866
Test plan:
- Create a new question
- Select a question type of "Numerical Answer"
- Select answer type of "Answer with Precision"
- You should see an answer input field and a precision input field
- The precision field should default to 10 and accept input between
1 and 16, these are the limits of javascript floats
- The answer input should accept numerical inputs with or without an `e`
exponent and be formatted according to the configured precision
- The quiz submission form should accept answers with a precision of up
to 16 in normal or exponential format (#.##e##)
Change-Id: Idc117a61040a43b038272afec9319bada43e5f54
Reviewed-on: https://gerrit.instructure.com/64068
Reviewed-by: Matt Berns <mberns@instructure.com>
QA-Review: Michael Hargiss <mhargiss@instructure.com>
Tested-by: Jenkins
Product-Review: Jason Sparks <jsparks@instructure.com>
This is the first step to get us moved over to factory girl for test
factories. Gergich (rightly) has a lot to say on this, because I've
moved around a lot of scary looking code, but I am hesitant to spend
much time on fixing it here, since the end goal would be to rewrite most
all of the factory logic in factory girl anyway. Any feedback is good
feedback!
Change-Id: Id0da1099e98d4ac79c6bf1e1e8808d6e7ea43596
Reviewed-on: https://gerrit.instructure.com/57853
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: John Corrigan <jcorrigan@instructure.com>
Tested-by: John Corrigan <jcorrigan@instructure.com>
Product-Review: John Corrigan <jcorrigan@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>
This patch provides support for answering Quiz Questions via the API.
closes CNVS-9844, CNVS-10225
TEST PLAN
---- ----
Testing this will be a bit rough because there are many variations and
validations to cover. I'll spare the validations that are covered by
specs from the test plan.
Create a quiz with a question of *each* type except "Text" and "File
Upload". There's a script that creates a quiz with its questions
automatically for you if you don't want to keep doing this manually. See
references.
> Answering Questions
Now you need to answer each question via the API. Most of them vary in
formats, but they are fully specified in the API documentation page
(along with examples). See DOCUMENTATION for more info.
> Flagging Questions
Flagging, and unflagging, a question is the same regardless of its type,
see the "EXAMPLE REQUESTS" section.
> Access Validations
Here are some generic, non-question based validations to verify. You
should NOT be able to answer a question if:
- the quiz submission has been turned in
- the quiz submission is overdue
- the Access Code for the quiz is invalid
- the IP filter of the Quiz prohibits you from taking the quiz
- the quiz submission :validation_token is incorrectly specified (ie,
other students shouldn't be able to answer your questions)
- you don't specify the latest :attempt, so if the Quiz has multiple
attempts, and this is your 2nd take, you specify an :attempt of 1,
3, or anything but 2 should fail
- NEW: turn quiz into an OQAAT quiz with the "Can't go back" flag on;
the API should not reject all requests to modify any of the
questions with a 501 error saying that type of quizzes is not
supported yet (support will come in CNVS-10224)
> Grading
Also, when you're done answering the questions, take a look at the
grades and make sure everything gets graded just like it does when using
the UI directly.
> Verifying results in the browser
While taking a quiz in the canvas UI, the scripts perform backups in the
background that would overwrite any changes you do via the API. If you
want to verify the changes you make via the API from the UI, you must
append "?backup=false" to the take quiz page URL, something like this:
http://localhost:3000/courses/1/quizzes/1/take?backup=false
Setting that flag will (for now) disable the backup behaviour and should
make things tick.
EXAMPLE REQUESTS
------- --------
Don't forget to set the 'Content-Type' header to 'application/json'!
> Answering a Multiple-Choice question
[PUT] /api/v1/quiz_submissions/:quiz_submission_id/questions/:id
{
"attempt": 1,
"validation_token": "1babd0...",
"answer": 10
}
> Flagging a question
[PUT] /api/v1/quiz_submissions/:quiz_submission_id/questions/:id/flag
{
"attempt": 1,
"validation_token": "1babd0..."
}
> Unflagging a question
[PUT] /api/v1/quiz_submissions/:quiz_submission_id/questions/:id/unflag
{
"attempt": 1,
"validation_token": "1babd0..."
}
DOCUMENTATION
-------------
Run `bundle exec rake doc:api` and check out the Quiz Submission
Questions page. There's an Appendix that contains example requests for
each question type, as well as the errors produced by each handler.
LINKS
-----
- bootstrap script:
https://gist.github.com/amireh/e7e8f835ffbf1d053e4c
- direct link to the API documentation page:
http://canvas.docs.kodoware.com/quiz_submission_questions.html
Change-Id: I9a958323ece8854bc21a24c2affd8dc3972e46d5
Reviewed-on: https://gerrit.instructure.com/27206
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
This fixes a couple bugs with quizzes but more issues remain that require a
more in-depth refactor. This makes the following changes:
* QuizQuestion::ShortAnswerQuestion - don't let a blank answer match and
receive full points. (the actual ticket being fixed)
* Fixed display of matching question results. If user left it blank it just said,
"You put:". Now shows the "You left this blank" and uses the color for wrong.
* Fixed display of short_answer_question (fill-in-the-blank single option) as it
never showed the "you left this blank" even though the code was setup
with that intention.
* Added spec and factory change to validate the short_answer_question
scoring change.
Test Plan:
* Create a quiz with a single "Fill in the blank". Give it 1 or 2 answers and don't remove the
the blank answers.
* Preview the quiz (or take as a student... it's the same)
* Taking the quiz, leave the question blank and submit.
* The quiz review page should now show "Your Answer: You left this blank" and
not award any points.
Change-Id: I485463849367c2a9e54882235a9961c2cf2e3cf9
Reviewed-on: https://gerrit.instructure.com/10704
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Steps to Reproduce:
- create a quiz with a due date/time and NO time limit or lock time
- have student start quiz before due time
- exit the quiz without hitting submit
- allow due time to pass
- refresh quizzes page as student and verify that the quiz has a score
Change-Id: Ic9038eec076d1b89961511872f1c1ddf441982ae
Reviewed-on: https://gerrit.instructure.com/10621
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mark Ericksen <marke@instructure.com>
* gemfile tweaks
* removed ruby-debug (since it's broken in 1.9.3)
* removed colons from case statements
* turned off whiny nils for tests (they cause a 2X perf hit)
* added utf-8 encoding markers to files with multibyte chars
* removed an instance of calling String#map, which no longer works
* fixed an issue in the assets file where the yaml emitter doesn't output the
same whitespace as it did in 1.8.7
* fix call to .map without block
* fix yaml engine initialization for delayed jobs (was happening too late)
* fix rspec instafail
* fix UserProfile#id calls
* fix ModelCache for instance_methods now returning symbols
* fix user_spec collection not seeing the new objects
* fix course specs where POST lines are slightly different in 1.9
* fix utc_datetime in the time initializer
Change-Id: Ic95dda23cb910579e2828fb448323d4fc18902a2
Reviewed-on: https://gerrit.instructure.com/10705
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Zach Wily <zach@instructure.com>
these are (hopefully) pretty comprehensive specs for the scoring code
for the various quiz question types. parts of these specs are marked as
pending due to various bugs uncovered while writing them, an upcoming
patch set will do some refactoring of this code and fix those uncovered
bugs.
refs #8267
test plan: n/a
Change-Id: Ia2235a4c6341c9fe292c21345e291cf72108548f
Reviewed-on: https://gerrit.instructure.com/10217
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
test plan(main quiz page):
1. create and publish a quiz
2. as a student begin taking the quiz
don't finish the quiz, click a link
to go somewhere else
3. go back to the quizzes main page and you
should see the resume quiz link
4. login as the teacher and lock the quiz
5. as the student go to the quiz main page
notice the resume quiz link is gone
test plan(individual quiz page):
1. create and publish a quiz
2. as a student begin taking the quiz
don't finish the quiz, click a link
to go somewhere else
3. go back to the quiz main page and click
the quiz name to go into the quiz
4. notice the resume quiz button on the right
5. as a teacher lock the quiz
6. as a student either refresh the page you are
already on or go back to the quiz page and click
the link to to back into the quiz. notice the resume
quiz button is gone
Change-Id: I700f107c3c6cbfcd7e0811dddf7adfd910691f45
Reviewed-on: https://gerrit.instructure.com/10044
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
fixes#7494
test plan: start taking a quiz, then delete your session from the
database. the subsequent backups should result in an error. (there is a
separate ticket filed to put the user back on the initial quiz page or
something when this happens)
Change-Id: I598012af1ee8f0595e95b81dd6caeb9bcfbc5428
Reviewed-on: https://gerrit.instructure.com/9703
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>