Commit Graph

1541 Commits

Author SHA1 Message Date
Cody Cutrer e149fae7bc arel-ify controllers
closes CNVS-4706

Change-Id: I694a06a0d1d5ea83cc1b742e46e7ddfdcba6915a
Reviewed-on: https://gerrit.instructure.com/18672
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-03-22 20:12:59 +00:00
Brian Palmer cb5e957965 start adding rails 3.0 support
This can successfully load rails console and rails server. There are
many, many problems still. The idea is this won't change anything under
rails 2.3, it's all backwards compatible.

closes CNVS-4711

test plan: `touch RAILS3` in your Canvas Rails.root directory. The run
`bundle update` and verify that you get rails 3 installed. Run `bundle
exec rails c` to load console or `bundle exec rails s` to start a
webrick server. You can login, though the dashboard currently breaks.
Also jammit isn't working yet.

But more importantly, Rails 2.3 should still work same as ever. All
tests should pass, and a basic regression sanity check would be good too.

Change-Id: Idd6f35de88adde84cd2db3a650f44b71bd6e9684
Reviewed-on: https://gerrit.instructure.com/18453
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-03-22 19:08:40 +00:00
Sterling Cobb 0f308db11d add admin tools for undeleting courses
You can now restore a course if you have its id from the admin tools
page.

Test Plan
1. Go to an accounts page.
2. Click on 'admin tools' in the left hand navigation.
3. Enter the ID of a deleted course into the field under 'Find a deleted
course'
4. Click 'Restore'
5. View the course and ensure its now in an Unpublished state.

Permissions Part
1. Go to the permissions page
2. In account permissions change the course restore permission to be an
X for all roles.
3. Log into an account that can see course settings for the account you
changed the permission on.
4. The "Account tools" should not show up.

fixes CNVS-3797
fixes CNVS-3692

Change-Id: I009fbdc8f1d5cf86a9ccd1b6652d0153cfb363c9
Reviewed-on: https://gerrit.instructure.com/18492
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2013-03-22 17:59:24 +00:00
Jacob Fugal 19edc5dcb9 searchable messageable users
fixes CNVS-1170

test-plan:
 - be able to find messageable users and contexts from any shard,
   regardless of the shard you're on

Change-Id: I5c5828a9c66eb3e6eb9f3e713f389723d514784c
Reviewed-on: https://gerrit.instructure.com/18146
QA-Review: Clare Hetherington <clare@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
2013-03-22 00:24:54 +00:00
Cody Cutrer a3acc3609c sort CoursesController#users correctly
refs CNVS-4115

test plan:
 * with postgres, ensure that it sorts case insensitively, and with
   shorter last names first

Change-Id: I7eff0f1832d4494909be62f6d0e8f7baea0aee08
Reviewed-on: https://gerrit.instructure.com/18067
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-03-21 17:25:04 +00:00
Joe Tanner 8fa31d9af3 set hidden tracking fields, refs #CNVS-4198
helper commit needed for a plugin

Change-Id: I4de2ce865ed064853233cf46c170b50ea03037d6
Reviewed-on: https://gerrit.instructure.com/18760
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Joe Tanner <joe@instructure.com>
Product-Review: Joe Tanner <joe@instructure.com>
QA-Review: Joe Tanner <joe@instructure.com>
2013-03-21 04:21:23 +00:00
Bracken Mosbacker d20390594f hide module draft state
publishing/unpublishing modules isn't quite ready to go

Test Plan
 * Create a module, it should be published.
 * You shouldn't be able to unpublish it
 * It should also be published when creating, by default. (it should be
 * gray)

closes CNVS-4346

Change-Id: Idaa616bb8c4f2816c85bd9d60c2f76811bf65ad3
Reviewed-on: https://gerrit.instructure.com/18305
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-03-19 12:38:42 -06:00
Erik Lyngved 7dacbab558 adding quiz information to assignments with quizzes
Notes:
* Assignments with an attached quiz will now return a quiz_id
  parameter

Test Plan:
* Create a graded quiz and publish it
* Get the quiz's assignment id - one way I've found how to do that
  in the front end is to go to the Assignments page, hover over the
  quiz name in the list, and look at the status bar for the ID:
  http://cl.ly/image/0t2c3I0K0E1A
* Go to /api/v1/courses/:course_id/assignments/:assignment_id.json
* quiz_id should be present

fixes CNVS-4613

Change-Id: I5bb5f28212fd87bd51f6b943d6dd7bb3d00c8849
Reviewed-on: https://gerrit.instructure.com/18708
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
2013-03-19 11:15:57 -06:00
Cody Cutrer a5ccb6bc2a fake arel!
closes CNVS-4705

 * use the fake_arel gem to get a good portion of the way there
 * override fake_arel's AR override even more to get proper behavior
   of select and group merging
 * add even more Rails 3 query methods to Scope (except, reorder,
   pluck, uniq)
 * fix some spots in our code that break with the new semantics

test plan:
 * test all the things!

Change-Id: I4290d00db407f3250570df4e89c8c78283fe5f5f
Reviewed-on: https://gerrit.instructure.com/18427
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-03-19 11:10:22 -06:00
Brian Palmer f10b0c8b11 force health check to honor the TMPDIR env var if set
Dir.tmpdir (and thus Tempfile) has some internal checks to make sure
that the directory specified in ENV['TMPDIR'] exists and is writable,
otherwise it falls back to the system default (usually /tmp). But some
other parts of the stack such as Passenger/Rack still try to use TMPDIR
even if it's not writable, which can happen if it's a bad drive, so we
want to force the health check to always try the directory anyway.

test plan: /health_check should return "ok" still if TMPDIR is set and
writable. It should fail if TMPDIR is not writable, even if /tmp is
writable.

Change-Id: I6d4efed9327dc6fb6395940cd90bd5e93d7c4069
Reviewed-on: https://gerrit.instructure.com/18691
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
2013-03-19 10:11:57 -06:00
Brad Humphrey aade19a079 allow 3rd parties to use oauth for authentication
adds scopes to access token and a new scope, 'userinfo'. when this scope is
used, a user may choose to remember authorization for a 3rd party. when this
option is selected, subsequent requests for an access token scoped to userinfo
will skip the the step where the user authorizes the app and will return userinfo
but no access token.

test plan:
* follow the oauth token flow adding a param for scopes=%2Fauth%2Fuserinfo to the initial request
- check the box for to remember authorization
- click login
* repeat the above request
* you should not see the request access page

* delete the tokens that were generated above
* run the test above, this time not remembering access
* you should see the request access page on the second request

Change-Id: I303a55d3c71de517ce6aa5fd8acd74d89aa4c974
Reviewed-on: https://gerrit.instructure.com/17604
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
2013-03-18 14:53:29 -06:00
Brad Humphrey 9e053f69bd do not allow oauth code reuse
this fixes an issue that allows 3rd parties to request multiple oauth
tokens with the same code until the code exiles on its own in redis

test plan:
 * follow the oauth token flow
  - request canvas access
  - exchange the code for the final access token
 * you should get an access token
  - repeat the previous request to exchange the code for the access token
 * you should get an 'invalid code' message

Change-Id: I7724988c16ac307be7dd4b762a07e936c3ad38bd
Reviewed-on: https://gerrit.instructure.com/18592
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
2013-03-18 14:53:13 -06:00
James Williams c0b4dd54ca remove files rss feed
fixes #CNVS-4569

Change-Id: I3785eaa00517e9cd552dec760119907ff0b6f6d4
Reviewed-on: https://gerrit.instructure.com/18541
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2013-03-18 14:26:04 -06:00
Bracken Mosbacker b03b6645fb create migration issues and start content migration api
this will allow migrations to have flexible todo items
and allow us to make a super awesome UI for helping
teachers fix any migration problems

Test Plan:
 * Run a migration that has issues. :)
 * exercise the issue api

closes CNVS-4230

Change-Id: I4577f811dd3b16aa200d381f039632b7cc2cd184
Reviewed-on: https://gerrit.instructure.com/18639
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2013-03-18 12:21:58 -06:00
Erik Lyngved 649a3ad6e8 show re-publish button when editing a quiz question group
Notes:
* Editing a question group now marks a quiz as having unpublished
  changes
* Reordering questions or moving questions in/out of a group also
  marks the quiz as changed

Test Plan:
* Create a quiz with question groups
* Publish the quiz
* Add, edit, or delete a question group
* Save quiz
* Re-publish button should be present

fixes CNVS-4567

Change-Id: I1a2990df869809f0e7139eaea20b5e6fae0063e1
Reviewed-on: https://gerrit.instructure.com/18593
QA-Review: Amber Taniuchi <amber@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2013-03-15 09:19:12 -06:00
Cody Cutrer 469b6b674a resend course invitations async
fixes CNVS-4580

and don't load all the enrollments at once, either.

test plan:
 * (in production mode)
 * invite some people to a course
 * stop delayed jobs
 * click the re-send invitations link in the course settings
 * the users should not see the invitations again yet (in /messages)
 * start jobs
 * the invited users should see the invitations again now

Change-Id: Id2a7396df9cfe1a0f559a9780c5df0d8b7b0fcb2
Reviewed-on: https://gerrit.instructure.com/18509
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
2013-03-14 17:38:39 -06:00
Cody Cutrer fec3ae76a7 more aggressively set context on page views
fixes CNVS-4455

you can never have too much context

also, apparently this is the first integration spec that uses the
API from a session (not an access token), so fix API forgery
protection to respect the allow_forgery_protection option
(what's set for specs to not have to worry about forgery
protection), and clean up enabling of it in specs to use
stubbing

test plan:
 * do an action that counts as participating, but wasn't a GET
   (i.e. comment on a discussion)
 * you should see a page view for the user in that course

Change-Id: I8714de45575123d6877e0265623e0fcaf9e7fa58
Reviewed-on: https://gerrit.instructure.com/18504
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
2013-03-14 17:38:20 -06:00
Simon Williams 716768ec38 fix notifications for quizzes + vdd
fixes CNVS-4510

test plan:
- set students to get due date and course content notifications immediately
- make sure they are active and they're email address is confirmed
- find an old published quiz with overrides (at least a few hours old)
- change the due dates, check 'notify of updates', and hit save
- the student should get a notification that contains the due date that applies
  to them.

Change-Id: I3a43bb2d6673625a4181f1ae5880f354652b93fa
Reviewed-on: https://gerrit.instructure.com/18457
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
2013-03-14 10:06:49 -06:00
Jacob Fugal e92c3dc22d fix filtering conversations by user on non-default shard
only apply the tag normalization to Shard.default for context tags, not
user tags. also, generalize it slightly so it happens anytime anyone
uses the tagged scope on a conversation_participants association.

fixes CNVS-4522

test-plan:
 - create non-default shard A
 - create users A and B on shard A
 - create a conversation on shard A between users A and B
 - as user A on shard A, filter the inbox by user B
 - should see the conversation

Change-Id: I54883bb1f746369a26a8d920c40e960033a33849
Reviewed-on: https://gerrit.instructure.com/18569
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2013-03-13 16:24:49 -06:00
Ryan Florence 85b4a76ed1 first iteration of new course/users page
test plan:
1. visit /courses/:id/people
   - users should populate the page
2. scroll down
   - should lazy load next pages
3. enter a search term
   - should render results
4. scroll down
   - should lazy load large result sets

Change-Id: I20b2aa2ec5dab74053b78340ac9d2920b0521e8b
Reviewed-on: https://gerrit.instructure.com/18447
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Joe Tanner <joe@instructure.com>
QA-Review: Ryan Florence <ryanf@instructure.com>
2013-03-13 12:56:10 -06:00
Jon Jensen c762d2e3a4 show a warning to unsupported browsers, fixes CNVS-4579
test plan:
1. use canvas in any supported browser (including mobile)
2. you should not see a warning
3. use canvas in an unsupported browser (e.g. ie8, old firefox)
4. you should see an orangish warning at the top of every page
5. it should not be dismissable

Change-Id: I092455c416a754d102ddadbda99280856b4082de
Reviewed-on: https://gerrit.instructure.com/18524
QA-Review: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Joe Tanner <joe@instructure.com>
2013-03-13 10:38:32 -06:00
Simon Williams f4c3d5a2c2 kill gradebook rss feed
closes CNVS-4565

test plan:
- before checking out this ps, find a gradebook rss feed url
  (it'll look like /feeds/gradebooks/<enrollment_uuid>) and you
  can probably find it on the gradebook1 page (or gradebook history)
- now check out the patch set
- that feed show no longer work, and the pages shouldn't advertise
  them anymore

Change-Id: I0c7cc4183da64ec51c62d5e850384ff05ce91db2
Reviewed-on: https://gerrit.instructure.com/18503
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Stanley Stuart <stanley@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
2013-03-12 14:37:10 -06:00
Joe Tanner a26150c4de Regression found.
Revert "allow a plugin to override the signup form, refs #CNVS-4198"

This reverts commit ae013fcabb

Change-Id: Ibbad3d88bdb2022d6594a17a342abb680bc7b1b5
Reviewed-on: https://gerrit.instructure.com/18530
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Joe Tanner <joe@instructure.com>
QA-Review: Joe Tanner <joe@instructure.com>
2013-03-12 14:03:43 -06:00
Simon Williams 83793ecbbb fix incorrect media_recording submission types
fixes CNVS-4588

test plan:
- enable the kaltura plugin
- find an old assignment that is set up to accept media recordings
- make sure that 'online media recording' is checked in the assignment view
- create a new assignment that accepts media recordings
- make sure the show page says "a media recording" under 'submitting'

Change-Id: Ia166c532f5ede0390afb2226d3cf4fb335814cf2
Reviewed-on: https://gerrit.instructure.com/18525
Reviewed-by: Stanley Stuart <stanley@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
2013-03-12 13:58:01 -06:00
Jon Willesen f863d072a4 api call to delete a conversation for everybody
fixes CNVS-4437

test plan:
 - The api endpoint is:
   https://<canvas>/api/v1/conversations/:id/delete_for_all
   no other parameters (besides authorization header) are
   required.
 - Create a group conversation involving multiple users.
 - Get the group conversation's id
 - Try delete_for_all as one of conversation's users. Should
   receive 401.
 - Try to delete_for_all the conversation as an account admin
   user. Should receive 401 error.
 - Try to delete_for_all the conversation as a site admin
   without "become user" permission. Should receive 401 error.
 - Try to delete the conversation as a site admin with "become
   user" permission. Call should succeed.
 - The conversation should be gone from all involved users'
   inboxes.

Change-Id: Idf5d1f8d66aaa2c5bb26cec451dffcac1aaafcaa
Reviewed-on: https://gerrit.instructure.com/18393
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Eric Berry <ericb@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
2013-03-12 10:30:56 -06:00
Cody Cutrer b843f68a38 upgrade attachment_fu to use aws-sdk gem instead of aws-s3
closes CNVS-4248

this gains us EU region support, and no longer using a forked aws-s3 gem

in the process, setting bucket_name via a plugin is no longer supported

test plan:
 * should be able to upload new files via various methods
 * should be able to download old and new files still

Change-Id: If32fa5f381f5a4ac493948fa32230175a695f51e
Reviewed-on: https://gerrit.instructure.com/18282
QA-Review: Clare Hetherington <clare@instructure.com>
Tested-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2013-03-11 15:55:58 -06:00
Bracken Mosbacker db83cb2f83 allow deleted courses on the courses api show endpoint
and add a route for course show in an account

Test Plan:
 * test api calls to /api/v1/accounts/:account_id/courses/:id
 * delete a course and then make sure you can get that course
   when adding ?include[]=all_courses to the request

refs CNVS-3692

Change-Id: I96fb541a829d7c117bfe1afa7a765d35c98cfe5c
Reviewed-on: https://gerrit.instructure.com/18325
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2013-03-11 15:13:10 -06:00
Joe Tanner ae013fcabb allow a plugin to override the signup form, refs #CNVS-4198
test plan:
- go to /register_from_website
- the forms should behave normally

Change-Id: I317f4a8404cbf00f2de112a88421c724834e6181
Reviewed-on: https://gerrit.instructure.com/18470
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
QA-Review: Cam Theriault <cam@instructure.com>
2013-03-11 14:30:46 -06:00
Jeremy Stanley 5fa07f9fe9 retrieve info about 'deleted' MediaObjects
fixes CNVS-4085

test plan:
 - upload a video to a course on the files page
 - put the video in a wiki page via the wiki sidebar
 - copy the course (course copy, not export/import)
 - in the original course, delete the video file
 - in the copied course, make sure the video still
   plays in the wiki page

note:
 - the video will still play in the copied course's
   files page; the new course made new submissions to
   kaltura.  We probably want to either fix the html
   links to point to the new media object, or make
   the new course's Attachments reuse the originals'
   media_ids (and make Attachments not destroy their
   associated MediaObjects when they're deleted).
   However, this feels like it might be an expedited
   fix, so I'll hold that for a later commit.

Change-Id: I5d7977e16fa6424ef8cf8e36d9f76afbfddfe50b
Reviewed-on: https://gerrit.instructure.com/18158
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2013-03-11 14:19:05 -06:00
Jeremy Stanley 909ef9ba75 don't preload all a module's progressions
because there could be lots of them in a mooc, and we're generally
not interested in any of them except those belonging to the
current user

also, tear out the expensive uncollapse! no-op

fixes CNVS-4312

test plan:
 - module progressions/collapsing/uncollapsing should work
 - modules page performance as a student (rendering time,
   completing requirements) should not collapse when lots
   of other students are enrolled

my own performance test results for modules page rendering
are as follows:

3 small modules, 10000 progressions each, total of
30000 progressions:
 before: 5.52 seconds
 after:  1.38 seconds

4 modules (the above, plus a 1000-item module; total of
40000 progressions:
 before: 8.55 seconds
 after:  4.35 seconds

(average of 5 page loads, timed by chrome's developer tools,
 clearing cache between sets, and discarding the initial
 page load after clearing the cache; mostly to discount
 the megabytes of javascript being downloaded)

Change-Id: Ic0f59e38928305ac7fd8c61943fa08cf92eae822
Reviewed-on: https://gerrit.instructure.com/18296
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2013-03-11 08:41:32 -06:00
Brian Palmer cc1954e0e6 fix permissions check for UsersController#show
This needs to check the user, not the account, but we no longer grant
:view_statistics if a user has :read_reports on a course, effectively
blocking teachers from viewing the top-level user page by default.

A new user-level :read_reports permission was added so that teachers and
account admins can still view the teacher/student interaction reports as
before, even though teachers don't have :view_statistics

fixes CNVS-2964

test plan:
- a site admin user should be able to view /users/X on any account
- an account admin user should be able to view /users/X for students in
  thier account, but not in other accounts
- a teacher should not be able to view /users/X for a student in their
  course Y, but they should be able to view /courses/Y/users/X

Change-Id: Iebc639bd935f50344cb77614f6eeae2bacb421e2
Reviewed-on: https://gerrit.instructure.com/18473
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-03-09 17:59:03 -07:00
Simon Williams fb452cc4a5 fix quiz action list spacing; remove a js_block
fixes CNVS-4396

test plan:
- the right sidebar on quiz show for teachers should be formatted correctly
- try deleting a quiz from the edit and show pages
- they should both work

Change-Id: I8dda88bcc1637d0a12d4a3a376afb6415b3b7685
Reviewed-on: https://gerrit.instructure.com/18259
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Stanley Stuart <stanley@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
2013-03-08 17:00:30 -07:00
Mark Severson caf40051cb disable the outcome mastery page for large_roster courses
test plan:
 * add an outcome on a course
   (note the outcome id/url)
 * set the large_roster flag on the course
 * ensure that the outcomes are still listed
 * ensure that the outcome mastery page cannot be accessed
   * through a direct url
   * through the course outcomes page
   * through the assignments page
   * through the a course rubric page
     (Edit > Find Outcome Criterion)
   * through the quizzes page
     (Edit > * > Show Rubric)
   * through the discussions page
     (* > Add Rubric)
   * through question banks
     (Align Outcome)

 ! Note:
   this does not change the way account outcomes are handled!
   outcome mastery pages will still be shown for account outcomes.

fixes #CNVS-3094

Change-Id: Iaaaf437e3e76fb7c102641d55d5b6c8930a23d39
Reviewed-on: https://gerrit.instructure.com/18287
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
2013-03-08 14:16:47 -07:00
Brian Palmer 02be6b764c make sure the confirmation_code changes when resetting password
If the cc is already active, @cc.confirm is a no-op so the reset
confirmation code didn't ever get saved back to the db. As a consequence
forgot password links could be used multiple times.

fixes CNVS-3608

test plan: Send yourself a forgot password email. Click the link and
reset your password. Click the link again, and you should get redirected
back to the login screen with an error message.

Change-Id: I0737bbc9e305f20984b5b1c4fcd0fc5542698c40
Reviewed-on: https://gerrit.instructure.com/18336
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
2013-03-07 17:01:26 -07:00
Stanley Stuart 49f952b1d5 make fancy midnight work for assignment overrides
also fixes an issue where some dates display as "Friday at 11:59pm" instead
of just "Friday"

Also does a little bit of refactoring and spec backfilling for the
override list presenter. The override list presenter now returns a much
more friendly list of "due date" hashes to the outside world to make it
easier to consume in views. Views don't have to format the dates by
passing in a hash anymore.

test plan:
  - specs should pass
  - as a teacher, create an assignment with overrides using the web
    form. In one of the overrides, enter a day like March 1 at 12am.
  - save the overrides
  - Make sure fancy midnight works for lock dates and due dates, but not
    unlock dates (12:00 am unlock date should show up as 12:00 am, not
    11:59 pm)
  - on the assignment's show page, you should just see "Friday", meaning
    that the assignment is due at 11:59 pm on March 1.
  - The "fancy midnight" scheme should work correctly for
    assignments,quizzes,and discussion topics, including the default due
    dates.
  - Be sure to check that the dates show up correctly on the
    assignment,quiz, and discussion show pages.
  - Be sure to make an override that has a blank due_at, lock_at, and
    unlock_at, but has a default due date, lock date, and unlock date.
    The overrides should not inherit from the default due date (fixes
    CNVS-4216)

fixes CNVS-4216, CNVS-4004, CNVS-3890

Change-Id: I8b5e10c074eb2a237a1298cb7def0cb32d3dcb7f
Reviewed-on: https://gerrit.instructure.com/18142
QA-Review: Amber Taniuchi <amber@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2013-03-07 15:53:06 -07:00
Jon Willesen 773f8371f6 order inbox based on last message received, ignore sent messages
this boils down to not updating the last_message_at field on
conversation_participant when a user sends a message

for new conversations, it shouldn't show up in the user's inbox
at all, and should instead be in the user's sent folder.

fixes CNVS-1779

test plan:
 - start a new conversation.
 - the new conversation should not show up in the sending
   user's inbox folder.
 - the new conversation should show up in the sending user's
   sent folder.
 - the new conversation should show up in the receiving user's
   inbox folder.
 - create several conversations in a user's inbox.
 - choose a conversation that is not at the top of the list.
 - post a new message to the conversation.
 - the conversation should not jump to the top of the list.

Change-Id: Iba62a16b40d94a0df7c39a2e73e8b089523d39f9
Reviewed-on: https://gerrit.instructure.com/18270
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Willesen <jonw@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
2013-03-07 15:49:10 -07:00
Ethan Vizitei 80c2b2d031 cleanup and sharding fixes in grade_summary
Simple "with_each_shard" fix for the
actual enrollment loading code.

I also pushed the data transformations down into
a presenter since there were so many
instance variables, and added some focused
specs around the presenter. (and updated
the view to reference all collections
from the presenter, memoizing to ensure
nothing gets transformed more than once)

Finally, to make the grade book summary work,
had to branch off of Jacob's fix for foreign
keys across shards and make use of
'relative_id_for' in the gradebooks_controller

fixes CNVS-2201

TEST PLAN:
1) login as a user who has enrollments
in 2 courses on different shards.

2) navigate to "/grades"

3) you should see all your courses, not just
the ones on your current shard.

Change-Id: I385bd94cce71bf2aee03b1ae7679157c08910924
Reviewed-on: https://gerrit.instructure.com/17667
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: Jacob Fugal <jacob@instructure.com>
2013-03-07 15:44:20 -07:00
Brian Palmer 4722d61200 more validation of blank password
The LDAP unique_id response stuff doesn't go through the normal
pseudonym method. Also add validation to the controller action, to catch
it even earlier.

fixes CNVS-4447

test plan: the javascript on the normal login page blocks blank
passwords, so the easiest way to test this currently is to use a mobile
browser or change your user-agent to be a mobile browser so that you get
the mobile login screen, which currently allows blank passwords through
(though that'll be fixed at some point too). then login with a username
but no password and verify you get a "No password was given" error
rather than an incorrect username/password error.

Change-Id: Iccd3cccb1f5e2d5ee9f6a71aead74acf6f2e2c13
Reviewed-on: https://gerrit.instructure.com/18389
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
2013-03-07 13:59:16 -07:00
Jacob Fugal 60bbe31715 transpose ids to default shard when filtering conversations
fixes CNVS-3969

test-plan:
  * create user A on shard 1
  * create user B on shard 2
  * create course C on shard 2 and enroll both A and B
  * create a conversation between A and B
  * have A open his inbox on shard 2 and filter by course C
  * the conversation between A and B should show up

Change-Id: I0289ba8ecd44b50928ae35bfb9006c7e75fa774d
Reviewed-on: https://gerrit.instructure.com/17970
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
2013-03-04 15:53:34 -07:00
Duane Johnson 5d6215c3a6 add last_activity_at to enrollments
caches the last page view on a course on the enrollment in an
after_filter

Test Plan:
  - visit any page in a course
  - in the console, the student's enrollment should have a
    'last_activity_at' value that is recent

fixes CNVS-3825

Change-Id: I0ea38eb6399f4ea65617bb6a3e5f79dc8db9415c
Reviewed-on: https://gerrit.instructure.com/18154
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Paul Hinze <paulh@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
2013-03-04 12:43:56 -07:00
Joe Tanner 1b833858e7 make student quiz results async to speed up quiz page load time
closes #CNVS-4166

test plan:
- go to a quiz
- click on "Show Student Quiz Results"
- it should load asynchronously

Change-Id: Ie61a48976ec166b26dca46cb347967b0a2099124
Reviewed-on: https://gerrit.instructure.com/18145
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
QA-Review: Joe Tanner <joe@instructure.com>
2013-03-01 17:04:23 -07:00
Eric Berry 10fb1e9284 calendar2 drag event to all day saves as an all day event
this also includes a refactor of CalendarEvent#default_values

fixes CNVS-1661

test steps:
- as a teacher create a new course
- go to calendar (ensure calendar2 is enabled)
- click the 'week' tab
- create a new event
- click and drag the event to the 'all day' row
- ensure that the event stays in the 'all day' cell
- drag all day event to another all day event cell
- drag non all day event into another days all day event cell
- drag an undated event to all day

Change-Id: Ib9c109071110cf251b5a9c64b37df2054f0fd90c
Reviewed-on: https://gerrit.instructure.com/17770
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
Reviewed-by: Mark Ericksen <marke@instructure.com>
2013-03-01 15:56:37 -07:00
Zach Pendleton 2976d9c60f add setting to control institution email address.
fixes CNVS-4001

allow institutions to prevent students from removing
their institution-given, SIS-imported email address
from canvas.

test plan:
  * in an account set the 'Users cannot delete their
    institution email address' setting to true;
  * create an SIS-imported communication channel;
  * as a student or teacher in the account, create
    and confirm a new communication channel and set
    it to your default;
  * verify that you cannot delete the SIS-imported channel
    using the UI (e.g. the trash can icon will not
    display);
  * verify that attempting to delete the SIS-imported
    channel from the API returns a 401.

Change-Id: If9b92f9436d6fe027a977894a1819792530435c4
Reviewed-on: https://gerrit.instructure.com/18071
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Willesen <jonw@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
2013-03-01 15:08:56 -07:00
James Williams 82dd8df77e allow default_time_zone to be updated through account api
test plan:
* update an account through the api using the parameter
  account[default_time_zone]
* make sure invalid time zones are rejected
  (response status 400, 'unrecognized time zone'
   in the errors)
* GET accounts and
  ensure the default time zone is returned

fixes #CNVS-3507

Change-Id: If83f8a025a9a6c436b6b3599c1180b9d46b9bf02
Reviewed-on: https://gerrit.instructure.com/17663
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2013-03-01 14:49:00 -07:00
Duane Johnson aa3ce93aed interpret shard-aware user_ids in context_controller
User IDs with shard id are not properly interpreted by
context_controller and therefore show the wrong user when viewing from
a shard different from the user's shard.

Test Plan:
  - visit /courses/[course-id]/users/ and add shard-aware user_id. The
    user's profile should be viewable (from any shard)

fixes CNVS-3847

Change-Id: Ida03893668a3ff5d1695e881569bfc5da2aba136
Reviewed-on: https://gerrit.instructure.com/17965
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Duane Johnson <duane@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
2013-03-01 11:27:33 -07:00
Simon Williams b7deea32cf add varied due dates to discussions
closes CNVS-505

this adds the multiple due dates widget to the discussions edit interface.  as
a side effect it allows for setting lock dates for discussions, which was
previously unavailable.

test plan:
- in a course with multiple sections
- make sure discussions with a single due date still work
- make sure you can add different due/lock/unlock dates to different sections

Change-Id: I4a12168051b1ddffee1180e623573e7d367d2051
Reviewed-on: https://gerrit.instructure.com/17950
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Stanley Stuart <stanley@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
2013-03-01 11:13:49 -07:00
Simon Williams f4cfb69309 add assignment options to discussion edit page
closes CNVS-3987

discussion new/edit pages now provide full assignment
options for discussions that have assignment details.

test plan:
  * attempt to create a new discussion assignment and
    verify that new options can be set/save properly;
  * edit an existing discussion assignment and verify that
    previously set assignment options display properly and
    that changes are properly persisted.
  * also make sure that announcements still work properly

Change-Id: I773bf1dd1c4f8feb4a3df9bf374c6b0b5436a963
Reviewed-on: https://gerrit.instructure.com/17863
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Stanley Stuart <stanley@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
2013-03-01 11:13:42 -07:00
Jon Jensen cd6d2de848 remove birthdate from UI, fixes CNVS-4191
test plan:
1. go to /register
2. you should not be prompted to enter a birthdate in any of the flows
3. the forms should work
4. go to your (user) settings
5. you should not see your birthdate nor be able to enter one
6. the form should work
7. go to the self enrollment page for a course as a new user
8. you should not be prompted to enter a birthdate
9. the form should work

Change-Id: I9bf92d27e208696b2aed74b4a6396d434494679c
Reviewed-on: https://gerrit.instructure.com/18143
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
QA-Review: Cam Theriault <cam@instructure.com>
2013-02-28 14:23:38 -07:00
Zach Pendleton 55cb7e6a20 restrict student access to wiki page history.
fixes CNVS-4203

test plan:
  * as the teacher in a course, create a wiki page;
  * as the teacher, view the wiki page's history (using the
    link on the wiki page), and copy the URL;
  * as a student in the course, attempt to view the wiki
    page history by navigating directly to the URL;
  * verify that you receive an unauthorized access message.

Change-Id: Ie43fff754663894bf9c0ef98a02d991803e9d883
Reviewed-on: https://gerrit.instructure.com/18131
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mark Ericksen <marke@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
2013-02-28 13:23:10 -07:00
Ethan Vizitei 15b29294aa google docs front end
FIXES #CNVS-3196

this is the javascript bit that takes duanes
refactored server side for the google docs
submission and makes use of the new endpoint
to lazy-load the google docs into it's tab when
clicked.

TEST PLAN:

This should be a simple replacement of functionality
(with the addition of an ajax loader) so regression
tests on submitting google docs as assignment submissions
are all that should be necessary.

1) login as a user who has authorized with google docs
2) go to the submission page for an assignment
that allows a google doc submission
3) click the google docs tab, you should see a loader
indicator and then the google docs tree.
4) pick a document, it should not allow you to pick
more than one.
5) submit the document, it should give you a success message.

Change-Id: Idd6c85668a40ef37a09631c635f3e83db69178e9
Reviewed-on: https://gerrit.instructure.com/17915
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
2013-02-28 10:45:04 -07:00