Commit Graph

1657 Commits

Author SHA1 Message Date
Bracken Mosbacker 5585c3a203 add custom role support to course users tab
You can add enrollments with the custom roles and see who
has the roles.

Test Plan:
 * Create custom roles for each enrollment type
 * Test all the settings page's functionality like adding/deleting users with custom roles
 * Make custom observers observe students in various combinations of custom roliness
   - verify that the new observer role has the custom role
 * Make sure the section limited check box shows up for custom tas/teachers by selecting those options in the new user select box

closes #cnvs-1166

Change-Id: I5f133bf1b5b1438d7f8e34297b450ff561d401d0
Reviewed-on: https://gerrit.instructure.com/16272
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
2012-12-26 15:46:12 -07:00
Cameron Matheson f842c4ba4c cache submission lateness
fixes #CNVS-1295

* Adds a new 'late' field to submissions
* Adds compute_lateness method to submissions which
  is called on every save when the 'late' field is nil
  or when the submission time changes
* Adds after_save callbacks to Assignment and
  AssignmentOverride to recompute lateness on submissions
  in a background process
* Includes data migration for initializing the value of the
  new cache field

Change-Id: I68d47fdbcbb167bef8428b6ecd48bf6f66ef8cb7
Reviewed-on: https://gerrit.instructure.com/16086
QA-Review: Amber Taniuchi <amber@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2012-12-26 15:37:18 -07:00
Cameron Matheson 105a4ae0a9 don't ignore muted assignments in gradebook csv
closes #CNVS-2397

Test plan:
  - set up a course with assignments
  - mute some assignments
  - set grades for students
  - make sure the gradebook csv totals and the gradebooks match
  - the student's grade page (when masquerading) should *not* match
    (it should ignore muted assignments)

Change-Id: Iebe15c5d108dcfa899bd501cc6dd45ceb688fa25
Reviewed-on: https://gerrit.instructure.com/16197
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Tested-by: Simon Williams <simon@instructure.com>
2012-12-26 10:11:50 -07:00
Jeremy Stanley 7a6f15e975 fix API workflow wrt inactive/deleted roles
add index and show endpoints for Roles API; fixes #CNVS-2357
these endpoints add the ability to view inactive roles

remove the ability to delete and make the DELETE method
deactivate (at least until we figure out how to delete properly
with regard to account users, enrollments, and sub-accounts);
fixes #CNVS-2378

test plan:
 * render the docs and examine the new actions
 * test the index action (GET /api/v1/accounts/X/roles)
   - make sure it lists all roles
   - make sure built-in roles are 'active'
   - make sure you can list inactive roles
     with state[]=inactive
 * test the show action (GET /api/v1/accounts/X/roles/RoleName)
   - make sure it works for a built-in role
   - make sure it works for a custom role
   - make sure it 404s if an invalid name is given
 * test the deactivate action (DELETE /api/v1/accounts/X/roles/RoleName)
   - make sure it deactivates the role

Change-Id: Ic0b1e1709d2f52b17d26bc15ab7ecd60dd7ed743
Reviewed-on: https://gerrit.instructure.com/16291
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Bracken Mosbacker <bracken@instructure.com>
2012-12-26 07:30:13 -07:00
Jon Jensen 03502069b7 only count self enrollments toward limit, refs #CNVS-1120
don't count manually created student enrollments toward the cap

test plan:
1. set an enrollment limit on a new course (e.g. max 1)
2. as a teacher, add several students
3. confirm that additional students can still self enroll up to the limit
   (the students added in step 2 don't count)

Change-Id: I93309181f3a5021d6cf51b8c02ba899f017cd32e
Reviewed-on: https://gerrit.instructure.com/16308
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Joe Tanner <joe@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2012-12-23 15:59:31 -07:00
Cody Cutrer ead78975b0 change cached enrollments cache key
Change-Id: I52f95e7cbca04e26853e57461969892838d2250c
Reviewed-on: https://gerrit.instructure.com/16336
Reviewed-by: Jon Jensen <jon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Cody Cutrer <cody@instructure.com>
2012-12-22 08:11:52 -07:00
Simon Williams dc8d35802b set graded_at when grading from csv upload
fixes #CNVS-2003

test plan:
- upload a csv to the gradebook that changes some grades
- go to the grading history
- the grading changes should show up correctly

Change-Id: I28ededf74b57286c5a85786e041781d714c665fe
Reviewed-on: https://gerrit.instructure.com/16315
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
2012-12-21 17:18:29 -07:00
Stanley Stuart 50243db1e7 improve outcome groups api with more helpful error message
Before, the API for groups returned the string 'error' when an API
consumer tried to delete a link to an outcome that that was the last
link to an outcome.

The API still needs better error messages for when RecordNotSaved
occurs.

test plan:
  * as a teacher, create an outcome
  * attach it to a rubric.
  * edit some things in the rubric and save the rubric.
  * now remove the outcome from the rubric
  * try to unlink the outcome from the api from its group
    * if you didn't create an outcome group, all outcomes by default
    * belong to the default "root outcome group" for the course
  * the api should give you a message indicating that you can't delete
    the last link to an outcome instead of message of 'error'

Change-Id: I136dd4e4f61581668b2eb7d9b65245664ef2f678
Reviewed-on: https://gerrit.instructure.com/15940
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
2012-12-21 16:09:44 -07:00
Simon Williams 34bf7cb4af add course setting to disable student distribution graphs entirely
there are various concerns about the distribution graphs available on the
student grades page revealing too much about other students scores.  give
teachers the option to remove these for all students in their course.

fixes #CNVS-1063

test plan:
- as a teacher, grade > 5 students for an assignment
- as a student, verify that you can see the box and whisker plot of the grade
  distribution on your grades page.
- as a teacher, go to course settings > more options > and check "hide
  distribution graphs"
- as a student, verify that you cannot see the graph anymore.

Change-Id: Ieab4137e52b616a394a3de0ee313cfd0a0abcc0d
Reviewed-on: https://gerrit.instructure.com/16191
Reviewed-by: Stanley Stuart <stanley+gerrit@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
2012-12-21 12:45:15 -07:00
Joel Hough a9626310f8 make [quiz|assignment].locked_for? vdd aware
fixes #CNVS-517
fixes #CNVS-761

test plan
- start with a course with students in different sections
- create a quiz with a lock date that locks the quiz currently
- create a lock date override that unlocks the quiz for one section
- ensure that a student from a section that the override does not apply to
  does see a lock icon on the course's quizzes list for the quiz
- ensure that a student from the section that the override does apply to
  does not see a lock icon on the course's quizzes list for the quiz

Change-Id: Ic1f553818ff106e1d29a8f1b66d8445b99aecffc
Reviewed-on: https://gerrit.instructure.com/16228
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2012-12-21 10:38:06 -07:00
Zach Pendleton 0db0bac4c4 respect overrides when deciding lateness in speed grader.
fixes #CNVS-474

when displaying submission lateness in the speed grader,
respect any assignment overrides.

test plan:
  * create an assignment due in the past with an override
    due_at in the future;
  * as a student to whom the override applies, submit the
    assignment;
  * as a teacher, view the submission in the speed grader
    and verify that no late message is displayed.
  * make a late submission and verify that the late message
    is still displayed as expected.

Change-Id: Id9c0a55569b39f2e7d316ee0ced9189795ccfbf9
Reviewed-on: https://gerrit.instructure.com/15961
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
QA-Review: Zach Pendleton <zachp@instructure.com>
2012-12-21 09:40:07 -07:00
Jeremy Stanley c1896fbeb8 make delete-role endpoint fail (bad request) if role is in use
instead of deleting it if it can, and deactivating it otherwise,
but returning the same response code either way.

add a separate endpoint for deactivating a role.

also document all three endpoints (delete, deactivate, activate)

test plan:
 - create a role
 - delete the role, and verify it gets deleted
 - delete the role again, and verify you get a 404
 - create a role and assign it to someone
 - try to delete the role, and verify this fails with
   "Role is in use" error message
 - deactivate the role; this should succeed
 - reactivate the role; this should work too

fixes #CNVS-2223
fixes #CNVS-2260

Change-Id: I04a567de104d5d39ef2cda6bb10c915a85d18ec5
Reviewed-on: https://gerrit.instructure.com/16122
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-12-20 17:25:39 -07:00
rob orton d0c8001a66 fix due date change messages to have correct date
broadcast policy  was being kicked off too early 
which caused the previous due date to be sent on a
due date change notification

test plan
 * create an assignment 
 * change the due date
 * the assignment due date change notification 
   should have the correct due date

Change-Id: Icaa26143e36113e8ad001e7ce950e463d7526787
Reviewed-on: https://gerrit.instructure.com/16170
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2012-12-20 16:00:21 -07:00
Mark Severson 6fab11cc82 changed Student View to create a default section (if necessary)
fixes #CNVS-2300

test plan:
 * using a course that has no sections
 * click 'Student View'
   - the Student View should show correctly (not error)

Change-Id: I2dbfab8775d51a4a0cf4aae22de9f7207da848c3
Reviewed-on: https://gerrit.instructure.com/16223
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2012-12-20 13:46:17 -07:00
Jon Willesen bb22a92259 creating submission comments no longer goes to author's inbox
To support instructors of MOOCs, making a submission comment
via gradebook or speedgrader should no longer create a
conversation message in the instructor's inbox. The
conversation will only exist in the sent folder.

If a private conversation between the teacher and student
already exists, the message will be added to the private
conversation and its state will not be modified for the teacher.

In general, the behavior of submission comments was changed so
that creating a submission comment does not create a message in
the author's inbox. Instead the message should appear in the
author's sent folder. This applies to all users (teachers and
students).

fixes #CNVS-1162

test plan:
 - As a teacher, create a submission comment from gradebook.
 Make sure the comment doesn't show up in the teacher's inbox.
 - As a teacher, create a submission comment from speedgrader.
 Make sure the comment doesn't show up in the teacher's inbox.

 - In general, create submission comments as a teacher and a
 student and run through the following combinations of states:

 - Existing Private Conversations:
   - If a private conversation between the student and the
   teacher already exists, the state of the message should not
   be updated for the submission comment author.
   - If a private conversation between the student and the
   teacher does not already exist, the message should only show
   up in the sent folder for the submission comment author.

 - Notification Preference: Mark new submission comments as read
   - Setting this should still prevent incoming submission
   comment messages from showing up in the instructor's inbox
   or changing the state of an existing private conversation.

 - Muted Assignments:
   - When an assignment is unmuted and only one user has made
   submission comments, that user should be treated as the
   message author.
   - When an assignment is unmuted and more than one user has
   commented on the submission, the message is treated as a new
   message for everyone.

Change-Id: Ic55cc64f181e8a0c560fe325bd31ea65082568d2
Reviewed-on: https://gerrit.instructure.com/16007
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
2012-12-19 16:32:33 -07:00
Jon Jensen 92c4bfdd37 self enrollment caps, refs #CNVS-1120
add support for self enrollment caps to limit the size of a particular
course. there is no UI for setting caps (yet)

test plan:
1. run specs
2. follow test plan for https://gerrit.instructure.com/15819

Change-Id: Ibf0a8f04f0c2efa820d0850cef26dfae20849246
Reviewed-on: https://gerrit.instructure.com/16021
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Joe Tanner <joe@instructure.com>
QA-Review: Cam Theriault <cam@instructure.com>
2012-12-19 12:29:58 -07:00
Jon Jensen f74ebd096b self enrollment refactor to facilitate CN integration
fixes #CNVS-1119, potentially supersedes
https://gerrit.instructure.com/14501 with a little work.

simpler flow that is more consistent with FFT signup. whether you click
the "join course" button (popup) or go to the join url, the workflow is
the same:

1. if you are authenticated, you just click the enroll button.
2. if you are not authenticated, you can either:
   1. enter your (canvas/ldap) credentials and submit to join the course.
   2. register and join the course (single form). you will then be
      dropped on the course dashboard in the pre_registered state just
      like a /register signup (you have to follow the link in your email
      to set a password).

note that if open registration is turned off, option 2.2 is not available.

other items of interest:

* fix CSRF vulnerabilities where you can enroll authenticated users in
  open courses, or un-enroll them if you know their enrollment's UUID
* move to shorter course-id-less route (w/ join code)
* reuse UserController#create
* handy openAsDialog behavior and embedded view mode
* better json support in PseudonymSessionsController#create
* extract markdown helper from mt
* show "you need to confirm your email" popup when you land on the course
  page the first time (already showed on dashboard)

test plan:
1. test the authenticated/unauthenticated scenarios above, for both the
   popup and join pages
2. regression test of /registration forms

Change-Id: I0d8351695356d437bdbba72cb66c23ed268b0d1a
Reviewed-on: https://gerrit.instructure.com/15902
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Joe Tanner <joe@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2012-12-19 12:29:47 -07:00
Bracken Mosbacker 2ea0eeaf04 add roles with counts helper for courses
Adds a convenience method to get all the roles available
to a course and the count of those enrollments in the
course

Test Plan:
 * Run specs

refs #cnvs-1166

Change-Id: Ia884591e135b9f84c2472d4ef2f2df3fa528a6f3
Reviewed-on: https://gerrit.instructure.com/16098
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Bracken Mosbacker <bracken@instructure.com>
2012-12-19 08:25:11 -07:00
Simon Williams 622833300c avoid interacting with deleted grading standards
- make course/account/user associations not load deleted grading standards
- make course copy not copy deleted grading standards
- never show more than 100 grading standards on a course/account page

fixes #CNVS-2230

test plan:
- in a course, create a grading standard
- delete it
- copy the course
- the destination course should not have that grading standard

Change-Id: I0063b5ca704667b2863f1d571c86df82c2a5cb97
Reviewed-on: https://gerrit.instructure.com/16108
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
2012-12-18 17:03:20 -07:00
Dave Donahue 3b3b746cca vdd backend for quizzes
[Fixes #CNVS-1145]

* Adds support for attaching AssignmentOverrides to quizzes
* Links common overrides for Assignments that belong to Quizzes
  so quiz.due_dates_for(user) == quiz.assignment.due_dates_for(user)
* Moves common functionality for VDD out of the Assignment model
  and into the DatesOverridable module, which is now included on
  Quiz for a consistent interface

Test plan:
* Run through a few of the old VDD scenarios and verify things
  still work as expected since a lot of code has shifted around
* No interface changes have been made to quizzes yet, so nothing
  to check there

  https://gist.github.com/f12b3694016f3dcc979e

Change-Id: I32b4a54273f90fac689e05174039b8efc952dd39
Reviewed-on: https://gerrit.instructure.com/16028
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
2012-12-18 14:28:34 -07:00
Ethan Vizitei bbda931a4a consider mooc performance
refs #CNVS-1292

Was unable to find any job-per-student
behavior (not to say that we won't ever discover
any), but I did find several instances of loading
full collections into memory
 of student objects or objects
that would be instantiated in the same order of
magnitude as students for a course, and was able
to tweak many of those.  There are undoubtably
more to find.

Change-Id: I044a1d92f90c830b4d1d07f0d4de17a718bcbe55
Reviewed-on: https://gerrit.instructure.com/16030
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
2012-12-18 10:38:58 -07:00
Cody Cutrer 0560a390dc drop backwards compatible stream item columns
test plan:
 * full regression test on dashboard stream items and activity
   stream in the API

Change-Id: I7739fd7d7ea6350f6f7088b7736fd5d287e9384e
Reviewed-on: https://gerrit.instructure.com/15487
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ethan Vizitei <ethan@12spokes.com>
QA-Review: Clare Hetherington <clare@instructure.com>
2012-12-18 10:25:41 -07:00
Zach Pendleton 592e644c8c add context groups to the API. fixes #CNVS-1949
expose the existing GroupsController#context_index action
to API clients.

test plan:
  * create account-level and course-level groups;
  * make API requests as a student and verify that:
    * at the course level, all of the groups you belong
      to are returned;
    * course groups you do not belong to are excluded;
    * at the account level, a 401 is returned.
  * make API requests as a teacher and verify that:
    * at the course level, all groups are returned;
    * at the account level, a 401 is returned.
  * make API requests as an account admin and verify that:
    * at the course level, all groups are returned;
    * at the account level, all groups are returned.

Change-Id: I27775def062d700c6f1c1fbae4fd83f9eb03378f
Reviewed-on: https://gerrit.instructure.com/15939
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Joel Hough <joel@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
2012-12-17 14:22:25 -07:00
Cody Cutrer 75c88dd389 don't use OpenObject for stream item serialization
test plan:
 * existing stream items should still show up correctly
 * new stream items shoudl also show up correctly

Change-Id: I62d4ed0ebb2266e26a2aca5230890525f86c33f6
Reviewed-on: https://gerrit.instructure.com/15510
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-12-17 09:14:53 -07:00
Cody Cutrer 8412afb024 ensure that Account#file_namespace is relative to the default shard
it always should be, but just in case...

test plan:
 * make sure uploading files on the default shard and other shards
   still works
 * make sure downloading old files on the default shard and other
   shards still works

Change-Id: I82375f01ce095db0bcc72437d2fb5e0ed5ce366e
Reviewed-on: https://gerrit.instructure.com/16031
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2012-12-14 08:59:39 -07:00
Cody Cutrer f0616910bb don't unnecessarily load stream item when saving the instance
test plan:
 * run specs
 * general regression testing around dashboard

Change-Id: Ifa029adb016f450d00fff7433c93562de9d62fb6
Reviewed-on: https://gerrit.instructure.com/16065
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2012-12-13 15:37:21 -07:00
Ethan Vizitei 2529ce88f3 Better signatures for message redirects
refs #CNVS-1833

This creates a signature policy that
prevents you from just being able to guess
the next id of another message and navigate
to it.  Also moved twitter messaging
responsibility out of the message persistence
object.

TEST PLAN:
  1) take any message and get the sig for it:
   in the console run:
     msg = Message.last
     AssetSignature.generate(Message.last)

  2) take the resulting signature and login to
the system, then use the url bar to navigate to
  "/mr/[signature]"

  3) you should get redirected to the message
   url properly
 
  4) now try changing the signature. Leave the ID
   alone, but change a few characters in the 
   hmac at the end, and you should no longer get
   redirected properly but should instead be
   taken to the default redirect.
Change-Id: I881e047341d16ba7e422dc05eae62b9f2a460898
Reviewed-on: https://gerrit.instructure.com/15889
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
2012-12-13 12:12:58 -07:00
Jeremy Stanley be56c13863 disallow sis enrollment roles as custom role names
to avoid ambiguity, don't allow custom roles named 'student',
'teacher', 'ta', 'observer', or 'designer'

also fix the error message from the api not to assume that
the base role type is invalid

test plan:
 - using the api, try to create a custom role with one of the
   above names
   -> it should tell you the name is reserved
 - also, try to create a custom role with a valid name
   but an invalid base role type
   -> it should tell you the base role type is invalid

Change-Id: Ic7f91a56e79d2929a64780115553ed38aec5f592
Reviewed-on: https://gerrit.instructure.com/15978
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Cody Cutrer <cody@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2012-12-13 09:39:59 -07:00
Jeremy Stanley b7ba47f680 allow DesignerEnrollments in the API; fixes #CNVS-2147
the API was created without the ability to enroll Designers.
we think this was an oversight.

test plan:
 - enroll a designer via the API
 - enroll a custom role based on designer via the API

Change-Id: Idee15513dd001500a710ecf73eed56f92cac47c4
Reviewed-on: https://gerrit.instructure.com/16029
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-12-12 15:12:33 -07:00
Cody Cutrer 930bf23da4 clean up RoleOverride#permission_for
* use Account#account_chain_ids instead of re-implementing it
   (especially since it uses a recursive query for postgres)
 * reverse the order of iterating overrides in order to vastly
   simplify the logic of applying them
 * and short circuit as soon as a locked override is found

this also fixes bugs around :explicit and :prior_default

test plan:
 * in a root account, explicitly enable a permission for a teacher
 * in a sub account, it should not show as being explicitly set
   (since you never explicitly set it)
 * general permissions regression tests

Change-Id: Id03b05b8e71eb81928591caedda08af3eb0cfd6f
Reviewed-on: https://gerrit.instructure.com/15921
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
2012-12-12 12:43:45 -07:00
Zach Pendleton 4253e673df add optional privacy warning to notifications page.
fixes #CNVS-1278

test plan:
  * as an account admin, navigate to account settings,
    click the notifications tab, check the "Display
    one time pop-up..." checkbox, and update settings;
  * as a user in that account, navigate to your
    notification preferences page and verify that you
    receive a pop-up with a warning about using
    external communication channels;
  * close the pop-up and reload the page; verify that
    the pop-up no longer displays on page load.
  * verify that the pop-up does not display for
    accounts that have not updated their settings.

Change-Id: Ie2de7c3bf8888819f1b9b9b8489e87b53d21be95
Reviewed-on: https://gerrit.instructure.com/15871
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mark Ericksen <marke@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
2012-12-11 17:00:03 -07:00
Zach Pendleton 179af6c9bf pass message data to delayed messages. fixes #CNVS-1286
previously, calls to Notification#record_delayed_messages
on a notification whose template expected data would throw
an error because data was not passed from create_messages.

now data is passed and these messages work as expected.

test plan:
  * create a teacher with appointment notification
    preferences set to daily or weekly;
  * as a student in that teacher's class, sign up for an
    appointment in the scheduler;
  * verify that no error report is created and that the
    teacher's notification is scheduled as expected.

Change-Id: Ie350576add18866bbfd980a9c8316d310f635b7e
Reviewed-on: https://gerrit.instructure.com/15841
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mark Ericksen <marke@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
2012-12-11 16:59:49 -07:00
Simon Williams 571ef941b8 fix turnitin pledge for sub accounts
the turnitin pledge was not working when sub accounts tried to look it up from
their parent accounts, causing the default value to always be used for courses
in sub accounts

fixes #CNVS-2082

test plan:
- set up an account with a sub-account and a course in the sub-account
- set a custom turnitin pledge on the root account
- create an assignment in the sub-account course
- when students submit the assignment, they should see the custom pledge
  message.

Change-Id: I51e05068a17befd2f31ead7359755842d1e02217
Reviewed-on: https://gerrit.instructure.com/15999
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Stanley Stuart <stanley+gerrit@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
2012-12-11 16:56:56 -07:00
Duane Johnson cdbf5fcef4 Fix Ruby 1.9 Gradebook1 UTF-8 error
In gradebook1 we serialize all columns in User objects, which turns
out to be a bad thing in Ruby 1.9 because it is now UTF-8 aware and
fails for some bad UTF-8 characters in the 'collkey' sortable name
column. We just remove collkey from the serializable columns and
we're good.

Test Plan:
  1. Check that international characters in the sortable name field
     does not break the gradebook1 page.
  2. Specifically, check the original page on beta that discovered
     this bug (and the only one we know for certain reproduces the
     bug):

     https://mtest2.beta-19.instructure.com/courses/8361/gradebook

fixes #CNVS-1972

Change-Id: I3b949faaf4abc4ae0a025ff097ec566c69fa5276
Reviewed-on: https://gerrit.instructure.com/15905
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
2012-12-11 16:25:46 -07:00
Ethan Vizitei 7b130d163e optimize stream item generation
refs #CNVS-1291

break out of single record by record creation
and use bulk insert instead (also
had to take into account replicating
observer and lifecycle event behavior that was 
declared elsewhere)

TEST PLAN:
  Go to a large course and take some action
that generates stream items for all the students.
It should not take nearly as long now.

Change-Id: I8f40ccdcfc81e6edb44ac3b245d254b9376dd3b2
Reviewed-on: https://gerrit.instructure.com/15874
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ethan Vizitei <ethan@12spokes.com>
QA-Review: Clare Hetherington <clare@instructure.com>
2012-12-11 16:23:34 -07:00
Bracken Mosbacker 2b1488fb90 add role method for getting all base types and related custom roles
This is a convenience method for various places in the UI
that want to show base roles and their types

refs #cnvs-1166

Change-Id: If3138bd0b9bed54bec60c69633e1b704bdda5904
Reviewed-on: https://gerrit.instructure.com/15994
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
2012-12-11 14:40:06 -07:00
Cody Cutrer 6d23722c26 don't give account only permissions down the chain fixes #CNVS-1973
i.e. an AccountAdmin in a root account doesn't get site admin only
permissions, even on that root account

test plan:
 * create a custom role in site admin with all account and course
   permissions, but no site admin permissions
 * add a user to that role
 * add a user as an Account Admin in a regular root account
 * when logged in as (masquerading doesn't count) the site admin
   user, you should be able to masquerade as the regular root account
   admin

Change-Id: I72130a1c0751c36fdb1a7c2367dc7c5fa0daea11
Reviewed-on: https://gerrit.instructure.com/15865
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
2012-12-11 11:49:30 -07:00
Cody Cutrer f444db290f make sure to log error reports against the master
so that even slave failures get recorded

Change-Id: Idb276e02e0c4ff1f5b3c6ab027669d3f5fcda1b9
Reviewed-on: https://gerrit.instructure.com/15974
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Brian Palmer <brianp@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2012-12-11 09:12:14 -07:00
Cody Cutrer d68b9c1008 move slow assignments_needing_* queries to slave
Change-Id: I18cc60239d92e65b1aec86eb3ffe634884a2cc2c
Reviewed-on: https://gerrit.instructure.com/15953
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Cody Cutrer <cody@instructure.com>
2012-12-10 10:41:11 -07:00
Cody Cutrer c9039f73b2 move slow conversations preload to slave
Change-Id: Ie5a6d94f5ef6b30d5e9f730551aae96b86cb5370
Reviewed-on: https://gerrit.instructure.com/15952
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Cody Cutrer <cody@instructure.com>
2012-12-10 10:40:55 -07:00
Cody Cutrer 698c127575 send painful query to slave
Change-Id: I9d84220347cdc4f630250c26040ed5e4d2407f72
Reviewed-on: https://gerrit.instructure.com/15949
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Cody Cutrer <cody@instructure.com>
2012-12-10 10:39:59 -07:00
Brian Palmer 7b03752291 wrap quiz#submissions_for_statistics in a slave block
Change-Id: Ib387e6f4c8fb9631f2c6cc7b7fa52d3287e811f6
Reviewed-on: https://gerrit.instructure.com/15951
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
Tested-by: Brian Palmer <brianp@instructure.com>
2012-12-10 10:38:54 -07:00
Jeremy Stanley b87eeb0149 course role support in sis import/export
closes #CNVS-1078
test plan:
 - create custom roles in an account
 - sis import:
   - put the custom role name in the 'role' column in a SIS
     enrollment import, and ensure the role_name is assigned
     in the Enrollment
   - ensure only valid roles can be assigned this way
     (must be defined in the course's account or parent
      account, and must not be inactive)
  - sis export:
   - ensure custom role names are exported in the 'role' column
     of the SIS enrollment export and provisioning reports

Change-Id: Ib8b4c129d451023fa51c73747baadd42cb305338
Reviewed-on: https://gerrit.instructure.com/15868
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-12-10 08:41:20 -07:00
Simon Williams cb3576c87f maintain rubric-outcome associations in course copy
the looked like they were being maintained, but the content tag links between
rubric and outcome and between assignment and outcome were not being generated
properly after a course copy.

fixes #CNVS-1274

test plan:
- create and account level outcome and a course level outcome
- in the course create two assignments, with rubrics
- in one, add the course level outcome
- in the other add the account level outcome
- grade a student with the rubrics
- ensure that alignments and mastery look correct
- copy the course
- in the new course grade a different student
- ensure that alignments and mastery look correct

Change-Id: I04c240256f007791613e4f29b8288f1bc7729849
Reviewed-on: https://gerrit.instructure.com/15908
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
2012-12-07 17:15:04 -07:00
Brian Palmer 8fd97bfa66 filter out page views with the same created_at ruby side
This avoids a sometimes-nasty query plan by removing request_id from the
order by clause, at the expense of selecting some duplicate rows and
having to query cassandra about them.

Also remove references to last_request_id since it's no longer used.

test plan: the page view cassandra migrator should still run, and not
process duplicate page view entries (as before).

refs #CNVS-868

Change-Id: I5933c695cc5f4c519f89362af315595221a70fdc
Reviewed-on: https://gerrit.instructure.com/15879
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
2012-12-07 16:17:29 -07:00
Dave Donahue cf16537d09 optimize varied due dates for when there are no overrides
[Fixes CNVS-1945]

Previously, we were executing a lot of unnecessary queries
in AssignmentOverrideApplicator#overrides_for_assignment_and_user
when the end result was coming up as an empty array in the case
of no overrides. We can predict this outcome by simply checking
if an assignment has overrides before trying to determine if a user
has matching enrollments.

With caching disabled for this method, hitting the assignments
listing as a student with 5 assignments and no overrides ran 46
queries. With this change, only 27 queries are made (41% fewer).

Change-Id: I42d6c81fe1a271e5fdea89e148417833312c83c3
Reviewed-on: https://gerrit.instructure.com/15838
Reviewed-by: Stanley Stuart <stanley+gerrit@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
2012-12-06 12:48:35 -07:00
Ethan Vizitei c931c22f16 dont hit scribd from the files_controller
refs #CNVS-1267

this reworks the thumbnail_url method
on the attachment model to just use
the cached scribd thumbnail if available
and to return nil if not (in the case
of a scribd document).

also did a bit of refactoring and removed
some trailing whitespace.

TEST PLAN:

create a scribd doc attachment to an assignment
submission.  It should not hit the Scribd API
at all during the course of the request.  If
the tester does not have a way to monitor network traffic
than this could still be confirmed by ensuring the
request response time isn't significantly longer
than uploading a NON-scribd attachment

Change-Id: I324a99ec94e2efdeb8d1ead80ee0cd92eec036ac
Reviewed-on: https://gerrit.instructure.com/15821
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
2012-12-06 12:01:42 -07:00
Cody Cutrer 3c78a7ce4a search pseudonyms from all shards for User#mfa_settings fixes #CNVS-1339
test plan:
 * create users (with a login in an account) on two shards, then merge
   them together
 * enable MFA (optionally) on the account in the shard that the user
   did not end up on
 * log in as the user
 * on the profile settings page, the link should be there to
   configure MFA

Change-Id: I95468243647e3fb8f90d23b2c686c221fee8ee00
Reviewed-on: https://gerrit.instructure.com/15791
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
Tested-by: Cody Cutrer <cody@instructure.com>
2012-12-05 16:24:52 -07:00
Brian Palmer c3cd989fac fix and improve the page view cassandra transition infra
Store the page view method on the individual object at creation, so we
get the right method still when saving.

fixes #CNVS-868

test plan: with the global Setting set to cache page views, but a
specific shard set to cassandra page views, make sure that page views
created on both that shard and another shard go to the right place.

Change-Id: Ib236c8cd4401a919978423f777c5e95ce4f1ee85
Reviewed-on: https://gerrit.instructure.com/15825
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Tested-by: Clare Hetherington <clare@instructure.com>
2012-12-05 11:20:46 -07:00
Cody Cutrer bd50b1eddd make invitation previews a setting closes #11985
test plan:
 * follow a link to an invitation in the default account
 * you should be able to look around the course before accepting
 * follow a link to an invitation in a non-default account
 * it should immediately accept the invitation or send you through
   the registration process if you are not logged in
 * enable invitation previews in the settings for the non-default
   account
 * follow a link to an invitation in that account again
 * it should now allow you to preview the course before accepting

Change-Id: I92bde85e0cae9dc4167f5ebd2e32cbbc06aa4242
Reviewed-on: https://gerrit.instructure.com/15636
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2012-12-05 09:45:34 -07:00