Commit Graph

261 Commits

Author SHA1 Message Date
Cody Cutrer 47119da659 spec: remove sharding_spec_helper requires
[skip-stages=Flakey]

the main spec_helper already requires it

Change-Id: Ibcd905aa7ae603c8cdfa3cd24216e16aee252a8f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276853
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-10-28 00:19:18 +00:00
Cody Cutrer 0a025efa2f spec: use require_relative instead of require File.expand_path
[skip-stages=Flakey]

Change-Id: I861a46acffa893b4ea6630039da66851c71b5a77
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276831
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-10-28 00:15:03 +00:00
Cody Cutrer ff416aeb59 RuboCop: Lint/UnusedBlockArgument spec
[skip-stages=Flakey]

all manual

Change-Id: I7137e91c6b576fe29bfe8d8cb4cde343fe3df3a9
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276621
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-10-26 20:41:00 +00:00
Cody Cutrer 06a2c9df42 spec: remove manual requires of spec_helper
[skip-stages=Flakey]

Change-Id: Id65c835b72e1c0a4bb825b58490ce0ff7c8d9873
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276829
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-10-26 20:38:27 +00:00
Cody Cutrer 349ff7fa49 RuboCop: Lint/UnusedMethodArgument spec
[skip-stages=Flakey]

all manual

Change-Id: I7703886011d35c28ba1b06414a39671eca12b501
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276448
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-10-21 16:20:05 +00:00
Cody Cutrer 6cb0ea010c RuboCop: Lint/UselessAssignment spec
[skip-stages=Flakey]

all manual

Change-Id: I615934f94060ed339c17d6a73599487dc577e376
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276433
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-10-21 13:38:12 +00:00
Isaac Moore f94fe15d01 Add `locked_for_user` property to `observer_alert_json`
This change adds a new `locked_for_user` property to the Observer Alert
API to indicate whether or not a particular alert's context is "locked"
(e.g., invisible) for the calling observer. This can be set to `true` for
a number of reasons, but most commonly, the deletion of the content or
the conclusion of the course.

closes LS-2668
flag=none

test plan:
- create an observing enrollment for a student enrolled in a course
- using the API, as an observer, create an observer alert threshold for
  a high assignment grade for your student (see the bottom of the commit
  message for an example request)
- as a teacher, enter a grade for the student in the course above the
  value you set in your threshold
- call the `/api/v1/users/self/observer_alerts/<student_id>` endpoint and
  verify an alert appears, and `locked_for_user` is false
- set the course end date to the past, and restrict students from viewing
  the course after the end date
- call the API again, and verify `locked_for_user` becomes true
- revert your change to the course end date
- call the API again, and verify `locked_for_user` becomes false
- delete the assignment
- call the API again, and verify `locked_for_user` becomes true again

### Example threshold creation request:
```
curl --request POST \
  --url http://<canvas URL>/api/v1/users/self/observer_alert_thresholds \
  --header 'Authorization: Bearer <your token here>' \
  --header 'Content-Type: application/json' \
  --data '{
	"observer_alert_threshold": {
		"alert_type": "assignment_grade_high",
		"threshold": "90",
		"user_id": <your student's user id>
	}
}'
```

Change-Id: Ifc0775c70a0e0cb6bf66c5e60968013a91661eb9
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276187
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Nate Armstrong <narmstrong@instructure.com>
QA-Review: Nate Armstrong <narmstrong@instructure.com>
Product-Review: Isaac Moore <isaac.moore@instructure.com>
2021-10-20 22:54:45 +00:00
Jackson Howe 60f3a182fe Tweak zoom/webex regex to allow '-' in url
fixes LS-2752
flag = none

Test plan:
 - Add a link like https://instr-ucture.zoom.us/j/9585021282 (with a
   hyphen) to a k5 subject calendar event location or description
 - Visit the planner
 - Expect to see a join button

Change-Id: Iac43b8bc15eada834bdc71054e3f239d253e4aee
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276272
Reviewed-by: Robin Kuss <rkuss@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Jackson Howe <jackson.howe@instructure.com>
2021-10-19 19:43:13 +00:00
Rob Orton 4c14d0fdf1 don't join cross shard for discussion_topics
test plan
 - specs should pass

fixes VICE-2164
flag=none

Change-Id: I3be48a2d4500dc7377ec274d9a6a87c01130f725
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/275553
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Drake Harper <drake.harper@instructure.com>
QA-Review: Drake Harper <drake.harper@instructure.com>
Product-Review: Drake Harper <drake.harper@instructure.com>
2021-10-18 15:47:51 +00:00
Eric Saupe 36ebfea4ec Fix inconsistent can_submit value
fixes LS-2679
flag=none

test plan:
- Create a published course with a student enrolled
- Create and publish an assignment
- Create a module and leave it unpublished
- Check the API for the assignment for the student with
include[]=can_submit in the request like this,
api/v1/courses/:course_id/assignments/:assignment_id?include[]=can_submit&as_user_id=:user_id
- Verify the can_submit value is true
- Add the assignment to the module
- Verify the API response for can_submit is false
- Publish the module
- Verify the API response for can_submit is true

Change-Id: Ife6ce897bf52c990ad6bdd3a7d7d5787dda069dc
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/275985
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Nate Armstrong <narmstrong@instructure.com>
QA-Review: Nate Armstrong <narmstrong@instructure.com>
Product-Review: Eric Saupe <eric.saupe@instructure.com>
2021-10-15 19:33:05 +00:00
Spencer Olson 734344eaff fix speedgrader status menu with anonymous assignments
closes EVAL-1995
flag=edit_submission_status_from_speedgrader

Test Plan:
1. Enable "Edit Submission Status from Speedgrader".
2. Create an anonymous assignment.
3. Go to SpeedGrader and change a student's status (i.e. Late, Missing,
   Excused, or None) using the select menu. Verify the request succeeds
   and the status is updated.
4. Create an assignment that is not anonymous.
5. Go to SpeedGrader and change a student's status using the select
   menu. Verify the request succeeds and the status is updated.

Change-Id: I949648b7a2c78e01642d0c73298995acb3e4e7d6
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/275004
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Adrian Packel <apackel@instructure.com>
Reviewed-by: Eduardo Escobar <eduardo.escobar@instructure.com>
Reviewed-by: Syed Hussain <shussain@instructure.com>
QA-Review: Kai Bjorkman <kbjorkman@instructure.com>
Product-Review: Jody Sailor
2021-10-14 16:19:50 +00:00
Mysti Lilla 377d4eb438 Add developer key ID to external tool JSON
flags=none

Test plan
- Load up an LTI 1.3 external tool in the API
- See the developer_key_id

Change-Id: I00c277be71c7c1c9056c17a3f6bd3906708c60bb
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/275467
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
QA-Review: Xander Moffatt <xmoffatt@instructure.com>
Product-Review: Connor Merchant <cmerchant@instructure.com>
2021-10-08 17:36:52 +00:00
Cody Cutrer dbd8c46655 RuboCop: Lint
[skip-stages=Flakey]

auto corrections applied:
 * Lint/AmbiguousOperator
 * Lint/AmbiguousOperatorPrecedence
 * Lint/AmbiguousRegexpLiteral
 * Lint/DeprecatedClassMethods
 * Lint/DeprecatedOpenSSLConstant
 * Lint/NonDeterministicRequireOrder
 * Lint/ParenthesesAsGroupedExpression
 * Lint/RedundantRequireStatement
 * Lint/RedundantSafeNavigation
 * Lint/RedundantSplatExpansion
 * Lint/RedundantStringCoercion
 * Lint/RedundantWithIndex
 * Lint/SendWithMixinArgument
 * Lint/SymbolConversion

Change-Id: I222ec19978033544513bb99755994d109435abad
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274551
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-09-29 03:38:23 +00:00
Cody Cutrer 223aedadff rubocop: update to 1.21
[skip-stages=Flakey]

new cop autocorrected: Layout/LineEndStringConcatenationIndentation

Change-Id: Ib59a7fadeb2d9af68d90eb82b9ac855dead29121
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274524
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-09-28 02:40:46 +00:00
Cody Cutrer b6e406ddcf RuboCop: RSpec/ExampleWording
[skip-stages=Flakey]

Change-Id: I291432cd1f51fdaefb3cf6160d423879fb858c11
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274253
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-09-24 02:15:35 +00:00
Cody Cutrer 649ed90556 RuboCop: Layout spec/lib
[skip-stages=Flakey]

Change-Id: I8ea79181841e3da783801500e26f630770c4d672
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274150
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-09-22 19:17:20 +00:00
Jackson Howe 2d2a324f65 Add some new conferencing providers
Add regex to support extracting join links from Teams, Webex, and
Google Meet. Reserving the DynamicSetting for on-the-fly changes.

refs LS-2618
flag = none

Test plan:
 - Make a calendar event in a k5 course with a Teams/Webex/Meet url
   in the location or description.
 - View the planner as a student - expect to see a join button that
   opens the conferencing provider.

Change-Id: I3c60bd3f33e03a5306cc01f86614fac640ac4ced
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/273445
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
QA-Review: Ed Schiebel <eschiebel@instructure.com>
Product-Review: Peyton Craighill <pcraighill@instructure.com>
2021-09-15 19:04:16 +00:00
Dustin Cowles b273c8a5be do not include rubric with assignment in api when rubric.deleted?
Currently if there is an active association for a deleted rubric, the
rubric will be included with the assignment by default. This change will
check if the associated rubric is deleted and will not include it.

closes EVAL-1951
flag=none

Test plan:
- PreReq: PostMan with authenticated session
- Create a course with an assignment with an associated rubric
- Call api/v1/courses/{{CourseID}}/assignments/{{AssignmentID}}
- Observe 'rubric' key in response contains the associated rubric
- Set rubric.workflow_state = 'deleted' (do not call rubric.destroy!)
- Call api/v1/courses/{{CourseID}}/assignments/{{AssignmentID}}
- Observe no 'rubric' key in the response

Change-Id: I4456ef61fdc1be4ebea9d8c70fa480470f670a32
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/273320
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Adrian Packel <apackel@instructure.com>
Reviewed-by: Syed Hussain <shussain@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
QA-Review: Syed Hussain <shussain@instructure.com>
Product-Review: Syed Hussain <shussain@instructure.com>
2021-09-15 16:05:46 +00:00
Mysti Lilla 8303761f3f Add launch url redirect to sessionless launch
This also makes tool domain matching work with ports
for working with localhost.

fixes INTEROP-6849
flag=none

Test plan
- Set up the LTI 1.3 test tool in the RCE
- Create a deep link for an iFrame
  (which seems to require some json in the
  iFrame section)
- Use an API key to generate a sessionless
  launch with a URL pointing to the deep link
  like canvas/api/v1/courses/:id/external_tools/
  sessionless_launch?url=deep_link
- The return URL you receive can be placed in a
  browser and then in the POST to /login, in the
  request data you should be able to see the
  target_link_uri that you gave
- If you fiddle with the deep link URL and make
  it something that doesn't match the domain
  of the tool, it should NOT send that URL
  as the target_link_uri

Change-Id: I5487b221d24faeb3267eec84ff038d1c789ad55b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/271777
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
Reviewed-by: Evan Battaglia <ebattaglia@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Evan Battaglia <ebattaglia@instructure.com>
Product-Review: Mysti Lilla <mysti@instructure.com>
2021-09-13 19:23:14 +00:00
Jon Scheiding c2279a1820 Add rewriteUrls parameter for GQL
fixes MAT-406
flag=none

Allows GQL API types to expose an option for the client to request
not to rewrite relative URLs into absolute ones in user content.

Also specifically adds this option for the SubmissionDraft GQL API.

test plan
- Navigate to Student View for an Online Text Entry assignment in a
  course with Assignment Enhancements enabled
- Switch the RCE to HTML view and enter the following HTML:
  <img src="/some_image.jpg" />
- Observe the "Draft Saved" notification at the bottom
- Refresh the page
- Verify that the submission HTML has not changed
  (in production, you will see that it changes to
  <img src="https://myusername.instructure.com/some_image.jpg" />)

Change-Id: I3437683f2f3a1915d03d1374d2d499bb3daf9a3f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/271886
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
Product-Review: Jon Scheiding <jon.scheiding@instructure.com>
Tested-by: Jon Scheiding <jon.scheiding@instructure.com>
2021-09-09 18:05:29 +00:00
Ryan Hawkins 7b13cda89c Fix Custom Params Edit and Publish Bug
Previously, when publishing an assignment that uses an LTI 1.3 tool with
custom parameters for submission, the custom parameters would disappear.
This was caused by a difference in format from the GET Assignment
endpoint vs. the PUT and POST Assignment endpoints.

This commit updates these endpoints so they now send and expect the same
format, which is also now documented. In addition, the Assignment Edit
and New page was updated to switch to this new format.

Lastly, the previous existing specs were moved and adapted to more
directly mimic a direct API call, rather than just testing the logic
itself. This means we now have more thorough tests that run almost as
fast as the old ones! A SET's true dream.

closes INTEROP-6929, INTEROP-6930

flag = none

test-plan:
* You'll need the LTI 1.3 Test Tool for this. Install it and make sure
  it has the Assignment Selection placement.
* Create a new assignment that uses the LTI 1.3 Test Tool for
  submission. When you're configuring the tool in the assignment, give
  it some custom parameters to save. Use custom parameters for now.
* Save that assignment and make sure the custom parameters you entered
  get saved as well. The most thorough way is to launch the tool and
  make sure they got sent in the JWT.
* Go to the assignment index page and publish the assignment you just
  created. Launch the tool again and make sure the custom params are
  still there (that was the first bug)
* Create another assignment, also with the test tool and custom
  parameters and just save it.
* Go to the assignment index page and then edit it from there.
* Launch the tool again and make sure that the custom parameters are
  still there (that was the second bug)
* Create another assignment, same as before, but save and publish it
  this time. Make sure the custom params are still there when you launch
  the tool.
* Celebrate!

Change-Id: I3bbe3fd92c3b7b2fc34e95bcb2b547d2834ca49a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/271674
Reviewed-by: Evan Battaglia <ebattaglia@instructure.com>
QA-Review: Evan Battaglia <ebattaglia@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Ryan Hawkins <ryan.hawkins@instructure.com>
2021-09-02 22:42:21 +00:00
Ed Schiebel 8af5a65c6d Add a "join" button to planner calendar events with a zoom link
closes: LS-2505
flag=none

test plan:
  - create some calendar events:
    1. an all day event, one today, one another day
    2. an event with start time and no end time,
       one today with the start time before "now",
       one with the start time after "now"
    3. an event with start and end time
       one with "now" between start and end time
       one where it's not
    some with zoom link in description, some in location
    use your parsonal zoom meeting
    use a zoom link from google calendar
    use whatever zoom link you can find

  with canvas for elementary off
  - load the planner
  > expect no "Join" button

  with canvas for elementary on
  - load the planner
  > expect to see a "Join" button on each of the events
  > expect the Join button to be green for events that are
     currently active
  > expect teh Join button to be grey for events that are
     not currently active
  - shrink the window
  > expect the layout to accomodate the smaller screen size
  > expect screenreaders to distinguish between active and
    scheduled online meetings when reading the Join button

Change-Id: Icd0df43010b42dcc83fab2a11f8d206da9001190
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/271818
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jackson Howe <jackson.howe@instructure.com>
QA-Review: Jackson Howe <jackson.howe@instructure.com>
Product-Review: Peyton Craighill <pcraighill@instructure.com>
2021-08-23 16:11:19 +00:00
Math Costa 8675ccb46f Remove course image feature flag
closes: LS-2417
flag=none

test plan:
- Confirm the course image feature behavers as expected

Change-Id: I3b4c2a204418562a25f0512104e3964082393bd7
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270197
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Robin Kuss <rkuss@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Luis Oliveira <luis.oliveira@instructure.com>
2021-08-03 21:07:41 +00:00
Han Yan ff2ea293f1 fix invalid regrade_option option
closes QO-743

flag=none

test plan:
- pass specs

Change-Id: Ifc2fc6d530b6fd5139065df6c4cb5a7c774fc5fd
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/267638
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Mark McDermott <mmcdermott@instructure.com>
Product-Review: Mark McDermott <mmcdermott@instructure.com>
Reviewed-by: Stephen Kacsmark <skacsmark@instructure.com>
2021-07-19 21:44:14 +00:00
Jorge Arteaga 0506150c42 allow updating submission type of none-quiz assignments via API
closes DEMO-189
flag=none

test plan:
- create an assigment with a submission type other than
  online_quiz
- send a student submission for the assignment
- as a teacher/admin, you should be able to update the
  submission type and the submission type options
  from the UI and the REST API
  (PUT /api/v1/courses/:course_id/assignments/:id)

- create an assignment with submission type "online_quiz"
- as a teacher/admin, you should be able to update the
  submission_types field via the REST API
- as a student, take the online quiz
- as a teacher/admin, you should not be able to update
  the submission_types field via the REST API

Change-Id: I97853407569894de03974dc3a29ecea91b22f50d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/266015
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Susan Sorensen <susan.sorensen@instructure.com>
Reviewed-by: Stephen Kacsmark <skacsmark@instructure.com>
QA-Review: Mark McDermott <mmcdermott@instructure.com>
2021-07-07 13:59:22 +00:00
Jackson Howe 316b1eb31b Show an unread indicator next to new grades in k5
Adds an include param to the submission api which includes the
read_state for each submission. If this param is included, the
associated submissions are then marked as read.

closes LS-2141
flag = canvas_for_elementary

Test plan:
 - As a student, visit grades in a k5 subject course with some
   assignments
 - As a teacher, visit the gradebook for that course and change one
   or two of that student's grades
 - As the student, refresh the page and expect to see some blue dots
   next to those assignments with new grades

Change-Id: Ia9d200a409f9af99abcd1c7a4260f673c8cfec3d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/263882
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jonathan Guardado <jonathan.guardado@instructure.com>
QA-Review: Jonathan Guardado <jonathan.guardado@instructure.com>
Product-Review: Jackson Howe <jackson.howe@instructure.com>
2021-05-03 18:48:55 +00:00
Jorge Arteaga b60338b902 prevent editing submission_types via the REST API
fixes DEMO-144
flag=none

test plan:
  - Create a classic quiz assignment
  - Update the submission_types field of the quiz
    assignment via the REST API
    (PUT /api/v1/courses/:course_id/assignments/:id)
  - As a student take and submit the quiz
  - Try updating the submission_types field of the quiz assignment
    via the REST API. This time the field will not change

Change-Id: Ifc9237f27bcfdb1eb3107d0f948c351e81e5996f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/257449
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Stephen Kacsmark <skacsmark@instructure.com>
QA-Review: Mark McDermott <mmcdermott@instructure.com>
Product-Review: Stephen Kacsmark <skacsmark@instructure.com>
2021-04-30 18:01:49 +00:00
Rob Orton 3b6a43db9b include users in conferences json
Revert "avoid joining conferences to users unnecessarily"

This reverts commit d44d00d421.

Reason for revert: so turns out we do use the users in this json
response.
currently it is used in the front end when editing a conference
see #markInvitedUsers around
ui/features/conferences/backbone/views/EditConferenceView.coffee:199

test plan
 - create a conference and add some users to it
 - edit the conference and you should see the same users checked

Fixes VICE-1310
flag = none

Change-Id: I76765676faab1bcd19d3b13e0d10255fa6299167
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/261960
Reviewed-by: Davis Hyer <dhyer@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-04-20 23:49:43 +00:00
Nate Armstrong 1ad4207dcf Only show download button for canvas files
fixes MAT-28
flag=none

test plan:
- Create a new page
- Switch to html view
- Add an instructure_file_link to an external file
    <a class="instructure_file_link instructure_scribd_file"
      href="https://google.com">google</a>
- Add an instructure_file_link to a mailto link
    <a class="instructure_file_link instructure_scribd_file"
      href="mailto:test@test.com">mailto</a>
- Add an instructure_file_link to a course file
    <a class="instructure_file_link instructure_scribd_file"
      href="/courses/1/files/1">file</a>
- Add an instructure_file_link to a course file download
    <a class="instructure_file_link instructure_scribd_file"
      href="/courses/1/files/1/download">download</a>
- Add an instructure_file_link to a course file preview
    <a class="instructure_file_link instructure_scribd_file"
      href="/courses/1/files/1/preview">preview</a>
- Add an instructure_file_link to a course navigation item
    <a class="instructure_file_link instructure_scribd_file"
      href="/courses/1/pages/a-page">page</a>
- Download button should only show for files

Change-Id: I97069ca5dfd8b539a4da2eb47fba48bdde594412
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/262493
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
QA-Review: Ed Schiebel <eschiebel@instructure.com>
Product-Review: Nate Armstrong <narmstrong@instructure.com>
2021-04-13 17:50:52 +00:00
Simon Williams d44d00d421 avoid joining conferences to users unnecessarily
we don't show the user ids belonging to a conference in the UI anywhere,
so we shouldn't need to load it.

closes FOO-1791
flag = none

test plan: basic regression test of conferences UI.

Change-Id: I62753edee5d43b4c514c35ec14cb6cc58a2d7fb2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/261782
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2021-03-30 02:14:49 +00:00
Wagner Gonçalves 562fa66294 fix infer file extension from attachment module
The `infer_file_extension` first should try to infer the extension from
name, filename, or url parameters, because, there's more than one mime
type to the same extension, like text/plain: dat, txt, hh, hlp.
In case the extension wasn't find, we will try to find using the
content_type parameter.

closes INTEROP-6616
flag=none

test-plan:
1. Have a Course recorded;
2. Have a Student enrolled in this Course;
3. Have an Assignment recorded to this Course with some restrict upload
   file types;
4. Enable the assignment enhancements feature in the course settings;
5. Logged as a student, you should be able to upload files with
   diferrent extensions (according to extensions restricted in step 3)
   without receiving the console error `filetype not allowed`;
6. You should be able to receive the console error `filetype not allowed`
   when trying to upload a file with a extension that wasn't in the
   restricted list;
7. Accessing the submission details, you should be able to validate if
   the attachment corresponds to the file you submitted;
8. Accessing the speed grader as a Teacher, you should be able to preview
   or download the file submitted;
9. You should be able to you should be able to upload files after
   disabling the assignment enhancements feature and execute steps 5
   until 8;

Change-Id: Ie54b16fb3b6906554a2e1aad6010ad54d86a60f3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260893
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Xander Moffatt <xmoffatt@instructure.com>
Product-Review: Wagner Goncalves <wagner.goncalves@instructure.com>
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
2021-03-22 16:27:05 +00:00
Mauricio Salles a4ee9e90be fix no method error on DelayedNotification job
no method error was throwed when a unexpected context was passed
thru a polymorphic_url for a Message object

Test Plan:
   - Monitor the sentry logs to check if theres no new occurencies

fixes VICE-1190

flag = none

qa risk=medium: It may causes unexpected behavior when anchor media
links aren't proccessed as expected due to this unexpected parameter
bug

Change-Id: I0477e0337682f99c84575fb1245bc19a58604cf8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260911
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-03-18 16:17:27 +00:00
Wagner Gonçalves fabc4c3053 enable to submit homework assignment zip files from windows
closes INTEROP-6605
flag=none

When a user was submitting a zip file with `application/x-zip-compressed`
extension, we weren't accepting and returning `unable to find extension`
error.

So, we're changing the `canvas_mimetype_fo` gem to work with multiple
mime_type for the same extension like zip: application/zip,
application/zip-compressed, and application/x-zip-compressed.

And changing the `infer_file_extension` method to try to find the
extension from the filename when we don't know the content_type given.

test-plan:

test-plan
* Have a Course recorded;
* Have a Student enrolled in this Course;
* Have an Assignment recorded to this Course;
* In the course settings, you have to allow the assignment enhancements
  feature;
* Logged as a student, you should be able to submit the homework by
  uploading a zip file with different mime types like `application/zip`
  and `application/x-zip-compressed`;
* Accessing rails console, you should be able to validate if the
  Attachment.content_type corresponds to the file you submitted;
* To upload a zip file with `application/x-zip-compressed` mime type I
  used parallels to have a Windows running in Mac;
* You should be able to submit the homework after disabling the
  assignment enhancements feature;

Change-Id: If3a0dd3da67072c6292e65c551d83be9e235e7f2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260472
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ryan Hawkins <ryan.hawkins@instructure.com>
QA-Review: Wagner Goncalves <wagner.goncalves@instructure.com>
Product-Review: Karl Lloyd <karl@instructure.com>
2021-03-15 17:19:41 +00:00
Cody Cutrer 160ff3c899 bump sanitize to latest
[fsc-max-nodes=12]
[fsc-timeout=60]

 * switch lots of parsing to Nokogumbo to keep things consistent
 * deep CSS sanitization is now built in, and with a proper parser (meaning
   we can drop our code to do it, and adjust some specs to account for things
   that _are_ valid)

lots of changes because gumbo parsing<->serialization cycle is slightly different:
 * better job preserving original whitespace
 * literal non-breaking space characters are converted to &nbsp; entities
 * <p> tags aren't inserted for the heck of it
 * several _other_ entities are unnecessary, and output as literal characters
 * some elements no longer have a closing tag

Change-Id: I7c5e36cbd04b8a05f64c9e0af00868dd6b00f4ce
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/256444
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-02-17 18:17:57 +00:00
Augusto Callejas 92e03a64cd Allow reassignment from SpeedGrader
closes OUT-4033

[fsc-timeout=50]

flag=reassign_assignments

This feature allows teachers to reassign an assignment
to a student after they've submitted to the assignment
and the teacher has provided feedback via comments.

The reassignment will appear in their planner with
a "Redo" tag visible next to the assignment.

Only supports assignments of submission type "Online".

test plan:
  - enable "Reassign Assignments" feature option
  - in a course, create a student account
  - as a teacher, create an assignment with a due date
  - as a student, confirm the assignment appears in
    their planner
  - as a student, submit to the assignment
  - as a teacher, open the submission in SpeedGrader
  - reassign the assignment to the student by:
    * adding a comment to the assignment
    * clicking the "Reassign Assignment" button
  - as a student, confirm the assignment appears
    with a "Redo" pill in the planner, along with
    the comment from the teacher
  - as a student, resubmit to the assignment and
    confirm the assignment shows as completed again
    in the planner without the "Redo" pill
  - repeat the above steps, except with an assignment
    that has "Anonymous Grading" enabled and it should
    behave in the same way
  - repeat the above steps but with more students and
    no due date on the assignment, but with various
    assignment overrides with due dates and some students
    assigned to those overrides (using course sections)
    and confirm the "Resassign Assignment" button only
    appears for those students with assignment overrides
    (and hence due dates), with the button being disabled
    until the student both submits to the assignment and
    the teacher has provided a comment.

Change-Id: Id745b50f3810378804e0728e544ebf6bff8f756a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/251663
QA-Review: Kai Bjorkman <kbjorkman@instructure.com>
Product-Review: Jody Sailor
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Adrian Packel <apackel@instructure.com>
Reviewed-by: Pat Renner <prenner@instructure.com>
2021-02-17 00:28:25 +00:00
Han Yan a5cc6a3e43 New Quizzes should not retain peer reviews settings
closes DEMO-116
flag=none

test plan:
- create an online Canvas assignment with peer reviews settings
- create another online assignment, and see peer reviews
  settings are retained on assignment creation page
- creat a NQ quiz
- check the NQ assignment in rails console, and all peer reviews
  settings are reset to false/0

Change-Id: I4189aa9c3f48ee212a280568ecc4b14b89a93b4c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/257264
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jared Crystal <jcrystal@instructure.com>
QA-Review: Mark McDermott <mmcdermott@instructure.com>
Product-Review: Han Yan <hyan@instructure.com>
2021-02-05 15:04:58 +00:00
Wagner Gonçalves 968ce4b846 refactor content_type/extension identification
refs INTEROP-6483
flag=none

See the discussion: https://gerrit.instructure.com/c/canvas-lms/+/257523/
5/app/controllers/submissions_api_controller.rb#625

The current behavior of inferring content-type/extension only considers
name or filename or url parameter to infer the extension, but when a name
doesn't contain the file extension and filename/url contains it, we can
use these fields to infer the content type/extension.

So, we're changing this behavior to infer from filename/url when it is
possible. When the name/filename/url contains an unknown mime type like
`example.xpto`, we'll return the content_type as `unknown/unknown` and
the extension as `xpto`.

test-plan:
* All steps from https://gerrit.instructure.com/c/canvas-lms/+/257523
  should work fine;
* You should configure the assignment to restrict upload file types
  like: png,xpto (invalid/unknown mime type);
* You should be able to submit the assignment and validate the file
  created via Submission Details page, after:
  * Informing a name without an extension and filename/url with extension;
  * Informing a name/filename/url with an unknown extension;

Change-Id: I173c5ca2a6f9832ab3da92fd858b65654139221f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/257762
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Wagner Goncalves <wagner.goncalves@instructure.com>
Product-Review: Wagner Goncalves <wagner.goncalves@instructure.com>
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
Reviewed-by: Mysti Lilla <mysti@instructure.com>
2021-02-03 14:10:40 +00:00
Wagner Gonçalves 2d605454cc fix the filename identification when submitting an assignment
When we’re submitting a file using the LTI tool, in some situations,
we can face a tool that doesn't send the text field in the content item
payload. This field is used to infer the filename and extension of the
submission file.

As a fallback, we'll try to recover the filename from the URL.

closes INTEROP-6483
flag=none

test-plan
* Have an LTI tool installed (you can use lti-1.3-test-tool); You could
  use this  commit https://gerrit.instructure.com/c/lti-1.3-test-tool/+/257525
  to  facilitate the tests in case it was not submitted yet.
* Have a Course recorded;
* Have a Student enrolled in this Course;
* Have an Assignment with online submission recorded to this Course;
* As a Student, you should be able to access the Assignment to submit
  your homework. On the submission homework page, you should be able to
  find LTI tool (usually rendered in a tab);
* After launching the tool, you should be able to select File as the
  Content Item Type and fill the File URL field and submit;
* After submitting the Assignment, you should be able to access the
  Submission Details page, and validate if the specified file was properly
  created/recorded  (name and image);
* I used https://dummyimage.com to generate some images like:
  * https://dummyimage.com/300/09f/sample
  * https://dummyimage.com/300/09f/sample.png
  * https://dummyimage.com/300/09f
  * https://dummyimage.com/300
* You should check if when the LTI tool sends the File Name (text) field
  and everything works as expected;

Change-Id: Iae5f128492834f8efc8934de347cfa5d9944ac1b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/257523
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
QA-Review: Xander Moffatt <xmoffatt@instructure.com>
Product-Review: Karl Lloyd <karl@instructure.com>
2021-01-29 16:11:39 +00:00
Ethan Vizitei 524148d394 cap users in groups json
closes FOO-1436
flag=none

TEST PLAN:
  1) make a giant group with more memberships than your setting value
  2) ask for the groups index with "include[]=users"
  3) you only get the first N users in each group
  4) you can still paginate through group memberships
     from the memberships endpoint successfully

Change-Id: I211c48d7adcc444b9d9e05d22b38131add66be41
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/256219
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2021-01-07 18:19:46 +00:00
Wagner Gonçalves ad46fd9511 persist custom params at assignment selection placement
We are adding the ability to save the custom params from an external
tool at assignment selection placement.

closes=INTEROP-6311
flag=none

test-plan:
* Have a LTI tool installed in your local Canvas, you can use the
lti-1.3.-test-tool for it;
* Have a Course recorded;
* When creating a new Assignment:
1. Choose `External Tool` from the Submission Type field;
2. Click in the find button to select `LTI Test Tool` at
`Configure External Tool` modal;
3. After the LTI tool was lunched, you will be able to fill Custom Params
text area with a custom JSON and click on submit;
4. At this point you will be able to check that the hidden input was
filled with the custom JSON, for example you can access the browser
console and execute `$('#external_tool_create_custom_params').val()`;
5. After selecting the tool and saving the assignment, you will be able
to check the Assignment into the database, for example:
Assignment.find(assignment).lti_resource_links.first.custom;

Change-Id: I5f1b1143eec035eb18f814439c6ae7077bcab8bf
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/254453
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Product-Review: Weston Dransfield <wdransfield@instructure.com>
2020-12-16 20:50:05 +00:00
Ethan Vizitei 8077f72d6d give wiki-pages a media redirect path
refs FOO-1186
flag=none

TEST PLAN:
  1) make a new wiki page with a video
     embed.
  2) notification should get sent, and it should
     have a media download url pointing at the
     course the page lives in

Change-Id: I7b5b3599bf264b5b3aa0cc1c4bb4d09fc135b2cf
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/253934
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2020-11-30 22:39:37 +00:00
Pat Renner cf71d5567e ensure course scale is used in the LMGB
closes OUT-4042
flag=account_level_mastery_scales

test-plan:
- Generate student result data for assignments
aligned to an account rubric:
> Generate account level mastery scales, if not already
created (values between 0-100 makes things easier)
> Create an account rubric
> Create a course, students, with an assignment using
account rubric
> Assess a student using the account rubric assignment
- Create a course level mastery scale for this course
- Repeat the above steps, but with a course rubric
  > Using vastly different numbers (1000, 900, ..,
    helps make the differences apparent)
- Enable the LMGB, SLMGB feature flag
- Visit the LMGB
- Verify that only course level mastery levels are used in
the gradebook, and results associated with the account level
rubric have been scaled appropriately
- Verify that the LMGB column tooltip chart accurately
shows the percents using course level scales
- Verify the filters on the right of the LMGB are using course
level scales
- Turn off the account_level_mastery_scales FF
- Verify that the LMGB uses account scales for the filter
and column charts
- Verify that the results are now scaled using the
account level scale

Change-Id: Ie95f3347a0f1bd326d50c4adf6c972c0cf528715
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/252322
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Jody Sailor
Reviewed-by: Augusto Callejas <acallejas@instructure.com>
Reviewed-by: Michael Brewer-Davis <mbd@instructure.com>
QA-Review: Brian Watson <bwatson@instructure.com>
2020-11-18 18:04:13 +00:00
Ethan Vizitei e6ae468af4 make routes work for media downloads
closes FOO-1186
flag=none

discussion entries and announcements
were generating a lot of failures

TEST PLAN:
  1) make a new discussion entry with a video
     embed.
  2) notification should get sent, and it should
     have a media download url pointing at the
     course the topic lives in

Change-Id: I888a8508bd18ac9e37727eab5ede9e7a0102f184
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/252278
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2020-11-10 20:13:09 +00:00
Cody Cutrer 81d0bbc465 add # frozen_string_literal: true for specs
Change-Id: Id508bec1817937b1c24c29f1db7221e09cb9c2ab
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/251157
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2020-10-27 20:48:35 +00:00
Adrian Packel b7a5ce6e6e Fall back to scores for override grade changes
fixes EVAL-1276
flag=final_grade_override_in_gradebook_history

Test plan:
- Have a course with a grading scheme enabled (C1) and one without a
  grading scheme (C2)
  - For both courses, add some students, allow final grade override in
    Gradebook, and enter some override grades for students
- Open Gradebook History for each course and check the
  before/after/current columns for the override grade events
  - For C1, the columns should show the appropriate letter grades
  - For C2, the columns should show the score displayed as a percent
    (e.g., "89%")
  - In both cases, the lack of a value should still be indicated by a
    dash
- Do some general testing with switching a grading scheme on/off,
  doing some grading, then switching back (e.g., for C1, disable the
  scheme, enter some override grades, the re-enable it)
  - For override grade changes:
    - The before/after columns should reflect the grading scheme (or
      lack thereof) *at the time of the grade change*
    - The current column should always reflect the current grading
      scheme (or lack thereof)
  - Grade changes for assignments should not be affected

Change-Id: Id6011a78a19f69fc39090e8bc7ce56f9aeec0ae3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/250911
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Gary Mei <gmei@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
QA-Review: Spencer Olson <solson@instructure.com>
Product-Review: Syed Hussain <shussain@instructure.com>
2020-10-23 15:30:53 +00:00
Cody Cutrer 114399a1d3 rails 6: fix overrides API to use SisPseudonym
Change-Id: I56d1d651293330b8a43b235e01b62cefd3f4e000
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/224593
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2020-10-19 21:36:08 +00:00
Ed Schiebel b706c50618 Use an svg file as its own thumbnail
as long as it's < 16k (some course designers embed base64 encoded
png images in their 2MB svgs. we don't want those)

closes LS-1522
flag=none

test plan:
  - upload an svg file
  - find it in the files page
  > expect it to have itself as its thumbnail
  - upload a giant svg file
  > expect it to have a vanilla icon instead of its thumbnail

Change-Id: I4ad26e67c1b7dfbc2a38fa2182a6fa18d233f27e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/249403
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Peyton Craighill <pcraighill@instructure.com>
2020-10-14 19:45:26 +00:00
Pat Renner 0dd41c3310 return resolved calc method in outcome response
closes OUT-3771
flag=account_level_mastery_scales

test-plan:
- follow the steps in g/248109 but ensure changing the
calculation method accurately updates whether or
not the student met mastery

Change-Id: I843d20f9d2f0f79b8faaee15382dc174adf6886f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/248449
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Brian Watson <bwatson@instructure.com>
Product-Review: Jody Sailor
Reviewed-by: Manoel Quirino <manoel.quirino@instructure.com>
Reviewed-by: Michael Brewer-Davis <mbd@instructure.com>
2020-10-01 23:03:15 +00:00
Adrian Packel 452405d197 Show "final grade override" as assignment name
closes EVAL-1069
flag=final_grade_override_in_gradebook_history

Test plan:
- Enable the "Final Grade Override in Gradebook History" feature flag
- Have a course with some override grades given out
- Open gradebook history
- You should see override grade changes in the results
  - For those results, the assignment name should  appear as "Final
    Grade Override" (italicized)
- For non-override grade change events, the assignment name should
  appear as before

Change-Id: Id88388c8fe7f0e292c7a1742a2a9107735a106d4
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/247667
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
Reviewed-by: Kai Bjorkman <kbjorkman@instructure.com>
Reviewed-by: Gary Mei <gmei@instructure.com>
QA-Review: Adrian Packel <apackel@instructure.com>
Product-Review: Jody Sailor
2020-09-18 19:59:53 +00:00
Adrian Packel f7d1ae25b6 Return override grade changes in results
Update the grade change audit API controller to return override grade
changes if the FGOGH feature flag is enabled, rather than always
excluding them.

flag=final_grade_override_in_gradebook_history
closes EVAL-1068

Test plan:

Take care to test that this works both when reading data from
ActiveRecord and when reading data from Cassandra. Note that a bug
currently exists (separate from this patchset) where grade change data
*written* will only be properly indexed in Cassandra if Cassandra is
also set as the active read_path. In other words, if you have
active_record as the read_path and assign some grades, those grades will
not appear when you view the results using Cassandra.

- Have auditors set up for both ActiveRecord and Cassandra
- Have a course with some assignments and students
  - Issue some assignment grades and some course override grades
- With the Final Grade Override in Gradebook History feature flag ON:
  - Gradebook history for a course should include override grades in the
    results
    - The "Before" and "After" columns should display the override
      grade values before and after that change
    - The "Current" column should display the current override grade if
      there is one (or score if no grading scheme exists)
    - Note that the above two columns should always show the override
      grade, never the *computed* grade (even if there is no current
      value for the override grade)
    - The assignment name will display as "Not available"--for now, this
      is fine
  - Filtering by a specific assignment should not include override
    grades in the results
  - Filtering by other parameters, however (e.g., student/grader) should
    include override grades where appropriate
- With the feature flag OFF:
  - Gradebook history should not show override grades
- Test the above with both ActiveRecord and Cassandra set as the auditor
  read_path (but see the preliminary note)

Change-Id: I90768edfb512774eed7c4c87c76e1df93955511b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/246383
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
Reviewed-by: Kai Bjorkman <kbjorkman@instructure.com>
QA-Review: Adrian Packel <apackel@instructure.com>
Product-Review: Syed Hussain <shussain@instructure.com>
2020-09-04 16:06:17 +00:00