Commit Graph

1404 Commits

Author SHA1 Message Date
Michael Brewer-Davis 398ca11a8c add i18n to outcome reports, lmgb export
closes OUT-3197

Test plan:
With permutations of the following feature flags
 - Account:
   Enable i18n features in outcomes exports
 - User:
   Include BOM in compatible exports
   Use semicolons in compatible exports
   Autodetect separators in compatible exports

Test that the following reports obey the
requested settings:
 - Account reports
   - Outcome Results
   - Student Competency
 - Learning Mastery Gradebook
   - Export report
   
See g/199468 for details on how reports should respond
to each setting

Change-Id: Iea942bdbc6d1efc560b0c4fc422c7c14a8fd90c4
Reviewed-on: https://gerrit.instructure.com/203101
Tested-by: Jenkins
Reviewed-by: Nathan Prabhu <nprabhu@instructure.com>
Reviewed-by: Frank Murphy III <fmurphy@instructure.com>
QA-Review: Brian Watson <bwatson@instructure.com>
Product-Review: Michael Brewer-Davis <mbd@instructure.com>
2019-08-02 21:42:51 +00:00
James Williams 2521226b54 use subject user for courses API is_favorite value
test plan:
* as an account admin, calling
/api/v1/users/X/courses?include[]=favorites
for a student should return whether the student
has favorited the course, not the admin

closes #ADMIN-2763

Change-Id: If52ce5c9405bc2895fbdf6fb456cfca8f4163fbf
Reviewed-on: https://gerrit.instructure.com/201520
Tested-by: Jenkins
QA-Review: Mysti Lilla <mysti@instructure.com>
Product-Review: Mysti Lilla <mysti@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Mysti Lilla <mysti@instructure.com>
2019-07-31 19:49:15 +00:00
Nathan Prabhu d5fe2754f0 Expose rub. assessment's assessor user & avatar in submiss. api
closes OUT-3168

Test plan:
* Create an assignment submission with a rubric
* Log in as an assessor with an avatar and make a rubric assessment
* Hit the following endpoint: /api/v1/courses/:course_id
    /assignments/:assignment_id/submissions/:user_id
    ?include[]=full_rubric_assessment
* Verify you see something along these lines:
    {
        ...
        "full_rubric_assessment": {
                "id": 1,
                "rubric_id": 1,
                "rubric_association_id": 1,
                "score": 33,
                "artifact_id": 8,
                "artifact_type": "Submission",
                "assessment_type": "grading",
                "assessor_id": 1,
                "artifact_attempt": 2,
                "data": [
                    {
                        "id": "blank_2",
                        "points": 0,
                        "criterion_id": "_3856",
                        "learning_outcome_id": null,
                        "description": "No Marks",
                        "comments_enabled": true,
                        "comments": "Comment",
                        "comments_html": "Comment"
                    },
                    {
                        "id": "1_3114",
                        "points": 30,
                        "criterion_id": "1_2790",
                        "learning_outcome_id": null,
                        "description": "Full Marks",
                        "comments_enabled": true,
                        "comments": ""
                    }
                ],
                "rubric_association": {
                    ...
                },
                "assessor_name": "nprabhu@instructure.com",
                "assessor_avatar": null
            }
    }
* Data should only be accessible to assessor, teacher/moderator, &
  student owning the assignment. Same visib. rules as any submission.
* If no rubric assessment was done, response should still succeed but
  not contain the "full_rubric_assessment" field

Change-Id: Ic6586b11eb6205311e15c7ce733bb394328dfac2
Reviewed-on: https://gerrit.instructure.com/202280
Reviewed-by: Michael Brewer-Davis <mbd@instructure.com>
Reviewed-by: Frank Murphy III <fmurphy@instructure.com>
Tested-by: Jenkins
QA-Review: Brian Watson <bwatson@instructure.com>
Product-Review: Michael Brewer-Davis <mbd@instructure.com>
2019-07-30 18:52:42 +00:00
Brent Burgoyne 09f4640395 include user nav lti in global nav fly out
closes PLAT-3271

test plan:
- install an lti tool with a user nav placement
- click on the user button in the global nav
- the fly out menu should have the placement

Change-Id: Ia08cec7d236e3b3d63f0b866675509574f229f0e
Reviewed-on: https://gerrit.instructure.com/200532
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-07-16 20:23:56 +00:00
Derek Bender 531e5dbc58 Scope speed grader to new setting
Closes: GRADE-2245

Test Plan:
- Given a course with new gradebook enabled
- Given Filter by Student Group is enabled
- Given at least two groups with students in each
- Given the new gradebook has "Group Filters" selected in the
  View -> Filters menu

- When the new filter has the first group selected
- Then the Speed Grader page for any assignment will only display
  students from the first group

- When the second group filter is selected
- Then the Speed Grader page for any assignment will only display
  students from the second group

- When the filter is changed to "All Student Groups"
- Then the Speed Grader page for any assignment will display all
  students like when this feature is disabled

- Given a course with new gradebook enabled
- Given Filter by Student Group is disabled
- Given at least two groups with students in each
- Given the new gradebook has "Group Filters" selected in the
  View -> Filters menu

- When the filter is changed to the first group
- Then the Speed Grader page for any assignment will display
  all students

- When the filter is changed to the second group
- Then the Speed Grader page for any assignment will display
  all students

- When the filter is changed to "All Student Groups"
- Then the Speed Grader page for any assignment will display
  all students

Change-Id: I530f12bbef0cdd799c15f159366cbae3d9b0eb1e
Reviewed-on: https://gerrit.instructure.com/198809
Tested-by: Jenkins
Reviewed-by: Adrian Packel <apackel@instructure.com>
Reviewed-by: Keith Garner <kgarner@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: Keith Garner <kgarner@instructure.com>
2019-07-03 20:08:00 +00:00
Dan d7df40acd9 Add `created_at` to group categories API
closes gh-1380

Test Plan:
* Group category APIs should return their respective
  object's `created_at` field

Change-Id: I04d872e7ee9e08c9b0c563dcdb145f16cdbf283f
Reviewed-on: https://gerrit.instructure.com/199747
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Bryan Petty <bpetty@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2019-07-02 20:14:06 +00:00
Gary Mei 662f193638 add filter SpeedGrader by student group setting
closes GRADE-2240

Test Plan
- Send a PUT request to this url:
  /api/v1/courses/2/settings?filter_speed_grader_by_student_group=true

- With New Gradebook off, verify that this command should return false:
  `your_course.filter_speedgrader_by_student_group?`

- With New Gradebook on, verify that this command returns true:
  `your_course.filter_speedgrader_by_student_group?`

- Send a PUT request to this url:
  /api/v1/courses/2/settings?filter_speed_grader_by_student_group=false

- Now verify that this returns false:
  `your_course.filter_speedgrader_by_student_group?`

Change-Id: If72c5b8b9fae32dc8060c26d918c8bdfe29ce578
Reviewed-on: https://gerrit.instructure.com/197933
Tested-by: Jenkins
Reviewed-by: Jeremy Neander <jneander@instructure.com>
Reviewed-by: Adrian Packel <apackel@instructure.com>
QA-Review: Adrian Packel <apackel@instructure.com>
Product-Review: Keith Garner <kgarner@instructure.com>
2019-06-24 20:02:20 +00:00
James Williams b2ce07066e use in_region_associated_shards for api pseudonym search
test plan:
* /api/v1/accounts/self/admins should not take a long
 time or timeout on accounts with account admins with
 many cross-region associated shards

closes #CNVS-46281

Change-Id: I552889ee1586973a4427ddde0fbb8f240944b249
Reviewed-on: https://gerrit.instructure.com/198212
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
Tested-by: Jenkins
2019-06-19 19:01:35 +00:00
Drake Harper 0df1e52bb0 dd public_jwk_url and is_lti_key fields to developer key model
refs PLAT-4493

Test Plan:
-Create a developer key and verify that it has the new fields
	(public-jwk_url and is_lti_key)

Change-Id: I72508ae26709ce5f7560de35d5ee0c03d4000b5d
Reviewed-on: https://gerrit.instructure.com/197314
Tested-by: Jenkins
Reviewed-by: James Williams <jamesw@instructure.com>
Reviewed-by: Clint Furse <cfurse@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Product-Review: Drake Harper <dharper@instructure.com>
2019-06-18 14:33:50 +00:00
Adrian Packel bfbe2faac9 Move post policies to setting, tie to NG
Convert post policies from a garden-variety feature flag into a global
setting and remove the old feature flag. Add some helper methods to
handle enabling and disabling, and have everywhere in the code that
references the feature use the new helper methods instead. Also, have
the activation of post policies for a given course depend on whether new
gradebook is active for that course.

closes GRADE-1974

Test plan:

Note that the Post Policies feature flag no longer exists, and instead
there's a setting you'll need to turn on. You can do so in the console
using:
  > PostPolicy.enable_feature!

To disable it:
  > PostPolicy.disabled_feature!

Note that, even when enabled, it should only apply to courses that have
new gradebook turned on.

- With the new setting ENABLED:
  - Courses with new gradebook behave as though post policies is enabled
    - Do a bit of smoke testing to see if stuff like posting/hiding and
      changing assignment posting policies hasn't broken
  - Courses with old gradebook do not
    - For example, calling a mutation like postAssignmentGrades on an OG
      course should return an error indicating the feature isn't enabled
- With the new setting DISABLED:
  - Courses with new gradebook behave as though post policies is
    disabled (e.g., old-style muting is active)
    - Calling a mutation, as described above, should return an error

Change-Id: I5e223d2c4ca4202cce0641f316ecaa505a66298c
Reviewed-on: https://gerrit.instructure.com/196062
Tested-by: Jenkins
Reviewed-by: Keith Garner <kgarner@instructure.com>
Reviewed-by: Gary Mei <gmei@instructure.com>
QA-Review: Derek Bender <djbender@instructure.com>
Product-Review: Keith Garner <kgarner@instructure.com>
2019-06-13 22:09:06 +00:00
Nathan Mills f898af4332 Revert "optimize dashcard course images"
fixes CORE-3034

This reverts commit 626140841b.

Reason for revert: Images are too small, and Inst-FS doesn't currently support specifying the resolution.

Change-Id: I3e7b1180e4e8ada363862887fc851037a9b566f6
Reviewed-on: https://gerrit.instructure.com/196445
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2019-06-13 20:32:44 +00:00
Marc Phillips f15136a4d1 Remove Manage DevKey from perms page
closes PLAT-4427

Test Plan:
 - see that the bug has been fixed

Change-Id: I50fb60fe1db4d44031581301b4d3b3f58b23808e
Reviewed-on: https://gerrit.instructure.com/197174
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Tested-by: Jenkins
Product-Review: Marc Phillips <mphillips@instructure.com>
2019-06-12 16:00:03 +00:00
Drake Harper 540db8d275 Create Developer Key update endpoint for public_jwk update
fixes PLAT-4492

Test Plan
-Create test tool
-Use tool to create developer key in canvas
-Change tool credential oauth_client_id to match
	client id from developer key
-Go to http://lti13testtool.docker/developer_key/update_public_jwk/21
-Verify that public JWK was changed:

Change-Id: Ic09a665d4ab14d3423b7e4b2a3a51296c0617981
Reviewed-on: https://gerrit.instructure.com/194447
Tested-by: Jenkins
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Product-Review: Jesse Poulos <jpoulos@instructure.com>
2019-06-07 21:43:56 +00:00
Mark Valentine 507322c334 pass nil session to account_reports api_json
- fix issue where account_report json was not
  limited to selected attributes.

Test Plan:
Dev replicated issue locally, and verified that passing
a nil session in for session parameter restored the api
to only showing desired parameters.

Change-Id: I64924aef302d4bf02a36d72895e2c32cacc15bb3
Reviewed-on: https://gerrit.instructure.com/196611
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
Tested-by: Jenkins
2019-06-05 21:37:02 +00:00
Steven Burnett e6c39ab7e9 create iframe_content route for rce consumption
refs COMMS-2659 COMMS-2661

Test Plan:
- rebase the rce-service
- create a media object/recording
- visit http://localhost:3000/media_objects_iframe/<media-object-id>
- notice the nice video player that shows

Change-Id: I56da53364481a2e587a8230adbe64cb808744bb6
Reviewed-on: https://gerrit.instructure.com/196164
Reviewed-by: Landon Gilbert-Bland <lbland@instructure.com>
Tested-by: Jenkins
QA-Review: Steven Burnett <sburnett@instructure.com>
Product-Review: Steven Burnett <sburnett@instructure.com>
2019-06-05 16:34:33 +00:00
Nathan Mills 626140841b optimize dashcard course images
fixes CORE-2811

test-plan:
* turn on course_card_images feature flag
* upload a large image for a course
* load the course dashboard
* check that the image being returned is a thumbnail

Change-Id: I5866a6839b1125dff944ae6249736b662a075687
Reviewed-on: https://gerrit.instructure.com/194600
Tested-by: Jenkins
Reviewed-by: James Williams <jamesw@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Nathan Mills <nathanm@instructure.com>
2019-05-31 19:02:33 +00:00
Cody Cutrer d54c16d050 add user uuid as an optional response field on several more APIs
Change-Id: Ibb9d08c9aaa39b5c1bd008a97aeb353969d97b64
Reviewed-on: https://gerrit.instructure.com/194828
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2019-05-31 14:38:04 +00:00
Rob Orton eff4ef4775 session is not needed for report json
refs CORE-3011

test plan
 - specs should pass

Change-Id: Id8045e8c2f3e9fa6ebec531a4154c0b57e693506
Reviewed-on: https://gerrit.instructure.com/195558
Tested-by: Jenkins
Reviewed-by: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
2019-05-29 15:36:22 +00:00
Adrian Packel c858092ceb Add student group filter to new gradebook
Add a filter for student groups to new gradebook. It can be enabled
from the View menu (as with the other filters) and behaves generally as
they do, with the small difference of showing groups/group categories
hierarchically. Also add the option to show a student's groups as their
"secondary info" below their name.

closes GRADE-2122

Test plan:
- Have a course (using New Gradebook) and some students
- Create some student groups for the course, and assign
  students to them
- Open New Gradebook
- The "View" menu should have a "Student Groups" filter in addition to
  the existing filters
  - Enabling it should make a filter appear that lets you choose between
    the student groups for the course (or show all groups)
  - Selecting a particular group should show only students belonging to
    that group
  - Selecting "All Student Groups" should show all students
  - Your selection should persist between page views
- The ellipsis menu in the Student Name column should have a new "Group"
  option under "Secondary Info"
  - Selecting it should set the secondary text below a student's name to
    the groups that student is part of

Change-Id: Id6b1c62699f1778e60545ba85f945ebecfc3e98a
Reviewed-on: https://gerrit.instructure.com/194096
Reviewed-by: Keith Garner <kgarner@instructure.com>
Reviewed-by: Jeremy Neander <jneander@instructure.com>
Tested-by: Jenkins
QA-Review: Derek Bender <djbender@instructure.com>
Product-Review: Matthew Goodwin <mattg@instructure.com>
2019-05-28 21:36:43 +00:00
James Williams 5794f9c13a catch all uri errors when processing incoming html content
invalid mailto links shouldn't cause a 500 when saving

closes #CORE-2348

Change-Id: I44544aebeb5caea3ebd44641ede7ecf2159a4116
Reviewed-on: https://gerrit.instructure.com/195128
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2019-05-28 15:34:51 +00:00
Aaron Hsu cf38f6c599 disallow unauthenticated users from seeing location event data
fixes COMMS-2069

Test Plan
* Create a public course
* Go to calendar and create many events
* Try to query for those events using something like

  http://localhost:3000/api/v1/calendar_events?
  context_codes[]=course_6&start_date=2018-05-20T17:14:33.619Z&
  end_date=2019-05-30T17:14:33.619Z&per_page=50

* Notice how if you are logged in the location_address
  and location_name will show up in the json returned
* Notice how if you are logged out the info will not
  be there

Change-Id: I9867936a432bb3c343fee0715f0043c5c5d061e7
Reviewed-on: https://gerrit.instructure.com/194432
Tested-by: Jenkins
Reviewed-by: Matthew Lemon <mlemon@instructure.com>
Reviewed-by: Steven Burnett <sburnett@instructure.com>
QA-Review: Landon Gilbert-Bland <lbland@instructure.com>
Product-Review: Aaron Hsu <ahsu@instructure.com>
2019-05-24 15:47:45 +00:00
Nathan Mills 1ce4492b8c Set unknown file type to application mime-type
fixes CORE-2963

test plan:
* make sure instfs is enabled

* upload an unrecognized filetype to canvas

* check the content-type of the uploaded file, it should be
'application/octet-stream'

Change-Id: Iab6c6ee7f0a30c7c721adecf0a6dcb028f572acf
Reviewed-on: https://gerrit.instructure.com/193986
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2019-05-21 15:07:53 +00:00
Rob Orton 128a4cb3cc use sis_pseudonym from enrollment if there is one
fixes CORE-2926

test plan
 - specs should pass

Change-Id: I0b349bc44aecffbcede7093b0689e686c49fe0bb
Reviewed-on: https://gerrit.instructure.com/192886
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2019-05-14 15:18:40 +00:00
Gary Mei f3e2b52e6b add hidden pill to submission tray
closes GRADE-2147

Test Plan
- Hide grades for a student.
- Open the submission tray and verify the hidden pill is present.
- Post grades for that student.
- Open the submission tray and verify the hidden pill is not present.

- Disable Post Policies.
- Mute the assignment.
- Open the submission tray and verify the hidden pill is NOT present.

Change-Id: If695d441b1973dd3870c9b9ecf77d25ed2139b30
Reviewed-on: https://gerrit.instructure.com/192262
Tested-by: Jenkins
QA-Review: Gary Mei <gmei@instructure.com>
Product-Review: Jonathan Fenton <jfenton@instructure.com>
Reviewed-by: Adrian Packel <apackel@instructure.com>
Reviewed-by: Jeremy Neander <jneander@instructure.com>
2019-05-13 19:04:44 +00:00
James Williams 48eb3db075 improve downloadable attachments for diffed sis batches
test plan:
* when creating a batch using diffing, the 'csv_attachments'
 returned in the api should only list the files uploaded
 and "diffed_csv_attachments" should return the files
 created by the diffing process

closes #CORE-2914

Change-Id: Iabc4ef26e989329c9d1b334ac6dee38ccb3ad50e
Reviewed-on: https://gerrit.instructure.com/192578
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2019-05-11 16:55:38 +00:00
James Williams 02a2726035 improve caching around assignment overrides and module info
add assignment.cache_key(:availability) to cache
around overrides/due date data

once that's more reliable we can get more safely discard the
highly unreliable (and time-dependant) locked_for caches

refs #CORE-2851

Change-Id: I4be5fd666ca65a377e4daa3f2da1b718e862de47
Reviewed-on: https://gerrit.instructure.com/192393
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
2019-05-10 15:15:04 +00:00
Drake Harper 67a86c19e3 Add create 1.3 tool config to external tools controlller.
Deleted create_tool_from_tool_config,
moved functionality into create.
Edited external tools json to include version.

fixes PLAT-4437

Test Plan:
-Create LTI key
-Create context external tool using client of LTI key
	-Should return success
-Create context external tool with bad client id
	-Should return 404
-Create a 1.1 tool using same endpoint
	-Original functionality should still work
-Create a context external tool with disabled client id
	-Should return 422

Change-Id: I5fce06db376f5eca13e6d41b9bb38f9f25c3c8d5
Reviewed-on: https://gerrit.instructure.com/192664
Reviewed-by: Marc Phillips <mphillips@instructure.com>
QA-Review: Marc Phillips <mphillips@instructure.com>
Product-Review: Marc Phillips <mphillips@instructure.com>
Tested-by: Jenkins
2019-05-09 22:38:37 +00:00
Marc Phillips 3a92065910 Fix tool deletion on assignment update
fixes PLAT-4423

test plan:
 - check bug is fixed

Change-Id: I2981110d248802a9660e7bccd2e957e6f92ca2ce
Reviewed-on: https://gerrit.instructure.com/192144
Tested-by: Jenkins
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Product-Review: Marc Phillips <mphillips@instructure.com>
2019-05-06 16:35:43 +00:00
Rob Orton 4296381ded don’t try stuff on nil
fixes CANVAS-5DQZ - show_helper 133k
fixes CANVAS-4VFR - quizzes_controller 293k
fixes CANVAS-4VFT - oauth/providor 287k
fixes CANVAS-5T4G - oauth2_providor_controller 11k
fixes CANVAS-4VQF - context_modules_controller 13k
fixes CANVAS-4W6A - grades.html.erb 1k
fixes CANVAS-4SNC - discussion_entry 46k
fixes CANVAS-4VJY - dup of discussion_entry 16k
fixes CANVAS-4SYM - users_controller 51k
fixes CANVAS-4VRJ - quiz_submission_history 3.3k
fixes CANVAS-4Y92 - gmail 51k
fixes CANVAS-4VM8 - media_object 7.8k
fixes CANVAS-4VHB - quiz_submission_events 9.2k
fixes CANVAS-6WSZ - course.rb 5
fixes CANVAS-5SD6 - active_record 33
fixes CANVAS-6WYD - dup of active_record 1
fixes CANVAS-4VHG - collaborations_controller 24k
fixes CANVAS-6PFH - files/show 2.2k
fixes CANVAS-4VSR - pv4_client 14k

Change-Id: I12cf698c6930ef4674ecfee02bc341e3650ef7fc
Reviewed-on: https://gerrit.instructure.com/188120
Tested-by: Jenkins
Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com>
QA-Review: Brent Burgoyne <bburgoyne@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2019-05-03 21:01:35 +00:00
Marc Phillips de05ae43bf Add Edit to LTI Keys
closes PLAT-3718, PLAT-3716

Test Plan:
 - Edit a key using the manual form, should save
 - Go back and edit the json, should save

Change-Id: I4bd1b764f1c1905e306f5bb7fa0c01dcf6dab80b
Reviewed-on: https://gerrit.instructure.com/190740
Tested-by: Jenkins
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
Reviewed-by: Nathan Mills <nathanm@instructure.com>
QA-Review: Nathan Mills <nathanm@instructure.com>
Product-Review: Jesse Poulos <jpoulos@instructure.com>
2019-05-01 19:02:51 +00:00
James Williams d234d60142 improve teacher count in courses api
don't double-count enrollments in multiple sections
in the same course

closes #ADMIN-2601

Change-Id: Ia3710feba7d6c32aa32f1be4c08c3822cafc31b9
Reviewed-on: https://gerrit.instructure.com/190144
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2019-04-23 16:38:16 +00:00
Gary Mei bcc0e485da fix anonymous submission urls for To Do
Anonymous peer review links that showed in the dashboard and course
To Do list were not anonymized, leading to an Unauthorized action
when clicked.

fixes CNVS-45837

Test Plan
- Create an anonymous peer review.
- Assign 2 students to review each other.
- Verify that the links in the Course To Do and the Dashboard are
  both anonymized and lead to the correct submission.

- Verify that this works for normal peer review assignments as well.

Change-Id: I33ac5fc131a5e27209e26636bd727f365dd3c66c
Reviewed-on: https://gerrit.instructure.com/190120
Reviewed-by: Keith Garner <kgarner@instructure.com>
Product-Review: Keith Garner <kgarner@instructure.com>
QA-Review: KC Naegle <knaegle@instructure.com>
Tested-by: Jenkins
2019-04-20 18:44:42 +00:00
Rob Orton e5291c04db rename user_past_lti_ids to user_past_lti_id
Change-Id: If7801aa4af6e39af0f885eba78e354ec7096db29
Reviewed-on: https://gerrit.instructure.com/189636
Tested-by: Jenkins
Reviewed-by: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
2019-04-17 19:11:29 +00:00
Ryan Shaw e28bb762a9 Don’t load sanitize-html in the browser
This approach solves the same xss vulnerability, but by doing it a way
we can guarantee that what we are trying to .html() onto the page is
safe (and not just arbitrary user content) instead of having to load the
_huge_ sanitize-html npm package and all of it’s deps
(like postcss, source-map, htmlparser2, buffer, and a bunch of others)
On the frontend so we can use it to sanitize all the untrusted
data-mathml content.

closes: CORE-2748
refs COMMS-1846

Test Plan:
* Go to the calendar, click on a day to add an event, and click on the
  "More Options" button.

* Switch to the html editor, and add the following:

  <img class='equation_image'
  data-mathml='<img src=x onerror=prompt(document.cookie); />'>

* Save the event. Go back to the calendar and click on the newly saved
  event, and notice that you don't get XSS'd

* Create another event in the calendar, and this time add the
  following via the html editor:

  <img class="equation_image" title="(-\infty,\infty)"
  src="/equation_images/(-%255Cinfty%252C%255Cinfty)"
  alt="Infinities: (-\infty,\infty)"
  data-equation-content="(-\infty,\infty)" />

* Save the event, and load it in the calendar. Notice that it still
  properly displays this mathml image properly.

* Test the same calendar event with a screen reader, and notice that
  it is still accessible

Change-Id: I5fc1e17ecfc8576dfeaffacff8efcb08873bdd5e
Reviewed-on: https://gerrit.instructure.com/188609
Tested-by: Jenkins
Reviewed-by: Landon Gilbert-Bland <lbland@instructure.com>
QA-Review: Landon Gilbert-Bland <lbland@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-04-12 20:30:55 +00:00
Adrian Packel 26106f6a6f Disable posting and hiding in NG if needed
closes GRADE-2092

Test plan:
- Enable post policies
- Set up a course with three assignments (A1, A2, A3)
- Change the posted_at dates on submissions like so:
  - A1: no submissions posted
  - A2: at least one posted and one unposted submission
  - A3: all submissions posted
- Open new Gradebook and check the "Post grades"/"Hide grades" options
  in the assignment column headers
  - A1: "Hide grades" should be disabled and the text should be
    "All grades hidden"
  - A2: Both options should be enabled
  - A1: "Post grades" should be disabled and the text should be
    "All grades posted"
- Clicking any of the enabled options should bring up the tray as
  usual
  - Note that the menus do not (yet) change to reflect the results
    of posting/hiding grades; you'll need to reload the page to
    see changes

Change-Id: Ifca722476a706b97ca5aea22022fc3e8d9fd2dca
Reviewed-on: https://gerrit.instructure.com/187549
Tested-by: Jenkins
Reviewed-by: Jeremy Neander <jneander@instructure.com>
Reviewed-by: Gary Mei <gmei@instructure.com>
QA-Review: Jeremy Neander <jneander@instructure.com>
Product-Review: Jonathan Fenton <jfenton@instructure.com>
2019-04-02 14:04:49 +00:00
Rob Orton 883fc1ae98 include past_uuid when it exists
avoid n+1 queries

test plan
 - specs should pass

Change-Id: I15df977272a12e288ff4c70cc6d7238879f273a2
Reviewed-on: https://gerrit.instructure.com/187470
Tested-by: Jenkins
Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com>
QA-Review: Brent Burgoyne <bburgoyne@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2019-03-29 22:17:19 +00:00
Rob Orton c4de231b0e support past lti ids for users
when a user_a is merged into user_b, user_a is
deleted, but the enrollments lti_tools still point
to the old lti_id, so this allows us to store them
and serve them as the lti_id when a user is merged

fixes CORE-2565

test plan
 - merge a user that uses an lti tool in a course
 - the lti_id should not change for that course

Change-Id: Iac70957ed1fcb08111745a91d0c2e402dfad3002
Reviewed-on: https://gerrit.instructure.com/181905
Tested-by: Jenkins
Reviewed-by: Marc Phillips <mphillips@instructure.com>
QA-Review: Tucker Mcknight <tmcknight@instructure.com>
Product-Review: Jesse Poulos <jpoulos@instructure.com>
2019-03-28 22:03:07 +00:00
Gary Mei 6d7073ec16 fix student commenting not showing name on save
A student commenting on their submission in the submission details
page would previously not show their name on the new comment until
the page was refreshed.

fixes GRADE-2052

Test Plan
- Create an assignment.
- As a student, submit to the assignment.
- Navigate to the submission details page.
- Leave a comment; the author name should appear as the student's
  name.
- Do the same as a teacher, for that submission. The teacher name
  should appear after leaving a comment.

- Test this with peer review assignments as well.

Change-Id: Id8505a1ceee2c2f8a96396ad7595bef7a4786957
Reviewed-on: https://gerrit.instructure.com/187089
Tested-by: Jenkins
Reviewed-by: Jeremy Neander <jneander@instructure.com>
Reviewed-by: Adrian Packel <apackel@instructure.com>
QA-Review: Adrian Packel <apackel@instructure.com>
Product-Review: Jonathan Fenton <jfenton@instructure.com>
2019-03-28 20:51:08 +00:00
James Williams cfd346b523 add an extendable course visibility setting
closes #CORE-2682

Change-Id: I24eaed3625dedd1816c219e52ff81b699e241877
Reviewed-on: https://gerrit.instructure.com/187196
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2019-03-28 16:00:35 +00:00
Jeremy Neander edd105b104 use "allow final grade override" in new gradebook
closes GRADE-2060

test plan:
 A. Setup
    1. Select or create a course
    2. Ensure the course has at least one assignment
    3. Enable the "Final Grade Override" feature flag
    4. Enroll two teachers
    5. Enroll at least one student
    6. Visit New Gradebook as the first teacher

 B. Verify with Overrides Enabled and Allowed
    1. Open the Gradebook Settings Modal
    2. In the 'Advanced' tab, check "Allow final grade override"
    3. Verify the Overrides column is present
    4. Verify overrides can be applied, changed, and removed
    5. Refresh and reconfirm Steps 3 & 4
    6. Visit New Gradebook as the second teacher
    7. Reconfirm Steps 3 & 4

 C. Verify with Overrides Enabled and Not Allowed
    1. Visit New Gradebook as the first teacher
    2. Open the Gradebook Settings Modal
    3. In the 'Advanced' tab, uncheck "Allow final grade override"
    4. Verify the Overrides column is not present
    5. Refresh and reconfirm Step 4
    6. Visit New Gradebook as the second teacher
    7. Reconfirm Step 4

Change-Id: Ibaeeb00ab6fe53dd2f64f78d9c8c6c2a1d690def
Reviewed-on: https://gerrit.instructure.com/186076
Reviewed-by: Adrian Packel <apackel@instructure.com>
Reviewed-by: Gary Mei <gmei@instructure.com>
Tested-by: Jenkins
QA-Review: Adrian Packel <apackel@instructure.com>
Product-Review: Keith Garner <kgarner@instructure.com>
2019-03-22 14:30:12 +00:00
Nick Houle 533b02544f Update Progress Widget UI
Fixes: GOOF-701

Note:
- We are no longer using the `workflow_state` attribute form the
  Attachment model. We are using AttachmentUploadStatus that is
  joined to the Attachment model to retrieve the same results.
  We are now using Redis to track the state of the Attachment
  per Submission which will allow us to give a more accurate view
  of the Attachment state as it is being processed.

Test plan:
- Compile assets for canvas
- Boot up the docker container
- Navigate to a course with the google lti installed
- As a student submit an assignment from google drive
- On the assignment detials, submission details and grade summary
  pages (found on the invision links in the ticket) confirm you
  see the progress widgets and the files correct upload status
- On the submission details page in the grade book confirm you
  can see the icons
- In speedgrader confirm you can see the correct icons on the right
  hand sidebar AND confirm they change accrodignly as you change
  the submission selected from the dropdown if there are multiple
  submissions

Change-Id: I6c1152cb7b450c3c2e3a2ca810233fc222c0967a
Reviewed-on: https://gerrit.instructure.com/180605
Tested-by: Jenkins
Reviewed-by: Joshua Orr <jgorr@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Jesse Poulos <jpoulos@instructure.com>
2019-03-19 18:31:36 +00:00
Michael Guymon 59b04ee722 Add AttachmentUploadStatus to track upload errors.
Add model AttachmentProgressStatus that tracks if an upload fails.
This is used instead of the deprecated Attachment#workflow_status
field. The Rails.cache is used store a temporary pending status. If no
pending status or AttachmentProgressStatus for the upload, it is
considered a success

fixes GOOF-709

Test Plan:
* Verify that homework submission from Google works as expected.

Change-Id: I41273eb071ad92ed139e37c994def26065634134
Reviewed-on: https://gerrit.instructure.com/179109
Tested-by: Jenkins
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Reviewed-by: Joshua Orr <jgorr@instructure.com>
Reviewed-by: Derek Bender <djbender@instructure.com>
Reviewed-by: Nick Houle <nhoule@instructure.com>
Product-Review: Nick Houle <nhoule@instructure.com>
2019-03-19 18:31:28 +00:00
Frank Murphy 1548720365 Include rubric ratings in submission API.
Fixes OUT-3004

Test Plan:
- Create an assignment with a rubric with several criteria
  with different ratings, including one criteria with multiple
  ratings with the same point value.
- Submit as a student.
- As a teacher, assess the submission with different ratings.
- Via the submissions API:

  https://canvas.instructure.com/doc/api/submissions.html

- Fetch the graded submission, including the rubric assessment.
- Verify that the rating ids in the API response match the
  prior assessment ratings.
- PUT an assessment with rating ids specified.
- Verify the criteria with multiple ratings with the same point
  value has the correct rating identified.
- PUT a modified assessment with a different rating for the
  multi-rating-with-equal-points criteria.
- Verify the right ratings are displayed in the UI and returned via
  the API.

Change-Id: Ie6c1031d639193a61d5f153cb57a5f5aad3807d6
Reviewed-on: https://gerrit.instructure.com/183973
Reviewed-by: Neil Gupta <ngupta@instructure.com>
Reviewed-by: Andrew VanWagoner <andy@instructure.com>
Product-Review: Frank Murphy III <fmurphy@instructure.com>
Tested-by: Jenkins
QA-Review: Brian Watson <bwatson@instructure.com>
2019-03-19 02:45:28 +00:00
Jeremy Neander 06a3629ab0 use course setting for final grade override
closes GRADE-1952

test plan:
 A. Setup
    1. Select or create a course
    2. Ensure the course has at least one assignment
    3. Enable the "Final Grade Override" feature flag
    4. Enroll at least one student
    5. Visit New Gradebook as the teacher
    6. Open the Gradebook Settings Modal
    7. In the 'Advanced' tab, check "Allow final grade override"
       * If already checked, uncheck and save first
    8. Override the grade for the student

 B. Verify with Overrides Enabled and Allowed
    * The following behavior is expected when the "Final Grade
      Overrides" feature flag is enabled and the "Allow final grade
      override" setting is enabled in New Gradebook. In the interest of
      brevity, specific steps for driving the behavior have been elided.

    1. In New Gradebook
       a. the Overrides column is present
       b. overrides can be applied, changed, and removed

    2. Publishing grades via Grade Sync
       * correct configuration assumed
       * overrides will be included

    3. Courses API Index
       * /api/v1/courses.json
       a. computed_current_score is the override score
       b. computed_current_grade is the override grade
       c. computed_final_score is the override score
       d. computed_final_grade is the override grade

    4. Gradebook Exports
       * overrides will be included

    5. User Enrollments API
       * /api/v1/users/[user_id]/enrollments
       a. current_score is the override score
       b. current_grade is the override grade

    6. Course Enrollments API (as a teacher)
       * /api/v1/courses/[course_id]/enrollments
       a. current_score is the computed score
       b. current_grade is the computed grade
       c. override_score is present
       d. override_grade is present

    7. Grades Endpoint
       * /grades
       * grade is the override score

    8. Grades for Student Endpoint
       * /grades_for_student?course_id=[course_id]&enrollment_id=[…]
       * grade is the override score

 C. Verify with Overrides Enabled and Not Allowed
    1. Visit New Gradebook as the teacher
    2. Open the Gradebook Settings Modal
    3. In the 'Advanced' tab, uncheck "Allow final grade override"

    4. Repeat Step B, with this caveat:
       * When verifying, note that override scores/grades will not be
         present in addition to computed scores/grades. Also, the scores
         and grades present will be their computed versions, not the
         overrides.

Change-Id: Ida1fb7ccefdc20de1447130812fe779514a897d1
Reviewed-on: https://gerrit.instructure.com/184442
Tested-by: Jenkins
Reviewed-by: Adrian Packel <apackel@instructure.com>
Reviewed-by: Gary Mei <gmei@instructure.com>
QA-Review: Adrian Packel <apackel@instructure.com>
Product-Review: Keith Garner <kgarner@instructure.com>
2019-03-15 14:05:26 +00:00
Marc Phillips 6b7c9806b8 Add visual indicator of LTI Key
closes PLAT-4255

Test Plan:
 n/a

Change-Id: I42cecd3bd0e7970ab63857064178e705fd81c45f
Reviewed-on: https://gerrit.instructure.com/185209
Tested-by: Jenkins
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Product-Review: Jesse Poulos <jpoulos@instructure.com>
2019-03-14 18:05:14 +00:00
Adrian Packel 9478515582 Unanchor SpeedGrader links
closes GRADE-1866

Test plan:
- Make sure specs pass
- Smoke test a few Canvas pages that link to a particular student in
  SpeedGrader
- For example:
  - Submission tray in new Gradebook (only if non-anonymous)
  - Submission details in old Gradebook (ditto)
  - Student links on grade summary page for moderated assignment
  - Link in student reply on a graded discussion topic
    - (Create a discussion topic with "Graded" enabled and reply to
      the topic as a student; the ellipsis menu for that reply will
      have an "Open in SpeedGrader" link)
  - Notifications (e.g., "assignment submitted") for both
    anonymous and non-anonymous assignments

In all cases, the links to SpeedGrader should be of the form
  speed_grader?assignment_id=<id>&student_id=<student_id>
and NOT of the form
  speed_grader?assignment_id=<id>#{"student_id":"<student_id>"}

Change-Id: I9899e169348bc0fef287383c6f3262c73040c722
Reviewed-on: https://gerrit.instructure.com/184538
Tested-by: Jenkins
Reviewed-by: Gary Mei <gmei@instructure.com>
Reviewed-by: Jeremy Neander <jneander@instructure.com>
QA-Review: Gary Mei <gmei@instructure.com>
Product-Review: Keith Garner <kgarner@instructure.com>
2019-03-11 18:41:41 +00:00
Matthew Berns baf2136cc6 Render live assessment results in student LMGB
fixes OUT-2953

test plan:
  - create a new course in an account
  - enable LMGB and student LMGB in course feature options
  - create a course outcome
  - create a student user in the course
  - create two assignments, one titled "assessed assignment"
    and another titled "unassessed assignment" and align the
    outcome to both assignments
  - create a quiz question bank with a single question and
    align the outcome to the bank
  - create two quizzes, one titled "assessed quiz" and another
    titled "unassessed quiz", both pulling the question from
    the above bank
  - create a live assessment:
    > c = Course.last
    > la = LiveAssessments::Assessment.create!(
      key: 'test1', title: 'assessed live assessment', context: c)
    > o = LearningOutcome.last
    > o.align(la, c)
    > LiveAssessments::Result.create!(user: User.last, assessor_id: 1,
      assessment_id: la.id, passed: true, assessed_at: Time.now)
    > la.generate_submissions_for([User.last])
  - as the student, submit to the two assignments and two quizzes
  - in speedgrader, assess the "assessed assignment" and "assessed quiz"
    submissions
  - open the student LMGB for the given student
  - confirm that assessed quiz, assignment and live assessment appear,
    followed by unassessed quiz and assignment

Change-Id: I8cb62396a3a09aa168d90bb043e28f12b92019e0
Reviewed-on: https://gerrit.instructure.com/183458
Reviewed-by: Frank Murphy III <fmurphy@instructure.com>
Reviewed-by: Neil Gupta <ngupta@instructure.com>
Tested-by: Jenkins
QA-Review: Brian Watson <bwatson@instructure.com>
Product-Review: Neil Gupta <ngupta@instructure.com>
2019-03-06 21:00:26 +00:00
Rex Fleischer daf99cd851 add the required fields for updating assignments with graphql
fixes: ADMIN-2381

Test-Plan:
perform different updates in graphiql an ensure they
actually happen without error.

Change-Id: Ib7b3a6b41b7bb46b9cc3a6dd76348cc02d093d41
Reviewed-on: https://gerrit.instructure.com/180607
Tested-by: Jenkins
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
QA-Review: Ed Schiebel <eschiebel@instructure.com>
Product-Review: Rex Fleischer <rfleischer@instructure.com>
2019-03-01 19:36:24 +00:00
Gerrit Code Review e2813097c9 Merge "Merge branch 'dev/proserv_ntn'" 2019-02-22 20:02:25 +00:00
James Williams e873913009 check for teacher enrollment updates when downloading submissions
test plan:
* create a course with two sections, each with one student
* create a teacher section-limited to one section
* have each student submit to an assignment
* download the submissions as the teacher
* it should show the submission for one section
* move the teacher to the other section
* download the submissions again
* it should show submissions for the other section
 (should not have re-used the old download)

closes #CNVS-45149

Change-Id: Iee8d8aca0f159428316f306368723fea8ae2a332
Reviewed-on: https://gerrit.instructure.com/181212
Tested-by: Jenkins
QA-Review: Anju Reddy <areddy@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
2019-02-21 21:37:37 +00:00