Commit Graph

3506 Commits

Author SHA1 Message Date
Ryan Taylor 6abb24a4f0 Prevent JSON parse errors in Quiz Statistics
Some quizzes ended up with a set of answers which caused the statistical
calculations to implode.  This catches these and sanitizes them.  JSON
parsers are happier now.

Closes CNVS-17466

Test Plan:
  - Create a quiz which replicates the original problem.  Apparently
    this can be done by answering the quiz with different answers and
    only two students, however I suspect it has more to do with answers
    having a standard deviation of zero (i.e. identical answers).
  - Visit the quiz statistics page for that quiz and confirm that stats
    finish loading and show some data.

Change-Id: I2847a2aa99c34579c926b05b371a7c48242ab618
Reviewed-on: https://gerrit.instructure.com/47766
Tested-by: Jenkins
Reviewed-by: Cameron Sutter <csutter@instructure.com>
Product-Review: Matt Fairbourn <mfairbourn@instructure.com>
QA-Review: Sean Lewis <slewis@instructure.com>
2015-01-27 22:34:47 +00:00
Joel Hough 90f878f497 make for_masquerading_user scope check global ids also
fixes CNVS-17162

test plan
- have sharding set up
- have a user with a conversation with global ids in the
 root_account_ids field (use console trickery to cause this to
 happen)
- as an account admin who isn't a site admin, masquerade as the
 user
- navigate to the conversations inbox
- ensure that the conversation is visible in the inbox

console trickery
c = Conversation.find <your conversation id here>
c.root_account_ids |= c.context.root_account.global_id
c.save!
c.conversation_participants.each do |cp|
  cp.update_attribute(:root_account_ids, c.read_attribute(:root_account_ids))
end

Change-Id: Ie99c7ad863a74f68ca3b745225076e5b8b0a0ea4
Reviewed-on: https://gerrit.instructure.com/47634
Reviewed-by: Matthew Wheeler <mwheeler@instructure.com>
Tested-by: Jenkins
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
2015-01-26 23:46:33 +00:00
James Williams 413dbfcac1 fix adding designer roles with restricted permissions
test plan:
* create an account admin role with the ability to
"Add/remove students" but not teachers/ta's/designers
* visit the "People" page and click the "+ People"
 button to start adding a person
* the "Designer" role should not appear in the Role
 dropdown

closes #CNVS-1484

Change-Id: I3c2b138b8744db66e897b39b4a1ec625aac8ad34
Reviewed-on: https://gerrit.instructure.com/47810
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins
QA-Review: Clare Strong <clare@instructure.com>
2015-01-26 18:47:32 +00:00
Jeremy Stanley 966463926b [SOC-2] use terms_of_use_url and privacy_policy_url helpers
remove the account model methods, since these don't have
access to the request IP address, which is needed for
international terms of service.

test plan:
 0. enable self-enrollment in account settings
 1. enable self-enrollment in a course in the account
 2. register a new user using the course's self-enrollment URL
 3. terms of use and privacy policy links that appear on the
    "require acceptance of terms" dialog should function
    (and should not take the user to another "require
    acceptance of terms" dialog)
 4. create a new user via the Accounts page, then click the
    link in the email sent to the user to complete the registration.
    the terms of use/privacy policy links that appear in the dialog
    should work (as in 3). (note that you can go to
    /users/<id>/messages as an admin to see this email even if
    outbound email is not configured in your portal.)

closes CNVS-18025

Change-Id: Ibf19d2892c587f9e251917f70448212aac0709ad
Reviewed-on: https://gerrit.instructure.com/47607
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2015-01-23 22:30:27 +00:00
Dan Minkevitch 7424223755 Fixes bug with iterator going beyond two digits
fixes CNVS-18146

Test Plan:
* Enable "Better File Browsing" feature flag
* Go to any course's Files page as an admin
  or teacher
* Click the "+ Folder" button, then press enter
  on the input (leaving the folder's name blank)
* Repeat the above step 10 or more times
* The folders created should be named "New Folder",
  "New Folder 2", "New Folder 3", etc, and should
  continue past "New Folder 10", "New Folder 11",
  "New Folder 12", up to however many you created

Change-Id: I151c9baa8b6fd6176c434144f10165f23a600a22
Reviewed-on: https://gerrit.instructure.com/47709
Tested-by: Jenkins
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Dan Minkevitch <dan@instructure.com>
2015-01-23 21:45:33 +00:00
Cody Cutrer 1c8d862d34 add started_at to sis_batches
refs CNVS-17788

so you can easily tell the difference between how long a batch took
vs. how long it took to start

test plan:
 * upload an SIS batch and let it run
 * when you view it via the API, it should include a started_at
   timestamp

Change-Id: I142024f82260c2ba690a950a09365e90c18cd43d
Reviewed-on: https://gerrit.instructure.com/47412
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Jenkins
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2015-01-23 21:31:26 +00:00
James Williams 67ca345bbc don't cause an infinite job loop with automatic_peer_reviews
test plan:
* create an assignment with a due date set in the past and
 automatic peer reviews set to be assigned in the future
 (and a number of peer reviews per user greater than 0)
* save the assignment
* check the list of running delayed jobs ("/jobs")
* should resolve the job and not keep queueing itself 5evr

refs #CNVS-18148

Change-Id: I2ee38ca4725fa7629667348592d7e04329655d8e
Reviewed-on: https://gerrit.instructure.com/47719
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2015-01-23 20:56:28 +00:00
Joel Hough 71c91a99ec remove draft state check from announcement broadcast policy
fixes CNVS-17975

test plan
- create an announcement with a delay post at date
- wait for delay post time
- ensure that announcement notification is sent

Change-Id: Ic6186de76c45622e8af7f33b8059c2262eb03003
Reviewed-on: https://gerrit.instructure.com/47682
Tested-by: Jenkins
Reviewed-by: Matthew Wheeler <mwheeler@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
2015-01-23 18:26:23 +00:00
James Williams b3b9ce1d95 add comments to bulk submissions update api
test plan:
* see the documentation for the submissions api
"Grade multiple submissions" action
* should be able to add comment information now

closes #CNVS-18099

Change-Id: Ib3879d7bd208efd902ae0c0045e245500aedb25b
Reviewed-on: https://gerrit.instructure.com/47657
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
2015-01-23 14:02:35 +00:00
James Williams 841a41511b update cache_key for temporary invitations
need to include role_id in cached enrollments

closes #CNVS-18072

Change-Id: Iac7cdf7c5285162cee3ab1103d007f006efd034f
Reviewed-on: https://gerrit.instructure.com/47638
Tested-by: Jenkins
Reviewed-by: Dan Minkevitch <dan@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2015-01-22 16:48:01 +00:00
Benjamin Porter c398425127 Learning Outcome model change int to integer in error message
Since int is not technically a word

Fixes CNVS-18061

Test Plan:
    - Through the api, attempt to change the calculation_int of an
      outcome that has already been used to assess a student
    - Ensure that it is rejected with an error message that uses the
      word 'integer' instead of 'int'

Change-Id: I68a6ae2de437354a4abe6faecf231bd7b356f5e3
Reviewed-on: https://gerrit.instructure.com/47499
Tested-by: Jenkins
Reviewed-by: John Corrigan <jcorrigan@instructure.com>
QA-Review: Adam Stone <astone@instructure.com>
Product-Review: Benjamin Porter <bporter@instructure.com>
2015-01-22 16:17:25 +00:00
James Williams 11585b2d33 fix legacy wiki front page behavior
test plan:
* create a course
* create a wiki page with the old default front page title
 "Front Page"
* replicate the legacy wiki state in the console with the
 following command:

 course = Course.find <COURSE_ID>
 course.wiki.update_attribute(:has_no_front_page, false)

* "Front Page" should be the front page

closes #CNVS-18060

Change-Id: Ieabf84d5c601bab4f5a2d898af847b933aa1e5eb
Reviewed-on: https://gerrit.instructure.com/47605
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Mark Severson <markse@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Tested-by: Jenkins
2015-01-22 14:33:36 +00:00
Cody Cutrer b5860cb446 really fix re-queueing of sis jobs
Change-Id: I36c6f45796be4c470c0885ad7360fbfdcfe5e376
Reviewed-on: https://gerrit.instructure.com/47230
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2015-01-20 20:25:54 +00:00
Nathan Mills 571d9d1771 refactor variable substitutions
fixes PLAT-815

test-plan
regressions test lti1 variable substitutions
regression test lti1 sessionless varialbe substitutions

Change-Id: I6b57bff184b79a2b47b4d828aadfbf1831e11b1c
Reviewed-on: https://gerrit.instructure.com/46667
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brad Humphrey <brad@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Nathan Mills <nathanm@instructure.com>
2015-01-19 21:02:39 +00:00
James Williams 211e2073c7 fix rake db:initial_setup
test plan:
* re-create your test db using
RAILS_ENV=test rake db:initial_setup
* should work

Change-Id: Iec245880490a43f1749c68bd2cc8869c6aba4d96
Reviewed-on: https://gerrit.instructure.com/47310
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
2015-01-16 20:04:47 +00:00
Nathan Mills b5959a53f3 validate shared secret for tool proxies
fixes PLAT-829

test-plan:
specs should pass

Change-Id: Ie65f2619d7215008c9495e82da52b3b0a4d1a842
Reviewed-on: https://gerrit.instructure.com/47258
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brad Humphrey <brad@instructure.com>
Product-Review: Nathan Mills <nathanm@instructure.com>
QA-Review: Nathan Mills <nathanm@instructure.com>
2015-01-16 18:33:23 +00:00
John Corrigan fc8afc7afa validate grading_type to be accepted value
Athough there is UI protection against this use case, it has been
possible to provide an invalid value for Assignment#grading_type
via the API. This adds a protection at the model level.

fixes CNVS-15455

test plan:

- Perform a POST api request to the assignment creation enpoint
  (`/api/v1/courses/:course_id/assignments`) with an invalid
  value for `grading_type`. A sample set of request parameters might
  look something like:

{
  "assignment[description]": "omg a description.",
  "assignment[due_at]": "2015-08-28T23:59:00-06:00",
  "assignment[grading_type]": "schmozzleboff",
  "assignment[points_possible]": 30,
  "assignment[title]": "Here is another title."
}

- An error like the following should be returned:

```
{
    "errors": {
        "grading_type": [
            {
                "attribute": "grading_type",
                "type": "inclusion",
                "message": "inclusion"
            }
        ]
    }
}
```

Change-Id: Ib410e9837adc609c668bad70ceab4affa8b11064
Reviewed-on: https://gerrit.instructure.com/47091
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
QA-Review: Sean Lewis <slewis@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2015-01-16 17:40:42 +00:00
Joel Hough 28d82fa793 push notifications
fixes CNVS-7398

test plan
- using canvas mobile app with push notification support, enable
 push notifications
- cause a notification to be sent from the canvas web ui
- ensure that the canvas app gets a notification

Change-Id: Idb320520a23ba6c5c2649253da557160be54084a
Reviewed-on: https://gerrit.instructure.com/42892
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
2015-01-15 22:19:24 +00:00
Cody Cutrer d909c6487b remove before/after callbacks pairs that simply check _changed?
you can check _changed? in after_save callbacks

Change-Id: I306b2dfcae00f2c435930a84814ca1a21425961e
Reviewed-on: https://gerrit.instructure.com/47044
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Nick Cloward <ncloward@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2015-01-15 19:53:40 +00:00
Jeremy Stanley dea1f8b11f touch the root folder when hiding or showing the Files tab
to ensure the permissions on it are updated in a timely fashion.

test plan:
 0. enable "better file browsing"
 1. have a student enrolled in a course
 2. view the student's files page, and note the course's files
    appearing in the list
 3. in a separate browser, as a teacher or admin, hide the
    files tab in the course
 4. refresh the student's browser and confirm that the course's
    files no longer appear
 5. in the teacher's browser, re-enable the files tab
 6. refresh the student's browser and confirm that the course's
    files appear again

fixes CNVS-17891

Change-Id: I43bb2d5606341e2ef7a337065d2e50e85bb1a40d
Reviewed-on: https://gerrit.instructure.com/47085
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
2015-01-15 19:18:55 +00:00
James Williams efc2d97a12 invalidate module progressions on prerequisite change
test plan:
* create two modules, both with an item and completion
 requirement
* leave the first one unpublished, but publish the second
* add the first module as a prerequisite for the second

* view the modules page as a student
* the second module should be available (since the first
 one is unpublished)

* now publish the first module
* visit the modules page again as the same student
* it should have reset the progress for the second module,
 locking it

closes #CNVS-17819

Change-Id: I53bbb15d183866bb0bb25c8a7cf562b018bfe7f4
Reviewed-on: https://gerrit.instructure.com/46919
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2015-01-15 18:41:01 +00:00
James Williams ee549d1a84 don't invalidate account quota cache when unnecessary
test plan: (basically same as g/44678)
* create an account with a sub account
* change quotas on the parent account
* should still update the defaults on the sub account

refs #CNVS-14971

Change-Id: I1d064271fcf0eda3cedc223664cec861af98817b
Reviewed-on: https://gerrit.instructure.com/47164
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2015-01-15 14:04:13 +00:00
Cody Cutrer f1104347a7 fix stalling of sis imports
refs CNVS-17778

if there a bunch of slow jobs in a row, the singleton won't have created
a job for each one, and we might run out of jobs

Change-Id: I99b89d1266e88b8a004fe9dff2d9be0760b97bc3
Reviewed-on: https://gerrit.instructure.com/47219
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2015-01-15 02:59:47 +00:00
Cody Cutrer d395937eae gemify qti_exporter
fixes CNVS-14283

also fixes ContentMigration to work with auto-loaded worker classes

Change-Id: I57a8dc0f241ac599ff77fc344504bf83ecee4aac
Reviewed-on: https://gerrit.instructure.com/46133
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>
2015-01-15 01:10:47 +00:00
Cody Cutrer ab731fbc9c break up job processing after long sis batches
refs CNVS-17778

the point of the loop is to not spawn a ton of jobs for tiny live
events. for large batches, we want it to take a breath in between
so that if a hotfix happens, the next batch will run with new code

Change-Id: I50bef7fa6c3abcf514b8dbb301fe4ff99b965515
Reviewed-on: https://gerrit.instructure.com/47148
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2015-01-14 20:49:09 +00:00
Simon Williams 0eb4ccc38d fix roles for student view student
fixes CNVS-17951

test plan:
- go to course settings and enter student view
- open a browser console and type ENV.current_user_roles
- it should include 'student'

Change-Id: I8b4e05089519a9ed2946262c42853cb5c1da03dc
Reviewed-on: https://gerrit.instructure.com/47034
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Sean Lewis <slewis@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2015-01-14 19:38:23 +00:00
Brad Horrocks c69e8ff120 Fix page load error on Account level group discussions
Group.all_real_students will return all account users when a group's
context is an Account

Fixes CNVS-17623

Test plan

Regression Test
  - Account Level Discussions
  - Group Level Discussions

Change-Id: I0db79ab8285f264d46bce82ddd2a020d894befcd
Reviewed-on: https://gerrit.instructure.com/46974
Reviewed-by: Joel Hough <joel@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Brad Horrocks <bhorrocks@instructure.com>
2015-01-14 15:25:35 +00:00
Cameron Matheson 8442169d80 include current letter grade in gradebook.csv
Test plan:
  Download the gradebook csv for a course that has a grading standard.
  It should show both final and current letter grades.

Change-Id: I352354b5e6254325738b031d5e382d0a0c690102
Reviewed-on: https://gerrit.instructure.com/46861
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
2015-01-13 22:25:29 +00:00
Michael Nomitch 89b36d052d include observers in assignment notifications
fixes CNVS-8728

test plan:
  - DA off
    - set up an observer following a student
    - set up an observer in course without a student
    - create an assignment in this course
    - both observers and the student should be
      notified of the assignments creation
    - remove an enrollment from an observer user
      - create another assignment and this user
        should not be notified
  - DA on
    - set up an observer following a student
      (we'll call him observer A)
    - set up an observer following a student
      in a different section (observer B)
    - set up an observer in course without a student
      (observer C)
    - create an assignment in this course for only
      the section that observer A's student is in
    - observer A and observer C should be notified of
      the assignment, observer B should not be

Change-Id: I5ff01cc9a6f19e8c7dca4f806fe48b9d6d8dbe36
Reviewed-on: https://gerrit.instructure.com/45853
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Sean Lewis <slewis@instructure.com>
Product-Review: Hilary Scharton <hilary@instructure.com>
2015-01-13 21:20:06 +00:00
Ryan Taylor d836c6f08a A landing page for when Quiz Stats are just too big
Quiz Stats were silently failing. This catches the failed server request
and renders a clean error page which directs the user to download the
reports instead of using the statistics UI.

Closes CNVS-17285

Test Plan:
  - Access a quiz with more than 1000 submissions or more than 50
    questions.  See that the stats page is no longer rendered empty, but
    that an error page is shown.
  - Confirm that report buttons are operational
  - Confirm that report popup info boxes are looking good

Change-Id: I850406ed164a61e59d137dda3221746ee25a77cc
Reviewed-on: https://gerrit.instructure.com/46377
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Ryan Taylor <rtaylor@instructure.com>
2015-01-13 19:17:14 +00:00
Cody Cutrer 856a56f152 skip sis uniqueness validation if nothing changed
refs CNVS-17778

we still have a unique constraint in the db that checks it
every time as well

Change-Id: Ie60798283a808bc8f3762b754d151d5c61f6afbc
Reviewed-on: https://gerrit.instructure.com/47020
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2015-01-13 18:46:29 +00:00
Nathan Mills 92b5489e98 create scope for installed apps
fixes PLAT-819

test-plan:
the api at http://{host}/api/v1/{context}/{context_id}/lti_apps
should include disabled lti2 apps

regression test the external tabs selection of assignments and modules

Change-Id: I77e504ac0b6a9edd5eb77abea6c980778bcf0ed4
Reviewed-on: https://gerrit.instructure.com/46862
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Eric Berry <ericb@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Nathan Mills <nathanm@instructure.com>
2015-01-13 15:09:31 +00:00
Nathan Mills 1ba618892f fix pagination for tools with the same name
fixes PLAT-816

test-plan:
*create a bunch of external_tools and lti2 tools with the same name
*hit the api here: http://{host}/api/v1/{context}/{context_id}/lti_apps
*it should paginate correctly and return all results across pages

*regression test the external tool selection for modules and assignments

Change-Id: I715d2bf38b796c70ea3f547b0b5c2d85f44f85ea
Reviewed-on: https://gerrit.instructure.com/46828
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Eric Berry <ericb@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Nathan Mills <nathanm@instructure.com>
2015-01-13 15:09:08 +00:00
Cody Cutrer d1f08ad993 the cassandra migrator does not need to be shard aware
especially when it's flat out wrong and causes it to not work

even when run in a sharded environment, it's run per-shard anyway

Change-Id: I6f568b44a6fe636468372e708cfcdcb329d4a733
Reviewed-on: https://gerrit.instructure.com/46744
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2015-01-12 22:23:26 +00:00
Benjamin Porter 7276769e02 Outcomes API return better error messages
Fixes CNVS-17816

Test Plan

    - Set a calculation_method and a calculation_int and make sure it
      works
    - Set illegal values, and make sure it doesn't work
    - Observe that the error message is decent

Change-Id: I13855bc33162be74fb0c642cec7083d3627d5644
Reviewed-on: https://gerrit.instructure.com/46713
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
QA-Review: Adam Stone <astone@instructure.com>
Product-Review: Benjamin Porter <bporter@instructure.com>
2015-01-12 20:03:05 +00:00
Cody Tanner 47889f7c65 Add settings to make course public to auth users
closes PFS-884, PFS-885, PFS-886, PFS-887, PFS-888, PFS-889, PFS-891, PFS-892

Test Plan: 
	1) View a course that is public (Possibly take a screenshot) 
	2) Go the settings for that course and check 'Make this course visible to authenticated users'
	3) Attempt to view that course without being logged in. You should not be able to. 
	4) Login but make sure you aren't enrolled in that course and you should see the identical page that was seen when the page was public
	5) Enroll in the course and it should appear normally. 

Change-Id: I5303874c80db9d19c838ef44581102f4dfaf5f29
Reviewed-on: https://gerrit.instructure.com/46550
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Sean Mikkelsen <smikkelsen@instructure.com>
Reviewed-by: Dan Minkevitch <dan@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Reviewed-by: Cody Tanner <ctanner@instructure.com>
Product-Review: Cody Tanner <ctanner@instructure.com>
QA-Review: Cody Tanner <ctanner@instructure.com>
Tested-by: Cody Tanner <ctanner@instructure.com>
2015-01-12 18:25:04 +00:00
Jacob Fugal b17d8b98aa don't blow up with explicitly nil trusted_referers
sometimes account.settings[:trusted_referers] is explicitly nil (probably a bug,
but needs more digging). don't blow up in that case, just treat it the
same as empty string.

test-plan:
  * set account.settings[:trusted_referers] to nil
  * try to login
  * shouldn't get a page error

Change-Id: I6c8f8f545c4c85849f7da71dadd40e55bd8e9da4
Reviewed-on: https://gerrit.instructure.com/46896
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
2015-01-10 16:38:03 +00:00
Cameron Sutter b308b3ba14 reactify grading standards page
convert grading standards page to React code,
and add a tab for Grading Periods when MGP feature flag
is turned on.

closes CNVS-15966

test plan:

1) As an admin, visit the 'Account' home page (
	for example, http://localhost:3000/accounts/1).
	Go to settings and turn the feature flag on for
	'Multiple Grading Periods'

2) Click on the link on the left-hand side that says
		'Grading'

3) Verify that there are now 2 tabs - one for 'Grading Periods',
		and one for 'Grading Schemes'. There should not be any
		content in the 'Grading Periods' sectiion (this will be
		added in a later ticket).

4) Click on the 'Grading Schemes' tab. Verify that the tab
		is fully functional, i.e. you can create, edit, and delete
		grading schemes. Follow this link to a Jing video for
		more detail on what needs to be QA'd here (there is a lot).
		(http://screencast.com/t/nsiCVsMjcdF).I changed the behavior
			slightly from how it is portrayed in the video. Now, the
			values will auto-recalculate when input is changed, as opposed
			to changing when focus is lost on the input.

5) Verify when you hover over the '+' icon to add a new row to
		the scheme, a line appears below the current row to show where
		the new row will be inserted.

6) Verify that clicking "Add grading scheme" and then clicking
		"Cancel" removes the new grading scheme, rather than resetting
		the values of the scheme to default values (this behavior is
		different from what was shown in the video, and was changed after
		a talk with Product).

7) Check all functionality covered in the video is also accessible.

Change-Id: Iff61acf917bce297f7943ac758862fa56eed275c
Reviewed-on: https://gerrit.instructure.com/44667
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Spencer Olson <solson@instructure.com>
2015-01-09 20:42:51 +00:00
Brad Horrocks b187ddddfe Scheduler will now load with multiple course section sub contexts
Updated "inconsistent appointment group" subcontext check to explicitly
check for group_categories

Fixes CNVS-17414
Fixes CNVS-16580

Test Plan:

- Follow steps in ticket. Didn't want to post client data in commit message

Change-Id: I211be6ca03884e594a7aedf70d9c4667c76b0c92
Reviewed-on: https://gerrit.instructure.com/46018
Reviewed-by: Mark Severson <markse@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Matt Fairbourn <mfairbourn@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2015-01-09 18:29:56 +00:00
Michael Nomitch 57e9c0729e add non_digital_submission to assignment
refs CNVS-15324

no test plan

Change-Id: Ia60a27829ad86e13e1540a0e32c8e2d5bbbd3b0a
Reviewed-on: https://gerrit.instructure.com/46595
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Steven Burnett <sburnett@instructure.com>
QA-Review: Mike Nomitch <mnomitch@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2015-01-08 21:30:01 +00:00
Simon Williams b10f626dde remove unused external feeds columns
external feeds have three columns that really aren't adding any value

* body_match: never used anywhere in the code, always nil in the
  database
* feed_type: always 'rss/atom' (built to handle ical, but never used)
* feed_purpose: always 'announcements' (build to handle calendar_events,
  but never used)

closes CNVS-17581

test plan:
- create an external feed on the announcements page
- wait for the rss feed to post a new story and the aggregator to run,
  OR, in a rails console:
  * set the created_at date on the external feed to before the last
    posted entry, something like
      ef = ExternalFeed.last
      ef.created_at = 5.days.ago
      ef.save!
  * run the external feed aggregator, like so:
      ExternalFeedAggregator.process
- it should create an announcement for the blog post from that feed

Change-Id: I74deffbdaaa1e217f8eefbdfd1000d50c2406cb1
Reviewed-on: https://gerrit.instructure.com/45990
Reviewed-by: Joel Hough <joel@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2015-01-07 23:36:18 +00:00
Jayce Higgins 98e65e1608 Add validation to the post grades model
Fixes: SIS-748

Test-Plan:
See SIS-631

Change-Id: I9e0d74b25dced0a20592ba69b0f922a5a82d77c2
Reviewed-on: https://gerrit.instructure.com/46622
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Tyler Pickett <tpickett+gerrit@instructure.com>
Reviewed-by: Tyler Pickett <tpickett+gerrit@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
2015-01-07 23:27:25 +00:00
Benjamin Porter 93a656887b Outcomes API - switch default calculation_method to be 'highest'
This solves the issues of handling pre-existing outcomes, as well as
imports.

Fixes CNVS-17729

Test Plan:

    All using the API:

    - Create a new outcome with no calculation_method specified
    - Observe that the outcome is created with a calculation_method of
      'highest' and a calculation_int of 'nil'
    - Make sure the calculation_method cannot be set to nil, or any
      illegal values
    - Make sure the calculation_int cannot be set to any illegal values
    - Make sure outcomes can be created/edited/destroyed successfully

Change-Id: I2f9b54ba6eaeab8d78b754f5cdae49adfa90e77b
Reviewed-on: https://gerrit.instructure.com/46480
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Adam Stone <astone@instructure.com>
Product-Review: Benjamin Porter <bporter@instructure.com>
2015-01-07 18:13:38 +00:00
Benjamin Porter 1b86f2f51b Make outcomes API use error messages for validation failures
rather than silently changing the values.

Fixes CNVS-17630

Test Plan:

    Using the API:
        - set an outcomes calculation_method to an illegal value
          (anything besides 'decaying_average', 'n_mastery', 'latest',
          and 'highest'
        - Observe that you get an error message telling you it is an
          illegal value.
        - set an outcomes calculation_int to an illegal value
        - Observe that you get an error message telling you it is an
          illegal value.
        - Repeat the check for calculation_int for each calculation_method

Change-Id: Ic310583f7c14b25a0425fa809c0307d1f3194961
Reviewed-on: https://gerrit.instructure.com/46300
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Adam Stone <astone@instructure.com>
Product-Review: Benjamin Porter <bporter@instructure.com>
2015-01-07 18:12:13 +00:00
Benjamin Porter fb2eaf982a Outcomes - add calculation_method and calculation_int API access
Add API access to get/set the calculation_method and calculation_int on
learning outcome objects.  Add some default values for these, and
handling for older learning outcomes that have a nil calculation_method
and calculation_int.  Also add some specs.

Fixes CNVS-10619

Test Plan:

    (Verify this all works when authorized, and all fails when
    unauthorized)

    Using the API:
        context: create a new outcome
            - create a new outcome group and an outcome
            - query for the group and outcome and make sure they return properly
            - observe that the default calculation_method is returned as 'decaying_average'
            - observe that the default calculation_int is returned as 75

        context: query an existing outcome
            - query an existing outcome (should have a nil
              calculation_method in the DB)
            - observe that the API returns 'highest' for the
              calculation_method

        context: update an outcome
            - make an update to an existing learning outcome, adding
              a calculation_method of 'highest'.
            - re-query, verifying correct info returned
            - verify that a calculation_int is NOT returned
            - make another update to the outcome, this time setting
              calculation_method to 'n_mastery' or 'decaying_average'.
              Set calculation_int to '8' or '85', respectively
            - re-query, verifying correct info returned. Verify that
              a calculation_int IS returned

Change-Id: If07b0f6a85a8a080b6e96cadc1f5b3745b71794f
Reviewed-on: https://gerrit.instructure.com/45399
Reviewed-by: Matt Berns <mberns@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Adam Stone <astone@instructure.com>
Product-Review: Benjamin Porter <bporter@instructure.com>
2015-01-07 18:11:28 +00:00
Jeremy Stanley f02cab90d5 separate :read_profile from :rename rights
test plan:
 - users (teachers and students) should be able to rename
   themselves only if the "user can edit display name" account
   setting is enabled
 - teachers should not be able to rename students
   (unless they are account administrators)
 - account admins should be able to rename students
 - teachers (who are not account admins) should still be able
   to access student profiles via the API endpoint
   /api/v1/users/:user_id/profile

refs CNVS-15410

Change-Id: Ieca773a566ec55da7d28f8a2f647eba99a8ef1ea
Reviewed-on: https://gerrit.instructure.com/46402
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2015-01-07 18:01:13 +00:00
Bracken Mosbacker 5d67b73629 add used storage quota include to courses api
So that an api consumer doesn't have to make a call for each
individual course to find courses that are close to their
quota usage.

Test Plan:
 * do an include[]=storage_quota_used_mb for the courses api
 * it should return the property 'storage_quota_used_mb'

closes PLAT-812

Change-Id: Ia617ec825b685cbd682baffedee5afa7b19c5280
Reviewed-on: https://gerrit.instructure.com/46247
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
2015-01-06 20:39:54 +00:00
James Williams 368f60053c fix favorite courses for cross-shard users
test plan:
* create a user on one shard
* enroll the user on a course on another shard
* should be able to set that course as a favorite

closes #CNVS-17647

Change-Id: Icb2163b8755243955f8a35d04bacad4e32be0c08
Reviewed-on: https://gerrit.instructure.com/46506
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
2015-01-06 20:08:44 +00:00
Mark Severson 789f25b1b2 fix group wiki pages
fixes CNVS-17705

test plan:
 * smoke test group Pages (/groups/:id/wiki)

Change-Id: Ie3ee3e26a008f59716b135d8e0b62f2f89b480ec
Reviewed-on: https://gerrit.instructure.com/46534
Reviewed-by: Brad Horrocks <bhorrocks@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Matthew Wheeler <mwheeler@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Mark Severson <markse@instructure.com>
2015-01-06 19:26:57 +00:00
James Williams 9987e6f2b7 fix course unpublishable status with deleted assignments
test plan:
* create an assignment
* enroll a student and submit to the assignment
* grade the submission
* note that it should not let you unpublish the
course on the course home page
* delete the assignment
* now you should be able to unpublish

closes #CNVS-17713

Change-Id: Ib76974c4d32efe7997caf32996b98e0446a8dd01
Reviewed-on: https://gerrit.instructure.com/46510
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
2015-01-06 13:55:37 +00:00