Commit Graph

71 Commits

Author SHA1 Message Date
Alex Slaughter 1ffd248c49 chore(LTI): Error for LTI Grades with Non-Parseable Score
test plan:
- Provide grade_passback endpoint with 'test' instead of '5'
- Observe new error message

Fixes: QUIZ-7074

Change-Id: Ic0232802938d3769d42aa2051bc3f54f5b8596c2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/212427
Tested-by: Jenkins
Reviewed-by: Stephen Kacsmark <skacsmark@instructure.com>
Reviewed-by: Marc Phillips <mphillips@instructure.com>
Product-Review: Kevin Dougherty <jdougherty@instructure.com>
Product-Review: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Alex Slaughter <aslaughter@instructure.com>
2019-10-24 15:09:36 +00:00
Adrian Packel 72a317f751 Post grades on q.n submission
fixes GRADE-2296

Test plan:
- Have a course with new gradebook
- Enable post policies:
  > PostPolicy.enable_feature!
- Check that taking a quiz via Q.N (and getting a grade):
  - Posts the submission to the student if the assignment is set to
    automatically posted
  - Does not post if the assignment is manually-posted

Change-Id: I0ac35dac972a4ff374b58a6a1fe38f7fb138728a
Reviewed-on: https://gerrit.instructure.com/201218
Reviewed-by: Keith Garner <kgarner@instructure.com>
Reviewed-by: Gary Mei <gmei@instructure.com>
QA-Review: Jacob Burroughs <jburroughs@instructure.com>
Tested-by: Jenkins
Product-Review: Keith Garner <kgarner@instructure.com>
2019-07-15 22:00:15 +00:00
Han Yan a4ce7d27e2 resolve correct tool when there is a domain/url conflict
the url match priority order should be:
1) exact match
2) match ignoring parameter
3) tool domain match

closes QUIZ-6477

test plan:
- create two ContextExternalTool:
  the 1st one is a faked with domain = 'canvas.docker'
  the 2nd is a Q.N ContextExternalTool
- run
    ContextExternalTool.find_external_tool(
      'http://xxx.canvas.docker/lti/launch?participant_session_id=2&quiz_session_id=2',
      context
    )
- it should return Q.N external tool

Change-Id: Ib365fd82d8347ae3b025153c0c3bdd56f6ab17de
Reviewed-on: https://gerrit.instructure.com/194175
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Marc Phillips <mphillips@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Han Yan <hyan@instructure.com>
2019-06-18 18:49:51 +00:00
Han Yan eb24844f9a allow a Q.N quiz to be reopened
closes QUIZ-6268

test plan:
- create a Q.N quiz, and take it as a student
- the grade should be on Canvas grade book
- from Q.N moderation page, reopen the quiz session
- go to Canvas speedgrader, the attempt should be removed from
  attempt list

Change-Id: I93f9393df2ce898a4f4c5c4993820bcda5cce607
Reviewed-on: https://gerrit.instructure.com/191408
Tested-by: Jenkins
Product-Review: Kevin Dougherty III <jdougherty@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Reviewed-by: Adrian Packel <apackel@instructure.com>
Reviewed-by: Stephen Kacsmark <skacsmark@instructure.com>
2019-05-23 17:08:47 +00:00
Han Yan 64131daf7c stop grade passback exceptions for closed grading period
closes QUIZ-6364

test plan:
- create an assignment with closed grading period
- submit a new Q.N attempt
- there is no excpetion, and the submission workflow_state is 'unsubmitted'

Change-Id: I675cc01667172e588dc6a21451a6abf233fbb201
Reviewed-on: https://gerrit.instructure.com/192407
Tested-by: Jenkins
Reviewed-by: Keith Garner <kgarner@instructure.com>
Reviewed-by: Stephen Kacsmark <skacsmark@instructure.com>
QA-Review: Han Yan <hyan@instructure.com>
Product-Review: Han Yan <hyan@instructure.com>
2019-05-08 17:56:17 +00:00
Jacob Burroughs 4681149cc8 Pull the Q.N url off the model
refs QUIZ-6365

Change-Id: I2b5467b66e40cdbb1e8cea9aec40c4cc86003ecd
Reviewed-on: https://gerrit.instructure.com/191245
Reviewed-by: Stephen Kacsmark <skacsmark@instructure.com>
Tested-by: Jenkins
QA-Review: Jacob Burroughs <jburroughs@instructure.com>
Product-Review: Jacob Burroughs <jburroughs@instructure.com>
2019-04-29 18:58:05 +00:00
Rob Orton 6fe3babe9e one less submission query in lti grade pass back
refs CORE-2598

test plan
 - specs should pass

Change-Id: I3508f52a420c509bb61eb0383995a63304c6c621
Reviewed-on: https://gerrit.instructure.com/186507
Tested-by: Jenkins
Reviewed-by: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2019-03-25 19:00:04 +00:00
Hannah Bottalla 9f8ff5fa98 Read Quizzes.next submitted_at from resultData node
closes: QUIZ-5907

test plan:
QA with g/184596

Change-Id: If9d9ce8437d6b9ecfca157b4d82d9dd08b651428
Reviewed-on: https://gerrit.instructure.com/184593
Tested-by: Jenkins
Reviewed-by: Stephen Kacsmark <skacsmark@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Matthew Goodwin <mattg@instructure.com>
2019-03-19 16:53:57 +00:00
Han Yan e3739cb581 Quizzes.Next Submissions do not send email notifications
closes QUIZ-6007

test plan:
- set user notification option All submissions to right away, through
  '<canvas_path>/profile/communication'
- complete Quizzes.Next assignment as a student
- check '<canvas_path>/users/<:user_id>/messages, there should be new
  messages

Change-Id: If3239c7370942714f9a9c797fe3b4ccc29a34a2c
Reviewed-on: https://gerrit.instructure.com/181326
Tested-by: Jenkins
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Matthew Goodwin <mattg@instructure.com>
Reviewed-by: Stephen Kacsmark <skacsmark@instructure.com>
2019-02-21 20:55:47 +00:00
Hannah Bottalla f6d14850f4 Fix grade and score parameters in QuizzesNextVersionedSubmission
closes: QUIZ-5725

test plan:
1. Create a quizzes.next quiz with Display Grade As Incomplete/Complete
or another type besides points
2. Take the quiz
3. Verify in the gradebook it shows the grade correctly

Change-Id: I005fb89b02a18372fc257c59867f35f53e240dee
Reviewed-on: https://gerrit.instructure.com/176346
Reviewed-by: Stephen Kacsmark <skacsmark@instructure.com>
QA-Review: Stephen Kacsmark <skacsmark@instructure.com>
Tested-by: Jenkins
Product-Review: Hannah Bottalla <hannah@instructure.com>
2018-12-22 00:00:41 +00:00
Han Yan 02262065fd fix exceptions due to nil url in a Q.N submission
closes QUIZ-5701

test plan:
- create a Q.N quiz (with at least a student for the course)
- go to speedgrade and see there is no submission from a student
- simulate a Canvas internal update:
  rails console to Canvas, and find the submission
  set submission.grader_id = 1
  after submission.save!, we can check
    submission.versions.count # should be 1
- check the api url from browser, no error should be there:
  <canvas_url>/api/v1/courses/<course_id>/assignments/<assignment_id>/submissions?include[]=submission_history

Change-Id: Ifcfecea7de80db578bc57c71076cf63db6023895
Reviewed-on: https://gerrit.instructure.com/174874
Reviewed-by: Stephen Kacsmark <skacsmark@instructure.com>
Tested-by: Jenkins
QA-Review: Stephen Kacsmark <skacsmark@instructure.com>
Product-Review: Han Yan <hyan@instructure.com>
2018-12-10 22:59:37 +00:00
Han Yan 956504e552 implement clean submission history for Quizzes.Next
closes QUIZ-5514

test plan:
The patch should be tested with /c/quiz_lti/+/170099/
QA live event path:
  These containers and their dependencies should be up running:
  - Canvas: web
  - quiz-lti: ui, api, kinesis2sqs-quizzes and sqs2quizlti
  - quiz-api: web, work (you can kill elasticsearch and events_consumer to
    save cpu and memory)

  test auto grading:
  create one Q.N quiz, with a couple questions and multiple attempts
  enabled (default highest), but without essay questions.
  1) As a student, take the quiz 3 times, there should be 3 history items
  in speedgrader history list

  test manual grading:
  create one Q.N quiz, with a number of questions, with at least 1 essay
  question and multiple attempts enabled.
  As a student, take the quiz 3 times
  1) make sure speedgrader history list has 3 records after 3 attempts are
  taken
  2) test manual grading on previous attempts in different order
  - manually grade the attempts in different order (1st attempt: 10%,
    3rd attempt: 80%, and 2nd: 50%)
  - make sure speedgrader has 3 history items, grades are corresponding to
    (10%, 50%, 80%), and in this order
  3) manual grading a same attempt won't add additional history items
  - manually change grade for the 1st attempt from 10% to 60%
  - make sure speedgrader still has 3 history items, grades are
    corresponding to (60%, 60%, 80%)
  - then manually change grade for the 1st attempt from 60% to 90%
  - make sure speedgrader still has 3 history items, grades in the list
    are (90%, 90%, 90%) and in the exact order

  test the similar steps for score_to_keep: average and latest

QA webhook path:
  These containers and their dependencies should be up running:
  - Canvas: web
  - quiz-lti: ui, api
  - quiz-api: web, work (you can kill elasticsearch and events_consumer
    to save cpu and memory)

  repeat the test cases for live event path.

Change-Id: I2e7ff4ea669ce2b84a95aa4f3ddf4a6f6c2a8002
Reviewed-on: https://gerrit.instructure.com/171695
Reviewed-by: Stephen Kacsmark <skacsmark@instructure.com>
Reviewed-by: Adrian Packel <apackel@instructure.com>
Tested-by: Jenkins
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Kevin Dougherty III <jdougherty@instructure.com>
2018-11-28 15:41:17 +00:00
wdransfield bc466c22a4 Basic outcomes: set submitted at but don't increment attempt
fixes PLAT-3726

Test Plan:
- create a course and enroll a student
- create an assignment that uses LTI outcomes service
  (but does not send resultData)
- submit to the assignment as the student
- verify the submitted_at timestamp is equal to the time
  of the submission
- verify the attempt number of the submission is 1
Change-Id: I2b638987c42e7815b2b5d450999bb9ef1004ea24
Reviewed-on: https://gerrit.instructure.com/164285
Tested-by: Jenkins
Reviewed-by: Marc Alan Phillips <mphillips@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Jesse Poulos <jpoulos@instructure.com>
2018-09-14 17:03:20 +00:00
Cody Cutrer dd5867d020 all file_download strand jobs should be high priority
they often have users waiting on their results. they're protected
by an n_strand anyway from consuming all the workers

Change-Id: I5ab18b2cc7c21306a1c0a9d1e28c1a98506f77f8
Reviewed-on: https://gerrit.instructure.com/164147
Reviewed-by: James Williams  <jamesw@instructure.com>
Tested-by: Jenkins
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2018-09-12 16:05:25 +00:00
Cody Cutrer 20179e2b06 use a strand-per-domain for file downloads
closes GOOF-543

each of these slightly different jobs really should be on the same
strand, because they're all calling Attachment#clone_url at their core

Change-Id: I241ca0fd47b696dba17164f8ecbb07f41912e2f3
Reviewed-on: https://gerrit.instructure.com/162278
Reviewed-by: James Williams  <jamesw@instructure.com>
Tested-by: Jenkins
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2018-08-28 16:46:32 +00:00
wdransfield b65fa777d0 Start grade passback submission attempt at 1
Fixes PLAT-3619

Test Plan:
- Make an external tool assignment that can handle grade passback.
- As a student create a submission via gradepassback.
- Verify the submission has attempt == 1 rather than
  attempt == 2.

Change-Id: I9c4b386a0dcc6605483b988237b7fe68a58b0840
Reviewed-on: https://gerrit.instructure.com/159072
Tested-by: Jenkins
Reviewed-by: Marc Alan Phillips <mphillips@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Weston Dransfield <wdransfield@instructure.com>
2018-07-31 16:36:00 +00:00
Marc Phillips 4b3fb3aff9 Add submittedAt details to Basic Outcomes
A tool may now submit the submitted at timestamp for a submission
in the tool and Canvas will honor the timestamp submitted as
the submission time.

closes PLAT-2933

Test Plan
 - Submit a submission using the new submissionDetails node
   and the submittedAt subnode to submit an assignment
 - The submission timestamp should be the same as the
   timestamp submitted in the node
 - This timestamp should be honored whether a resultData
   is in the xml or not

Change-Id: I0dec6b326b0c3380f6a8ee19f78f34f5c943758a
Reviewed-on: https://gerrit.instructure.com/147421
Tested-by: Jenkins
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Karl Lloyd <karl@instructure.com>
2018-04-23 17:06:49 +00:00
Marc Alan Phillips 5162c83e0b Fix External Tool Submission Type subbmitted_at
submitted_at timestamps for an external_tool submission_type
are given their own submission creation path from the rest of
the outcomes results data, which in turn meant that the
submitted_at is set incorrectly.

closes PLAT-2877

Test Plan:
 - Create a submission using
 https://github.com/kaufnizer/lti-or-die/blob/master/canvas_lti_config.xml
  or some other tool that will return an outcomes replace request
  and remove the resultData.
 - Submitted_at should reflect the submission time

Change-Id: I9dde0824635a36bf4b3938c6fba26a2d63ff924c
Reviewed-on: https://gerrit.instructure.com/136146
Tested-by: Jenkins
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
Reviewed-by: Andrew Butterfield <abutterfield@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Jesse Poulos <jpoulos@instructure.com>
2018-01-02 22:38:02 +00:00
Weston Dransfield 278682f152 Revert "Revert "Accept signed JWT tokens as the sourcedid for basic outcomes""
This reverts commit 50e604a8a9.

Change-Id: Ib9b403abe9dbfa5ba1468bd86317d210687b33c0
Reviewed-on: https://gerrit.instructure.com/133324
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Andrew Butterfield <abutterfield@instructure.com>
Tested-by: Jenkins
Product-Review: Weston Dransfield <wdransfield@instructure.com>
2017-11-29 21:45:46 +00:00
Weston Dransfield 50e604a8a9 Revert "Accept signed JWT tokens as the sourcedid for basic outcomes"
This reverts commit 57a70424f5.

Change-Id: Id4f590f720423b1cbe873590466a42f06f440e07
Reviewed-on: https://gerrit.instructure.com/133150
Tested-by: Jenkins
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Brad Humphrey <brad@instructure.com>
Product-Review: Brad Humphrey <brad@instructure.com>
2017-11-17 16:02:55 +00:00
Brad Humphrey 57a70424f5 Accept signed JWT tokens as the sourcedid for basic outcomes
Add sourcedid class

load sourcedid from token with validation

this supports both jwt and legacy sourcedids

use sourcedid class in in basic_outcomes

Test Plan:
  - Execute an LTI basic outcomes request
  - It should update grades and/or create a submission in canvas
  - It should still use the OLD sourced_ids (i.e.
    %r{^(\d+)-(\d+)-(\d+)-(\d+)-(\w+)$})
  - Enable the "Encrypted Sourcedids for Basic Outcomes"
    on the root account.
  - Execute an LTI baic outcomes request
  - It should use the NEW sourcdids (an encrypted JWT)
  - It should update grades ando/or create a submisison in canvas

refs PLAT-2747

Change-Id: I1b6223611228c8a078bcfa73976329365ebb1b7c
Reviewed-on: https://gerrit.instructure.com/128167
Reviewed-by: Nathan Mills <nathanm@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Tested-by: Jenkins
Product-Review: Weston Dransfield <wdransfield@instructure.com>
2017-11-06 16:55:03 +00:00
Landon Wilkins 7473953da1 da licença part 26
add consistent license headers to all source files
(ruby, coffeescript, javascript)

except for vendor files

Change-Id: I74f079254fdbff56b4f9d7013b01f11fc862777a
Reviewed-on: https://gerrit.instructure.com/110049
Tested-by: Jenkins
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2017-04-27 21:52:25 +00:00
Brad Horrocks 3b9be451c1 Delayed job outcome submission race condition fix
This moves the submission creation to a separate method, so it
can be called from a delayed job after the attachment is downloaded

refs: RD-3449

Test plan:

Makse sure LTI Cloud assignment submissions work

Change-Id: Ib28cf43fc7ece4e05bd925f67f9ce43181fa6910
Reviewed-on: https://gerrit.instructure.com/101763
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Benjamin Porter <bporter@instructure.com>
Reviewed-by: Nathan Mills <nathanm@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Caleb Guanzon <cguanzon@instructure.com>
2017-02-21 22:29:50 +00:00
Brad Horrocks c0fa1ffd8e Submission auto submit to canvadocs
Non auto submitted submissions will set annotation true when loaded in speed grader
Cloud Assignment submissions will auto submit to canvadocs

refs: RD-3449

Test plan:

Create a cloud assignment
As a student submit the cloud assignment
As a teacher open the assignment in speed grader
Observe the ability to annotate the cloud assignment

Change-Id: I6ddff84a4a97d920d17dcb26933fcc02c5e59026
Reviewed-on: https://gerrit.instructure.com/99196
Reviewed-by: Josh Orr <jgorr@instructure.com>
Tested-by: Jenkins
Product-Review: Caleb Guanzon <cguanzon@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
2017-01-10 23:42:09 +00:00
Brad Horrocks d5ccec2a3b Cloud Assignment Submissions
Ref: RD-3406

Test plan:

Create a cloud assignment with the Office365 LTI app
As a student submit the cloud assignment
As a teacher check that the submission shows up in speed grader

Change-Id: Ib6a059c2e16f882f1f254233de0f8e09b69e8814
Reviewed-on: https://gerrit.instructure.com/97435
Reviewed-by: Andrew Butterfield <abutterfield@instructure.com>
Tested-by: Jenkins
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Josh Orr <jgorr@instructure.com>
Product-Review: Brad Horrocks <bhorrocks@instructure.com>
2016-12-15 20:02:09 +00:00
Shahbaz Javeed 95283746ea prevent grading if submission is due in closed grading period
closes CNVS-32229
closes CNVS-32232

test plan:
* Create a course with MGP enabled and two grading periods in
  the default term
* Create two assignments for this course, one in a closed GP and
  one in an open GP
* To test overrides, create the following as well:
  * For one of the students, make the open assignment due in the
    closed grading period
  * For another student, make the closed assignment due in the
    open grading period

* Ensure the following steps work for all assignment/student
  combos due in a closed grading period.

** CNVS-32229 **
* Login as a teacher
* Go to speedgrader for the assignment in the closed GP
* Notice that the grade input is locked down
* Right click on the locked-down input and select 'Inspect'
* Remove the 'ui-state-disabled' class and remove
  readonly="readonly" from the input field's HTML
* Notice the input is no longer grayed out and you can enter
  a grade
* Enter a grade and tab out of the input
* You should see an error message that says something went wrong
  and notice in the Network tab of your dev tools that the AJAX
  post failed, meaning the submission was not gradeable
* Refresh the page and notice the grade is not there.
* Verify it isn't there in Gradebook either

* Login as an admin
* Go to speedgrader for the assignment in the closed GP
* Notice that the grade input is *not* locked down
* Enter a grade and tab out of the input
* You should *not* see an error message that says something went
  wrong meaning the submission was graded successfully
* Refresh the page and notice the grade is there.
* Verify it is also present in Gradebook

** CNVS-32232 **
* Login as a teacher
* Go into a gradebook that has an assignment that is
  locked down because it is in a closed grading period
* Notice that the grade cells for the assignment are locked
  down (because the submissions fall in a closed grading period)
* Right-click on one of the locked-down cells and select 'Inspect'
* Remove the 'grayed-out' and 'cannot_edit_in_closed_grading_period'
  classes
* Notice the cell is no longer grayed out and you can enter a grade.
* Enter a grade
* Click on another cell.
* You should see an error message that says something went wrong
  and in the Network tab of your dev tools verify the AJAX post
  failed, meaning the submission was not gradeable
* Refresh the page and notice the grade is not there

* Login as an admin
* Login as a teacher
* Go into a gradebook that has an assignment that is
  in a closed grading period
* Enter a grade in a cell that should be due in a closed grading
  period
* Click on another cell
* You should *not* see an error message that says something went
  wrong meaning the submission was graded successfully
* Refresh the page and notice the grade is there.
* Verify it is also present in Gradebook

Change-Id: Ia80e4de626616309c5e9dffb78ed0f9671ad1076
Reviewed-on: https://gerrit.instructure.com/95687
Reviewed-by: Jeremy Neander <jneander@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
Tested-by: Jenkins
QA-Review: Anju Reddy <areddy@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
2016-12-08 21:01:07 +00:00
Nathan Mills 182e12e2e0 ensure sumbission_type on grade passback
fixes PLAT-1944

test plan:
setup module progression to require a sumbission for an external
tool assignment that does grade passback

do a "what-if" grade for the external tool assignment

do a grade passback for the external tool

it should mark the assignment as submitted and allow module
progression

Change-Id: Ib43769ab6dfffa265cf9c321c767db3a9f233f26
Reviewed-on: https://gerrit.instructure.com/94333
Tested-by: Jenkins
Reviewed-by: Andrew Butterfield <abutterfield@instructure.com>
Reviewed-by: Matthew Wheeler <mwheeler@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Karl Lloyd <karl@instructure.com>
2016-11-03 20:37:42 +00:00
Nathan Mills 7fb13337af don't change submission type for grade updates
fixes: PLAT-1836

test plan:
1. Install this tool into a Canvas course:
https://lti-tool-provider.herokuapp.com
2. Create and publish an assignment that uses the external tool from #1
3. Enroll and masquerade as a student and access the assignment
4. Submit either text or url (or a valid LTI launch URL)
5. view the submission details (grades --> click the assignment), notice
your submission is previewable
6. view the submissions API and notice the submission_type is
"online_upload"
7. return to the assignment and give yourself a grade
8. make sure that the assignment is still previewable and that the
submission_type didn't change

Change-Id: Ibdd2fbafb54f80d20dff447ec7f2b776eee419bb
Reviewed-on: https://gerrit.instructure.com/91100
Tested-by: Jenkins
Reviewed-by: Matthew Wheeler <mwheeler@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Nathan Mills <nathanm@instructure.com>
2016-09-27 17:51:44 +00:00
Andrew Butterfield 7731dbf37f Fix Basic Outcome for IMS LTI Certification
fixes PLAT-1767, PLAT-1773, PLAT-1774, PLAT-1775, PLAT-1776, PLAT-1777

Test plan:
* Regression test basic outcomes service
* Ensure that in each <imsx_POXBody> there is a corresponding

  <replaceResultResponse/>

  <deleteResultResponse/>

  <readResultResponse>
    <result>
      <resultScore>
        <language>en</language>
        <textString>0.91</textString>
      </resultScore>
    </result>
  </readResultResponse>

  depending on the kind of request being made

Change-Id: If049bd5380b60ab4fc7b309cffd14d4a78595090
Reviewed-on: https://gerrit.instructure.com/88811
Tested-by: Jenkins
Reviewed-by: Nathan Mills <nathanm@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Andrew Butterfield <abutterfield@instructure.com>
2016-08-26 20:38:08 +00:00
Ryan Taylor 646a16b255 Fix speedgrader LTI integration bugs
1) Respect global context in URL lookups
2) Update submission_type when replacing previous submission

Closes PLAT-1623

Test Plan:
 - Speedgrader integrations should load without error
 - Cross-sharded speedgrading should load properly

Change-Id: I9ed6d6f629d6af9c03a5fe4d13aded771ff17f61
Reviewed-on: https://gerrit.instructure.com/83476
Reviewed-by: Cameron Matheson <cameron@instructure.com>
Reviewed-by: Davis McClellan <dmcclellan@instructure.com>
Reviewed-by: Shahbaz Javeed <sjaveed@instructure.com>
Tested-by: Jenkins
QA-Review: Benjamin Christian Nelson <bcnelson@instructure.com>
Product-Review: Brad Humphrey <brad@instructure.com>
2016-06-27 22:19:11 +00:00
Brad Humphrey e7229f0fc8 allow basic outcomes to accept an lti link with no score
fixes PLAT-1617

Change-Id: I8206a13fe30095a5c85b2e20dd704f040c14c95a
Reviewed-on: https://gerrit.instructure.com/83200
Tested-by: Jenkins
Reviewed-by: Matthew Wheeler <mwheeler@instructure.com>
QA-Review: Benjamin Christian Nelson <bcnelson@instructure.com>
Product-Review: Brad Humphrey <brad@instructure.com>
2016-06-23 18:37:24 +00:00
Ryan Taylor 167b46924a Add LTI launch capability to speedgrader
Closes CNVS-29144

Test Plan:
   - Add an external tool assignment
   - Passback a URL type score which matches the launch URL of the tool
   - Confirm that speedgrading that page launches into the tool

Change-Id: Iff3e00ece10c6b4ff891e4af90053c88a677db6a
Reviewed-on: https://gerrit.instructure.com/79526
Reviewed-by: Davis McClellan <dmcclellan@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
Tested-by: Jenkins
Reviewed-by: Nathan Mills <nathanm@instructure.com>
QA-Review: Michael Hargiss <mhargiss@instructure.com>
Product-Review: Jason Sparks <jsparks@instructure.com>
2016-05-24 21:14:02 +00:00
James Williams 12bd2627ab remove float rounding monkey-patch
used to turn 1.0.to_s to "1"

closes #CNVS-28310

Change-Id: I79106a4c0b42fe9b6d96097aaf9dd28a43024373
Reviewed-on: https://gerrit.instructure.com/75194
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins
QA-Review: KC Naegle <knaegle@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2016-04-22 18:17:18 +00:00
Nathan Mills e893a488c8 gracefully handle missing sourcedid for grade passback
fixes PLAT-1356

test plan:
send a grade passback with no sourcedid
canvas shouldn't return a 500

Change-Id: I21436d679e05a5fa837167b163212a729c10a3a8
Reviewed-on: https://gerrit.instructure.com/72998
Tested-by: Jenkins
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Brad Horrocks <bhorrocks@instructure.com>
Product-Review: Nathan Mills <nathanm@instructure.com>
2016-02-26 18:29:52 +00:00
Nathan Mills fbb91fdfcd allow tii lti originality scores to be resubmitted
if there is already a submission for grade passback
then keep the original submission_type

fixes PLAT-1313

test plan:
setup the turnitin lti tool and submit an assignmnet
wait until you get an originality score back
edit the db to change the status of the result to error
resubmit the assignment in speed grader
you should get the score again, and the status in the db should change
then go into turnitin as a teacher and submit a grade for the submission
check the database the submission_type should still be 'online_upload'

Change-Id: I2bc609bc5559e80f678cf00370f6a04af4d3b6aa
Reviewed-on: https://gerrit.instructure.com/71118
Reviewed-by: Brad Horrocks <bhorrocks@instructure.com>
Reviewed-by: Andrew Butterfield <abutterfield@instructure.com>
Tested-by: Jenkins
Reviewed-by: Ryan Taylor <rtaylor@instructure.com>
Reviewed-by: John Corrigan <jcorrigan@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Nathan Mills <nathanm@instructure.com>
2016-02-16 19:37:31 +00:00
Nathan Mills 894c849a28 fix bad returns for decode_source_id
fixes PLAT-1303

test plan:

grade passback should still work

Change-Id: I48f841b51e21e5f5c3cc5d55d8193374c97dd115
Reviewed-on: https://gerrit.instructure.com/69806
Reviewed-by: Brad Horrocks <bhorrocks@instructure.com>
Tested-by: Jenkins
QA-Review: August Thornton <august@instructure.com>
Product-Review: Nathan Mills <nathanm@instructure.com>
2016-01-27 18:05:18 +00:00
Brad Horrocks 020e580830 Better error logs and responses for grade passback
This adds error reports for failed/unsupported outcomes

Fixes PLAT-1278

Test Plan:
TBD... Any sugestions

Change-Id: Ie29f5e92735d73268f9221bdba73d1ef7af87758
Reviewed-on: https://gerrit.instructure.com/66083
Reviewed-by: Nathan Mills <nathanm@instructure.com>
Tested-by: Jenkins
QA-Review: August Thornton <august@instructure.com>
Product-Review: Brad Horrocks <bhorrocks@instructure.com>
2015-11-05 22:49:25 +00:00
Brad Horrocks ff5dd90527 Capture better errors for failed grade passback
This adds oauth info to captured error exceptions

Fixes PLAT-1256

Test Plan:
The error report should include all of the OAuth1 header information
If the Authorization Header is not OAuth1 it should not include it
The error report should also include the signature canvas generates
The error report should include where the authorization failed. i.e.
signature, nonce, expiration

The best way to test this is run the test :D
The best way to manually test this:
- Setup an LTI Tool (I used the example tool with all the checkboxes
  checked)
- Use post man stand alone
- create a new request to "/api/lti/v1/tools/<tool_id>/grade_passback"
- Use post man's Authorization tab to setup OAuth1
- Use the tools key and secret
- tweak settings for different failure tests
- select add params to header
- click update request
- send the request

You will need to manually change the auth header to get to some
failures. Let me know if you need help

Change-Id: If09882017eaae0ddff96d39b7f33c2da9c1a7fc8
Reviewed-on: https://gerrit.instructure.com/65944
Tested-by: Jenkins
Reviewed-by: Nathan Mills <nathanm@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Brad Horrocks <bhorrocks@instructure.com>
2015-11-05 22:49:16 +00:00
Brad Humphrey 64ef3becc7 Allow LTI tools to submit scores for 0 point assignments
fixes PLAT-1238

Change-Id: I601a3c81b7b10c13467dca15b4fe251dd032be18
Reviewed-on: https://gerrit.instructure.com/64033
Tested-by: Jenkins
Reviewed-by: Nathan Mills <nathanm@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Brad Humphrey <brad@instructure.com>
2015-09-25 21:29:59 +00:00
Brad Horrocks ad0275bf09 LTI grade passback correctly handles 0 point complete/incomplete assignments
when an assignment is worth 0 points. A score of 1.0 will be marked
as complete and anything less than 1.0 will be marked incomplete

Fixes PLAT-1095

Test Plan:
You'll need an LTI tool that uses grade passback
Use the external tool on an assignment with complete/incomplete as
the grading type.
Set the total points for the assignment to 0.
Make sure you can get a grade of "complete" after taking the assignment.

Change-Id: I911d22ec93ed223b79855ffe2c69fc0c94fa56f9
Reviewed-on: https://gerrit.instructure.com/59268
Tested-by: Jenkins
Reviewed-by: Nathan Mills <nathanm@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Brad Horrocks <bhorrocks@instructure.com>
2015-07-28 17:54:18 +00:00
Cody Cutrer 9834937c8c don't autorequire a bunch of gems that are rarely used
Change-Id: I09ed3686629b62849d392684d587f30cb2047013
Reviewed-on: https://gerrit.instructure.com/51853
Tested-by: Jenkins
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2015-04-09 18:47:50 +00:00
Nathan Mills ae99ccf7aa have grade passback do a more robust check for url matching
PLAT-818

test-plan:
install multiple tools with the same launch urls.
create assignments for each tool
attempt to do grade passback with the tools
they all should pass back a grade

Change-Id: I4a01b45eb2f1f1b0ed25ecc397ec4e978abc4a4e
Reviewed-on: https://gerrit.instructure.com/48913
Tested-by: Jenkins
Reviewed-by: Brad Humphrey <brad@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Nathan Mills <nathanm@instructure.com>
2015-02-19 21:06:13 +00:00
Nathan Mills 2ce0f083a8 fix multiple outcome submissions for assignments with no points possible
fixes PLAT-845

test-plan:
try and send grades back multiple times for an assignment with no points possible.  It shouldn't blow up

Change-Id: Id001a1d218931f127fd350a34f608ac4b246221f
Reviewed-on: https://gerrit.instructure.com/47955
Tested-by: Jenkins
Reviewed-by: Brad Humphrey <brad@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Nathan Mills <nathanm@instructure.com>
2015-02-02 20:47:13 +00:00
Bracken Mosbacker 3e5bcd4acc add resultTotalScore for LTI 1 outcome service
fixes CNVS-17784

Change-Id: Ie61a0f76220a38ed40465b07c22530b644933167
Reviewed-on: https://gerrit.instructure.com/46566
Tested-by: Jenkins
Reviewed-by: Alex Boyd <aboyd@instructure.com>
Reviewed-by: Brad Humphrey <brad@instructure.com>
Reviewed-by: Eric Berry <ericb@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2015-01-27 17:59:08 +00:00
Brad Humphrey 6ec8bdb081 add better error messages to lti outcomes
test plan
 - Install an LTI tool with grade passback
 - Setup an assignment in a course for LTI grading

 - Delete the user enrollment and execute outcomes API call
   * It  should say 'User is no longer in course'

 - Delete the assignment and execute outcomes API call
   * It  should say 'Assignment is invalid'

 - Delete the tool and execute outcomes API call
   * It  should say 'Assignment is no longer associated with this tool'

 - Delete the course and execute outcomes API call
   * It  should say 'Course is invalid'

fixes PLAT-821

Change-Id: Ia058a14854bd107eeea6a28b77258ab197980e25
Reviewed-on: https://gerrit.instructure.com/46891
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: August Thornton <august@instructure.com>
2015-01-13 22:52:03 +00:00
Cody Cutrer 575e1d0acb security.yml encryption key rotation support
fixes CNVS-15647

test plan:
 * ensure that all of the following still work -
   * replying to an e-mail notification
   * displaying avatars
   * changing your avatar
   * uploading a file that's exempt from quota checks (i.e.
     submitting an assignment)
   * grade passback via LTI
   * add an object embed to a wiki page
 * rotate your encryption key -
   * in security.yml, move encryption_key to previous_encryption_keys,
     and put something else in encryption_key
 * repeat step 1, as much as possible using the original verifier
   from that step (i.e. reply to the original e-mail, refresh just
   the object embedded in the wiki page)

Change-Id: Id36bbb1711f8b6c6f960cc1e898b75e335bfac81
Reviewed-on: https://gerrit.instructure.com/41368
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2014-10-27 20:50:45 +00:00
Cody Cutrer 5d42d023d2 no more dynamic finders (lib)
refs CNVS-15126

Change-Id: I4087b1c2442c5b8f70ce2138bf4aeef6ef7e59cd
Reviewed-on: https://gerrit.instructure.com/41259
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-09-23 16:53:56 +00:00
Brad Humphrey ce66769b69 implement lti outbound adapter
also, refactor lti outbound adapter parameters and
convert integration tests to use lit outbound adapter

test plan
 - Ensure that LTI launch parameters are the same before and after this change.
 - Test all of the different kinds of launches for differences

Change-Id: I749e7f7b887eaac87dd104f195b526b18040a2b9
Reviewed-on: https://gerrit.instructure.com/30087
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
2014-03-26 16:49:22 +00:00
Stephan Hagemann ea7e45c793 WIP basic_lti_outbound gem extraction
Change-Id: Icb8f78bdd5f41e4eae18b30d1a4cfc7dd9942057
Reviewed-on: https://gerrit.instructure.com/28722
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Raphael Weiner <rweiner@pivotallabs.com>
Product-Review: Brad Humphrey <brad@instructure.com>
QA-Review: Brad Humphrey <brad@instructure.com>
2014-01-23 22:35:20 +00:00
Brad Humphrey 4923906d88 fixes a bug in the LTI variable substitutor
test plan:

Add a custom variable with the value $Canvas.user.user and $Canvas.user.class.
These values should not be substituted when the tool launches .

fixes PLAT-311

Change-Id: Ifb64ebaeb0c732720d6c5312cbc595a9c6e9c21e
Reviewed-on: https://gerrit.instructure.com/28761
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2014-01-21 15:58:26 +00:00