Commit Graph

573 Commits

Author SHA1 Message Date
Cameron Matheson 9af963c357 custom gradebook columns: teacher_notes support
refs CNVS-5856, CNVS-6906, CNVS-6475

Test plan:
  This commit lets you mark columns as teacher_notes columns.  The UI
  only supports one teacher_notes column, but this isn't enforced by
  the API.  Create a teacher_notes column using the API.

Change-Id: I1c15082e95ac08b092148f32f3c6906ec2dcef11
Reviewed-on: https://gerrit.instructure.com/28097
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
2014-01-06 19:48:40 +00:00
Rob Orton ed12014bdb validate sis_id, section name and drop section_code
fixes CNVS-10147

test plan
 - set sis id, section name to longer than 255 chars
 - should throw rails error
 - should not throw database error

Change-Id: I05ebdf3ae89ace4f737ae6c124f015efceafec1d
Reviewed-on: https://gerrit.instructure.com/27835
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2014-01-02 20:43:52 +00:00
James Williams 3d949b9080 integrate sharding_spec_helper with switchman for rails 3
Change-Id: Id2205c4c375c569e88857bb3f24a7f11a9d184af
Reviewed-on: https://gerrit.instructure.com/27960
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-12-31 20:09:46 +00:00
Duane Johnson bc7918be78 Add integration_id to SIS models
An integration_id can be used in a way similar to sis_source_id in
that it documents a 3rd party identifier for a particular object. The
reason we use an integration_id instead of a sis_source_id for some
SIS integrations is that there is BOTH a sis_source_id and another
id that is used (as in the case of SIF) to ferry information between
systems.

Models that have an integration_id now include:
- pseudonyms
- course_sections
- courses
- enrollment_terms
- accounts

Test Plan:
- make sure the above tables have an integration_id column after "rake db:migrate"

Fixes SIS-107

Change-Id: I80a03d7384fc6ff243436bdf18798ece5059acb7
Reviewed-on: https://gerrit.instructure.com/27593
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Ken Romney <kromney@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Duane Johnson <duane@instructure.com>
QA-Review: Duane Johnson <duane@instructure.com>
2013-12-27 16:06:45 +00:00
Cameron Matheson b088c6beda custom gradebook columns api
closes CNVS-6906, CNVS-6475

Test plan:
  Use the new custom gradebook column apis to create/edit/delete custom
  gradebook columns, and set data for users in a course on those
  columns.

  only teachers/TAs should have permission to use these apis.

Change-Id: I658b8dc02d6104559c98a6b7e1be5c72e775d664
Reviewed-on: https://gerrit.instructure.com/27615
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
2013-12-26 17:45:40 +00:00
Cody Cutrer 6ff358abca notification preferences API
closes CNVS-5797

test plan:
 * GET /api/v1/users/self/communication_channels/:id/notification_preferences
   should return your preferences
 * GET .../notification_preferences/<one of the named notifications returned above>
   should return a single preference
 * PUT .../notification_preferences/<notification>?notification_preferences[frequency]=never
   should update it (will return it, and confirm by getting it again
 * PUT .../notification_preferences?notification_preferences[<notification>][frequency]=never&
   notification_preferences[<another notification>][frequency]=never
   should update two preferences at once
 * other allowed frequencies are immediately, daily, and weekly
 * repeat replacing the communication channel's id by email/<email address>
 * repeat by using an actual user id instead of self. users should
   not be able to view or update each other's preferences. admins
   should only be able to view, not update (the update routes only exist for "self",
   so you'll get a 404 instead of a 401 for them)
 * regression test notification preferences UI

Change-Id: I107f68a44cb68ee1675ad50ff7123e26d7765450
Reviewed-on: https://gerrit.instructure.com/26311
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-12-20 22:44:02 +00:00
James Williams 2d44a98248 integrate with switchman in preparation for rails 3
Change-Id: Ib2147e2a5c388ba56c1e558b414da9b7ec4c9cd2
Reviewed-on: https://gerrit.instructure.com/27614
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2013-12-18 15:42:37 +00:00
Cody Cutrer 866fb33a27 add foreign keys part 11
refs CNVS-6202

Change-Id: Iebe319ce5463aa862610b985f182809f2f48ad42
Reviewed-on: https://gerrit.instructure.com/24658
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Nick Cloward <ncloward@instructure.com>
Reviewed-by: Anthus Williams <awilliams@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-12-16 23:12:58 +00:00
Braden Anderson 0b9bbe5f66 conversations: delete conversations with no messages
fixes CNVS-9879

This is tricky to test, since ZachP already fixed the bug.
See https://gerrit.instructure.com/#/c/26059/ .

Consider manually breaking your own data:

UPDATE conversation_participants SET last_message_at = NOW() WHERE message_count = 0;

Change-Id: Id8eb4c23ff2968f7ab4ec6856629f76b82cb9515
Reviewed-on: https://gerrit.instructure.com/27121
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Braden Anderson <banderson@instructure.com>
2013-12-13 15:44:32 +00:00
Cody Cutrer 682457f341 remove unsupported PageView migration
redis queue for page views is no longer supported

Change-Id: I14caed9548d064016f3fdae0b5e8a0d74b28d68e
Reviewed-on: https://gerrit.instructure.com/27220
Reviewed-by: Anthus Williams <awilliams@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-12-10 20:28:31 +00:00
Cody Cutrer 2f0ec6e4d5 fix UpdateICUSortableNameIndex migration
Change-Id: I5d156b42300130d063cb7492b178b2be11cd32e3
Reviewed-on: https://gerrit.instructure.com/27133
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
2013-12-07 05:26:10 +00:00
Cody Cutrer 4441a812aa create fixed index concurrently
Change-Id: Ieccc3005587efbe364bc8cfa1b5594023560bbe3
Reviewed-on: https://gerrit.instructure.com/27033
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-12-06 18:21:12 +00:00
Cody Cutrer 6f2777352c update fake_arel
and re-pull-in with_scope from it, and re-apply our monkey patch

Change-Id: I8ca5362b382dc36d0ee7671fa97085d24c599ee3
Reviewed-on: https://gerrit.instructure.com/26708
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2013-12-04 16:25:39 +00:00
Jon Jensen dcf6819491 fix migration typo in previous refactor
refs CNVS-5180

test plan:
migrations should work on an install that had the old index, as well as on
new installs

Change-Id: Ia8e59a14104ba841eb9142293a9ea5162d2b279d
Reviewed-on: https://gerrit.instructure.com/26811
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
2013-11-27 17:30:09 +00:00
Cody Cutrer a7c4a85064 use rename_index method instead of writing SQL
Change-Id: I0e0bb97273908794ca81a60592be7ac871fa46d6
Reviewed-on: https://gerrit.instructure.com/26681
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-11-26 22:01:28 +00:00
Cody Cutrer 7f463161ec only do scribd docs on root attachments
fixes CNVS-9603

also, migration to move scribd_docs up to root attachments

test plan:
 * BEFORE checking this out:
   * configure and enable scribd
   * upload the same (scribdable) file to two courses in the same
     root account
   * inspect the database, and confirm that both files have a
     scribd_doc for them
   * confirm both files render in the UI (you'll need to have
     jobs running)
   * upload another (scribdable) file to two courses
   * directly set scribd_doc=NULL on the root_attachment of this
     second pair; do *not* view it in the UI
 * check out this change
 * run migrations
 * inspect the database, and confirm that only the root attachment
   of for both pairs of previous files has a scribd_doc now
 * in the UI, confirm that all 4 render correctly
 * double check the DB, and ensure that only the two root attachments
   have scribd_docs
 * stop jobs
 * upload *another* (scribdable) file to two courses
 * start jobs; confirm that both copies render with scribd, and only
   the root has a scribd_doc. also confirm that the last_inline_view
   for the non-root one is still NULL (and that the last_inline_view
   on the root is updated when you view the non-root one in the UI)
 * repeat the last two stops, with jobs running the whole time this
   time (i.e. make sure that the first copy of the new file renders
   in scribd before uploading the second copy)

Change-Id: I3053e23a592e3a0c0713880f20fc543eb2c726d4
Reviewed-on: https://gerrit.instructure.com/26503
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-11-26 15:51:18 +00:00
Rob Orton 95f58a2840 fix index migration for mysql build
closes CNVS-9674
test plan
 - migrations should not fail

Change-Id: I9acb8cb20b33bcdb2318fcaab894ac8f7c4c2c8f
Reviewed-on: https://gerrit.instructure.com/26658
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2013-11-25 22:44:44 +00:00
Cody Cutrer 4e7e22b852 add push communication channel type
fixes CNVS-5794

links to an access token to get the proper ARN

test plan:
 * set up an SNS app in AWS
 * configure your credentials in sns.yml
 * set sns_arn on a developer key to be the ARN of the app in SNS
 * using an access token created from that developer key,
   you should be able to create a push channel
 * you should see that channel in your profile (named after your developer
   key)

Change-Id: I183241d02715252bf558c495d72d4995cea4232d
Reviewed-on: https://gerrit.instructure.com/25281
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-11-21 21:38:45 +00:00
Nick Cloward 711f33c07e add option for course grade change (log auditing)
fixes: CNVS-348

This adds grade change auditing functionality.  It uses cassandra and is built
after the authenication auditing.  A new API endpoint was created to query these
logs.  Permissions for this is a domain account.  The logs can be quiried by
assignment, course, student, and grader.

Refer to: https://gollum.instructure.com/grade-auditor-implementation

Test Case:

  Setup:
    - Create a course with a student and an assignment.

  1. Grade an assignment for a student.
  2. The auditor should create a record in cassandra.
  3. Query the endpoint should return the audit event.
      - Query by Assignment
      - Query by Course
      - Query by Student
      - Query by Grader
  4. Ensure permissions are valid by querying with a non root account admin.
  5. Permissions should be changable by site_admin under account permissions.

Change-Id: I0a1cf867d5d1b5bfbdeacc7eac81747f8732025a
Reviewed-on: https://gerrit.instructure.com/25961
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Nick Cloward <ncloward@instructure.com>
2013-11-21 20:53:27 +00:00
Stanley Stuart 38f6fdb9de don't send "needs grading" notification for graded surveys
test plan:
  - As a teacher, create a graded survey with an essay question.
  - As a student, take the graded survey.
  - As the teacher:
    -  You should not receive a notification that the submission needs
       grading
    - You should not see the survey in your todos list on the course
      home page.
    - When you view the quiz submission in speedgrader, you should see
      the full points possible for that question in the input on
      the question header box, instead of '--'.

fixes CNVS-1786

Change-Id: I658c0bc94d54be8449830412fd2da28884e98b4c
Reviewed-on: https://gerrit.instructure.com/25593
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ahmad Amireh <ahmad@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
2013-11-21 18:14:44 +00:00
Cody Cutrer a4c2bbb581 add foreign keys part 10
refs CNVS-6202

Change-Id: I11fcc6d25d96c654dcbad511dff150b15439cf5a
Reviewed-on: https://gerrit.instructure.com/24645
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2013-11-21 16:49:13 +00:00
Ahmad Amireh 6b8d55a77b Controlling visibility of student quiz scores
Teachers can now control when, and for how long, students get to see the
correct answers to their quiz submissions.

The patchset introduces two new columns to Quiz and a CSS rework of the
quiz options form. See linked references for more info.

Quiz#show_correct_answers should no longer be directly accessed, use
Quiz#show_correct_answers? instead.

== Test plan

CAs stands for Correct Answers.

  - Create a quiz with 3 questions
  - Take the quiz as a student, and:
    - get 2/3 of the questions answered correctly
    - submit it

Case A - Showing CAs the moment the submission goes in:

  - Edit the quiz, and:
    - Tick the 'Let Students See Their Score Points' checkbox
    - Leave both date fields empty
    - Save quiz
  - Refresh student view
    - You should see the CAs

Case B - Showing CAs after some date:

  - Edit the quiz, and:
    - Tick the 'Let Students See Their Score Points' checkbox
    - Set the "Show Correct Answers At" to 3-days from now
  - Refresh student view:
    - You should not see the CAs
  - Edit the quiz, and:
    - Set the date to 3-days back
  - Refresh student view:
    - You should see the CAs

Case C - Hiding CAs after some date:

  - Edit the quiz, and:
    - Tick the 'Let Students See Their Score Points' checkbox
    - Set the "Hide Correct Answers At" to 3-days from now
  - Refresh student view:
    - You should see the CAs
    - You should see an alert that tells you the CAs will be hidden at
      the date you chose earlier
  - Edit the quiz, and:
    - Set the date to 3-days-back
  - Refresh student view:
    - You should no longer see the CAs
    - Alert should read that the answers stopped being visible as of the
      date you chose earlier

Case D - Creating a time-frame for showing CAs:

  - Edit the quiz, and:
    - Tick the 'Let Students See Their Score Points' checkbox
    - Set the "Show Correct Answers At" to yesterday
    - Set the "Hide Correct Answers At" to 3-days from now
  - Refresh student view:
    - You should see the CAs
    - You should see an alert that tells you the CAs will be visible
      between yesterday and 3 days from now
  - Edit the quiz, and:
    - Set the "Show At" date to tomorrow
  - Refresh student view:
    - You should no longer see the CAs
    - Alert should still tell you that the CAs will be visible starting
      tomorrow until 3 days from now

Case E - Choosing a bad range

  - Edit the quiz and:
    - Tick the 'Let Students See Their Score Points' checkbox
    - Set the "Show at" to tomorrow
    - Set the "Hide at" to today, or tomorrow
    - You should see an error-box

== Notes and really wild things

- http://docs.kodoware.com/canvas/cnvs-8103-take2
- http://docs.kodoware.com/canvas/cnvs-8103 (legacy changes)

refs CNVS-8103, CNVS-9386

Change-Id: Ib241ee5f143b87164105b7541aadac00f38f79ad
Reviewed-on: https://gerrit.instructure.com/25505
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
2013-11-20 22:08:21 +00:00
Cody Cutrer 5b7e1e98d8 automatically repair data before fixing unique index
Change-Id: I4d5689fe8872654f8c91233017ad1e1894a7dc2b
Reviewed-on: https://gerrit.instructure.com/26414
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2013-11-19 21:07:52 +00:00
Jeremy Stanley 0e075a24b4 feature flags infrastructure and API
test plan:
 - install the test_features plugin (since no real features exist yet)
 - render and consult the feature flags documentation
 - have a test environment with a root account,
   sub-account, course in sub-account, and user

 - Use the "list features" endpoint as a root account admin
   (with no site admin privileges), on the root account context, and
   confirm that hidden features do not show up
 - Use the "list features" endpoint as a site admin user,
   on the root account context, and confirm that hidden features
   show up
 - Use the "list features" endpoint on the site admin account
   and confirm the hidden features show up

 - Use the "set feature flag" endpoint on a hidden feature on site
   admin and ensure the feature becomes visible in all root accounts
 - Use the "set feature flag endpoint" on a hidden feature on a
   single root account, and ensure the feature becomes visible to
   that root account and not others

 - Confirm that root_opt_in features appear "Off" by default
   in root accounts, after being "Allowed" in code or site admin

 - Confirm a feature flag that is set to "on" or "off" (vs. "allowed")
   cannot be overridden in a lower context (and the API returns
   locked=true for them)

 - Confirm that setting locking_account_id requires admin rights
   in the locking account
 - Confirm that a feature flag with locking_account_id cannot be
   changed without admin rights in the locking account (e.g.,
   set a feature flag on a course, locked with the root account's id,
   and make sure a teacher who is not an account admin can't change it)

 - Confirm feature flags can be deleted with the "remove feature flag"
   endpoint (and they are only deleted where they are defined, not
   when called on an object that inherits a flag)

Change-Id: I3e12e23b4454889b6e8b263f1315e82d8f2ada52
Reviewed-on: https://gerrit.instructure.com/25502
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
Product-Review: Matt Goodwin <mattg@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
2013-11-19 20:50:03 +00:00
Nick Cloward 3ca2c595e5 analytics showing submissions were submitted if teacher give a 0
fixes: CNVS-1601

Since submissions were not created for students who did not submit an
assignment the analytics were showing them as missing even if they were not due
yet. Regardless what the score was.  The fix changed the DueDateCacher to create
submissions for students with overridden due dates.  This will cache the due date
so analyitics can correctly calculate the graph data.  The analytics will search
for a submission,  if it finds one it will use the cached due date for
calculations,  if not it uses the assignments date due assuming there are not any
dates that are overridden.

Also reference g/23800.

Test Case:
  Setup: Create a Course with an assignment and an enrollment.

  - Without the student submitting the assignment. Grade the assignment for the
    student.
  - Open analytics for the course and the Assignments graph should not show any
    submissions for that assignment.
  - Create a due date override.
  - A submission should be created to cache the due date and the graph should
    not show any submissions for that assignment.

Change-Id: Icdae246d9c9913c8a163505d14b86f1300c809de
Reviewed-on: https://gerrit.instructure.com/25352
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Nick Cloward <ncloward@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Nick Cloward <ncloward@instructure.com>
2013-11-19 20:36:33 +00:00
Cameron Matheson 0e4c03d64d properly sort by lastname, firstname
fixes CNVS-2330

Test plan:
  * make a course with students named "Ball Wall" and
    "Shmallart Wallart"
  * In gradebook2, "Ball Wall" should be listed *above* "Smallart
    Wallart"
    * only in chrome though... other browsers don't support the locale
      options we need
  * In gradebook.csv, "Wall, Ball" should be listed above "Wallart,
    Shmallart"

Change-Id: I7f20e81cc55b4ee962b2cca32cc48e6c49c48472
Reviewed-on: https://gerrit.instructure.com/26236
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
2013-11-14 20:26:16 +00:00
Cody Cutrer d2db6ead45 fix attachments sorting indexes
refs CNVS-5180

Change-Id: Idb1e0e75c71953d365a7faa54d6eea332c6bc5c9
Reviewed-on: https://gerrit.instructure.com/26029
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2013-11-07 20:16:09 +00:00
Cody Cutrer 12e1f8dd42 fix pending sis batches index
refs CNVS-5180

the original migration had a regression since it was originally run;
fix the regression, and any dbs that have been migrated since that
regressions was introduced

Change-Id: I773c53a371364b238c9330481f1c1a7fdf472aa1
Reviewed-on: https://gerrit.instructure.com/26010
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2013-11-06 22:53:22 +00:00
Cody Cutrer 62ce692b51 fix submission versions index
refs CNVS-5180

the original migration changed since it was originally run;
fix it if the original version ran

Change-Id: I809dbdf29979b7cb4de2edc5ac46b917e0469cd6
Reviewed-on: https://gerrit.instructure.com/26012
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2013-11-06 22:52:21 +00:00
Cody Cutrer d4343d7f74 add more gist indexes
closes CNVS-5180

Change-Id: Ib9d0db2d03c9c24f9536202e41cbeca4c2cd6b65
Reviewed-on: https://gerrit.instructure.com/26038
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2013-11-06 22:52:02 +00:00
Rob Orton ec58fb4b4f expand unique index on learning_outcome_results
if the same user answers the same aligned question (through a question
bank) in multiple quizzes, let each quiz's question instance get its own
learning outcome result.

fixes CNVS-1194

test-plan:
 - create an account-level outcome
 - create an account-level question bank
 - align the outcome with the question bank
 - create a question in the question bank
 - create two quizzes in course(s) under the account using that question
   from the bank
 - have one student take both quizzes
 - look at the student's generated outcome results for that outcome;
   there should be two results, one per quiz.
 - retake one or both quizzes; there should still only be one result per
   quiz, updated with the new score.

Change-Id: I1368270a06cec7dcd2c757ff60196b254c61d3d9
Reviewed-on: https://gerrit.instructure.com/25991
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2013-11-06 22:19:25 +00:00
Cody Cutrer 82952384d2 add index on report snapshots
refs CNVS-5180

Change-Id: I57bb1e049af086fff2d943ec3c70ccb726d11883
Reviewed-on: https://gerrit.instructure.com/26030
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2013-11-06 21:15:59 +00:00
Cody Cutrer 4e0ff9a9a4 fix migration broken during upgrade to find_in_batches_with_usefulness
Change-Id: Iea0a094e7f10c57e93bf5c03e4ed112b7baaae49
Reviewed-on: https://gerrit.instructure.com/25980
Reviewed-by: Nick Cloward <ncloward@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2013-11-05 17:13:04 +00:00
Cody Cutrer 2d94a43357 add foreign keys part 9
refs CNVS-6202

Change-Id: Ie2c879c356fd9181bb5a40b3f976b1aec73edba0
Reviewed-on: https://gerrit.instructure.com/24639
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2013-10-31 18:24:59 +00:00
Cody Cutrer 2c8fb04e0a remove backcompat for custom migration extensions
Change-Id: Ia8f225574c0359fc0be13a7f667572d4baef9600
Reviewed-on: https://gerrit.instructure.com/25801
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2013-10-31 18:24:12 +00:00
Simon Williams 5953c22992 undelete outcome alignments that were erroneously deleted
when the rubric data was an array of HashWithIndifferentAccess instead of
just Hash (which happens when the rubric is copied to another course), it
didn't have the comma in front of learning_outcome_id that was expected in the
FixOutOfSyncOutcomeAlignments data fixup.

fixes CNVS-9021

test plan:

*** before checking out this ***
- create a new learning outcome
- create rubric with the learning outcome
- import the rubric into another course using "Import Content" in course
  settings
- add the rubric to an assignment
- note the id of the outcome you added to the rubric
- in the console, run the following command:
  `ContentTag.where(:learning_outcome_id => <LO_ID_HERE>).
    update_all(:workflow_state => 'deleted')'
- go to the outcome page and it will not list any alignments
- set up some other outcome alignments that are active, and others that are
  deleted, that you would not expect to change

*** checkout the commit ***
- make sure delayed jobs ar running, and the UndeleteSomeOutcomeAlignments job
  is not in the failed jobs list
- go to the first outcome page again, it should correctly list the alignments
  (meaning they were restored) that you manually deleted from the second
  course (the one you imported into) but not the original. This is okay, and
  it's because we deleted all the outcome's alignments in the console.  In
  real data, only the alignments from the copied course would have been deleted.
- other alignments should not be touched

Change-Id: I524cc6a86483ea8beb6809fcc14653ef3ca711df
Reviewed-on: https://gerrit.instructure.com/25648
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2013-10-30 20:55:09 +00:00
Cody Cutrer b060df4c4e use where instead of conditions for partial indexes like Rails 4
Change-Id: I690b3be76137c57567bcb45b600bd606c631a5d1
Reviewed-on: https://gerrit.instructure.com/25783
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2013-10-29 22:21:02 +00:00
Cody Cutrer de32c0405b periodically destroy old scribd docs
fixes CNVS-6873

test plan:
 * upload a file that's scribdable (i.e. a pdf)
 * verify you can preview it
 * Setting.set('scribd.stale_threshold', 0) (this means scribd docs
   will be deleted immediately)
 * run Attachment.delete_stale_scribd_docs
 * refresh your preview; it should say it's still processing
 * refresh again, and it should show up

Change-Id: I129f216eafb2f43e9ea94ae451cd041f1d5914d5
Reviewed-on: https://gerrit.instructure.com/25563
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-10-29 21:35:14 +00:00
Cody Cutrer a318afb7dc rename concurrently: true to algorithm: :concurrently
for Rails 4 and Rails 3.2/postgres_ext compatibility

Change-Id: I960588c6c371606977dfc6b07df6083e67f53d37
Reviewed-on: https://gerrit.instructure.com/25684
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2013-10-29 20:34:13 +00:00
Cody Cutrer b7b5042b2c rename transaction attribute to disable_ddl_migration!
for Rails 4 compatibility

Change-Id: I7dd48ef8cce10e9e15536eebf3e4ab5aee365a40
Reviewed-on: https://gerrit.instructure.com/25686
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2013-10-29 20:33:53 +00:00
Rob Orton db130fd333 get rid of scribd_account
refs CNVS-8282

test plan
 - have scribd enabled
 - upload a scribdable document to a course
 - document should be rendered with scribd
 - previously created documents should still render

Change-Id: Id8d7ea962c7bbe16b0f124e23447c66a48dd4100
Reviewed-on: https://gerrit.instructure.com/25566
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2013-10-25 16:56:59 +00:00
Cody Cutrer 7458f6af24 cassandra 1.2/2.0 compatibility
refs CNVS-7877

 * counter updates have to be in their own batch in 1.2+
 * add the use_cql3? method to cassandra gem, even
   though we're not updating it yet
 * slight change in syntax for table creation
 * 1.2 doesn't return schema info in the schema cql command;
   use a query to get tables

Change-Id: I22642b0fb99e744080f9a7efd0b3d0372de020b9
Reviewed-on: https://gerrit.instructure.com/25361
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-10-23 20:23:51 +00:00
Cody Cutrer 7436a7011f don't create module progressions for users that aren't even in a course
Change-Id: I1ab5201c91bac51cea142f202c7e1fb62fdc7ffe
Reviewed-on: https://gerrit.instructure.com/24987
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-10-16 00:17:16 +00:00
Cody Cutrer 957d50a8e5 add framework for events to be triggered when a module is completed
use it to trigger a singular grade publish for a user

Change-Id: If28044b9bef6c71d2061adb2ac423b836f4c8634
Reviewed-on: https://gerrit.instructure.com/24977
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2013-10-15 21:59:07 +00:00
Simon Williams b59fae9897 make submission version datafixup ignore yaml errors
fixes CNVS-8241

test plan:
- is possible, have a submission version with invalid yaml
- make sure the PopulateSubmissionVersions job runs successfully
- make sure the GradingHistory api endpoint returns all submission
  versions

Change-Id: I00039df95cd3725d32c5478b27f10b9557cb9172
Reviewed-on: https://gerrit.instructure.com/24646
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2013-10-11 19:51:29 +00:00
Jacob Fugal dfab0425e3 use CANVAS_RAILS2 for conditionals
rather than CANVAS_RAILS3 or Rails.version

this is to be consistent, and to reinforce that any "special" branches
are for rails 2.3 backwards compatibility while trying to target rails
3, rather than rails 3 "forwards compatibility".

Change-Id: I4494b65e3f71108a43d09032c1569c478646a828
Reviewed-on: https://gerrit.instructure.com/24998
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
QA-Review: Jacob Fugal <jacob@instructure.com>
2013-10-10 15:58:43 +00:00
Cody Cutrer aec69f3743 drop unused context_modules.downstream_modules
Change-Id: Icf24669d94da42e8a9e4f8e09af2cd561ab85af7
Reviewed-on: https://gerrit.instructure.com/24973
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-10-10 00:42:45 +00:00
Cody Cutrer db7de5fbca add foreign keys part 8
refs CNVS-6202

Change-Id: Id5ed200fe03c20e2573a8740bb4f9360b7097a26
Reviewed-on: https://gerrit.instructure.com/24465
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2013-10-09 23:56:38 +00:00
Cody Cutrer a694ce5155 fix bad user_account_association data
Change-Id: I07c41f883f594d73f8299efc33dc92cb616d56dc
Reviewed-on: https://gerrit.instructure.com/25064
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2013-10-07 18:55:20 +00:00
Brian Palmer e1b650f53f log the remote_ip in page views
refs CNVS-8392

also update the page view API documentation

test plan:
* with this commit applied, page views will now log the remote
  ip of requests, and return that ip in the api and csv downloads
* regenerate api docs with rake doc:api, and verify that the user
  section now has expanded information on the api response

Change-Id: If463e211515881db6ce1f75c9bbca8c7fbcf7589
Reviewed-on: https://gerrit.instructure.com/24880
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
2013-10-07 15:04:50 +00:00