Commit Graph

394 Commits

Author SHA1 Message Date
Cody Cutrer c5bd3b122c this migration is non-transactional in dev
Change-Id: I1698e157f1dbcfdc44c5d66bbff6489e6b7c4476
Reviewed-on: https://gerrit.instructure.com/17419
Reviewed-by: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-02-04 12:33:38 -07:00
Jon Jensen f9e4b4f4ed context profiles, refs CNVS-2650
add Profile model which can be used by context-y things, and a basic
CourseProfile model

test plan: N/A, see https://gerrit.instructure.com/17020

Change-Id: I68f4a5a4f0913167e7e25e7bc231b5bf8394c335
Reviewed-on: https://gerrit.instructure.com/17019
Reviewed-by: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-02-01 17:57:07 -07:00
Cody Cutrer 996a457bdc make assignments_needing_x shard safe
fixes CNVS-2200

normalize ignores out of the users.preferences column into
its own table. makes it more performant, and shard safe

test plan:
 * add a user as a teacher in courses on two different shards
 * set up an assignment needing grading (i.e. have a student
   submit an assignment that requires grading) in both courses
 * the assignment should show up on the teacher's dashboard
   regardless of which shard he's on
 * ignore the assignment on your dashboard on one shard
 * reload - it should stay gone
 * it should also be gone on the other shard
 * have another student submit to that assignment
 * it should come back on both shards for the teacher
 * ignore it, permanently this time
 * have another student submit to that assignment
 * it should still be gone on both shards

Change-Id: I6646410273c6be05d4b21b29b6ab76feb8e65d0f
Reviewed-on: https://gerrit.instructure.com/17295
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
2013-02-01 17:08:41 -07:00
James Williams 67b9f83722 don't allow multiple root folders for courses
change the way we create the default course root folder
("course files") to use a atomic sql statement

this should prevent suspected race conditions from creating
multiple root folders for a course, as this causes the
files page to become unusable

test plan:
* Unfortunately there seems to be no consistent way to
 reproduce the errors, and thus no consistent way to
 test that this fixes the error

Change-Id: I223a2b230921752ef1175c82adfdd854e1331668
Reviewed-on: https://gerrit.instructure.com/17014
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Bracken Mosbacker <bracken@instructure.com>
2013-02-01 16:02:16 -07:00
Bracken Mosbacker 26ec655a8d Allow uploading subtitle tracks to videos
when you upload a video, you will now see a [cc]
box in the player for that video if you are
the uploader of that video and in a modern browser.
it will have a link to upload a caption track in
SRT or WebVTT format in any language you specify.

once you attach a caption track to any of your
videos, other people that view it will be able
to choose that track while playing it.
helpful for people that are deaf or that speak
another language!

this change also adds google analytics tracking to
videos so we know when a given media_id was
played, paused, and ended.

Test Plan:
* record a video, go to play the video
* you should see a [cc] button
* click the "upload subtitles" link, a dialog should appear
  that lets you choose a language and file to upload.  here's
  one you can test with:
  http://mediaelementjs.com/media/NT113_u008_v005_transcript.srt
* refresh, you (and anyone else that can see video)
  should now have the option to select that track
  for subtitles. (if using in HTML5 player)
* you should see a delete 'x' on it to delete
  it, when you click it it should go away. reload
  to make sure it is not there.
* The user who created the video, or any admins of the course
  the video is in should be able to manage these captions

closes CNVS-324

Change-Id: Id6d4abcb581f0daf101d601221dc45edaad6eaa8
Reviewed-on: https://gerrit.instructure.com/16882
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2013-02-01 12:53:16 -07:00
Cody Cutrer 357429ae14 handle private hashes for sharding
refs CNVS-1171

test plan:
 * begin a conversation with a (single) user from a different shard
 * "re"-begin a conversation with the same user from a different
   shard
 * it should re-use the old conversation
 * repeat, but using conversation batch (the async option in the API,
   I think)
 * begin a conversation between a teacher and a student on a different
   shard
 * have that teacher comment on a submission from that student
 * the submission comment should show up in the existing conversation

Change-Id: I8d11de0e7a1d6e9c9ff8cbfc727819aedacd6602
Reviewed-on: https://gerrit.instructure.com/17026
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-01-31 19:23:21 -07:00
Cody Cutrer e8e81deb5b Cross-shard conversations
fixes CNVS-1171

test plan:
 * full conversations regression test
 * initiate a conversation with a user from another shard
 * reply to that conversation from both the sender and the
   receiver
 * repeat for a group conversation involving two or more
   shards
 * repeat for huge batch conversations with hundreds of
   users and two or more shards
 * known NOT working yet:
   * re-using the correct cross-shard private conversation
   * probably the tagging of messages with Course x,
     Group y, etc.

Change-Id: I52549039875941cd518077cea4e28bfd2bc10dbf
Reviewed-on: https://gerrit.instructure.com/16523
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-01-31 17:11:48 -07:00
Cody Cutrer e71558bbc3 clean up user account associations
refs CNVS-1338

test plan:
 * run the migration on production-like data
 * it should not fail

Change-Id: Ib8527f2cbee05d5e00941286f16c245091b1a2d9
Reviewed-on: https://gerrit.instructure.com/17117
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
2013-01-31 10:41:55 -07:00
Simon Williams 6b2185cf36 remove course.allow_student_assignment_edits
this was a course setting which allowed students to edit assignment
descriptions only.  unfortunately, it didn't work, because the form validation
code assumed a title input field would be present and tried to require that it
was there.

closes CNVS-3267

test plan:
- make sure the setting is not availble in course settings
- make sure students cannot edit assignments
- make sure teachers can still edit assignments

Change-Id: Iebeaa00f357a59bff8462ecde79c57d68c04320f
Reviewed-on: https://gerrit.instructure.com/17056
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
2013-01-31 09:20:58 -07:00
Jeremy Stanley bb005dda58 course batch update api
also adds a new Progress class and API endpoint for
managing new background jobs.

fixes #CNVS-561

test plan:
 * refer to the API documentation for Courses
   and Progress
 * use the Update Courses endpoint to offer, conclude,
   and delete multiple courses in a batch
 * use the Query Progress endpoint to check the
   status of a batch
 * make sure offering already published courses
   succeeds, and also concluding already concluded
   courses

Change-Id: I49d89c1f373f4999b6201574b43a20c53ef28b70
Reviewed-on: https://gerrit.instructure.com/16844
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
2013-01-29 14:06:03 -07:00
Cody Cutrer 1adac7579a drop context_messages
left over cruft from a very long time ago, in case we needed to
revert stuff

test plan:
 * smoke test conversations

Change-Id: Ie222afc37dd17539e8e993857ed535c1bee4bade
Reviewed-on: https://gerrit.instructure.com/17197
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
2013-01-28 17:55:11 -07:00
Brian Palmer c35b234480 remove trailing comma in cassandra create table
This worked in 1.1 but throws a syntax error in 1.2 (which we don't
support yet, but will soon enough)

Change-Id: Ide2d3a39dd1700d04cb7a00620d77af273bf282b
Reviewed-on: https://gerrit.instructure.com/16991
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
2013-01-28 16:16:53 -07:00
Cody Cutrer 54c502c9f8 add index on conversation_messages(author_id)
so that user merges don't kill the db

test plan:
 * merges of users with lots of conversations should be faster

Change-Id: I4cc8f9cc081f205639999c8486e9604d23bc0ff5
Reviewed-on: https://gerrit.instructure.com/17167
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
2013-01-28 11:01:16 -07:00
Ethan Vizitei b1d8f2ef3b user searching module
refs #CNVS-2326

Added a UserSearch module that provides
and interface for searching across the name,
the email, and the sis id (and the database id),
and added a trigram index on the columns
that will be searched against.

also made a slight refactor to the AR
initializer in order to expose
some of the behavior I wanted more granularly
and added some specs to cover it

fixed a small permissions bug in course.rb
and pulled some scoping out of the courses
controller down into the user search module

TEST PLAN:
  This is currently not accessible from
the site itself, this is just the ground
work for the eventual user search api endpoint.
The code is not called by anything currently in
production either so there is no need for
regression testing.  The one thing to check would
be the creation of new users (and pseudonyms and
communication channels).  There have been new
indexes added to columns on those tables
and there is some documentation indicating
that writing to these indexes can be time
consuming if the data set is quite large.  It
would be worth making sure that there have not
been any unacceptable performance regressions
in the creation of any of those record types in
a database that has a full load of data
(comparable to the production environment)

Change-Id: I8fb13a6ec714f27efc8012c5ed2bed4d963c24e6
Reviewed-on: https://gerrit.instructure.com/16459
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2013-01-21 17:25:32 -07:00
Cody Cutrer 795ac516d6 add a specific setting for self registration refs #2660
test plan:
 * a fresh account should not be able to visit /register
 * enable self_registration in script/console for the account
   (see the migration)
 * you should now be able to visit /register
 * no other changes should be visible

Change-Id: Ibfd6a0d23d3c3e37243ffb762e284b8907cd45cc
Reviewed-on: https://gerrit.instructure.com/16713
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Cody Cutrer <cody@instructure.com>
2013-01-11 10:19:39 -07:00
Cody Cutrer 5db8700b1a this migration is non-transactional
Change-Id: Ia54bd05cc58ee95160b52dd27c918df2bba005eb
Reviewed-on: https://gerrit.instructure.com/16719
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2013-01-11 09:04:06 -07:00
Brian Palmer 41279b9251 fix HashAccessTokens migration
Avoid using the model, since the column may have already been added to
dropped_columns

Change-Id: I6d7eb623875572ebc3efe9c16e8f677d0fc61dc2
Reviewed-on: https://gerrit.instructure.com/16690
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
Tested-by: Brian Palmer <brianp@instructure.com>
2013-01-10 10:12:10 -07:00
Cody Cutrer 1e339db4c5 add support for applying role overrides to just self or just descendants
* wrap RoleOverride#permission_for with enabled_for? that also takes a
   context of where the permission is being applied, and recalculates its
   enabled-ness relative to that context; use that for checking account
   admin and enrollment permissions
 * refactor User#can_masquerade to properly check for descendant
   permissions

test plan:
 * create a custom role in site admin. give it permission to
   manage permissions
 * in script/console, find that override and set apply_to_self=false
 * add a user to that role, and login as that user
 * the user should not be able to change permissions in site admin
 * the user should be able to change permissions in the default
   account
 * add another role in site admin. give it permission to manage
   permissions
 * in script/console, find the override and set apply_to_self=true,
   apply_to_descendants=false
 * add another user to that role, and login as that user
 * the user should be able to change permissions in site admin
 * the user should not be able to change permissions in the default
   account
 * the first user should not be able to masquerade as the second user
   and vice versa
 * an Account Admin should be able to masquerade as either user
 * create a custom role in the default account, give it permission
   to manage permissions, and add a user to that role
 * the first user should be able to masquerade as the new user;
   the second user should not be able to masquerade as the new user

 * general regression tests on permissions and masquerading

Change-Id: I20a1183b7dfec419634a92cda498f245187060ef
Reviewed-on: https://gerrit.instructure.com/15896
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Cody Cutrer <cody@instructure.com>
2013-01-08 11:01:13 -07:00
Zach Pendleton a69f77218d add groups to collaborators table, add api endpoint.
refs #CNVS-1160

adds group_id to collaborators table to identify
collaborators associated w/ a group versus collaborators
added as individuals.

also adds a new API endpoint to return collaborators for
a given collaboration.

test plan:
  * run migrations to add the group_id column;
  * create new collaboration and add at least one user
    as a collaborator;
  * in the console, add a group as a collaborator, giving
    it a group_id and no user_id;
  * make a GET to /api/v1/collaborations/:id/members
    and verify that users added as individuals are
    returned as type 'user' and that users added with
    group_ids are returned as type 'group' and not
    displayed as individuals.
  * verify that one record exists for each collaborator
    regardless of type;
  * verify that adding per_page params will paginate
    requests to the endpoint.

Change-Id: Id509fd0e7eebe6a889b2ca86e8d7d8d1a9e93c63
Reviewed-on: https://gerrit.instructure.com/16203
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mark Ericksen <marke@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
2013-01-04 20:18:04 -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
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
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
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
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
Jeremy Stanley 8c609bf92e enforce unique role names within an account
also fix a bug in the spec where we weren't testing what we
thought we were testing

test plan:
 1. try to create two roles with the same name
    in the same account.  this should fail.
 2a. create a role.
 2b. change a permission in the role.
 2c. delete the role.
 2d. create a role with the same name as the one
     deleted in the last step.  this should
     succeed.
 2e. the permission change made in 2b should not
     be present in the newly created role

Change-Id: I3d7eb3a3f14c75eb42d1a1da22603b41c7e25b94
Reviewed-on: https://gerrit.instructure.com/15743
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
2012-12-04 13:52:25 -07:00
Stanley Stuart f4b8c3c8ef add the ability to take quizzes one question at a time
fixes #11781

This commit also adds the ability for quiz creators to restrict students
to only submit their answers for a question once, preventing them from
returning to a question they have already answered.

test plan:
- create a normal quiz, a 1-question at a time quiz, and a quiz that locks
  answered questions
- as a student, take each of these quizzes, making sure they work as expected
- make sure to use the next/previous buttons, the sidebar links, and try
  submitting in the middle of a quiz vs at the end of a quiz
- try to get back to a previous question on a locks answers quiz, make sure
  there is no way to do this.
- normal quizzes should function as you would expect.

Change-Id: Icb7efc646a51549269e3a4ead2c7f34b00e94103
Reviewed-on: https://gerrit.instructure.com/15292
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Stanley Stuart <stanley+gerrit@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Reviewed-by: Dave Donahue <dave@12spokes.com>
2012-12-01 22:59:31 -07:00
James Williams f06cfbf0f6 migrate account membership types to new role engine
test plan:
* migrate and confirm that the csv in
 account.membership_types is now split into
 Role objects with base_role_type of
 'AccountMembership'
* also, roleoverrides that aren't referenced
 in membership_types are assumed to have been deleted
 so confirm that a Role is still made
 but it is 'inactive'

Change-Id: Ic96c0ecdfd70e5678f74467686a9c9f385e53725
Reviewed-on: https://gerrit.instructure.com/15712
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
2012-11-30 16:42:24 -07:00
Brian Palmer f59e84b664 optimize the page views cassandra migrator
refs #11772

The previous strategy didn't perform as hoped, so we've switched to the
(account_id, created_at) index. This required storing a separate
progress state per account_id so we can migrate one account at a time.

At the same time I decided to switch from newest-first going backwards
to oldest-first going forwards. This will make it easier to do the
entire migration while still on db page views, then switch to cassandra
page views, then do a 2nd migration just to move over the small # of
page views created in the interim.

test plan: generate some db page views in multiple accounts. then switch
configuration to cassandra page views. run rake
db:migrate_pageviews_to_cassandra and the existing db page views should
now be in cassandra, including showing up in the user's page view
history.

Change-Id: Ic748376032a4305a0537f398670fb37ee17b071c
Reviewed-on: https://gerrit.instructure.com/15489
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
2012-11-30 13:30:03 -07:00
Cody Cutrer d10832b605 fix needs grading count trigger for mysql. fixes gh-245
test plan:
 * use mysql
 * accept a course invitation

Change-Id: I8307c2d5925f85dd3be7c4aded6fa822518be3b2
Reviewed-on: https://gerrit.instructure.com/15716
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
2012-11-30 09:22:10 -07:00
Ethan Vizitei c8b1c36d6f refs #8395 expanded page views
force a page_view record when
submitting an assignment
and when updating an assignment
description

force a page_view when
starting a new discussion
or when replying to a discussion

force a page_view when updating
a wiki page and when joining
a conference and when starting
a collaboration

start tracking http methods for
page views

don't link through to urls
for page views if they aren't 'get'
methods

pull some of the page_view logging
down into the asset_user_access
object and simplify it so
that the application controller is
more readable and the scoring incrementing
is easier to understand

TEST PLAN:
  1) login as a student
  2) turn in an assignment submission
  3) take a quiz
  4) update an assignment description
  5) start a discussion and reply to it
  6) login as an admin and confirm through
     analytics and through the detailed
     page view listing that all these
     actions counted as participations
     (and that the ones that are not
      'get' methods can't be clicked through
      from the student accound details page)

Change-Id: I2dfe4df41e8b006e6a0c0d8a1f914ecd7fb62477
Reviewed-on: https://gerrit.instructure.com/15428
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-11-30 08:34:18 -07:00
Cody Cutrer bdbeeb992d cross shard dashboards
two major pieces:
 * use context_type/context_id instead of context_code for
   three relations so that sharding extensions will
   automatically work
 * deserialize stream item data as actual AR objects instead
   of OpenObject (for similar reasons)

test plan:
 * run the predeploy migration, but not the postdeploy one
 * view your dashboard on a shard other than your home shard;
   it should be identical to your home shard
 * view courses that you are enrolled in with the same id but on
   different shards. the activity stream should have the correct
   data for the course in that shard, for both courses (i.e.
   no mixing of data from the two shards)
 * do actions that generate new stream items, and verify the new
   items appear correctly for the above two steps
 * run the postdeploy migration, wait for the job to finish, then
   repeat the test plan

Change-Id: I8d5fcadb8d971acf7388a12e9151a3e927751f44
Reviewed-on: https://gerrit.instructure.com/15462
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-11-29 17:36:24 -07:00
Brian Palmer 7bda6283ff drop the unencrypted token column on access_tokens
closes #8943

now that all access tokens have the crypted_token field filled in, we
can drop the unencrypted column.

test plan: both before and after running the migration, you should be
able to use existing access tokens to make api calls, and create new
access tokens.

Change-Id: I83cfb2342ad2302bb7b43aabc528341d1d265920
Reviewed-on: https://gerrit.instructure.com/15601
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
2012-11-28 14:19:22 -07:00
Jeremy Stanley 22e89bba38 check for name conflicts when validating Roles
refs #11739

Change-Id: I4cdca3926af368aef9ad00fd026af17f4daec525
Reviewed-on: https://gerrit.instructure.com/15634
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
2012-11-28 08:46:14 -07:00
Jeremy Stanley ec71b713f6 data structures for course roles engine
closes #11739

test plan: run specs (this is just infrastructure, no
functionality yet)

Change-Id: Icbe5a8db49665cede4371e023c6e37c32a1ad978
Reviewed-on: https://gerrit.instructure.com/15511
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-11-26 13:49:56 -07:00
Zach Wily 207c333ab3 Revert HTML5 video playback and subtitles
There are still several issues that need to be resolved with this, so it's
being removed from master for now.

Commits being reverted are:

f77b1d77f0
  "make media_object info action not an api, fixes: #11464"
497156a4f7
  "fix error when viewing a video file that has an unknown source type"
39eaab2269
  "use the playlist urls to get kaltura urls"
a22f8c13a3
  "Use html5 to show videos by default & show subtitles"

Change-Id: Iefcef83a42174634485e1c61e993244b0029aae2
Reviewed-on: https://gerrit.instructure.com/15440
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
2012-11-16 11:30:53 -07:00
Jeremy Stanley 6edaff4a7d VDD: notifications; closes #10896
The following changes have been made:
 - Assignment Created
  - students see the due date that applies to them
  - admins see "Multiple Dates"
 - Assignment Due Date Changed
  - students see the due date that applies to them;
    they receive no notification if their date doesn't change
  - admins receive a separate notification for each due
    date that changes, that they have access to;
    the message indicates which section or group applies
    (section-limited TAs will not get messages about due dates
    in sections they can't see)
 - Assignment Submitted Late
  - the message text does not change, but the student's overridden
    due date is checked
 - Group Assignment Submitted Late
  - same as previous

There were some bugs fixed along the way:
 - no longer send duplicate Assignment Submitted and
   Assignment Resubmitted notifications when an assignment
   is resubmitted
 - Group Assignment Submitted Late actually goes out
   (there was a typo in the whenever clause)

Test plan:
 - Create a course with two sections and a teacher
 - Enroll a student in each section
 - Enroll a section-limited TA in each section
 - Make sure everybody involved is signed up for "Due Date"
   notifications, ASAP
 - Using the API, Create an assignment with a default due date
   (in the past) and an overridden due date for section 2
   (in the future).  the assignment and override must be
   created in the same request (use the "Create an assignment"
   API and supply assignment[assignment_overrides]; it may
   be easier to use a JSON request body)
 - Verify that everybody got an "Assignment Created"
   message (use /users/X/messages)
   - the teacher should see "Multiple Dates",
     as should the TA in section 2 (because the default date
     is still visible to him)
   - the student and the TA in section 1 should see
     the default due date
   - the student in section 2 should see the overridden
     due date
 - "Due Date Changed" messages will not go out for assignments
   that were created less than 3 hours ago (by design, and not
   new with this changeset), so for the remaining items, you
   either need to wait 3 hours, or falsify created_at for the
   assignment you just made...
 - Change the default due date for the assignment, leaving it
   in the past
  - Everybody except the student in section 2 should get a
    notification with the new date
 - Change the overridden due date for section 2, leaving it
   in the future
  - everybody except the teacher and TA in section 1 should get
    a notification about the new date
  - the teacher and section-2 TA's notifications should indicate
    that they apply to section 2 (the student's should not)
 - submit the assignment as each student
  - the teacher should get one notification about each submission:
    the one about the student in section 1 should say it's late;
    the one about the student in section 2 should not
 - submit again
  - the teacher should get one notification about each submission:
    the one about the student in section 1 should say it's late;
    the one about the student in section 2 should not, and should
     be identified as a resubmission
     (there is no late-re-submission notification)

Change-Id: I26e57807ea0c83b69e2b532ec8822f6570ba1701
Reviewed-on: https://gerrit.instructure.com/14662
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
2012-11-14 09:04:07 -07:00
Simon Williams dd62ef5805 new dashboard design
the new dashboard design categorizes recent activity into buckets that can be
expanded/collapsed, and inidividual messages can be dismissed.  the categories
are announcements, conversations, discussions and assignments.  this redesign
applies to the homepage dashboard, the group home page, and the course homepage
when "recent activity dashboard" is selected as the course home page type.o

the motiviation is that the dashboard should capture and present in one place
important information happening in all the user's courses or groups, and allow
for jumping into this information to see more details:

- announcements/discussions should show on the dashboard when they are created,
  or when there are root replies to recent announcements
- conversations should show on the dashboard when there is new activity
- assignments should show on the dashboard when they are created, or when
  changes are made at least a couple hours after being created

the presence of a dashboard item means there is activity for that item that may
be of interest to the user.  additionally, the dashboard items will show
read/unread state (excluding assignments) for items which the user has not yet
viewed.

additionally, global messages such as course inivitations, account level
announcements, and new user messages have been restyled, but will keep their
place above the recent activity widget on the dashboard.

test plan:
- visit many exising user's dashboards and make sure they are functional in the
  new style.
- visit canvas as a brand new user (no enrollments), a new user enrolled in
  a new course and make sure the dashboard is restyled and the messaging makes
  sense.
- make an account level announcement and make sure it shows up on user's
  dashboards.
- create all different types of conversations: single, group, bulk private,
  from submission comment, add user to convo, etc. and make sure the
  appropriate dashboard items appear and make sense
- create discussions and announcements, reply to them at the root level and at
  the sub entry level (sub entries will not make new dashboard items), test
  from both a read and unread user's perspective, making sure dashboard items are
  correct. (note that read/unread state will not be correct for existing items
  before this code is applied, but should be correct for future items moving
  forward)
- dismiss dashboard items and account announcements, make sure they stay
  dismissed.
- test creating assignments, waiting > 2 hours, and updating due dates or other
  assignment details. make sure items appear. note that unread state will not
  exist for assignment notifications.

closes #10783
refs #11038
refs #11039

Change-Id: I276a8cb1fae4c8a46425d0a368455e15a0c470c5
Reviewed-on: https://gerrit.instructure.com/14540
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-11-11 21:56:16 -07:00
Cody Cutrer bb825e08f6 in maybe_drop, only attempt to drop if the column exists
avoids db errors in the common case

Change-Id: I29569079d010dfe7e57ff15f4acd168b4c605307
Reviewed-on: https://gerrit.instructure.com/15199
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2012-11-09 13:24:59 -07:00
Brian Palmer 27a83f69ae migrator for page views db -> cassandra
This is meant to be a one-time run, when setting up a new cassandra
cluster for page views and you want to migrate all your current page
views sitting in your db to that cluster.

test plan: generate some db page views, then switch configuration to
cassandra page views. run rake db:migrate_pageviews_to_cassandra and the
existing db page views should now be in cassandra, including showing up
in the user's page view history.

Change-Id: Ib1b1aa4277c306c1c651e9ca587d3654ab0d00d3
Reviewed-on: https://gerrit.instructure.com/14687
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Duane Johnson <duane@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
2012-10-31 17:10:46 -06:00
Zach Pendleton a030142121 change course root outcome group title to course name.
fixes #11502

previously, the name of the root course outcome group was
'ROOT.' now it's named after the course to reduce user
confusion.

this commit also includes a migration to fix all existing
courses w/ 'ROOT' titled outcome groups.

test plan:
  * create a new course;
  * create an account-level outcome;
  * in the new course, import the account-level outcome by
    visiting the outcomes page, clicking the 'find' button,
    navigating to the account outcome, and clicking the 'import'
    button;
  * verify that the pop-up reads, 'import outcome <outcome name>
    to group <course name>?
  * run the migration and repeat these steps with a previously
    created course; verify that the name still displays properly.

Change-Id: I6f26a9f748b3a5127a751fb9667be9e58b1d4664
Reviewed-on: https://gerrit.instructure.com/14825
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mark Ericksen <marke@instructure.com>
2012-10-31 10:32:00 -06:00
Jeremy Stanley fe56193ec8 remove half-baked assignment reminders feature
we're doing work and consuming storage keeping track of reminder
information that nobody is consuming.

should we decide to implement assignment reminders in the future,
reverting this commit would be an excellent start; then a
delayed_job that periodically called remind! on each result of
AssignmentReminder.needs_sending would get us most of the
way there.

Change-Id: I2b110cab79d53229b30c9fef64aac646b719a700
Reviewed-on: https://gerrit.instructure.com/14569
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2012-10-29 11:20:34 -06:00
Jacob Fugal 52cd995f1b Merge branch 'dev/learning_outcome_refactor'
simple keep-both merge in config/routes.rb

Conflicts:
	config/routes.rb

Change-Id: If4180b9c360f32786acce2a8ad6251437318db21
2012-10-25 15:12:10 -06:00
Brian Palmer 005e42a757 cassandra store for page views
Adds a new back-end store for page_views, using a Cassandra cluster. All
the current page view queries are supported, many using denormalized
views on the data.

test plan:

first, canvas instances that are currently using AR page views
should function as before.

by Setting.set('enable_page_views', 'cassandra') and restarting, you will
switch to cassandra page views. a script to migrate the AR page views to
Cassandra is coming. all page view functionality should work as before.
note that the format of the pagination headers in the
/api/v1/users/X/page_views endpoint has changed.

Change-Id: I2d1feb4d83b06a0c852e49508e85e8dce87507b4
Reviewed-on: https://gerrit.instructure.com/14258
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-10-24 17:23:56 -06:00
Jacob Fugal 2fc15ae69c Merge branch 'master' into dev/learning_outcome_refactor
simple keep-both resolutions for app/models/submission.rb and
config/routes.rb. spec/integration/learning_outcome_group_spec.rb stays
removed.

fixed path->url in outcome group api pagination to match master's new
rules.

Conflicts:
	app/models/submission.rb
	config/routes.rb
	spec/integration/learning_outcome_group_spec.rb

Change-Id: I8dd31e1d3764970a8f683aef362f0cca06abe90e
2012-10-24 13:56:33 -06:00
Jacob Fugal 7aaf63db52 VDD: Assignment#overrides_visible_to(user)
scopes the assignment's overrides to just those that the user can see.
intended for use with admin users (e.g. teachers or tas) not students,
since a student technically can see other students and thus this scope
will let them see the other students' adhoc overrides, which is not
desired. but this should never need to be called in the context of a
student.

test-plan:
 - architectural, run specs

Change-Id: I4e1515c263870a13f073af1b39cb19d223b41ab9
Reviewed-on: https://gerrit.instructure.com/14486
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-10-22 09:32:58 -06:00
Brian Palmer a4317b20db store and query hashed access tokens
refs #8943

This is phase 1. Once this is rolled out and the migrations have
finished, we can implement phase 2, which is dropping the token field so
that plaintext tokens are no longer stored in the database.

There should no longer be any code that reads the token attribute, it's
kept in the database purely to help with the transition.

test plan: before the postdeploy migration runs, access tokens should
still work. after it runs, access tokens should still work.
newly-created access tokens should work as expected. expired access
tokens should still error. For now, the plain-text token field should
still be populated for new tokens.

Change-Id: Icb1b4fdc8e2627ba6540d96d23eb28d874020acb
Reviewed-on: https://gerrit.instructure.com/14491
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-10-18 13:03:53 -06:00
Jacob Fugal 6fc0e64581 VDD: assignment override data structures
refs #10831

test-plan:
  - run specs. this is all infrastructure, no real separate test plan.

Change-Id: Ic67f574b7e4cbffd114f6ed34d306a393a6bd93c
Reviewed-on: https://gerrit.instructure.com/14117
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
2012-10-17 12:47:37 -06:00
Jon Jensen 52f04579ba fix bulk private message attachment regression, fixes #11277
ensure that the attachment associations get created for each bulk private
message. previously we would explicitly create each message, and thus tell
it which attachments it should have. now we create a single message (the
root one) and do the other ones in a delayed job. since we were just
cloning the root message, the associations were not being copied

fortunately, we have all the data, so we can restore any associations that
should have gotten created

test plan:
1. send a bulk private message to a bunch of people, specifying one or
   more attachments
2. ensure that the attachment appears in each created/updated conversation
   (for both sender and recipient)

Change-Id: I1a72b3ef0a047a413b84e780811b84b298c6ec57
Reviewed-on: https://gerrit.instructure.com/14474
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
2012-10-17 09:35:35 -06:00
Ryan Shaw a22f8c13a3 Use html5 to show videos by default & show subtitles
using a library called mediaElement.js, try to show
all kaltura video and audio using html5 and fall back
on flash if needed.  fixes #3969

test plan:
in all the different browsers (including mobile safari/chrome)
try recording webcam videos (as homework submission, as content in a wiki page, etc)
view those same pages
view recorded submission in speedgrader

AND...
Allow uploading subtitle tracks to videos

when you upload a video, you will now see a [cc]
box in the player for that video if you are
the uploader of that video and in a modern browser.
it will have a link to upload a caption track in
SRT or WebVTT format in any language you specify.
once you attach a caption track to any of your
videos, other people that view it will be able
to choose that track while playing it.

helpful for people that are deaf or that speak
another language!

this change also adds google analytics tracking to
videos so we know when a given media_id was
played, paused, and ended.

test plan:
* record a video, go to play the video
* (only) you should see a [cc] button (make sure others don't)
* click the "upload subtitles" link, a dialog should appear
  that lets you choose a language and file to upload.  here's
  one you can test with:
  http://mediaelementjs.com/media/NT113_u008_v005_transcript.srt
* refresh, you (and anyone else that can see video)
  should now have the option to select that track
  for subtitles. (if using in HTML5 player)
* (only) you should see a delete 'x' on it to delete
  it, when you click it it should go away. reload
  to make sure it is not there.

Change-Id: I8ed8f14167e68c750815ec6496a9f992b744aa56
Reviewed-on: https://gerrit.instructure.com/2963
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
2012-10-11 12:28:48 -06:00
Simon Williams 0f53105c2e submission unread counts
refs #10541

add a new unread count to the left nav bar, indicating how many grade changes
have occured since you last viewed the course.  a grade change can either be
a change in score or a comment left on a submission.  when the grades page is
visited, there will be a small new dot next to each submission with new grade
activity, and the count will clear after visiting the grades page.

todo: specs

test plan:
- as a teacher, set up some assignments, including some that are muted, and
  some that are peer review
- as a student, submit these assignments
- the counts should not change
- as another student, complete the peer review
- as the original student the count should be up by one, and there should be
  a blue dot next to the peer review assignment
- as the teacher, grade the other assignments, including the muted one
- as a student the count and dots should represent what was graded and visible
  (everthing but the muted assignment)
- after leaving/refreshing the page, the count and dots should be gone
- as a student, reply to comments on the submissions
- the counts should not change

Change-Id: Ifd5988e37831c4c63314f2aad27ddd2875389dd0
Reviewed-on: https://gerrit.instructure.com/14051
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-10-09 09:41:27 -06:00