Commit Graph

6002 Commits

Author SHA1 Message Date
Derek Bender 9d39754e48 fix has_annotations?
fixes: GRADE-339

test plan:
  - with new annotations disabled
  - have a course with an assignment that requires a file upload
  - have a student submit the assignment with a doc pdf or docx file
    type
  - as the student or teacher go to the assignment submissions page
  - as a student click 'Grades'
  - click the assignment that was previously submitted
  - ensure that the document preview loads without errors
  - as a teacher click 'Grades'
  - click the students name
  - click the assignment that was previously submitted
  - ensure that the document preview loads without errors

Change-Id: Idd6984aae779205b247927843da8c8acfb5a33d6
Reviewed-on: https://gerrit.instructure.com/128803
Reviewed-by: Spencer Olson <solson@instructure.com>
Reviewed-by: Keith T. Garner <kgarner@instructure.com>
Tested-by: Jenkins
QA-Review: KC Naegle <knaegle@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
2017-10-06 17:10:24 +00:00
Steven Burnett b48d3260ff create migration for populating terms
Change-Id: I13eddbe900070b8f50ff5c8f6f016daa27ec87d1
Reviewed-on: https://gerrit.instructure.com/128447
Tested-by: Jenkins
QA-Review: Steven Burnett <sburnett@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Reviewed-by: Steven Burnett <sburnett@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
2017-10-05 20:19:30 +00:00
Rob Orton 43e554fa40 add multi_term_batch_mode to sis import api
fixes CNVS-39788

test plan
 - should have multi_term_batch_mode in response

Change-Id: Idb0ada9eff15c62848d7b616e95a8b01d4870cca
Reviewed-on: https://gerrit.instructure.com/128521
Tested-by: Jenkins
Reviewed-by: Tyler Pickett <tpickett@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2017-10-05 14:04:46 +00:00
Steven Burnett f18305cf98 add terms of service and ToSC table to canvas
fixes COMMS-175 COMMS-174

Test Plan:
- Test pass
- You can log into rails console and create
  a Terms Of Service with content

Change-Id: Ib3a26e2fbb721c023a39469bb6412844690150e4
Reviewed-on: https://gerrit.instructure.com/124970
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
Product-Review: Steven Burnett <sburnett@instructure.com>
QA-Review: Steven Burnett <sburnett@instructure.com>
2017-10-04 16:13:02 +00:00
Matt Taylor efd4bc145b support any grading scheme key that is not a number
fixes GRADE-304

Test Plan
  1. Define a grading scheme with numbers followed by letters
     1A - 90%
     2B - 80%
     3C - 70%
  2. Create a course with students that uses the grading scheme
  3. Create an assignment with "letter grade" grading type
     and 10 points possible
  4. Go to new gradebook
  5. Grade the assignment with "2B", the cell should show 2B 8.9
  6. Grade the assignment with "2", the cell should show 3C 2
  7. Repeat 5-6 in old gradebook

Change-Id: I7e7d89a0e8c7d10c2c5922e65b710ef3a213a52d
Reviewed-on: https://gerrit.instructure.com/127949
Reviewed-by: Spencer Olson <solson@instructure.com>
Tested-by: Jenkins
Reviewed-by: Jeremy Neander <jneander@instructure.com>
QA-Review: KC Naegle <knaegle@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
2017-10-04 14:20:05 +00:00
Ryan Shaw 094d65a1cb Remove remaining dynamic brand css code
closes: CNVS-39103 CNVS-39104 CNVS-38650

test plan:
* do a general css styling regression pass
* make sure that the urls to css files look like
  /dist/brandable_css/new_styles_normal_contrast/<bundle>-<fingerprint>.css
  and not:
  /dist/brandable_css/<big long md5>/new_styles_normal_contrast/<bundle>-<fingerprint>.css
* make sure that stylesheets loaded by handlebars templates work
  eg: go to the calendar page and make sure it is styled correctly
* verify that the theme editor works. especially the process when you hit
  "preivew" and "apply"
* set up config/canvas_cdn.yml to use the dev cdn
* run `bundle exec canvas:compile_assets && bundle exec rake canvas:cdn:upload_to_s3`
* load a page, all the css should load from the cdn
* verify the theme editor works when using the cdn too.

* also review the changes in the brandable_css npm package:
  https://github.com/ryankshaw/brandable_css/compare/c6bef...b159d5

Change-Id: I55db41e90f6bc54183a661128f1050445a086d6b
Reviewed-on: https://gerrit.instructure.com/120912
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2017-10-03 22:49:11 +00:00
Neil Gupta 5e5cfcd67a store teacher view of current score in scores table
fixes GRADE-9

Test plan:
* Create a course with a student and 2 assignments
* Mute one of the assignments
* Grade both assignments
* Verify that student sees the unmuted current score
* Verify that teacher sees current score that includes both assignments
* In rails console:
  e = Enrollment.where(user_id: <student id>, course_id: <course id>)
  score = e.find_score(course_score: true)

score.current_score should match the student view score
score.unposted_current_score should match the teacher view score

Change-Id: I995ec26fdef8b10e3e981d7b467edcb989230943
Reviewed-on: https://gerrit.instructure.com/127467
Reviewed-by: Jeremy Neander <jneander@instructure.com>
Tested-by: Jenkins
Reviewed-by: Keith T. Garner <kgarner@instructure.com>
QA-Review: KC Naegle <knaegle@instructure.com>
Product-Review: Neil Gupta <ngupta@instructure.com>
2017-10-03 22:04:09 +00:00
Rob Orton d1227ce121 show notifications for active account memberships
fixes CNVS-39695

test plan
 - have two accounts and enrollment in each
 - a notification from account two should show on
   account one dashboard

Change-Id: I22e59fa7a1a04e00ff97d4a15333565ef70d4fed
Reviewed-on: https://gerrit.instructure.com/128037
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2017-10-03 21:07:41 +00:00
Jacob Fugal 328c1648dd request thumbnails from instfs when enabled
fixes CNVS-39058, CNVS-39061

Canvas doesn't need to store any additional metadata about instfs
thumbnails; the only metadata it uses about its legacy generated
thumbnails is the url (whether local or s3). we can just generate
thumbnail urls direct to instfs and forgo the thumbnail model
altogether.

test-plan:
- enable instfs
- upload an image to Canvas
- the uploaded image should have a thumbnail in the UI same as a
  non-instfs file before this commit, but the thumbnail should be being
  read from instfs as well
- regression test thumbnails with instfs disabled

Change-Id: I03c21be89469238de7efa317753763834d41c86c
Reviewed-on: https://gerrit.instructure.com/128180
Reviewed-by: Jonathan Featherstone <jfeatherstone@instructure.com>
Tested-by: Jenkins
QA-Review: Collin Parrish <cparrish@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
2017-10-03 20:00:08 +00:00
James Williams 5f683c9863 prioritize display_name when finding relative files
closes #ADMIN-78

Change-Id: Icf2580dae101f1991ab2970bcf5aa96c49d8db4f
Reviewed-on: https://gerrit.instructure.com/128111
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2017-10-03 16:29:51 +00:00
James Williams 66a8e23f1f remove some unused endpoints
they're probably broken anyway

Change-Id: Iecba584aa5f5919ac24c2de87c46ace4e340ff4d
Reviewed-on: https://gerrit.instructure.com/127355
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2017-10-03 15:18:00 +00:00
wdransfield 94bc93256e Support originality report launches in submission history
Closes PLAT-2850

Test Plan:
- Create an assignment associated with a plagiarism detection
  tool. The tool should be capable of doing originality report
  launches.
- Submit to the assignment and create an originality report.
- Resubmit to the assignment and create an originality report
  for the new attachment.
- From the gradebook submission details modal verify each
  version of the attachment has the score you gave them.
  Verify an LTI launch is performed when clicking on
  either of the scores.

Change-Id: I5ec56e848aaf1ce0578e234a25a7d3b95b75a663
Reviewed-on: https://gerrit.instructure.com/127468
Tested-by: Jenkins
Reviewed-by: Spencer Olson <solson@instructure.com>
Reviewed-by: Andrew Butterfield <abutterfield@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Weston Dransfield <wdransfield@instructure.com>
2017-10-03 14:58:47 +00:00
Andrew Butterfield d29aaaf6a1 Add Lti Link model for LTI 2 launches
refs PLAT-2724

Test plan:
* Regression test plagiarism platform

Change-Id: I98fd4efc5f259bd73747337d07a7e2ec2508dbb0
Reviewed-on: https://gerrit.instructure.com/122906
Reviewed-by: Jeremy Neander <jneander@instructure.com>
Reviewed-by: Nathan Mills <nathanm@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Keith T. Garner <kgarner@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Andrew Butterfield <abutterfield@instructure.com>
2017-10-02 22:32:18 +00:00
Rob Orton fa27d91c54 fix fk error on user split
fixes CNVS-39625

test plan
 - merge cross shard users
 - do stuff that creates notificaiton poilicy for the new
   communication_channel
 - split users
 - it should work

Change-Id: I2082ee0de1d9407b5dd0a5100d5052ab437b2ea7
Reviewed-on: https://gerrit.instructure.com/128008
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2017-10-02 19:51:30 +00:00
Venk Natarajan 7705466730 Add the ability to duplicate discussions.
Closes FALCOR-142
Closes FALCOR-143
Closes FALCOR-144

Test Plan:
  * Have a course.
  * Create some discussion topics.  Should cover various
    combinations of being an assignment/not being one, and
    being a group discussion/not being a group discussion
  * Discussion assignments, when duplicated from the discussion
    page, should have the "assignment" icon present in the new
    discussion.  Non-assignments should not have this.
  * Group discussions should also show as such/not show as such,
    as the case may be (verify by clicking through to the
    discussion page)
  * Duplicating assignments should work properly from the
    "assignments" view as well.
  * Students should not be able to duplicate discussions from either
    view.
  * All duplicates should appear as unpublished, even if the
    original was published.
  * When "saving" a new discussion, upon going back to the
    discussions view, you may get a dialog warning you of unsaved
    changes.  That is a bug (pre-existing and out of the scope of
    this change).  Ignore it.  There should be another ticket for
    this.
  * Make sure *deleting* the newly created discussion works, even
    if a reload was not performed.

Change-Id: Ifce143bfff13df1ac574e67967540f70cb642bc7
Reviewed-on: https://gerrit.instructure.com/117905
Tested-by: Jenkins
QA-Review: Heath Hales <hhales@instructure.com>
Reviewed-by: Felix Milea-Ciobanu <fmileaciobanu@instructure.com>
Product-Review: Christi Wruck
2017-10-02 19:41:32 +00:00
Rob Orton c5daffa68b create multi_term_batch_mode
fixes CNVS-39621

test plan
 - run multi_term_batch_mode sis imports
 - it should remove excluded items from all
   included terms
 - run rake doc:api
 - api docs and sis_csv doc should generate and be
   clear

Change-Id: I315b8bf4a78422a8b9f96cf330da6aa1553cacb8
Reviewed-on: https://gerrit.instructure.com/127686
Tested-by: Jenkins
Reviewed-by: Tyler Pickett <tpickett@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2017-10-02 18:55:59 +00:00
Keith Garner 374f4e408a fix mgp related N+1s in courses API
This patchset cleans up a few N+1s related to grading periods and
scores when the courses API is called for a student with
include=current_grading_period_scores and include=total_scores

fixes GRADE-300

test plan:
 - Have a few courses in an enrollment term with multiple grading
   periods set up.
 - Have a few courses in an enrollment term without MGP set up.
 - Register a student in those courses
 - As the student hit the courses API endpoint as:
   /api/v1/courses?include%5B%5D=needs_grading_count&include%5B%5D=syllabus_body&include%5B%5D=total_scores&include%5B%5D=term&include%5B%5D=permissions&include%5B%5D=current_grading_period_scores&include%5B%5D=favorites&include%5B%5D=tabs&per_page=99
 - Observe in the logs that grading period information and score
   information is only loaded once and not once per course

Change-Id: I5c2caf23bb7f51274a0a482ac8b4f3135e887cd6
Reviewed-on: https://gerrit.instructure.com/127447
Reviewed-by: Shahbaz Javeed <sjaveed@instructure.com>
Tested-by: Jenkins
Reviewed-by: Jeremy Neander <jneander@instructure.com>
QA-Review: Derek Bender <djbender@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
2017-10-02 18:03:52 +00:00
Jacob Fugal 234d5bd014 give durations to authenticated_url's ttl
fixes CNVS-39589

e.g. 86400.from_now isn't a thing; 86400.seconds.from_now is. all the
other uses besides the default url_ttl were already durations.

test-plan:
- enabled inst-fs in your development canvas
- upload a file to your user's files area in Canvas
- refresh the files area (for now, pending CNVS-39065)
- attempt to download the file you uploaded
- should get the file, served from inst-fs

Change-Id: Ibf7217f91a2f71c7b03b0798163a1f820e679b21
Reviewed-on: https://gerrit.instructure.com/127831
Tested-by: Jenkins
Reviewed-by: Andrew Huff <ahuff@instructure.com>
QA-Review: Collin Parrish <cparrish@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
2017-10-02 17:30:54 +00:00
Jon Willesen 8015156613 rework algorithm for assigning students to groups
The old algorithm didn't take into account max_membership. A patch was
applied earlier to try and fix this, but it didn't account for some
cases, as outlined by the bug description. Replaced the old algorithm
with one that takes the max_membership into account and requires less
ascii art to explain.

fixes CNVS-39226

test plan:
* generally regression test randomly adding students to groups
* create a group set with some groups with differing maximum memberships
* randomly assign students to these groups and notice that all the
  students get assigned to a group if there is space
* try mixing groups with limits and groups without limits
* do some manual group assignments and randomly assign the rest
  * it should try to equalize the group sizes, as it did before

Change-Id: Ibe438333c2bdad8cfe8589b2c672e8f0c9d688a2
Reviewed-on: https://gerrit.instructure.com/126190
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
Tested-by: Jenkins
QA-Review: Heath Hales <hhales@instructure.com>
Product-Review: Jon Willesen <jonw+gerrit@instructure.com>
2017-09-29 19:23:08 +00:00
Spencer Olson e1d4b3ee4d add edited_at to submission_comments
closes GRADE-303

Test Plan:
1. Verify the migration succeeds, and verify you can also roll the
   migration back successfully. The rest of the steps will assume the
   migration has been run.
2. Create a course with an assignment. Submit to that assignment as a
   student, and comment on the submission as the student.
3. Make an API call to get the submissions and their comments for the
   assignment.

     GET api/v1/courses/:course_id/assignments/:id/submissions?
         include[]=submission_comments

   Verify the submission comments that are returned have an 'edited_at'
   key on them. The value of 'edited_at' should be nil for all comments.

4. Enter a rails console and update the 'comment' attribute on the
   submission comment.

   assignment = Assignment.find(<your-assignment-id>)
   student = User.find(<your-student-id>)
   submission = assignment.submissions.find_by(user_id: student)
   comment = submission.submission_comments.first
   comment.update!(comment: "i am updating the text on the comment!")

5. Make an API call to get the submissions and their comments for the
   assignment.

     GET api/v1/courses/:course_id/assignments/:id/submissions?
         include[]=submission_comments

   Verify the value of the 'edited_at' attribute for the comment you
   adjusted in step 4 is a timestamp.

Change-Id: I4c91fdfd7a9cef194f08a2d086601fb827a50095
Reviewed-on: https://gerrit.instructure.com/127476
Tested-by: Jenkins
Reviewed-by: Derek Bender <djbender@instructure.com>
Reviewed-by: Shahbaz Javeed <sjaveed@instructure.com>
QA-Review: Anju Reddy <areddy@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
2017-09-29 14:54:03 +00:00
James Williams 81d775bd25 don't copy integration id/data when duplicating assignment
closes #CNVS-39616

Change-Id: Ifcad21acef66f0f2adb65a795be0ff43e162dd93
Reviewed-on: https://gerrit.instructure.com/127718
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2017-09-29 12:03:39 +00:00
Rob Orton aa6e191227 respect change threshold for batch mode imports
fixes CNVS-39608

test plan
 - use change_threshold in sis import api
 - it should work

Change-Id: Ice7625f4525753547d2b67cca99c0f02527c15eb
Reviewed-on: https://gerrit.instructure.com/127585
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Tucker McKnight <tmcknight@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2017-09-28 17:25:55 +00:00
wdransfield 4820e9f8fb LTI User show endpoint
Closes PLAT-2819

Test Plan:
- Create a tool consumer profile associated with a
  developer key that uses the newly added `vnd.Cavnas.User`
  service.
- Install a plagiarism detection tool that uses the
  new `vnd.Cavnas.User` service.
- Create an assignment in a course with students and
  associate it with the tool.
- Make a request to `/api/lti/users/:user_id` with
  the id of one of the students and no access token.
  verify that you get a 401
- Make the same request but this time include an
  access token. Verify the student details is returned.
- Make the same request but use the user's `lti_context_id`.
  Verify that the user details is still returned.
- Remove the tool from the assignment and save the change.
- Make the same request and verify a 401 is returned.
- Verify the behaviors outlined above work when the tool
  is installed in a course, account, and root account.

Change-Id: I81bd1446729d194f7f3910bca05638e57e5091d1
Reviewed-on: https://gerrit.instructure.com/126931
Tested-by: Jenkins
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: August Thornton <august@instructure.com>
Reviewed-by: Nathan Mills <nathanm@instructure.com>
Product-Review: Weston Dransfield <wdransfield@instructure.com>
2017-09-28 15:41:12 +00:00
James Williams 4e012aa54e copy student view restriction settings
test plan:
* create a course with one or more of the
"Restrict students from viewing ___" settings checked
* the setting should carry over when copied to a new course

(also should work on blueprint course when
 settings are included)

closes #CNVS-39459

Change-Id: I6ceca2e61744770236471b15041bcbf39d29def5
Reviewed-on: https://gerrit.instructure.com/127258
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2017-09-28 15:28:43 +00:00
Simon Williams ad1dfbfb3a better failure handling for invalid gradebook import csv headers
closes CNVS-39159

test plan:
- upload a gradebook import with an invalid header row
- it should behave the same as previously, from the user perspective
- check failed jobs, the jobs should not be listed there

Change-Id: I9a0c1fa61e6b3e105fe01398331c5dd8b37c705b
Reviewed-on: https://gerrit.instructure.com/125356
Reviewed-by: Matt Taylor <mtaylor@instructure.com>
Tested-by: Jenkins
QA-Review: Neil Gupta <ngupta@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2017-09-27 23:05:36 +00:00
James Williams 001ecd52e1 copy nil values for quiz hide_results
test plan:
* have a quiz in a course with "Let Students See their
 quiz responses" checked
* copy it into another course
* uncheck the setting in the original quiz
* re-copy the quiz into the same course
* it should uncheck the setting in the copied quiz

(also applies to blueprint courses)

closes #CNVS-39464

Change-Id: I36ae2dd514b466404efede9714770c07041ca75c
Reviewed-on: https://gerrit.instructure.com/127345
Tested-by: Jenkins
Reviewed-by: Dan Minkevitch <dan@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2017-09-27 19:03:56 +00:00
Matt Sessions cb86dcc537 Refs MBL-8772 - Update graded to not use workflow_state
- updated graded scope to include all cases and match
   graded? method
 - Changed submission_summary api to use graded scope

Test Plan:
 - Submit an assignment as a student
 - Grade the assignment
 - hit /api/v1/courses/<course_id>/assignments/<assignment_id>/submission_summary
 - The graded count should reflect the graded assignment
 - Remove the grade from the submission
 - hit the submission_summary api again
 - The graded count should be one less, reflecting
   the removal of the grade

Change-Id: I119ed0171226e377bc83779ab6ae948d728e140e
Reviewed-on: https://gerrit.instructure.com/127524
Tested-by: Jenkins
Reviewed-by: Cameron Sutter <csutter@instructure.com>
QA-Review: Taylor Wilson <twilson@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
Product-Review: Matthew Sessions <msessions@instructure.com>
2017-09-27 17:27:45 +00:00
Jacob Fugal 594bdff748 inst-fs upload preflight (and capture fixes)
fixes CNVS-38591

when the inst-fs service is enabled, generate a preflight response
tailored for inst-fs instead of for S3. the service will then receive
the POSTed file data, generate it, and ping Canvas at the embedded
capture URL. compatible with existing Canvas UI.

along the way, some cleanup refactoring in api_attachment_preflight:
* instead of taking submission_context and inferring a folder from
  that, have the submission API be responsible for determining the
  folder and then just specify it. note that the folder inference was
  the only use of submission_context, the submission API was the only
  caller of api_preflight_json to specify submission_context, and the
  folder option we took over was previously both broken and unused.
* simplify the remaining folder inference code. if a folder is
  specified by the code (vs. the user in params), assume they have
  necessary access (the :manage_contents permission would fail for a
  student making a submission)
* correctly abort if params[:on_duplicate] is invalid. before, if the
  UI provided an explicit but invalid value, it would cause a double
  render error.
* inline process_attachment_params for update, and skip it on
  preflight. the UI never provides any of the possible params but
  display_name for preflight, which is then ignored from the
  process_attachment_params result because it's treated separately

TODO: tests
* InstFS.upload_preflight_json
* api_attachment_preflight:
  - uploading a file to a submission (submissions_api#create_file) when the
    submissions_folder feature is enabled stores the file in the user's
    submissions folder
  - student uploading a file to a submission is not blocked by permissions
  - user with :manage_contents permission on a folder is not blocked when
    uploading to that folder
  - user without :manage_contents permission on a folder is blocked when
    attempting to upload to that folder
  - no double render error on on_duplicate=invalid
  - updates to lock_at, etc., on a file (via files#api_update) stick
* files#api_capture:
  - reject if over quota and not flagged quota_exempt
  - attachment.locked based on usage rights settings
  - attachment.handle_duplicates
  - content migration success callback triggered
* InstFS.authenticated_url:
  - includes iat claim
  - expiration is a timestamp

test-plan:
  inst-fs upload happy path:
  - have inst-fs service running, have canvas configured to be able to
    find and share a secret with it, and enable the inst-fs plugin setting
  - go to the files area, or a discussion, or a conversation, etc., and
    upload a file.
  - the file should be successfully uploaded
    - NOTE: known issue, there seems to be a race condition in the service
      responding 201 Created with a Location before Canvas is ready to
      respond to that Location. This will make the upload appear to fail.
      But if you refresh the page, the file should be present. This race
      condition will be fixed in a later commit; it has already been filed
      as a separate bug.
  - attempt to download/preview the file
  - download/preview should work, and should be served from inst-fs

  quota enforcement:
  - configure a course to have a quota
  - select a file that should exceed that quota when uploaded
  - bypassing the canvas UI, access the preflight endpoint directly
    while providing the true size; preflight should fail
  - access the preflight endpoint directly while providing a false size
    that would fit inside the quota; preflight should succeed
  - attempt to POST the file to the returned upload_url with the
    returned upload_params; the upload should fail

  locking pending usage rights:
  - configure the account to lock files without usage rights
  - upload a file
  - the newly created file should be locked
  - assign usage rights to the new file
  - it should unlock

  path collisions:
  - upload a file to a folder
  - upload a distinct file but with the same filename to the same folder
  - should be prompted to rename or overwrite
  - select rename; the newly uploaded file should have the filename
    modified to avoid the collision
  - repeat, but selecting overwrite; the filename should now refer to
    the new file, and the old file should not be accessible in the UI

  non-inst-fs unharmed:
  - disable the inst-fs plugin setting
  - do general regression tests on file uploads (whether S3 or local
    storage)

Change-Id: I2bff1e3c31a3ed0955c29e677a422b7149253318
Reviewed-on: https://gerrit.instructure.com/124929
Tested-by: Jenkins
Reviewed-by: Andrew Huff <ahuff@instructure.com>
QA-Review: Collin Parrish <cparrish@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
2017-09-27 16:35:40 +00:00
James Williams f0038285bb fix updating graded assignments with locked points
test plan:
* have a blueprint course with
 an ungraded assignment with locked points
* sync to an associated course
* should be able to edit the unlocked attributes
of the copied assignment

closes #CNVS-39508

Change-Id: Ifdb8f0d91185f5044a05a1ce20828ed906dcfcc4
Reviewed-on: https://gerrit.instructure.com/127189
Tested-by: Jenkins
Reviewed-by: Dan Minkevitch <dan@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2017-09-27 15:55:54 +00:00
James Williams 1d2e869d61 master courses: fix tab navigation for account tools
test plan:
* have an external tool configured on the account level
 that adds a course_navigation (sidebar tab)
* on a blueprint course, view the course settings,
 "navigation" tab and drag the external tool
 tab into the bottom section to hide from students
* sync the blueprint course to an associated course,
 (marking "include settings")
* the tool navigation item should be hidden
 in the associated course

closes #CNVS-38061

Change-Id: I24a7b5e94b531d83c6bfb7e7d3a16852b583aac6
Reviewed-on: https://gerrit.instructure.com/127243
Tested-by: Jenkins
Reviewed-by: Dan Minkevitch <dan@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2017-09-27 12:48:24 +00:00
Rob Orton 6a6129e6ff allow other states for enrollment diffing
fixes CNVS-39457


test plan
 - pass diffing_drop_status to sis import api
 - enrollments dropped by exclusion(through diffing)
   should be marked as the state passed

Change-Id: I5866c9456b1fa5b32ba4f723b20c6e3aa3c4d1ab
Reviewed-on: https://gerrit.instructure.com/126856
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
QA-Review: Tucker McKnight <tmcknight@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2017-09-25 23:21:34 +00:00
Simon Williams d386290ae2 protect against missing message context
fixes CNVS-39155

test plan:
- generate a notification without a context
- it should work

Change-Id: I9789886410f131f6751827a985f2a056a0fc45cf
Reviewed-on: https://gerrit.instructure.com/125348
Reviewed-by: Jonathan Featherstone <jfeatherstone@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Tested-by: Jenkins
Product-Review: Simon Williams <simon@instructure.com>
2017-09-25 17:15:36 +00:00
Jeremy Stanley 812adb9c0a remove redundant and incorrect TAB_PEOPLE check
this code was added (g/2783) before a proper :read_roster
permission check was put in (g/5092). it's no longer needed.

test plan:
 - an observer with "See the list of users" permission should
   be able to see the People tab on the left side of course nav
   (the actual page was already readable)

fixes CNVS-15980

Change-Id: Ib79c5a0a640009ba33f889386ba62ea7b0bfe105
Reviewed-on: https://gerrit.instructure.com/127016
Tested-by: Jenkins
Reviewed-by: Jon Willesen <jonw+gerrit@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2017-09-25 17:06:33 +00:00
Jeremy Stanley ec7b756395 allow default help link text to be edited
fixes CNVS-39004

this was allowed before, but was disallowed because it broke I18n
(see CNVS-37038). we will use the same technique we used with
the menu name in CNVS-38421 to allow link text and subtext to be
customized, or localized if it isn't customized; namely, we will
not store the saved value if it matches the default value from
the code in the locale of the user saving it.

test plan:
 0. enable help links by doing the following in a Rails console:

    Setting.set("show_feedback_link", "true")

 1. still in the Rails console, clear existing custom link
    definitions, if present, as follows:

    a = Account.default
    a.settings.delete(:custom_help_links)
    a.save!

 2. start your server with RAILS_LOAD_ALL_LOCALES=1

 3. go to /accounts/1/settings and edit the text of one of
    the default help links (note the URL is still immutable).
    Save account settings.

 4. change your language to Spanish.

 5. go back to /accounts/1/settings, and the link text you
    edited should be what you set it to. the other links
    should be displayed in Spanish.

 6. edit another link and save.

 7. switch back to English. the two links you edited should
    remain edited; the others should now show in English.

Change-Id: I44bd407c57f88166562b7e0745560133e78ad4ea
Reviewed-on: https://gerrit.instructure.com/126948
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Jenkins
QA-Review: Heath Hales <hhales@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2017-09-25 15:21:26 +00:00
Jeremy Neander 0979bc48f5 improve management of gradebook versions
refs GRADE-218

QA Notes:

The `version`, `new_gradebook`, and `new_gradebook_development`
parameters are available in development only. Using these will
override the related preference, feature flag, and ENV variable
for the loading of Gradebook. They will not change the values
persisted for these settings.

Using `version` will override whichever user-preferred version of
Gradebook has been previously saved and instead load the version
of Gradebook corresponding to the `version` parameter.

Uses of the `version` parameter:
--------------------------------------------
| default    | default gradebook           |
| 2          | default gradebook           |
| individual | individual gradebook        |
| srgb       | individual gradebook        |
| < absent > | uses user-preferred version |
--------------------------------------------

Using `new_gradebook` will override the New Gradebook feature
flag, loading Gradebook as though the Feature Flag is set to the
value provided with the `new_gradebook` parameter.

Uses of the `new_gradebook` parameter:
---------------------------------------
| true       | New Gradebook enabled  |
| false      | New Gradebook disabled |
| < absent > | uses feature flag      |
---------------------------------------

Using `new_gradebook_development` will override the
GRADEBOOK_DEVELOPMENT ENV variable, loading Gradebook as though
the variable is set to the value provided with the
`new_gradebook_development` parameter.

Uses of the `new_gradebook_development` parameter:
---------------------------------------------------
| true       | New Gradebook Development enabled  |
| false      | New Gradebook Development disabled |
| < absent > | uses env variable                  |
---------------------------------------------------

test plan:
A. disable New Gradebook in non-development
  1. visit Gradebook and select Individual Gradebook
  2. ensure SRGB loads
  3. select Default Gradebook
  4. ensure Default Gradebook loads
  5. ensure the version parameter has no effect
  6. ensure the new_gradebook parameter has no effect
  7. ensure the new_gradebook_development parameter has no effect
B. disable New Gradebook in development
  1. visit Gradebook and select Individual Gradebook
  2. ensure SRGB loads
  3. select Default Gradebook
  4. ensure Default Gradebook loads
  5. ensure the version parameter takes effect
  6. ensure the new_gradebook parameter takes effect
  7. ensure the new_gradebook_development parameter takes effect
C. enable New Gradebook in non-development
  1. visit Gradebook and select Individual Gradebook
  2. ensure "New" SRGB loads
  3. select Default Gradebook
  4. ensure "New" Default Gradebook loads
  5. ensure the version parameter has no effect
  6. ensure the new_gradebook parameter has no effect
  7. ensure the new_gradebook_development parameter has no effect
D. enable New Gradebook in development
  1. visit Gradebook and select Individual Gradebook
  2. ensure "New" SRGB loads
  3. select Default Gradebook
  4. ensure "New" Default Gradebook loads
  5. ensure the version parameter takes effect
  6. ensure the new_gradebook parameter takes effect
  7. ensure the new_gradebook_development parameter takes effect

Change-Id: I9088e9a66e2213b12eac95fa93b15f7253e0b9dd
Reviewed-on: https://gerrit.instructure.com/105658
Tested-by: Jenkins
Reviewed-by: Spencer Olson <solson@instructure.com>
Reviewed-by: Neil Gupta <ngupta@instructure.com>
QA-Review: Spencer Olson <solson@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
2017-09-25 15:12:53 +00:00
James Williams b4af481928 fix peer review rubric assessments
1. allow peer reviewers to make rubric assessments
 if they've posted comments and a rubric is added
 to the assignment afterwards
2. get rid of the permission check on :assess since
it's currently dependent on an instance variable (so bad)

test plan:
* create an assignment with peer reviews
 in a course with two students
* submit to the assignment as student A
* add student B as a peer reviewer for the other
* as student B, make a comment on the peer review
* add a rubric to the assignment and mark
 "use this rubric for grading"
* as student B, re-view the peer review page
* should be able to mark and save the rubric once
 but afterwards should not be able to edit it

closes #OUT-380

Change-Id: I86c1fd7c0006a6db6abca58f5d3c642de018ecc2
Reviewed-on: https://gerrit.instructure.com/126161
Tested-by: Jenkins
Reviewed-by: Matt Berns <mberns@instructure.com>
QA-Review: Anju Reddy <areddy@instructure.com>
Product-Review: Sidharth Oberoi <soberoi@instructure.com>
2017-09-22 14:47:22 +00:00
James Williams 98313e776b master courses: fix blueprint syncs with deleted modules
test plan:
* have a blueprint course and an associated course
* sync a module over
* delete the module in the blueprint course
* should be able to sync and have the module
 deleted in the associated course

closes #CNVS-39411

Change-Id: Ibfac60e63dd5ae23cb1969ebf2ad3250aa376e79
Reviewed-on: https://gerrit.instructure.com/126626
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Heath Hales <hhales@instructure.com>
Product-Review: Pert Eilers <peilers@instructure.com>
2017-09-22 14:47:01 +00:00
Matt Taylor 42be7c1a8a store scores for each assignment group
closes GRADE-19

Test Plan:
1. Using the master branch prior to this commit:
   a. Seed a course with all of the following:
      - weighted assignment groups
      - weighted grading periods
      - ungraded assignments
      - quizzes
      - late and missing policies
   b. Record all data displayed in the gradebook
2. Using the code in this commit:
   a. Verify GRADEBOOK_COURSE_SCORE_POPULATED is
      not set in your environment
   b. Run database migrations
   c. Repeat steps in (1a)
   d. Verify that results are identical to (1b)
3. Using the code in this commit:
   a. Set GRADEBOOK_COURSE_SCORE_POPULATED="true"
      in your environment
   b. Repeat steps in (1a)
   c. Verify that results are identical to (1b)
   d. (Dev-QA only)
      Verify that assignment group grades recorded in the
      scores table match those calculated by the front end
4. (Dev-QA only)
   run scores_spec and grade_calculator_spec tests
   with GRADEBOOK_COURSE_SCORE_POPULATED="true"
5. (Dev-QA only)
   After running grade calculations with the new migrations
   in place, revert those migrations and verify that all
   scores created for assignment groups are deleted

Change-Id: Ie5e06eb5ad7c0d3958a686e7f0b054e6585be37d
Reviewed-on: https://gerrit.instructure.com/123085
Reviewed-by: Rob Orton <rob@instructure.com>
Reviewed-by: Jeremy Neander <jneander@instructure.com>
QA-Review: Spencer Olson <solson@instructure.com>
Tested-by: Jenkins
Reviewed-by: Keith T. Garner <kgarner@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
2017-09-22 14:46:27 +00:00
Rob Orton ac91aee507 safely delete attachments
when deleting attachments permanently this will
now also delete the s3object. this also makes it
avoid FK error when there are children attachments

fixes CNVS-39122

test plan
 - destroy_permanently_plus should work
 - download submission zip and it should work
 - download eportfolio export and it should work

Change-Id: Ie995b9b3fac739e8aa3e9554c819b263cb67026b
Reviewed-on: https://gerrit.instructure.com/125236
Tested-by: Jenkins
Reviewed-by: brian kirkby <bkirkby@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2017-09-21 19:51:45 +00:00
Rob Orton e56c6c9d09 prevent unique index error on user split
fixes CNVS-39460

test plan
 - have users with conflicting enrollments that
   are deleted
 - user split should still work

Change-Id: Ia024cda6bdcf35be15169499d82f10e21b925cbb
Reviewed-on: https://gerrit.instructure.com/126860
QA-Review: Rob Orton <rob@instructure.com>
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2017-09-21 18:37:15 +00:00
James Williams c879c2c25c add incoming mail discussion replies on correct shard
closes #CNVS-39423

Change-Id: Ibde8b3d7620fc3ce3803b3b7c6efce094021da19
Reviewed-on: https://gerrit.instructure.com/126709
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2017-09-21 12:53:07 +00:00
Jeremy Stanley 39571af6f7 fix linking account question banks in blueprint syncs
this failed because the import migrations did not inherit the user
which is checked for permission to read the question bank

test plan:
 - set up a quiz that imports questions from an account question bank
   in a blueprint course
 - ensure the associated courses' quizzes also link to the bank

fixes CNVS-39348

Change-Id: I2075ccadcfa18ffb2c3263fdc007562e0acd7b6c
Reviewed-on: https://gerrit.instructure.com/126622
Tested-by: Jenkins
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Heath Hales <hhales@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2017-09-20 20:42:10 +00:00
James Williams 60d1468735 ignore deleted account_users in manageable_by_user
test plan:
(note: actually having enough courses to reproduce the
reported error as-is is somewhat infeasible locally but
the following plan should be sufficient)

* have a teacher in a couple courses
* in /courses/X/content_migrations, select
 "Copy a Canvas Course" and note the list of
 courses to choose from in the dropdown matches
 the list of courses the teacher is in

* add the teacher as an account admin
* note that the drop-down now lists all the courses
 in the account

* remove the user as an account admin
* the drop-down should not return all the courses in the
 account anymore

closes #CNVS-39369

Change-Id: I798952042f5bec4c9a714e62aaf1af684cb470ad
Reviewed-on: https://gerrit.instructure.com/126459
Reviewed-by: Dan Minkevitch <dan@instructure.com>
Tested-by: Jenkins
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2017-09-20 19:18:51 +00:00
Brent Burgoyne ebd20c047b reduce cache usage for conversation participants
the participants cache key will no longer include user. if
indirect_participants are included, additional participants will be
cached per user independant from the base participants.

closes CNVS-39349

test plan:
- test creating/replying to conversations
- ensure participants show for conversation

Change-Id: I6a2269becb2d18d03b8a46b348a428830322686a
Reviewed-on: https://gerrit.instructure.com/126155
Tested-by: Jenkins
Reviewed-by: brian kirkby <bkirkby@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Tucker McKnight <tmcknight@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2017-09-20 14:53:37 +00:00
James Williams e53c819c44 fix stream item generation for messages
Change-Id: I0f7deff680e80127d06fe4336d577cad5545689a
Reviewed-on: https://gerrit.instructure.com/126455
Reviewed-by: Dan Minkevitch <dan@instructure.com>
Tested-by: Jenkins
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2017-09-20 13:32:15 +00:00
James Williams a130158b40 master courses: return associated course count in api call
also speed up some of the js_env data for sidebar

test plan:
* the api "Get blueprint information" endpoint
 (e.g. /api/v1/courses/1/blueprint_templates/default)
 for a blueprint template should
 return an 'associated_course_count'
* also the blueprint sidebar should work as before

refs #CNVS-38933

Change-Id: Iea8d8cc6d67f0b53212f271afdcb6cc93cace3a8
Reviewed-on: https://gerrit.instructure.com/124442
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2017-09-20 13:31:18 +00:00
Jeremy Neander de3b4f0f3d ignore concluded enrollments in due date cacher
closes GRADE-269

QA Notes:

To run the due date cacher, open a Rails console and run:

    assignment = Assignment.find(<id of assignment>)
    DueDateCacher.recompute(assignment)

Check cached due dates for submissions in the Rails console.

    submission = Submission.find_by(
      user_id: <id of student>,
      assignment_id: <id of assignment>
    )
    submission.cached_due_date

test plan:
 A. Setup
   1. ensure the delayed jobs are not running
   2. create a course with one assignment
   3. enroll multiple students
   4. assign the assignment to everyone

 B. Student without a Submission
    1. enroll a student in the course
    2. conclude the student's enrollment
    3. manually run the due date cacher
    4. confirm the student does not have any submissions

 C. Changing a Due Date
    1. enroll a student in the course
    2. manually run the due date cacher
    3. conclude the student's enrollment
    4. change the due date on the assignment
    5. manually run the due date cacher
    6. confirm the student submission exists
    7. confirm the submission has the previous due date cached

 D. Unassigning an Assignment
    1. enroll a student in the course
    2. manually run the due date cacher
    3. conclude the student's enrollment
    4. create overrides for only the active students
    5. make the assignment due only to overrides
    6. manually run the due date cacher
    7. confirm the student submission exists
    8. confirm the submission has the previous due date cached

Change-Id: I5e7165c0120e5c87635da1fbbe47501970874653
Reviewed-on: https://gerrit.instructure.com/126270
Tested-by: Jenkins
Reviewed-by: Matt Taylor <mtaylor@instructure.com>
Reviewed-by: Keith T. Garner <kgarner@instructure.com>
QA-Review: KC Naegle <knaegle@instructure.com>
Product-Review: Spencer Olson <solson@instructure.com>
2017-09-19 19:42:12 +00:00
James Williams ad5d5709a1 improve assignments_needing_moderation query
move the need_grading_info subquery on submissions
into the main query so we can restrict it to the
submissions that have provisional grades

test plan:
* the to-do list should behave the same as before
for graders for moderated grading assignments

closes #GRADE-272

Change-Id: I9fb83636ac058393e393874867f5f57ad8128955
Reviewed-on: https://gerrit.instructure.com/126246
Tested-by: Jenkins
Reviewed-by: Jeremy Neander <jneander@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Indira Pai <ipai@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2017-09-19 19:14:54 +00:00
James Williams 754c19e027 fix all_day_date date shifting with account time zone
test plan:
* make sure the root account has a default time zone
 that is not UTC
* create an all day calendar event in a course
with a start and end date
* copy the course into another course with
 date shifting to a new start and end date
* the api for the new calendar event should
 list an all_day_date that matches the event's
 start_at/end_at

closes #CNVS-39314

Change-Id: I7b5fdc81baadffc9fdc5bfd380001001ba235f0f
Reviewed-on: https://gerrit.instructure.com/126304
Tested-by: Jenkins
Reviewed-by: Venk Natarajan <vnatarajan@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2017-09-19 16:12:51 +00:00
wdransfield f848bf5c64 Add 'lti_user_id' to submission live events
Closes PLAT-2824

Test Plan:

- Create a submission with an attachment as a student in an
  assignmetn associated with a plagiarism detection tool.
- Verify that the live event emitted contains an `lti_user_id`
  that matches the `lti_context_id` of the student.
- As a teacher click the `resubmit to plagiarism tool` button in
  speedgrader. Verify that the live event emitted contains the
  `lti_user_id` filed set to the student's `lti_context_id`.

Change-Id: I26d1da652f22ef7fd1cde361688704598db29fa7
Reviewed-on: https://gerrit.instructure.com/125503
Reviewed-by: Nathan Mills <nathanm@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Weston Dransfield <wdransfield@instructure.com>
2017-09-19 15:49:13 +00:00
Matthew Wheeler fe782c798d Guard against nil id in help links
Fixes CNVS-39363

Change-Id: I209bc76e9fee425e1ce17fb9e839a7d1710992ea
Reviewed-on: https://gerrit.instructure.com/126361
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2017-09-16 04:39:54 +00:00
Simon Williams ffca880b71 correctly invalidate course/user feature flag cache
test plan:
- change a course/user feature flag
- the change should stick and apply

Change-Id: I2b4045bf6a0c5c57c58591c98ddcd513e8243fa0
Reviewed-on: https://gerrit.instructure.com/126202
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
2017-09-15 20:19:49 +00:00
Cody Cutrer 102dca8bdc don't use multicache for course and user feature flags
closes CNVS-39324

Change-Id: I6c9fccaddd3661e3fdc350e94ae9e58854a544ad
Reviewed-on: https://gerrit.instructure.com/125792
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2017-09-12 21:38:14 +00:00
Weston Dransfield 0bb306727a Revert "Add global navigation for sub-accounts"
This reverts commit da9819e5c6.

Change-Id: Iabdbf6b3b7763b4785ddfb22d306f7016cd1fe2b
Reviewed-on: https://gerrit.instructure.com/125783
QA-Review: August Thornton <august@instructure.com>
Tested-by: Jenkins
Reviewed-by: Nathan Mills <nathanm@instructure.com>
Product-Review: Weston Dransfield <wdransfield@instructure.com>
2017-09-12 20:52:46 +00:00
Spencer Olson 0c39815253 add validation to originality_report
Adds a uniqueness validation to originality_report for attachment.

closes GRADE-258

Test Plan:
1. In a rails console, create an originality report:

   OriginalityReport.create(
   	attachment: attachment,
   	submission: submission
   )

 2. Create another originality report that belongs to the same
    attachment (the submission can be different). The record should be
    invalid and the error message should be "Attachment has already
    been taken".

    o = OriginalityReport.create(
    	attachment: attachment,
    	submission: some_other_submission
    )
    o.valid?
      => false
    o.errors.full_messages
      => ["Attachment has already been taken"]

Change-Id: I6d73a8f2f62192defffb6908c30233655d843e30
Reviewed-on: https://gerrit.instructure.com/125298
Reviewed-by: Matt Taylor <mtaylor@instructure.com>
Reviewed-by: Jeremy Neander <jneander@instructure.com>
Tested-by: Jenkins
QA-Review: KC Naegle <knaegle@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
2017-09-12 20:40:16 +00:00
James Williams 3855fc4af1 filter out localhost and local ips from canvashttp
test plan:
* use the API to queue a content migration for a course
 with a parameter 'file_url' set to a local url
 (i.e. 'localhost:3000/500.html')
* it should not download the file and allow the file
 to be downloaded on the content migrations page
 for the course

* create a link to a local file
 in a piece of course content (i.e. a page)
* run the course link validator
* it should not actually check if the link exists locally
 or not, but rather always flag the link

closes #SEC-606 SEC-607

Change-Id: I671c017ec93d88446df77d716725fff8874622bc
Reviewed-on: https://gerrit.instructure.com/125118
Tested-by: Jenkins
Reviewed-by: Brad Horrocks <bhorrocks@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Heath Hales <hhales@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2017-09-12 20:29:56 +00:00
Mark Valentine fd2ed0a2bd add rubric range logic
- feature flag for rubric range

Fixes:  PFS-8283

test plan:

Enable feature: Rubric Criterion Range
Access rubric in account, course, and assignment.

1. Verify that 'range' option is available when editing
   a non-outcome criterion.
2. Verify range option is not available for imported
   outcomes.
3. Verify range option is not available when using
   custom comments (assignment rubrics only)

For range enabled criterions:
1. Verify that increasing the total points assigned
   to a criterion will appropriately scale all
   range values.
2. Verify that increasing the max of highest score
   cell increases total points available for
   criterion.
3. Verify that increasing the max of a middle-cell
   will increase the min of cell to left.
4. Verify that min of cell farthest to right is locked
   at 0.
5. Verify that adjusting the min of a middle-cell
   will adjust the max of cell to the right.

In Speedgrader:
1. Verify that selecting values anywhere within a rating
   range will highlight the whole rating cell in green.

Feature Flag:
1. Verify that when feature flag is disabled app functions
   as if range has been disabled for all criteria. (Leave
   a criterion using range, and verify that is no longer
   uses range when the feature is disabled).

In Submission Page:
We should also check the submission show page, since Rubrics
are displayed there as well. It can be a little hard to find
since it doesn't follow typical REST patterns for some reason.
When someone submits to the assignment, the url will be the
assignment's id and the user's id.
e.g, for a user id of 9 and an assignment id of 7 on course 1,
the url would be:
/courses/1/assignments/7/submissions/9

Accessibility:
Verify the new fields are a11y compliant by testing keyboard only
and voiceover navigation, so we don't introduce any new
accessibility issues.

Internationalization:
Test range ratings with different numbering system (i.e. Polish)
Verify that rounding works correctly.

Course Copy:
Verify that course copy preserves rubric ranges.

Change-Id: Ia1e9d3cc1d544aecc21c3628bd3dbec70831da2f
Reviewed-on: https://gerrit.instructure.com/121870
Tested-by: Jenkins
Reviewed-by: Matt Berns <mberns@instructure.com>
QA-Review: Aiona Hernandez <ahernandez@instructure.com>
QA-Review: Andrew Porter <hporter-c@instructure.com>
Product-Review: Sidharth Oberoi <soberoi@instructure.com>
2017-09-12 19:58:40 +00:00
Cody Cutrer f315978819 use MultiCache for Account.find_cached
Change-Id: Ifcacb52d45e15ce19aa4f5c56ba1b929d3158892
Reviewed-on: https://gerrit.instructure.com/125746
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Reviewed-by: Tyler Pickett <tpickett@instructure.com>
Product-Review: Tyler Pickett <tpickett@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2017-09-12 18:06:58 +00:00
James Williams fa0b95bb2f allow unsetting require_sequential_progress on copy
test plan:
* create a blueprint course with a module that requires
 requirements to be done in order
* sync to an associated course
* unset the setting on the module in the original course
* resync the course
* the setting should be unset on the copied module

closes #CNVS-39132

Change-Id: Ic3b0db607042d7ad22107a2c75f7c3b74cf78ff9
Reviewed-on: https://gerrit.instructure.com/125321
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Heath Hales <hhales@instructure.com>
Product-Review: Pert Eilers <peilers@instructure.com>
2017-09-12 12:13:37 +00:00
James Williams 5059ced17e master courses: fix outcome copying on selective export
test plan:
* have a blueprint course with an associated course
* add an outcome to the blueprint course
* it should copy over to the associated course

closes #MC-290

Change-Id: I7baf402be34541db55bc7291b6ad8d1d5c85aae6
Reviewed-on: https://gerrit.instructure.com/125039
Tested-by: Jenkins
Reviewed-by: Jon Willesen <jonw+gerrit@instructure.com>
QA-Review: Heath Hales <hhales@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2017-09-12 12:13:15 +00:00
Spencer Olson 5e327e3c16 ignore attachment_associations that aren't linked to attachments
closes GRADE-264

Test Plan 1: attachment_id is nil
1. Create a 'file upload' assignment.
2. Submit as a student and attach a file.
3. Go into a rails console and adjust the attachment_association so that
   it no longer points to the attachment:

   assignment = Assignment.find(<assignment-id>)
   submission = assignment.submissions.find_by(user_id: <student-id>)
   association = submission.attachment_associations.first
   association.update!(attachment_id: nil)

4. Open the assignment in SpeedGrader and verify there is not a 500
   thrown.

Test Plan 2: attachment_id points to a deleted attachment
1. Create a 'file upload' assignment.
2. Submit as a student and attach a file.
3. Go into a rails console and permanently destroy the attachment:

   assignment = Assignment.find(<assignment-id>)
   submission = assignment.submissions.find_by(user_id: <student-id>)
   attachment = submission.attachments.first
   attachment.destroy_permanently!

4. Open the assignment in SpeedGrader and verify there is not a 500
   thrown.
Change-Id: I61b867ef74ae49e2173068e237bfd8c0c75a9348
Reviewed-on: https://gerrit.instructure.com/125450
Reviewed-by: Derek Bender <djbender@instructure.com>
Reviewed-by: Jeremy Neander <jneander@instructure.com>
Tested-by: Jenkins
QA-Review: Anju Reddy <areddy@instructure.com>
Product-Review: Pert Eilers <peilers@instructure.com>
2017-09-11 21:35:04 +00:00
James Williams f020dd21ba send new topic notification to topic creator
test plan:
* create a discussion topic
* should receive a notification

closes #CNVS-24928

Change-Id: I7a6a429e31f2b5fae0d3ba026978c5ddb587a237
Reviewed-on: https://gerrit.instructure.com/124631
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Pert Eilers <peilers@instructure.com>
Tested-by: Jenkins
2017-09-11 19:32:17 +00:00
Jeremy Stanley 5b8fb7eee2 fix permissions check for storage quota import
test plan: when importing a course export or performing a
course copy, the source course's quota should not override the
destination course's quota unless the user performing the
action has "manage storage quota" permissions in the course's
account.

also ensure that, if copying a source course containing files
whose total size exceeds the quota of the destination course,
the course copy still succeeds (because files are only charged
to the quota of the original course; the copy points at the
original rather than duplicating the file content. of course
newly uploaded files in the copy will count against its quota)

fixes CNVS-38987

Change-Id: Icbd96268fa0bf5acd93c0d4c247b7bdb19729a84
Reviewed-on: https://gerrit.instructure.com/125049
Tested-by: Jenkins
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2017-09-11 16:21:06 +00:00
Cody Cutrer de29fe9e31 eliminate duplicate rows in provisioning reports due to pseudonyms
fixes CNVS-38846

this also fixes the group memberships report for multi-shard users

test plan:
 * add multiple pseudonyms to a user
 * enroll that user in a course
 * do a provisioning report
 * that user should only have one row per enrollment

Change-Id: Iba2077e52a86182cf79ab83e918125ba7e08fc42
Reviewed-on: https://gerrit.instructure.com/124086
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2017-09-08 21:40:46 +00:00
James Williams 2f24fd67e2 don't touch discussion entry when liking
test plan:
* have a discussion topic with "Allow liking" enabled
* make a discussion entry
* edit the entry
* as another user, like the entry
* it should not change the "edited at" time

closes #CNVS-39056

Change-Id: I6780463544e30333f89ee45f990779c95b23d9db
Reviewed-on: https://gerrit.instructure.com/125191
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Heath Hales <hhales@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2017-09-08 12:21:06 +00:00
Mysti Sadler fd49bcc436 Remove "Courses" from navigation link SR text
closes CNVS-37919
closes GRADE-219

Test plan
- In a course, navigate through the course navigation tabs
- Ensure their link text matches the screenreader text
- On the dashboard, using the dashboard card view, ensure
  the screenreader reads the appropriate text for the
  announcements/discussions/files icon links
- Ensure the mouseover text for the links shows the same

Change-Id: I66a0c88c218ebc186ff0f8d6ca698c2471754fec
Reviewed-on: https://gerrit.instructure.com/124584
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: David Tan <dtan@instructure.com>
Product-Review: Nathan Rogowski <nathan@instructure.com>
Tested-by: Jenkins
2017-09-07 19:55:40 +00:00
Venk Natarajan 608ca627fe Don't show cross-listed courses in an account.
If account B cross lists a section into a course owned by
account A, then the course in account A would show up in account
B's list.  This is not desired -- we only want courses
*actually made within* account B to show up in account B's list.

This will *NOT* fix the analytics routes; the changes needed
to fix that are in a different repository.

Refs CNVS-38415.

Test Plan:
* Have an account with two sub-accounts, call them A and B
* Create a course in each sub account, and put a section in
  the course in account B.
* Publish these courses, and add them to the public index (in
  the settings for each course).
* Crosslist the section in the course in account B into the
  course in account A.
* Go to account B's page and ensure that the course in account
  A is *not* there.
* Also, go to /api/v1/accounts/#/courses for each account and
  check that only courses that *originated* in each account
  show up in the JSON response.

Change-Id: I4db30d8b2228fee37bd53957d200a6a6d0805e7f
Reviewed-on: https://gerrit.instructure.com/124003
Tested-by: Jenkins
Reviewed-by: Mysti Sadler <mysti@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Venk Natarajan <vnatarajan@instructure.com>
2017-09-07 19:45:36 +00:00
James Williams b899b8b5a6 keep wiki page assignment titles in sync on import
test plan:
* with mastery paths enabled, have a page
 configured for mastery paths
* copy it into a course twice
* the page title should not change

closes #CNVS-38968

Change-Id: I1821debae6fc591140575679f70f9538e9a69b10
Reviewed-on: https://gerrit.instructure.com/124899
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Heath Hales <hhales@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2017-09-07 12:42:23 +00:00
Shahbaz Javeed 140f5ec425 add the anonymous_instructor_annotations attribute to assignment
closes GRADE-157

this is currently hidden behind an environment variable until DocViewer
starts consuming this attribute and decides to expose it via a feature
flag

test plan:
* Setup the environment variable ANONYMOUS_INSTRUCTOR_ANNOTATIONS to
  'true'
* Start Canvas
* Go to create an assignment and verify that it contains a checkbox to
  anonymize instructor annotations for the new assignment
* Verify this checkbox works
* Edit the newly created assignment and verify the checkbox labelled
  anonymize instructor annotations always accurately reflects the choice
  made when saving the assignment

* Remove the ANONYMOUS_INSTRUCTOR_ANNOTATIONS environment variable
* Restart Canvas
* Go to create an assignment and verify it no longer contains a checkbox
  to anonymize instructor annotations
* Edit the assignment you created earlier and verify it also no longer
  contains a checkbox to anonymize instructor annotations

Change-Id: Ia43dee5c45ccd151319380e673d70dc509512ca8
Reviewed-on: https://gerrit.instructure.com/123646
Tested-by: Jenkins
Reviewed-by: Derek Bender <djbender@instructure.com>
Reviewed-by: Keith T. Garner <kgarner@instructure.com>
QA-Review: Indira Pai <ipai@instructure.com>
Product-Review: Matt Goodwin <mattg@instructure.com>
2017-09-06 19:47:21 +00:00
Spencer Olson 87e9bad41e add current grade to new gradebook history
closes GRADE-172

Test Plan:
1. Verify the New Gradebook History page results includes a "Current"
   grade column. The current grade should behave in the following ways:
   a) The points possible should be shown if the assignment is currently
      displaying grades as points and the current grade can be parsed as
      a number.
   b) If a current grade is not available (like if the submission has
      been destroyed), the current grade should be displayed as "N/A".

Change-Id: Ie1b753962eec10933be8a3be3829c1e2419a643f
Reviewed-on: https://gerrit.instructure.com/124834
Tested-by: Jenkins
Reviewed-by: Derek Bender <djbender@instructure.com>
Reviewed-by: Jeremy Neander <jneander@instructure.com>
QA-Review: Indira Pai <ipai@instructure.com>
Product-Review: Matt Goodwin <mattg@instructure.com>
2017-09-06 15:43:17 +00:00
James Williams 076fe5a41b fix adminable_accounts and pagination
Change-Id: If5179f631f482e3f8dfcb3ad2fba807c5f070b4b
Reviewed-on: https://gerrit.instructure.com/124940
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2017-09-05 22:55:45 +00:00
James Williams 09c770502f use in_region_associated_shards in some more places
refs #CNVS-38980

Change-Id: I8da10dca766ff0317c9a035b09dd1a0df41a84e6
Reviewed-on: https://gerrit.instructure.com/124882
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2017-09-05 15:56:49 +00:00
James Williams bf75de0bfb restrict editing for group discussion sub-topics
the changes get undone so just restrict editing altogether

test plan:
* have a course with a group set and a group
* create a group discussion topic
* visit the group's copy of the discussion topic
* the edit button should not be visible

closes #CNVS-38840

Change-Id: I278fcd918cf8a8767482ae55acadadc6d4ebee04
Reviewed-on: https://gerrit.instructure.com/124607
Tested-by: Jenkins
Reviewed-by: Venk Natarajan <vnatarajan@instructure.com>
QA-Review: David Tan <dtan@instructure.com>
Product-Review: Matt Goodwin <mattg@instructure.com>
2017-09-05 12:44:52 +00:00
James Williams 0d581a9291 assign group leaders after randomly assigning by section
test plan:
* have a course with a student
* create a group set with a group, marking
 the "automatically assign a student group leader"
* randomly assign students in the groups, marking
 the "require group members to be in same section"
* the group should have a leader

closes #CNVS-38934

Change-Id: Id9867566b1c6ca263817c4484c3b5c3944fc459e
Reviewed-on: https://gerrit.instructure.com/124610
Tested-by: Jenkins
Reviewed-by: Venk Natarajan <vnatarajan@instructure.com>
QA-Review: David Tan <dtan@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2017-09-05 12:44:50 +00:00
Rob Orton 06c5e912d3 only send relevant students to grade calculator
Change-Id: I66299d11d7c1f01e4607b794bfcd6fcefd6025a1
Reviewed-on: https://gerrit.instructure.com/124870
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2017-09-04 19:47:34 +00:00
Jeremy Stanley 9b225c2ac7 check date on submission comments for recent feedback
test plan: submissions more than four weeks old that have comments
that are also more than four weeks old should not appear in a
user's "Recent Feedback".

if you don't have such data available in your sandbox, you
should be able to fake it via the Rails console with something
like this (with a suitable submission object):

 submission.update_attributes(:created_at => 1.year.ago, :updated_at => 1.year.ago)
 submission.submission_comments.update_all(:created_at => 1.year.ago)

fixes CNVS-38820

Change-Id: Iabaa206bbf3c520201748de5adbfbda6c25ac7a6
Reviewed-on: https://gerrit.instructure.com/124552
Tested-by: Jenkins
Reviewed-by: Venk Natarajan <vnatarajan@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Heath Hales <hhales@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2017-09-01 21:27:11 +00:00
Jacob Fugal ddf0f2d9c6 don't pass extra parameters to attachment_fu
when s3 storage is enabled, attachment_fu's url generation is...
finicky. it'll blow up if parameters it's not expecting are present.

test-plan:
- have s3 storage enabled in your environment
- have a file in your user's file area (new or old, doesn't matter, as
  long as it's on s3)
- select the file in the file UI and click the "download" button
- should download the file instead of giving an error

Change-Id: I1a22cdfd095889045ff7e4b7912a617bcdde3d8c
Reviewed-on: https://gerrit.instructure.com/124791
Reviewed-by: Spencer Olson <solson@instructure.com>
Tested-by: Jenkins
Reviewed-by: Andrew Huff <ahuff@instructure.com>
QA-Review: Collin Parrish <cparrish@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
2017-09-01 20:36:21 +00:00
Jonathan Featherstone 68d1fbc138 Run notification failure and bounce in all regions
Test Plan:
  * Specs

closes CNVS-38891

Change-Id: Ide88ebba414b2c42d8fb35c90f47b8ff157bd2e4
Reviewed-on: https://gerrit.instructure.com/124210
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Collin Parrish <cparrish@instructure.com>
Product-Review: Jonathan Featherstone <jfeatherstone@instructure.com>
2017-09-01 19:47:06 +00:00
Derek Bender 38ad7d4392 add mobile_student_label mobile_teacher_state API
This currently does not expose a dropped mobile_teacher_state because
that concept isn't currently exposed in any meaningful way.
See also: GRADE-16

This API is undocumented by design.

closes: GRADE-168

Test Plan
=========

Base Case
---------
- Given an assignment with at least one submission
- When fetching the submissions API:
  `/api/v1/courses/1/assignment/1/submissions`
- Then the fields `mobile_student_label` and `mobile_teacher_state`
  are not present

Mobile Student Label Use Cases
---------------
Resubmitted:
- Given a submission that is resubmitted
- When fetching the submissions API with the string
  'mobile_student_label' in the `include` query parameter:
  /api/v1/courses/1/assignment/1/submissions?include[]=mobile_student_label
- Then the submission JSON includes a field 'mobile_student_label'
  with the value 'resubmitted'

Missing:
- Given an assignment that is past due with no student submission
- When fetching the submissions API with the string
  'mobile_student_label' in the `include` query parameter
- Then the submission JSON includes a field 'mobile_student_label'
  with the value 'missing'

Late:
- Given an assignment that was submitted but was after the due date
- When fetching the submissions API with the string
  'mobile_student_label' in the `include` query parameter
- Then the submission JSON includes a field 'mobile_student_label'
  with the value 'late'

Submitted:
- Given an assignment that has as submission
- When fetching the submissions API with the string
  'mobile_student_label' in the `include` query parameter
- Then the submission JSON includes a field 'mobile_student_label'
  with the value 'submitted'

Unsubmitted:
- Given an assignment without a submission
- When fetching the submissions API with the string
  'mobile_student_label' in the `include` query parameter
- Then the submission JSON includes a field 'mobile_student_label'
  with the value 'unsubmitted'

Mobile Teacher State Use Cases
---------------
Excused:
- Given an assignment with an excused submission
- When fetching the submissions API with the string
  'mobile_teacher_state' in the `include` query parameter:
  /api/v1/courses/1/assignment/1/submissions?include[]=mobile_teacher_state
- Then the submission JSON includes a field 'mobile_teacher_state'
  with the value 'excused'

Needs Review:
- Given a quiz with an essay question that needs review and student
  submission for said quiz
- When fetching the submissions API with the string
  'mobile_teacher_state' in the `include` query parameter
- Then the submission JSON includes a field 'mobile_teacher_state'
  with the value 'needs_review'

Needs Grading:
- Given an assignment submission that hasn't yet been graded
- When fetching the submissions API with the string
  'mobile_teacher_state' in the `include` query parameter
- Then the submission JSON includes a field 'mobile_teacher_state'
  with the value 'needs_grading'

Graded:
- Given an assignment submission that has been graded
- When fetching the submissions API with the string
  'mobile_teacher_state' in the `include` query parameter
- Then the submission JSON includes a field 'mobile_teacher_state'
  with the value 'graded'

nil:
- Given an assignment submission that has been graded
- When fetching the submissions API with the string
  'mobile_teacher_state' in the `include` query parameter
- Then the submission JSON includes a field 'mobile_teacher_state'
  with the value null

Also test with quiz submission

Change-Id: Icbc784b47ecc3baecb770703a9515b52b326e347
Reviewed-on: https://gerrit.instructure.com/123007
Reviewed-by: Spencer Olson <solson@instructure.com>
Tested-by: Jenkins
Reviewed-by: Shahbaz Javeed <sjaveed@instructure.com>
QA-Review: Taylor Wilson <twilson@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
2017-08-31 23:18:14 +00:00
Cody Cutrer 8cc1612f61 remove 4 year old backcompat query
so that we can get the performance improvements of the new one

Change-Id: I4a578f15138c649a84e8c347010bce07a455769c
Reviewed-on: https://gerrit.instructure.com/124684
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2017-08-31 21:09:39 +00:00
Rob Orton ecf3442f62 cleanup error files after progress is completed
also remove previous imports before error file

fixes CNVS-38952

test plan
 - sis imports should work

Change-Id: I1aff19d5eb9b59d3867b17fe270004dd57fb5ea9
Reviewed-on: https://gerrit.instructure.com/124593
Tested-by: Jenkins
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2017-08-31 19:24:43 +00:00
James Williams 23fd0bfd96 fix zip file exports with files over 64kb
test plan:
* have a course with multiple files with
 one of them being larger than 64kb
* select the files and download them as a zip
* unzip the zip file
* the large file should not be corrupted

closes #CNVS-38873

Change-Id: I4e8d3eca18c9c9591dc30a89ba4b48904e32ec8c
Reviewed-on: https://gerrit.instructure.com/124601
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: David Tan <dtan@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2017-08-31 14:14:52 +00:00
Cody Cutrer 6e0db65576 add index specifically supporting Submission.needs_grading
Change-Id: I9718a6f931f586b43c45f5505d0c6877eb3605ac
Reviewed-on: https://gerrit.instructure.com/124526
Reviewed-by: Tyler Pickett <tpickett@instructure.com>
Tested-by: Jenkins
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2017-08-30 21:30:04 +00:00
wdransfield da9819e5c6 Add global navigation for sub-accounts
Closes PLAT-2769

Test Plan:

An Instructure owned (since we don't officially support
this placement) LTI tool installed at the sub-account
level that uses the global_navigation placement should
only appear when viewed in each of the following situations:

1) Any admin that belongs directly to that sub-account,
   or one of its children
2) Any user that is enrolled in a course in that
   sub-account, or one of its children
3) Any root account admin that is viewing that
   sub-account, or one of its children
4) Any root account admin that is viewing a course that
   belongs to that sub-account, or one of its children

This means that if a user is enrolled in a subaccount they
should always see tools for the root account + sub account
in the global navigation, no matter what context they
are currently viewing.

- Visit pages that have not context (like profile settings)
  and verify proper global navs are displayed.

Change-Id: Ib26de86a51ce8a2cffb15074d9d785834148ef1f
Reviewed-on: https://gerrit.instructure.com/122701
Reviewed-by: Andrew Butterfield <abutterfield@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Nathan Mills <nathanm@instructure.com>
Tested-by: Jenkins
Product-Review: Jesse Poulos <jpoulos@instructure.com>
2017-08-30 20:18:44 +00:00
Cody Cutrer 53c4757629 don't query every assignment in the database when duping an assignment
Change-Id: Iffb1ec70cbaa33d7963cb951ed8ccf60c558217e
Reviewed-on: https://gerrit.instructure.com/124516
Reviewed-by: Venk Natarajan <vnatarajan@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
Tested-by: Jenkins
2017-08-30 20:16:38 +00:00
Xander Moffatt 722177e98b wrap authenticated_s3_url in a facade for InstFS
* replace authenticated_s3_url with authenticated_url
* InstFS JWT secret is always used as decoded base64

closes CNVS-38592

test plan: specs

Change-Id: Ic075a32a82534940bcb650d38bebd003bf727b66
Reviewed-on: https://gerrit.instructure.com/124228
Tested-by: Jenkins
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Xander Moffatt <xmoffatt@instructure.com>
QA-Review: Xander Moffatt <xmoffatt@instructure.com>
2017-08-30 19:41:58 +00:00
wdransfield 80e161acde Globalize developer key lookup by vendor code
Closes PLAT-2806

Test Plan:
- Create a developer key in your local site admin
  account and set the vendor code.
- Associate a tool consumer profile with
  restricted capabilities with this developer key.
- In an account on a different shard than the
  site admin account attempt to install a tool
  that uses restricted capaibilties and uses
  the developer key from the site admin account.
- Verif the tool instsalls.

Change-Id: I98d2b8c9227dfe826f87d90e21b1d25027f0d9f2
Reviewed-on: https://gerrit.instructure.com/124297
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Tested-by: Jenkins
Product-Review: Weston Dransfield <wdransfield@instructure.com>
2017-08-29 19:44:34 +00:00
James Williams d6affd926d master courses: use a separate table for tracking import results
may or may not alleviate locking problems on the
master migration object when dealing with way too many
child courses

test plan:
* syncing and viewing exceptions should work as before

closes #CNVS-38849

Change-Id: I5b2bb4d16f7d8e659f35458195b74a52a2982ca0
Reviewed-on: https://gerrit.instructure.com/124158
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2017-08-29 18:04:21 +00:00
August Thornton 2f6ac55d87 only find tools with active workflow_state
fixes PLAT-2803

test plan:
• install an lti 1 tool in an account and course context
• launch that tool and copy the launch URL used
• delete that tool
• launch to the url copied above and verify flash error along the lines of:
  "Couldn't find valid settings for this tool"

Change-Id: Ie8089f8b97bce0027ac4f1f1eb34dc1f29324712
Reviewed-on: https://gerrit.instructure.com/124272
Tested-by: Jenkins
Reviewed-by: Andrew Butterfield <abutterfield@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Product-Review: August Thornton <august@instructure.com>
2017-08-29 16:44:08 +00:00
Rob Orton 01922d15ad should remove batch enrollments under threshold
fixes CNVS-38903

test plan
 - run batch mode enrollment importer that would
   remove less than a set threshold
 - it should remove them

Change-Id: Ife0f74673826a411394d02747c1dc738efbd2c73
Reviewed-on: https://gerrit.instructure.com/124288
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Tested-by: Jenkins
2017-08-29 16:17:43 +00:00
James Williams 7ec5084fa4 don't show creation_pending in future list if disallowed
test plan:
* have an account with students restricted from viewing
 future courses and restricted from seeing future courses
 in the enrollments list
* have a student added to an unpublished course
* they should not be able to see the course
 in their "/courses" list

closes #CNVS-38833

Change-Id: If02ad835861f3d6f4ebc05731bb8a0c8c38e93db
Reviewed-on: https://gerrit.instructure.com/123968
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Heath Hales <hhales@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2017-08-28 20:50:26 +00:00
Shahbaz Javeed e966615880 ensure graded assignments aren't gradable after removal from overrides
closes GRADE-124

test plan:
* Create a differentiated assignment
* Submit the assignment from two students
* Assign grades to all but one student
* Unassign the assignment from a graded student and the ungraded
  student
* Go back to gradebook
* Verify that the cell for the graded student is grayed out and not
  editable
* Verify that the cell for the ungraded student is grayed out and
  not editable

Change-Id: I93c9a2f4dec0888d56ba39682bc2184196f25bba
Reviewed-on: https://gerrit.instructure.com/122731
Reviewed-by: Spencer Olson <solson@instructure.com>
Reviewed-by: Matt Taylor <mtaylor@instructure.com>
QA-Review: KC Naegle <knaegle@instructure.com>
Tested-by: Jenkins
QA-Review: Anju Reddy <areddy@instructure.com>
Product-Review: Matt Goodwin <mattg@instructure.com>
2017-08-28 15:56:43 +00:00
James Williams cdcda70806 master courses: sync deletions in quiz questions
test plan:
* have a quiz in a blueprint course
* sync the quiz to an associated course
* delete a quiz question on the blueprint side
* re-syncing should delete the associated question
 as well (unless the associated quiz has been
 changed)

closes #CNVS-38704

Change-Id: Ib4de42f0ceb0d6d434db58bfdbc3605f63976d86
Reviewed-on: https://gerrit.instructure.com/123520
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: David Tan <dtan@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2017-08-28 15:26:42 +00:00
Jon Willesen ee3461b4e2 Revert "unify SR course nav labels"
This reverts commit 639e3899d2.

The above commit removed the screenreader field that's being used by
the dashcards interface. See CNVS-37921.

fixes CNVS-38600

test plan:
* make sure the actions hover text and screenreader text show and read
  the proper strings.

Change-Id: If97203a21274563e8894c3593a66ae4d3960a395
Reviewed-on: https://gerrit.instructure.com/123982
Tested-by: Jenkins
Reviewed-by: Aaron Kc Hsu <ahsu@instructure.com>
QA-Review: Dan Sasaki <dsasaki@instructure.com>
Product-Review: Jon Willesen <jonw+gerrit@instructure.com>
2017-08-25 17:04:08 +00:00
James Williams 44b82f567a fix group assignment by section with more groups than students
test plan:
* have a course with a student
* create a group set with two groups
* randomly assign students, checking the
 box to require members to be in same section
* it should work

closes #CNVS-38813

Change-Id: I56a64aff1355c6d61160cd14911c0c5c4dc965a2
Reviewed-on: https://gerrit.instructure.com/123810
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2017-08-25 16:30:04 +00:00
James Williams 94a72d26b4 create submission comment mail replies on correct shard
closes #CNVS-38755

Change-Id: I4c2f12d247f9b569368f4fad21581080a1025f5b
Reviewed-on: https://gerrit.instructure.com/123970
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2017-08-25 15:12:07 +00:00
Cody Cutrer c7bd22d89c clear turnitin_id when duplicating assignment
fixes CNVS-38030

test plan:
 * set up an assignment to use turnitin (old way?)
 * actually submit something to the assignment, and have jobs running
   (to ensure the assignment's turnitin id gets generated)
 * duplicate the assignment
 * it should not error

Change-Id: I4737b09d743371e080e1429f28f3e8245d3f4c09
Reviewed-on: https://gerrit.instructure.com/123164
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Robert Lamb <rlamb@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2017-08-24 21:07:24 +00:00
Cody Cutrer d9c31d0607 force submission touching during assignment import to use slave
avoids a less-than-ideal query plan on large dbs

Change-Id: Ifef15fd1232323d42abb42b5f4f67114c52a8bd8
Reviewed-on: https://gerrit.instructure.com/123835
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2017-08-24 21:06:03 +00:00
James Williams a0fbb1ab3d cache progression and item visibility data on courses
so we don't constantly refetch the same data when running
progressions

test plan:
* module progressions with assignment overrides
 should work as before

closes #CNVS-38735

Change-Id: If85cb5f6d736eaebdcd84a5e16fcf1b243ec42aa
Reviewed-on: https://gerrit.instructure.com/123268
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Heath Hales <hhales@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2017-08-24 16:46:26 +00:00
James Williams 086a3f7bbe default to looking for existing tools on cc import
test plan:
* have a common cartridge package with an LTI tool
* set up an LTI tool on the account-level that
 matches the url/settings of the course tool to be imported
* import the package into a course
* it should not create a new course-level tool but
 use the account-level tool instead

closes #CNVS-38453

Change-Id: Ic54f462f120026460d07619fba3546fdc65fc516
Reviewed-on: https://gerrit.instructure.com/123525
Tested-by: Jenkins
Reviewed-by: Jon Willesen <jonw+gerrit@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2017-08-23 21:00:57 +00:00
James Williams bcfd08c865 master courses: don't restore deleted items unless locked
test plan:
* have a blueprint course and an associated course
* add an item (assignment/page/etc) to a
 blueprint course
* sync it over
* delete the copy in the associated course
* make a change to the original item and resync
* it should not restore the deleted copy

* lock the original item and resync
* it should restore the copy

closes #CNVS-38776

Change-Id: I5bc34d61a804deced31439f1be380a43c90c4096
Reviewed-on: https://gerrit.instructure.com/123652
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Heath Hales <hhales@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2017-08-23 19:48:38 +00:00
James Williams 5636abbdcb requeue job in build_media_object if progress is finished
refs #CNVS-38786

Change-Id: I15b829bf4a8baef53d89d2478423557bfdc5ae53
Reviewed-on: https://gerrit.instructure.com/123649
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2017-08-23 19:15:35 +00:00
Cody Cutrer 18111c6188 allow any printable character in usernames
fixes CNVS-38343

test plan:
 * do a SIS import of a user with a non-ASCII character as part of
   their username
 * ensure you can login and generally use Canvas as this user
 * do a SIS provisioning report; make sure it works
 * do people with single and double quotes in their usernames
 * ensure that things generally work correctly, and are properly
   escaped in reports

Change-Id: Ib1ec679dcf373c3b09ba893c69b9695b7e1475a6
Reviewed-on: https://gerrit.instructure.com/123197
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2017-08-23 18:55:27 +00:00
Nick Houle a757d32301 Allow assignment to save w/ post_to_sis unchecked
Fixes: SIS-2912 and SIS-2915

Test plan:
- Enable SIS feature options
- Navigate to a course
- Confirm you can create an assignment with post_to_sis checked
- Confirm you can create an assignment without post_to_sis
  checked
- Edit the assignment
- Check post_to_sis and add a due date for Everyone Else
- Confirm the assignment saves

Change-Id: I921343525713747e3a1fb7a0242ae62826c163f8
Reviewed-on: https://gerrit.instructure.com/122693
Reviewed-by: Michael Brewer-Davis <mbd@instructure.com>
Product-Review: Brad Humphrey <brad@instructure.com>
Tested-by: Jenkins
QA-Review: Mark McDermott <mmcdermott@instructure.com>
2017-08-23 16:06:46 +00:00
Xander Moffatt 4bf115297c add endpoint for InstFS capture
* reject if InstFS is disabled
* requires JWT from InstFS to access
* creates attachment from metadata given by service

closes CNVS-38590

test plan: specs

Change-Id: I0726beb1d0c368414e5dffc899ea70190c9caa10
Reviewed-on: https://gerrit.instructure.com/123349
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins
Product-Review: Xander Moffatt <xmoffatt@instructure.com>
QA-Review: Xander Moffatt <xmoffatt@instructure.com>
2017-08-22 23:58:48 +00:00
Rob Orton c556921de2 don’t use cleanup batch for non batch data types
fixes CNVS-38694

test plan
 - sis imports should run

Change-Id: Iefb4a5de1d3ea33ca9897184cd986ca4f6f5dee1
Reviewed-on: https://gerrit.instructure.com/122915
Tested-by: Jenkins
Reviewed-by: Tyler Pickett <tpickett@instructure.com>
QA-Review: Tucker McKnight <tmcknight@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2017-08-22 22:23:34 +00:00
Simon Williams affa953f61 drop Message#asset_context and DelayedNotification#asset_context
name did not match usage, and all remaining usage can be satisfied in
other ways.

closes CNVS-38407

test plan: regression test message sending (immediate, delayed, and
dashboard notifications w/ stream items)

Change-Id: Ibe110527b4644cbaa417c53b2b53c2fd7e18dc9e
Reviewed-on: https://gerrit.instructure.com/120520
Tested-by: Jenkins
QA-Review: Heath Hales <hhales@instructure.com>
Reviewed-by: Matt Smith <msmith@instructure.com>
Reviewed-by: Benjamin Christian Nelson <bcnelson@instructure.com>
Reviewed-by: Jon Willesen <jonw+gerrit@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2017-08-22 17:47:51 +00:00
Cody Cutrer ffa1432419 fix localization of help links
fixes CNVS-37038

test plan:
 * _before_ you check out this patchset
 * enable help links (`Setting.set("show_feedback_link", "true")`)
 * go to account settings, and add a custom help link
 * checkout this change, and run migrations
 * change your language
 * the default help links in both your menu and on the settings page
   should be translated now; the custom one won't magically translate
   itself
 * remove a default help link and save
 * add it again and save
 * it should still be translated
 * change your language again for good measure

Change-Id: Ie8d2fb504814aa227383b68ee1d8b5387e166f77
Reviewed-on: https://gerrit.instructure.com/123316
Tested-by: Cody Cutrer <cody@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2017-08-22 15:41:28 +00:00
wdransfield 7464d9fb31 Handle multiple tool on the page when resizing
Closes PLAT-2738

Test Plan:
- Install two lti tools that use the new
  'com.instructure.PostMessageToken' variable expansion.
- Visit a page with two LTI tools launched (this happens when
  launching a tool in a course that has chat enabled).
- Have one tool send a resize post message and verify the correct
  tool is resized. The post message should include the token
  for the value of 'token':

  <script type="text/javascript">
   parent.postMessage({
      subject: 'lti.frameResize',
      height: 12000,
      token: '<%= @wrapper_id %>'
   }, '*');
  </script>

- Verify the proper tool is resized.

Change-Id: Ie7e976c5cd53ef5c61cd86c471ba416045a0fb68
Reviewed-on: https://gerrit.instructure.com/119858
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Andrew Butterfield <abutterfield@instructure.com>
Tested-by: Jenkins
Product-Review: Weston Dransfield <wdransfield@instructure.com>
2017-08-18 16:30:28 +00:00
Rob Orton 2213f333ca don’t touch observer when skip_touch_user is true
fixes CNVS-38431

test plan
 - specs should pass

Change-Id: Id1bb379a0b7c7c11a78d33a9df1859529d05f25a
Reviewed-on: https://gerrit.instructure.com/123217
Tested-by: Jenkins
Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
2017-08-18 15:53:10 +00:00
Venk Natarajan dcc77a596f Don't show "new feedback" if already seen.
This changes things so that submissions are considered "read" if
the student clicks on an attempt or submission.  Then in the
planner API, we only mark those items that are *not* read as
having "recent" feedback.  This has the effect of no longer
showing the "New Feedback" pill if the student has seen the
assignment/quiz since the last time it was graded (if an
assignment gets graded again, the submission already gets
marked unread, so the "new feedback" pill will return").

Fixes FALCOR-536.

Test Plan:
* Ensure you have https://gerrit.instructure.com/#/c/123039/
* Create a quiz and assignment.
* Have a student take it.
* At this point, in planner, "New Feedback" should not appear.
* Now have it be graded, and make sure to leave some comments.
* Now the pill should appear.
* As the student, go back to the quiz/assignment pages and then
  click on the most recent attempt or submission.
  This should also work from the "grades" tab, and then clicking
  on the assignment/quiz from in there.
* The "New Feedback" and "New Grades" pill should now be gone in
  planner.

Change-Id: I043e64517b8a0873576183800ff67d09161139b7
Reviewed-on: https://gerrit.instructure.com/122740
Tested-by: Jenkins
Reviewed-by: Dan Minkevitch <dan@instructure.com>
QA-Review: David Mirabile <dmirabile-c@instructure.com>
Product-Review: Christi Wruck
2017-08-17 23:32:26 +00:00
Cody Cutrer e740c5f127 fix non-TLS LDAP auth
refs CNVS-38593

Change-Id: I4fafddabb19be4026d73442b9c83ec3e81a920c5
Reviewed-on: https://gerrit.instructure.com/123130
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2017-08-17 18:41:41 +00:00
wdransfield ec630644cf Make originality report launch borderless
Closes PLAT-2765

Test Plan:
- Create an originality report that does an
  lti launch.
- Click on an originality report and verify the
  launch is borderless.

Change-Id: I449b3626b37713317248d313d22163faa38dd517
Reviewed-on: https://gerrit.instructure.com/122985
Tested-by: Jenkins
Reviewed-by: August Thornton <august@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Weston Dransfield <wdransfield@instructure.com>
2017-08-17 18:30:38 +00:00
Stephen Jensen 2a3ce8b912 New Masquerade Modal implementation
Closes: CNVS-38417

Test Plan:
- Navigate to the following places where masquerading
  occurs
  * Courses/People (Selecting 'Act as User' through Student
  	Context Tray)
  * Courses/People (Selecting User Details from the drop
  	down menu and selecting 'Act as User')
  * Admin/Users (Select the user then select 'Act as User')
  * Groups/People (Select the user, then select 'User Account
  	Details' then 'Act as User')
  * Any other obscure locations where you can masquerade
- In each above location, selecting 'Act as User' will open
  a modal with a panda/mask animation
- You should see a table with user information, verify
  that these details are correct
- Within the modal, selecting 'Proceed' should cause
  a loading spinner to appear briefly. Then you should
  be taken to the student masquerade view which should
  behave as it did before.

Change-Id: I671c6892a5dd3d5a00bf6f524f5e9de1a0b71ea3
Reviewed-on: https://gerrit.instructure.com/120638
Reviewed-by: Pam Hiett <phiett@instructure.com>
QA-Review: Dan Sasaki <dsasaki@instructure.com>
Tested-by: Jenkins
Product-Review: Colleen Palmer <colleen@instructure.com>
2017-08-17 15:12:27 +00:00
Rob Orton b8ed33e735 should run provisioning report for cross shard data
fixes CNVS-38695

test plan
 - provisioning report should run

Change-Id: Ibb2e3b82aaa4b9da922eb850d4001a65cb42f232
Reviewed-on: https://gerrit.instructure.com/122953
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Tested-by: Rob Orton <rob@instructure.com>
2017-08-17 00:02:29 +00:00
Cody Cutrer e0dd51faa6 explicitly don't verify LDAPS certificates
fixes CNVS-38593

an updated net-ldap gem changed these defaults

test plan:
 * do an LDAP test against an LDAP server that uses SSL
 * it should work

Change-Id: I9519033ee45cdceb7dda356a18c497c1615a091b
Reviewed-on: https://gerrit.instructure.com/122785
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Tucker McKnight <tmcknight@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2017-08-16 19:50:18 +00:00
James Williams a463c4fc23 don't create migration issues for unreplaced link placeholders
if we sanitized away a link then don't make a confusing
migration issue

closes #CNVS-38688

Change-Id: I2129af0b459db52130f9204aa5f0b92fadaf23d7
Reviewed-on: https://gerrit.instructure.com/122782
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2017-08-16 19:22:41 +00:00
James Williams efc777277d don't delete manually created module items on re-import
test plan:
* create a module in a blueprint course
* sync to an associated course
* add a module item in the associated course

* change the module name in the blueprint
* sync to the associated course
* the moddule items in the associated course
 should not have been deleted

closes #CNVS-38655

Change-Id: I98127f54f72042e8a69b4ecc06a472ea73239745
Reviewed-on: https://gerrit.instructure.com/122933
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: David Mirabile <dmirabile-c@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2017-08-16 19:13:38 +00:00
Tyler Pickett f319f1f77f Run some async callbacks in process during course imports
Fixes: CNVS-38676

This was causing a storm of jobs and tons of duplicate advisory locks
during the import process, both of these things are unnecessary since
we're already in a background job.

Test Plan:
- Course Content Migrations still work
- There should be fewer jobs spawned during content migrations/imports

Change-Id: Ia29e2d4ba00a3f982404b834061822cae32e5364
Reviewed-on: https://gerrit.instructure.com/122763
Tested-by: Jenkins
Reviewed-by: James Williams  <jamesw@instructure.com>
Product-Review: Tyler Pickett <tpickett@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
2017-08-16 16:28:10 +00:00
Tyler Pickett 77869467b2 Stop submissions from circularly updating assignments
Fixes: CNVS-38667

When Assignment#update_submissions is being called it's triggering
Submission#update_assignment to be called without indicating that we
don't need to update the assignment again, this patch fixes that so the
assignment update won't be circular.

Test Plan:
- Stuff still works

Change-Id: I7deb87081725396fa3cfebda25605238b9614a57
Reviewed-on: https://gerrit.instructure.com/122624
Reviewed-by: Neil Gupta <ngupta@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Reviewed-by: Michael Brewer-Davis <mbd@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Tyler Pickett <tpickett@instructure.com>
2017-08-16 15:55:45 +00:00
Jeremy Stanley 030c2f422f password reset tokens expire after two hours (configurable)
test plan:
 - click "Forgot password" on the login screen and enter
   a valid login for a user
 - the reset password link sent to the user should work
   as expected (you can use /users/X/messages as an admin
   in a separate browser to get the link for testing purposes)
   - after the password is reset, you should be returned to the
     login screen with a flash message indicating your password
     was reset.
 - click "Forgot password" again, but wait > 2 hours
   before trying to use the reset-password link
   (or change the timeout by using the console to, e.g., 5 minutes:
    Setting.set('password_reset_token_expiration_minutes', '5')
    Note that this expiration applies only to password resets
    requested after the setting is changed.)
 - you should get a message indicating the code is no longer
   valid

fixes CNVS-2757

Change-Id: I6c3beec9a5b59e089997c46d518645357eec3b08
Reviewed-on: https://gerrit.instructure.com/119868
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Heath Hales <hhales@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2017-08-15 17:08:19 +00:00
Simon Williams 3dadfdba88 add from_name to CommMessage api
closes CNVS-38354

test plan:
- hit the CommMessages api
- it should return `from` and `from_name`

Change-Id: Ie06a09e778a3f0098a1ae80cd5bfc237014715bb
Reviewed-on: https://gerrit.instructure.com/120316
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2017-08-15 15:47:22 +00:00
Simon Williams 48b208c743 mark content imports as expired after X days
closes CNVS-38163

test plan:
- run Setting.set('content_migrations_expire_after_days', '1')
- create some content imports if you don't already have any
- ContentMigration.where(id: ContentMigration.last.id).
    update_all(created_at: 2.days.ago)
- visit the course content import page
- it should show as unavailable

Change-Id: I0491a1f1e292c0d9ded2ca202bd2cd997839a4bf
Reviewed-on: https://gerrit.instructure.com/118714
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2017-08-15 03:29:19 +00:00
Nathan Mills 8960204434 lti 2.1 certification changes
update the ims-lti gem with the new re-registration service name
remove the OAUTH2 algorithim for the security profile
support OAuth2 for re-registration

fixes PLAT-2721, PLAT-2722

test plan:
LTI2 launches should still work
re-registration should work with OAUTH2 now
the tool consumer profile shouldn't have an algoritim specified for
the OAUTH2 WS security profile

Change-Id: I00d3600da3296ab24d361c31b0599b93f96e715c
Reviewed-on: https://gerrit.instructure.com/118978
Tested-by: Jenkins
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Nathan Mills <nathanm@instructure.com>
2017-08-15 00:03:45 +00:00
James Williams 1c516e9eb7 master courses: allow generated quiz questions when locked
test plan:
* create a question bank in a blueprint course
 with a multiple choice question
* create a quiz with a quiz group linked to
 the question bank
* lock the quiz
* sync to an associated course
* should be able to preview and take the quiz
 and have answers scored

closes #CNVS-38629

Change-Id: Iab770823411ad68dcf293ba2dc53c08bdce729f0
Reviewed-on: https://gerrit.instructure.com/122571
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: David Mirabile <dmirabile-c@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2017-08-14 16:12:06 +00:00
James Williams d11450e8fb master courses: ignore deleted courses in account page counts
test plan:
* add an associated course to a blueprint course
* delete the associated course
* the accounts index shouldn't say "1 associated course"

closes #CNVS-38562

Change-Id: Ifac1b8e999f2cce76585f09ec5964ba189fac105
Reviewed-on: https://gerrit.instructure.com/122436
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: David Mirabile <dmirabile-c@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2017-08-14 15:37:38 +00:00
James Williams 5418ceed1f create stream items in slices
Change-Id: I4421d13c6905265f8565d16fd6ca001ba86f3f32
Reviewed-on: https://gerrit.instructure.com/122444
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2017-08-14 14:46:57 +00:00
Spencer Olson 1e838fce6f fix stale grading_period_id on submissions
When 1) a grading period is deleted, or 2) a grading period's start
or end date changes, we now update the cached grading_period_id on
submissions in the course.

closes GRADE-177

Test Plan:

1. At the account level, create two grading periods. For simplicity
   sake, let's make them full-year 2016 and 2017.
2. Create a course under that account with at least one student, and
   create an assignment without a due date.
3. Enter a rails console and verify the submissions created for the
   assignment have the grading period id for grading period "2017".

   assignment = course.assignments.find(<the-assignment-id>)
   submission = assignment.submissions.find_by(user_id: <a-student-id>)
   submission.grading_period_id # should match the id for "2017" period

4. Update the "2017" grading period so that its start date is Jan 1,
   2015, and its end date is Dec 31, 2015.
5. Enter a rails console and verify the submission from step 3 has had
   its grading_period_id updated to reflect the id for grading period
   "2016".

   submission.reload.grading_period_id # should match the id for "2016"

6. Delete the "2016" grading period (so that the only the "2017" grading
   period remains, whose dates span Jan-Dec of 2015).
7. Enter a rails console and verify the submission from step 3 has had
   its grading_period_id updated to reflect the id for grading period
   "2017".

   submission.realod.grading_period_id # should match the id for "2017"

Change-Id: Ideec6a1f22801593eaaa94e829b68dfc95f170e8
Reviewed-on: https://gerrit.instructure.com/122295
Reviewed-by: Neil Gupta <ngupta@instructure.com>
Tested-by: Jenkins
Reviewed-by: Jeremy Neander <jneander@instructure.com>
QA-Review: KC Naegle <knaegle@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
2017-08-14 14:43:30 +00:00
James Williams b8eb9b04d2 call translated license names in a lambda
Change-Id: Ibdbca9847de64e79f472df8d3ff886e3b9c4a4ba
Reviewed-on: https://gerrit.instructure.com/122503
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2017-08-14 13:03:04 +00:00
Rob Orton 570d1b32a3 use distinct instead of uniq
refs CNVS-38622

Change-Id: I4b25d337f79a81a0a2829eea05d0690252fd620c
Reviewed-on: https://gerrit.instructure.com/122560
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2017-08-13 23:05:48 +00:00
James Williams c5d2e625db create wiki pages directly on contexts
Change-Id: I2139b75e78b02fba2232cc78ccce527b20eea3da
Reviewed-on: https://gerrit.instructure.com/122325
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2017-08-11 20:46:17 +00:00
James Williams 858f509d54 spec: don't recreate roles on every spec
also remove a method that doesn't do anything

should make things faster maybe?

Change-Id: Ie3849b6faa539317338c6f55a0f7be86b8a20c3d
Reviewed-on: https://gerrit.instructure.com/122440
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2017-08-11 20:34:30 +00:00
Rob Orton f5d19cb690 use distinct instead of uniq
fixes CNVS-38622

Change-Id: Ic024761a34dea2b1e3eeaea9cb03eaeffa127bb4
Reviewed-on: https://gerrit.instructure.com/122372
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Tucker McKnight <tmcknight@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2017-08-11 17:53:21 +00:00
James Williams 4b9838eba0 preload content tags in course progress
Change-Id: Ic66c2b859214bc9ab3f09f873f4deb2deab2637f
Reviewed-on: https://gerrit.instructure.com/122131
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2017-08-11 17:45:47 +00:00
Simon Williams f9d0cb4e7e optimize scheduler notifications
don't need to serialize a whole user AR object just for a name

closes CNVS-38377

test plan: make sure all scheduler notifications from appointment groups
still work

Change-Id: Ie2343b90ec189ca30ce9ae2f9dd35a529e57d9ff
Reviewed-on: https://gerrit.instructure.com/120519
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
Tested-by: Jenkins
2017-08-11 17:41:54 +00:00
Simon Williams 9a49b30067 a few more optimizations to CourseProgress#to_json
this will help speed up ContextModuleProgression#evaluate a bit more.

test plan: basic regression test of evaluate (tests should pass)

Change-Id: Id85c6c182a59b4f6afeb91e6a52137fd75d9518d
Reviewed-on: https://gerrit.instructure.com/122169
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
2017-08-10 17:26:40 +00:00
James Williams 7ec22a0289 bump rails 5.1
Change-Id: Id0e0ad36c03cb52eb9ec158318a456386b169679
Reviewed-on: https://gerrit.instructure.com/122209
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2017-08-09 20:52:53 +00:00
Cody Cutrer 6ddafb386b fix explicit pseudonym<->auth provider linking for LDAP
Change-Id: Ic7a9d0e511ec93ebd0550aeb6c4d5d3290db47c4
Reviewed-on: https://gerrit.instructure.com/121948
Tested-by: Jenkins
Reviewed-by: Tyler Pickett <tpickett@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2017-08-09 17:28:21 +00:00
Brian Park 8d72bb26f1 fix regraded submissions not getting late policy applied
fixes: GRADE-3

depends-on: GRADE-133

Test Plan:
1. As teacher/admin, navigate to Gradezilla
2. Set up a late policy
3. Find or locate a late submission
4. Grade the late submission
  - Observe late penalty is applied
5. Re-grade the submission as its adjusted grade, e.g.:
  - 90/100 is penalized to 80/100
  - submission is regraded as 80/100
6. Observe the late deduction is applied to the new grade
7. Repeat 3-6 with SpeedGrader, Submission Details Page

Change-Id: I392e5adeeef9354f7a8953f267d13b984b048530
Reviewed-on: https://gerrit.instructure.com/121200
Tested-by: Jenkins
Reviewed-by: Keith T. Garner <kgarner@instructure.com>
Reviewed-by: Jeremy Neander <jneander@instructure.com>
QA-Review: Indira Pai <ipai@instructure.com>
Product-Review: Matt Goodwin <mattg@instructure.com>
2017-08-09 17:27:02 +00:00
James Williams 45147e0911 bypass the wiki model as much as possible for wiki_pages
Change-Id: I60ec3b519219fcb5256a132c05f63538600df73f
Reviewed-on: https://gerrit.instructure.com/121760
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2017-08-09 16:09:06 +00:00
James Williams 39412c857e master courses: avoid unnecessary child tag creation errors
use content_tag_for on creation so we can populate the
@content_tag_index for reuse in the migration

closes #CNVS-38017

Change-Id: Ia1b9fd773f55b4e3dcd068c740896ff0ec6d43e0
Reviewed-on: https://gerrit.instructure.com/122108
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2017-08-09 15:29:39 +00:00
James Williams 3fd266c774 fix n+1 loading of module object visibility in course progress
Change-Id: Ic20d7c2c814217ff777427f4e3da6a82d5ea5c0d
Reviewed-on: https://gerrit.instructure.com/122113
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2017-08-09 14:43:29 +00:00
Cody Cutrer 329930ea08 return canvas and LDAP users to their login screen when logging out
fixes CNVS-38441

test plan:
 * configure CAS as a primary auth provider
 * add and login as a Canvas auth user
 * when you logout, it should return you to /login/canvas, not to the
   CAS server

Change-Id: I9d839b7efdc81f307adfbd6d3c128faee64361d4
Reviewed-on: https://gerrit.instructure.com/121054
Tested-by: Jenkins
Reviewed-by: Tyler Pickett <tpickett@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2017-08-08 21:25:44 +00:00
Cody Cutrer 353bf2ec16 add first class support for the UK Federation
fixes CNVS-38446

refactor InCommon to be a common base class for both, and in our
special casing of InCommon refactor to iterate the children
classes

test plan:
 * add a SAML config with either InCommon or UK Federation special
   metadata URIs, and a valid entity ID for a school that's part of
   one or the other
 * the rest of the metadata should populate without error

Change-Id: Ie2d37e942cc35333ee16d1f0b3cbb2dc81f53767
Reviewed-on: https://gerrit.instructure.com/121421
QA-Review: Tucker McKnight <tmcknight@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Jenkins
Product-Review: Cody Cutrer <cody@instructure.com>
2017-08-08 20:26:52 +00:00
Mysti Sadler fd6495fd87 Add new_activity tag to planner item json
refs FALCOR-544
refs FALCOR-539

Test plan
- Create some grading items and some discussions/announcements
- Ensure they are not showing up with the new_activity flag
- in the API yet
- Ensure they do not show new_activity for submissions
- Grade or add feedback to the grading items
- Reply to the discussion/announcements
- Ensure that the api now does show new_activity

Change-Id: I8cf448c3296c21057aba9a9006b8efd8044986bd
Reviewed-on: https://gerrit.instructure.com/120658
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: David Mirabile <dmirabile-c@instructure.com>
Product-Review: Christi Wruck
2017-08-08 20:18:12 +00:00
Spencer Olson 3f0380d701 grade details tray: wire up radio options
closes CNVS-32373
closes CNVS-37561

Test Plan:
1. Start a rails server with GRADEBOOK_DEVELOPMENT enabled. Navigate to
   the New Gradebook as a teacher.
2. Set up a late policy and a missing policy.
3. Open the Grade Details Tray for a submission.
4. Verify the "None" radio option behaves in the following ways:
   a. If the submission is not late, missing, or excused, when you open
      the tray the "None" option is selected.
   b. If selecting the "None" option, the color in the submission
      cell changes to white.
   c. If changing from the "Late" option to the "None" option, any
      points deducted are removed. For instance, if a late submission
      has a score of 6 (raw score of 8 and 2 points deducted)
      and the "None" option is selected, the score in the submission
      cell should show 8 and the points deducted text should go away on
      the Grade Details Tray.
   d. If changing from the "Excused" option to the "None" option, the
      score changes to '-' in the submission cell.
5. Verify the "Late" radio option behaves in the following ways:
   a. If the submission is late, when you open the tray the "Late"
      option is selected.
   b. If the submission is late, when you open the tray the input
      under the "Late" option has a default value that reflects how late
      the submission is and the text next to the input ("Day(s)" or
      "Hour(s)") reflects the set interval on the late policy.
   c. If you change the interval on the late policy (from "Day" to
      "Hour", for instance), when you open the Grade Details Tray for a
      late submission, the text next to the input reflects the new
      interval, and the default value changes according to the interval.
      For instance, if a late submission initially showed a late value
      of "2 Day(s)" and then the late policy was changed to use "Hour"
      intervals, the submission should now show as "48 Hour(s)" late in
      the Grade Details Tray. This should not require a page reload.
   d. If selecting the "Late" option, the color in the submission cell
      changes to reflect the color the user has set for late
      submissions.
   e. If selecting the "Late" option, the default value in the input is
      0.
   f. If changing the value in the input under the "Late" option, the
      points deducted are recalculated (if a late policy is in place)
      and the score is adjusted. The new score is reflected in the
      submission cell, and the points deducted are reflected in the
      Grade Details Tray.
   g. If changing from the "Excused" option to the "Late" option, the
      score changes to '-' in the submission cell.
6. Verify the "Missing" radio option behaves in the following ways:
   a. If the submission is missing, when you open the tray the "Missing"
      option is selected.
   b. If selecting the "Missing" option, the color in the submission
      cell changes to reflect the color the user has set for missing
      submissions.
   c. If selecting the "Missing" option and the score is currently '-'
      or 'EX', the score is set according to the missing policy. If, for
      instance, the missing policy is set to award 0% for missing
      submissions, changing to the "Missing" option on a submission
      with a score of '-' or 'EX' should change the grade to 0.
   d. If changing from the "Late" option to the "Missing" option, any
      points deducted are removed. For instance, if a late submission
      has a score of 6 (raw score of 8 and 2 points deducted)
      and the "Missing" option is selected, the score in the submission
      cell should show 8 and the points deducted text should go away on
      the Grade Details Tray.
7. Verify the "Excused" radio option behaves in the following ways:
   a. If the submission is excused, when you open the tray the "Excused"
      option is selected.
   b. If selecting the "Excused" option, the color in the submission
      cell changes to reflect the color the user has set for excused
      submissions.
   c. If selecting the "Excused" option, the score in the submission
      cell changes to 'EX'.
   d. If changing from the "Late" option to the "Excused" option, any
      points deducted are removed. For instance, if a late submission
      has a score of 6 (raw score of 8 and 2 points deducted)
      and the "Excused" option is selected, the score in the submission
      cell should show 'EX' and the points deducted text should go away
      on the Grade Details Tray.

Change-Id: I5336e581cdbc1633752f0e81bf3f7daf5f90d537
Reviewed-on: https://gerrit.instructure.com/119573
Tested-by: Jenkins
Reviewed-by: Keith T. Garner <kgarner@instructure.com>
Reviewed-by: Jeremy Neander <jneander@instructure.com>
Reviewed-by: Shahbaz Javeed <sjaveed@instructure.com>
QA-Review: Anju Reddy <areddy@instructure.com>
Product-Review: Matt Goodwin <mattg@instructure.com>
2017-08-07 20:02:17 +00:00
wdransfield 3ee5623ce6 Add DeveloperKey/vendor code association for LTI2
refs PLAT-2708

Test Plan:
- Create a developer key through the Canvas UI and
  verify that a new vendor code text input is
  available and optional.
- Verify each of the following:
  * If a vendor is associated with a devloper key they
    must use one of the associated developer keys
    when registering.
  * If a vendor is associated with a developer key
    they may not register without using a
    developer key.
  * If a vendor is associated with a developer key
    they may not use a developer key other than
    one they are associated with to register.
  * If a vendor is not associated with a developer key
    they must register without a developer key.

Change-Id: I9c9974706f542c1442988634790656da1c407cb8
Reviewed-on: https://gerrit.instructure.com/118592
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Nathan Mills <nathanm@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Tested-by: Jenkins
Product-Review: Jesse Poulos <jpoulos@instructure.com>
2017-08-07 16:32:48 +00:00
James Williams 2d27a1369f master courses: re-copy assignment when rubric status changes
test plan:
* copy an assignment from a blueprint to another course
* add a rubric to the original assignment
* resync
* the copied assignment should have a rubric

closes #CNVS-38470

Change-Id: I32fc7ca26cac22817c91c3ec5af342562ac66e2d
Reviewed-on: https://gerrit.instructure.com/121391
Tested-by: Jenkins
Reviewed-by: Jon Willesen <jonw+gerrit@instructure.com>
Reviewed-by: Aaron Kc Hsu <ahsu@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: David Mirabile <dmirabile-c@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2017-08-07 16:27:09 +00:00
Simon Williams 80acdad108 set message from_name as course/group name when possible
fixes CNVS-38237

test plan:
- generate messages at the course level, like new assignment,
discussion, quiz, graded, etc.
- it should use the course name as the from_name

Change-Id: I5f51abd5a51f43fefbadb4cb0763c4480a1c869c
Reviewed-on: https://gerrit.instructure.com/120319
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: David Mirabile <dmirabile-c@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2017-08-07 16:02:56 +00:00
Spencer Olson cce05c3b7d improve speedgrader performance
Decrease SpeedGrader#json load time by preloading info.

closes GRADE-2

Test Plan:

1. Go to SpeedGrader for an assignment that has multiple submissions
   and at least one resubmission from a student.
2. Verify the page loads.

Change-Id: I94af7e6fad64351fb017bccc8c010e300112b0de
Reviewed-on: https://gerrit.instructure.com/121073
Tested-by: Jenkins
Reviewed-by: Keith T. Garner <kgarner@instructure.com>
Reviewed-by: Brad Horrocks <bhorrocks@instructure.com>
Reviewed-by: Derek Bender <djbender@instructure.com>
QA-Review: Indira Pai <ipai@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
2017-08-04 20:01:27 +00:00