Commit Graph

1029 Commits

Author SHA1 Message Date
Jeremy Neander 5ae5bbf1d6 Merge branch 'master' into dev/mgp-v2
Change-Id: I5aa3e3e9bec0c171eedd8a2ae42e482a9155975d
2016-09-21 14:57:45 -05:00
Cameron Matheson 8c46254ce2 annotations: support cross-shard crocodocs/canvadocs
refs CNVS-30480
fixes CNVS-30706

Test plan:
  * BEFORE checking out this commit:
    * create 2 shards (s1 and s2)
    * make a course with a file-upload assignment in s1
    * make a user in s2
    * enroll the user as a student in the course
    * submit homework
    * the teacher/student should not be able to see eachother's crocodoc
      comments
  * checkout this commit
    * the student/teacher should be able to see eachother's comments
  * make another submission as the student.  the teacher/student should
    be able to view each other's comments on that document too

Change-Id: Iee6c9087f2c67afc8959cb4989fd14eaa4ce3d46
Reviewed-on: https://gerrit.instructure.com/86715
Tested-by: Jenkins
Reviewed-by: Keith T. Garner <kgarner@instructure.com>
QA-Review: KC Naegle <knaegle@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
2016-09-21 17:04:24 +00:00
Keith Garner 31541740c1 Merge branch 'master'
Change-Id: Id19de299684b834b6897ef76767520b8adf0ba57
2016-09-19 09:00:38 -05:00
Rob Orton de15a0c21d fix invalid root_attachments from children
refs CNVS-30432
refs CNVS-30370
refs CNVS-30382

test plan
 - root_attachments that have invalid filenames
   but have children with valid names should be
   fixed

Change-Id: I651de5e01516060627c7f0d655d7d0547438e56b
Reviewed-on: https://gerrit.instructure.com/89942
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2016-09-16 16:51:34 +00:00
James Williams 57acd57814 use all the enrollment states as a "source of truth"™
drop the logging columns and go for it

try to replace as many areas as possible with scopes using
 the enrollment states table, give that it is kept nearly
 up-to-date and should be faster than instantiating all
 over the place

test plan:
* regression test key areas of canvas, particularly
 course access
* hold butt

closes #CNVS-30884

Change-Id: Ifa8a663522674eb7856c50de43be50966a086a0f
Reviewed-on: https://gerrit.instructure.com/87339
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Heath Hales <hhales@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2016-09-14 20:29:58 +00:00
James Williams ece679e717 fix copied assignment turnitin settings
don't set "created" on copied assignments

also go and fix all the old ones

closes #CNVS-31646

Change-Id: If9bef4db3d3c4a0adac39ab1df75d180d8892361
Reviewed-on: https://gerrit.instructure.com/89842
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2016-09-13 13:05:20 +00:00
James Williams 6a84bd8781 add migration_id index to context_external_tools
Change-Id: Ibfdd3ea0d2280832fd4b46b27d41d79defb4d05a
Reviewed-on: https://gerrit.instructure.com/89797
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2016-09-08 15:18:26 +00:00
Spencer Olson 5876b9a47e Merge branch 'master' into dev/mgp-v2
Change-Id: Ifcef2734ab6158826a0e51ee5cd01b94cbf61a67
2016-09-01 10:24:30 -05:00
Cody Cutrer 24302d8bf5 remove FilterPageViewUrlParam migration
it was just a datafixup that doesn't apply to new database. it's causing
problems for creating new shards under rails 4.2

Change-Id: I4bc3e4c62a85a9c126f13e9464b0404d6436ecb8
Reviewed-on: https://gerrit.instructure.com/89322
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2016-08-31 22:11:50 +00:00
Cody Cutrer 972b3b6ac8 fix Rails 5 deprecation warnings in migrations
except for CleanseTheSyckness, where serialized_attributes has been
removed without replacement

Change-Id: Ie0d81c17effa4b40b285f5d7108fa2586a8ce9ab
Reviewed-on: https://gerrit.instructure.com/89330
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2016-08-31 22:09:34 +00:00
James Williams 5c6ab9b3c0 fix mobile overrides in materialized discussion view
test plan:
* add js/css to the mobile section of the theme editor
* create a discussion with replies
* it should not load the mobile js/css

* view the discussion topic through the API w/ token
* the "message" values should include stylesheet/javascript tags

closes #CNVS-30339

Change-Id: I4a41a8fa74f9ed3ec8200ac618e6f878e726b0e6
Reviewed-on: https://gerrit.instructure.com/85310
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Tested-by: Jenkins
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2016-08-30 17:23:53 +00:00
Derek Bender 7ee67f074d Merge branch 'master' into dev/mgp-v2
Change-Id: Ia4c469719344f7f678d8df365992b7a5b301bf91
2016-08-24 14:54:23 -05:00
James Williams 5f2090172d don't allow nil rubric titles
also fixup current rubrics with nil titles

test plan:
* should not be able to create a rubric with a nil title

closes #OUT-8

Change-Id: Ic58b0c6f513ad54e11fed1b95342be16f6fd6e3f
Reviewed-on: https://gerrit.instructure.com/88496
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2016-08-24 14:34:23 +00:00
Jeremy Stanley 6c73b971c4 drop unused progresses.user_id index
refs CNVS-30929

Change-Id: I8fd4d20d1eb1a6aa60e42df72e8a5edfe86a7df5
Reviewed-on: https://gerrit.instructure.com/88382
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
2016-08-23 19:44:25 +00:00
James Williams 0c64db0688 fix more enrollment state mismatches
caused by sis user deletion and course state changes

also DRY up the enrollment recalculation a little

closes #CNVS-31060

Change-Id: Ife8b2a95223c423f2faec79f3f9d5af5377ce51e
Reviewed-on: https://gerrit.instructure.com/88307
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2016-08-22 16:08:28 +00:00
Spencer Olson d0a8ca6577 Merge branch 'master' into dev/mgp-v2
Change-Id: I25dacca1dbc91c326c7e11b8e258b6da5ce2e74f
2016-08-22 10:28:58 -05:00
James Williams b6e887e37e fix enrollment state mismatches caused by user merges
closes #CNVS-31119

Change-Id: Iabeb0d91a2899113e287b17024d3ae704d1a0175
Reviewed-on: https://gerrit.instructure.com/88207
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2016-08-19 18:29:05 +00:00
James Williams 4e613d52f7 add assessment_question_id index to quiz questions
should speed up AssessmentQuestion#quiz_questions

Change-Id: I2cc5110cd0e7801c7ac9fcd86b3b1b216e8e1a90
Reviewed-on: https://gerrit.instructure.com/88047
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2016-08-17 19:50:42 +00:00
James Williams d8fe089c28 Revert "favorite courses and groups by default"
This reverts commit 06cc23f79f.

Change-Id: I31abba276e080179ea915dc03f603099af1cc721
Reviewed-on: https://gerrit.instructure.com/87937
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2016-08-17 15:30:02 +00:00
James Williams a18227c2cb add context index to external tools
Change-Id: I91c635c0f33c43835c39fef1ff9495b2040abb95
Reviewed-on: https://gerrit.instructure.com/87912
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2016-08-17 12:52:17 +00:00
Spencer Olson a96f8e4241 Revert "Revert close date commits"
This reverts commit d3238e0251.

Change-Id: If50d495b208817362792d3a93f71c49724ce586b
Reviewed-on: https://gerrit.instructure.com/87982
Tested-by: Jenkins
Reviewed-by: Spencer Olson <solson@instructure.com>
Product-Review: Spencer Olson <solson@instructure.com>
QA-Review: Spencer Olson <solson@instructure.com>
Reviewed-by: Jeremy Neander <jneander@instructure.com>
2016-08-16 23:19:55 +00:00
Spencer Olson d3238e0251 Revert close date commits
this reverts commits c2075b89 and d863a93d.
these commits are being moved onto a dev
branch.

refs CNVS-27107
refs CNVS-30266

test plan:
- verify the close date is no longer visible
  in the UI at the account grading standards
  page and the course grading standards page

Change-Id: I1f82768f73c01454388e2f6789b227627c252eb2
Reviewed-on: https://gerrit.instructure.com/87571
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: Keith T. Garner <kgarner@instructure.com>
2016-08-16 21:19:28 +00:00
Jeremy Stanley c12a0acc72 limit duration of web conferences
also fix a bug restarting long-running conferences,
and remove `restartable?` because it's unused

test plan: create a web conference (e.g. Wimba)
 - the duration box should not allow you to enter more than
   8 digits
 - if you attempt to bypass this limit via the API
   (easiest way is to edit and resend with firefox),
   the request should fail with a 400 error
 - ensure you can create a long-running conference
   (check the "no time limit" box), manually stop it,
   and then rejoin it (as a teacher) and have it
   be active again

fixes CNVS-30770

Change-Id: Iad3d6ffd3a01c671d438a2e74008a72a490ee280
Reviewed-on: https://gerrit.instructure.com/86939
Tested-by: Jenkins
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2016-08-15 15:32:00 +00:00
Cody Cutrer ee412ae4d4 drop context message participants
refs CNVS-30929

unused for at least 3 years

Change-Id: Ic00ba5ade812a872463f7c5f27f40f8a66afb787
Reviewed-on: https://gerrit.instructure.com/87504
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2016-08-15 15:02:41 +00:00
Simon Williams 300dd5f8d9 recheck a partially applied index removal
refs CNVS-30214

test plan: migrations should run

Change-Id: I88be99b8f5f44f3ffea78530fd2960ee665401a7
Reviewed-on: https://gerrit.instructure.com/87530
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
2016-08-12 18:30:48 +00:00
Cody Cutrer a84970e47b drop some unused indices
refs CNVS-30929

Change-Id: I8a0d6e30c2ddaf0896a034c1a1ee2a95d45cb35c
Reviewed-on: https://gerrit.instructure.com/87507
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2016-08-11 17:20:00 +00:00
Matthew Sessions f5e94e2ce1 Add deleted conversations api
Site admin users can query for deleted conversations
allowing support to handle cases involving disputes
regarding content of conversations that have been
deleted.

Fixes CNVS-30743

Test Plan:
 - Create a conversation
 - Ensure the conversation has a message
 - Delete the conversation which will
   delete all of the messages
 - As a site admin hit
   /api/v1/conversations/deleted?user_id=<user_id>
 - The list of conversation messages should show
 - Provide another query param of conversation_id=<conversation_id>
 - Only deleted messages from the provided conversation
   should show
 - Using the deleted_before and deleted_after query
   params you should be able to filter based on the
   deleted_at date

Change-Id: Ia39d2763627be82f8084877a307ee2737a7e97d2
Reviewed-on: https://gerrit.instructure.com/86946
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Matthew Sessions <msessions@instructure.com>
2016-08-10 15:11:59 +00:00
James Williams 114fa41175 course timetable event generator
test plan:
* see the new api endpoints in the calendar events controller

* can use the 'set_course_timetable' endpoint to send a schedule
 for a course (optionally per section) with a list of
 weekdays (e.g. "Mon,Wed,Fri") and times

* it will automatically generate calendar events from the start date
 of the course (or section) to the end date that correspond to the dates

* if the schedule is changed, the old events will be deleted and
 new ones generated

* can also use the 'set_course_timetable_events' endpoint to
 generate events from a complete list

closes #CNVS-30523

Change-Id: Idf2b4047af14a6e71838bbe9672583f5bddc3e9f
Reviewed-on: https://gerrit.instructure.com/86051
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Heath Hales <hhales@instructure.com>
Product-Review: Hilary Scharton <hilary@instructure.com>
2016-08-05 17:07:21 +00:00
Alex Boyd 06cc23f79f favorite courses and groups by default
test plan:
* courses and groups in the menu should appear by default
 when enrolled or added

closes CNVS-28908

Change-Id: I48885a6748be20e0a010e23a13ad9ad611e04395
Reviewed-on: https://gerrit.instructure.com/80064
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Heath Hales <hhales@instructure.com>
Product-Review: Matt Goodwin <mattg@instructure.com>
Tested-by: Jenkins
2016-08-04 15:30:05 +00:00
Alex Boyd 46309f949d use index_exists? the right way
fixes CNVS-30741

Change-Id: Iadbfc515264f4af598eed38baef84cacb5988e61
Reviewed-on: https://gerrit.instructure.com/86772
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Alex Boyd <aboyd@instructure.com>
QA-Review: Alex Boyd <aboyd@instructure.com>
2016-08-03 19:22:21 +00:00
Alex Boyd 697a1c4562 point index_trgm_users_name_active_only at the right column
fixes CNVS-30740

Change-Id: I2463a0add13cead70f89524132b6b6eac640e945
Reviewed-on: https://gerrit.instructure.com/86769
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Alex Boyd <aboyd@instructure.com>
QA-Review: Alex Boyd <aboyd@instructure.com>
Tested-by: Jenkins
2016-08-03 03:32:23 +00:00
Alex Boyd 540ec880ac add trigram user indexes restricted to active users only
Change-Id: I03b0564b143148fca35062dc925999367f265bdf
Reviewed-on: https://gerrit.instructure.com/86550
Tested-by: Jenkins
Reviewed-by: Rosser Schwarz <rschwarz@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Alex Boyd <aboyd@instructure.com>
QA-Review: Alex Boyd <aboyd@instructure.com>
2016-08-02 18:41:06 +00:00
Cody Cutrer 49ee1a33aa allow multiple redirect URIs
fixes CNVS-30433

and match them exactly

test plan:
 * edit an existing developer key
 * it should list both a legacy redirect URI, and a place
   to put multiple redirect URIs
 * add some URIs to it and save
 * reload the page, and edit again
 * they should be there
 * add a new developer key
 * it should not have a place to put legacy redirect URI
 * save, refresh, edit, and it still shouldn't

Change-Id: Ie61c9b4026ca675df8f64d660480e52fafff0c57
Reviewed-on: https://gerrit.instructure.com/76990
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins
QA-Review: Benjamin Christian Nelson <bcnelson@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2016-07-28 01:07:58 +00:00
Spencer Olson d863a93de3 datafixup: set grading period close date to end date
backfill grading period close dates and add validations
for close date. validations include 1) presence and 2)
close date on or after end date. also, ensure end date
and close date are always in sync for course grading
periods.

closes CNVS-30266

test plan:
- before running migrations, make sure you have
  some grading periods without close dates on them
  and some with close dates on them (you should
  probably have some older grading periods hanging
  out that don't have close dates on them. if you
  don't, let me know and i can help you remove the
  close dates from a few)
- run the migration and verify all your grading
  periods have close dates
- enter a rails console. find a grading period
  that belongs to a grading period group that
  belongs to a _course_
- verify whenever you update that grading
  period's end_date, the close_date is changed
  to match the end date. verify if you attempt
  to change the close date and save, it does
  not change.

Change-Id: Ia680885d89db923ec945e4eb31e32d1a20b66a2e
Reviewed-on: https://gerrit.instructure.com/84591
Reviewed-by: Neil Gupta <ngupta@instructure.com>
Reviewed-by: Jeremy Neander <jneander@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
QA-Review: KC Naegle <knaegle@instructure.com>
Product-Review: Christi Wruck
2016-07-18 15:58:12 +00:00
Benjamin Porter 07687bcbd1 Add feature flag for canvadocs preferred plugin
When the new canvadocs annotation stuff is ready, we want to be able to
selectively turn it on to slowly roll it out.  This adds a feature flag
to the course that allows the new annotations to be enabled by course.
There is also an account-level flag that allows the feature to be turned
off globally per account, turned on, or simply "allowed" which delegates
to the course.

Refs CNVS-26668

Test Plan:

    - Open up the account settings and observe that there is a feature
      flag called 'New Annotations'
    - See that the feature flag can be either Off, Allowed, or On
    - Inside a course belonging to the account, see that there is
      a feature flag for New Annotations that can be toggled on/off when
      the account level setting is 'Allowed', or is Off when the account
      is off or On when the account is on.
    If you have rails console access:
        - Submit an attachment to an assignment in the course with the
          new annotations flag turned off
        - Observe that the preferred_plugin on the associated Canvadoc
          object is 'nil'
          - canvadoc_obj = Canvadoc.last # or whatever
          - # send has to be used cause #preferred_plugin is a private
          - # method.  Returns nil or 'pdfjs'
          - canvadoc_obj.send(:preferred_plugin)
        - Turn the feature flag on for the course (either through the
          course settings or through the account)
        - you should not need to resubmit, and shoudl see that the
          preferred_plugin gets set to 'pdfjs'.  It should toggle from
          pdfjs to nil and back when turning the feature flag on and
          off, whether at the account level or the course level

Change-Id: I6dd70fa2b379d527315dd7e14ee6ff8cceda024e
Reviewed-on: https://gerrit.instructure.com/84956
Tested-by: Jenkins
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
Reviewed-by: Keith T. Garner <kgarner@instructure.com>
Product-Review: Benjamin Porter <bporter@instructure.com>
2016-07-15 21:15:37 +00:00
Amber Taniuchi dc34731e20 add not counted towards final grade flag to assignments
Teachers have requested for the ability to choose
which assignments count towards the final grade. I have
added a checkbox in the Assignment edit page that
can be checked that says, "This assignment does not count
toward the final grade." A new column has also been added
to the Assignments table to track this state called
"omit_from_final_grade," logic to omit such assignments
in the grade calculators, as well as notification in
assignment show, details, student grades pages, gradebook
and SRGB that notify an assignment is not included in
final grade. New state also added in assignment json.

fixes CNVS-28528

Test Plan:
As a Teacher:
1. Create or edit an assignment.
Verify there is a checkbox to not include the assignment
towards the final grade right below the grading type dropdown.
(This checkbox will not show up for not_graded grading type)
2. Save the assignment.
Verify there is a warning that the assignment is not
counted towards final grade.

As a Student:
1. Go to the assignment created above as a teacher
Verify the assignment show page (courses/x/assignments/y)
warns about the assignment not counting towards final grade.
2. Submit to the assignment.
3. Go to the assignment details page
Verify there is a warning that the assignment is not
counted towards final grade.

As a Teacher:
1. Go to gradebook2
Verify there is a warning that the assignment is not
counted towards final grade.
2. Grade the assignment
Verify in the Total Grade column that grade for the
assignment is not included in the final grade.
3. Download CSV
Verify assignment is not included in final grade.
4. Verify all the above for SRGB

As a Student:
1. Go to the Student Grades Page
Verify a flag that assignment is not counted towards
final grade.
Verify the total grade shown does not include
grade given for the assignment.

Change-Id: I61e2d8ca02201c6e5ff4fc063432b190b6f3d60f
Reviewed-on: https://gerrit.instructure.com/77201
Tested-by: Jenkins
Reviewed-by: Neil Gupta <ngupta@instructure.com>
Reviewed-by: Derek Bender <djbender@instructure.com>
QA-Review: KC Naegle <knaegle@instructure.com>
Product-Review: Christi Wruck
2016-07-14 23:31:40 +00:00
Nick Pitrak c9faee1caa fix anonymous moderated grading
anonymous grading was not working for moderated assignments.
this commit adds graded_anonymously to the provisional grade
model to address the issue.

fixes CNVS-29261

test plan:
- create a Course with a Teacher, Student and TA
- on the Course Settings page in the Feature Options tab,
  turn on Anonymous Grading
- create and publish an assignment with the Moderated Grading
  checkbox enabled
- masquerade as the TA and grade the assignment in Speedgrader
- note the student's name is 'Student 1'
- masquerade as the Teacher and from the Assignment page, click
  the Moderate button
- click the Post button to push the moderated grades to the
  gradebook
- masquerade as the Student and open the Assignment page
- in the Submission Details box on the right, the
  'Graded Anonymously' field should read 'Yes'

Change-Id: I2e87635020cebb0bc81853d8eead228bbb5f1e6d
Reviewed-on: https://gerrit.instructure.com/83503
Reviewed-by: Spencer Olson <solson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Neil Gupta <ngupta@instructure.com>
Tested-by: Jenkins
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Christi Wruck
2016-07-14 22:07:45 +00:00
Shahbaz Javeed f7aab2e3c0 autosave comments on navigating to different user in speedgrader
closes CNVS-28529

While in SpeedGrader, if you have something entered in the comments
field and, without submitting those comments, you navigate to a
different user or otherwise navigate away from SpeedGrader, your
comments will now automatically be saved as "draft" comments for
that user's submission.

Draft comments
* don't show up anywhere other than while grading
* are invisible to users whether or not the assignment is muted
* are only "submittable" by the author of the draft comment

test plan:
1. Create a course, with at least two students
2. Add a quiz with at least one essay type question
3. As each student, take the quiz
4. As the teacher, grade the quiz and start up SpeedGrader
5. Enter comments for the first student's submission but do *not*
   submit them
6. Navigate to the next student
7. You should see a message telling you your comment was
   auto-saved
8. Go back to the previous student
9. You should see your comment styled differently with a red
   asterisk before it, indicating a draft comment (also using
   aria-label for a11y goodness)
10.Enter another comment and this time submit it
11.You should see your comment styled normally without a red
   asterisk before it, indicating a normal (non-draft) comment
12.Try steps 5 through 11 with different ways of leaving that
   student in step #6 e.g. using the drop down, or quitting
   SpeedGrader altogether and you should see the same results for
   draft comments
13.Go back to a submission with a draft comment.
14.Click on the button labelled "Publish" next to your draft
   comment.
15.Watch your comment change in appearance from a draft comment
   to a regular comment
16.Delete any comment and watch it disappear from the comment
   list.
17.Go to the next student
18.Go back to the previous student for whose submission you
   deleted the comment
19.Notice the deleted comment remains missing from the comment
   list.
20.Verify that, if logged in as a student, you never see draft
   comments

Change-Id: If32294a7bed6f847709b54d4c8e4fc21fb2a6eca
Reviewed-on: https://gerrit.instructure.com/77133
Reviewed-by: Spencer Olson <solson@instructure.com>
Reviewed-by: Neil Gupta <ngupta@instructure.com>
Tested-by: Jenkins
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Christi Wruck
2016-07-14 21:51:55 +00:00
Cody Cutrer 3a022627f1 federated attributes backend
refs CNVS-28864

test plan:
 * ensure the API docs for authentication providers render;
   familiarize yourself with the formats of the
   federated_attributes configuration
 * configure a SAML provider, via the API, passing
   federated_attributes
 * do a SAML login, passing some of the attributes you
   configured in the previous step; the user should update
   in Canvas with the passed attributes
 * enable JIT provisioning
 * ensure a new user being created via SAML gets the
   attributes set correctly
 * configure one of the federated_attributes as
   "provisioning_only": true
 * do a normal login; that attribute should not update
 * create a new user via JIT provisioning; that
   attribute should still be set

Change-Id: I0a5f3215bafd5c1980d2ea5deb62f2b22a79f8aa
Reviewed-on: https://gerrit.instructure.com/80677
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2016-07-13 19:00:00 +00:00
Spencer Olson cdd029a5c3 add close_date column to grading_periods table
in addition, if no close date is provided on
creation of a grading period, the end date
will be used as the close date.

closes CNVS-26714

test plan:
* run the migration and verify it succeeds:
  $ bundle exec rake db:migrate
* open a rails console and verify the close_date
  attribute exists and it is a datetime:
  $ bundle exec rails console
  $ GradingPeriod
* verify:
  1) you can create a grading period with an end
     date but without a close date. the close date
     will get set to the end date that you provided.
  2) you can create a grading period with a unique
     end date and close date. the close date must
     be on or after the end date. if you attempt to
     create a grading period with a close date that
     is before the end date, it should fail.

Change-Id: I1a180af4eb8c23703e3844d2e93159010f0c9e58
Reviewed-on: https://gerrit.instructure.com/84340
Tested-by: Jenkins
Reviewed-by: Jeremy Neander <jneander@instructure.com>
Reviewed-by: Keith T. Garner <kgarner@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
2016-07-11 15:03:39 +00:00
James Williams 1caf5ea44f fix issue with local storage and drop_zip_file_imports migration
uploaded_data= reattaches the child to the old root attachment

fixes #gh-828

Change-Id: I12a91ea720b348825fdf6a1cefb4ae8f3f834c61
Reviewed-on: https://gerrit.instructure.com/84027
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2016-06-30 18:36:50 +00:00
Christian Prescott 88459eb4a7 add score and points_possible to grade_change live event
refs CYOE-190

Test Plan
1. Monitor live events as sent from canvas, or as received by the CYOE
   lambda or web app. Ensure grade_change events are raised with
   correct attributes for all cases where grade or score is affected:
- submission is graded for the first time in an assignment. ensure nil
  old_score and old_grade.
- submission is regraded. ensure (old_)points_possible is not changed.
- assignment changes grading_type. ensure grade changes, but score does
  not.
- assignment changes points_possible. ensure score is unchanged,
  old_points_possible is correct. ensure subsequent events have correct
  old_points_possible.

Change-Id: I0ae18772fc816340a23a9b48aee3c00af7a12bcf
Reviewed-on: https://gerrit.instructure.com/81381
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
QA-Review: Robert Lamb <rlamb@instructure.com>
Product-Review: Christian Prescott <cprescott@instructure.com>
2016-06-30 18:19:19 +00:00
James Williams c34dac583d prevent negative unread_conversation_counts
also try to make sure that the unread_conversation_count is
updated correctly by running in a transaction

closes #CNVS-29376

Change-Id: I47e29e97958a6579208a711bb5fe03ee40096647
Reviewed-on: https://gerrit.instructure.com/83656
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2016-06-28 14:01:28 +00:00
Alex Boyd 5285a2102b Raise delayed message length limit
Fixes CNVS-30053

Test plan:
 - Make a wiki page whose title consists of 255 percent signs
 - Cause a notification to be sent out about that page
 - Ensure it gets delivered

Change-Id: I8ae661c3c384f7967de82285dd70d4a4a6238163
Reviewed-on: https://gerrit.instructure.com/82945
Tested-by: Jenkins
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Alex Boyd <aboyd@instructure.com>
2016-06-27 17:13:19 +00:00
James Williams 069ee1e547 create enrollment_states table
creates a new table that will store the enrollment
state_based_on_date information that we've been previously
calculating over and over again all the time

we'll invalidate the rows whenever we make any date
changes and recalculate them in a delayed job

also we'll periodically recalculate as relevant dates pass
for the enrollments

if the time between when we invalidate the data and when
we recalculate it is acceptably short, then we should start
using it for actual database scoping for enrollments

test plan:

* regression test term/course/section dates for future, active
 and soft-concluded enrollments
* also regression test visibility access settings (e.g.
 "Restrict students from viewing course before start date")
 on accounts and courses

closes #CNVS-29460

Change-Id: I27d23c0eb49e5b1b9a6fe532409e51be8a07be52
Reviewed-on: https://gerrit.instructure.com/80000
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2016-06-27 13:56:02 +00:00
Derek Bender 0f2a46b95c Merge branch 'master' into dev/grading-periods-update
Change-Id: Iebae44c64860efd766ca7e288ca1ec112a790456
2016-06-20 10:22:17 -05:00
Rob Orton c51429778e remove closed and completed from groups
fixes SIS-2121

test plan
 - sis imports should work when passing closed or
   completed
 - specs should pass

Change-Id: If7d976a774448aaa8db3d748c46bc485cfe7bf7c
Reviewed-on: https://gerrit.instructure.com/82120
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2016-06-16 22:24:25 +00:00
Cody Cutrer 98092d53ce make migration tolerant of being resumed
Change-Id: Ib1b4c65d36a7015702cebd53e6cba25c3b952cc8
Reviewed-on: https://gerrit.instructure.com/82704
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2016-06-16 21:22:02 +00:00
Cody Cutrer dd002ede18 add indexes supported moderated grading's foreign keys
otherwise deleted moderated grades has to do table scans that take forever

Change-Id: I76d7e734724f2fcc47a7ca860ff98a1a94dae62b
Reviewed-on: https://gerrit.instructure.com/82718
Reviewed-by: James Williams  <jamesw@instructure.com>
Tested-by: Jenkins
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2016-06-16 16:19:41 +00:00
Spencer Olson 099fbc4251 Merge branch 'master' into dev/grading-periods-update
Change-Id: Iac280c0bf0d1d54780c7cf6111aa01b3b8e3a617
2016-06-16 08:35:30 -05:00