Commit Graph

2218 Commits

Author SHA1 Message Date
Cameron Matheson 7f0bdb32eb add verify_hmac_sha1 function to Canvas::Security
Change-Id: I5b84cf9f28911bf38b39d78688259c1e82ee584f
Reviewed-on: https://gerrit.instructure.com/33950
Reviewed-by: Zach Wily <zach@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Cameron Matheson <cameron@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
2014-05-06 20:55:56 +00:00
Cody Cutrer 9b11443ae2 add hooks to Api to find objects from other root accounts
refs CNVS-1180

Change-Id: Ic3e023e1869eefb75efedec028fb54f6fc995918
Reviewed-on: https://gerrit.instructure.com/31948
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2014-05-06 20:19:33 +00:00
James Williams 208cfc7664 fix migration of wiki urls with anchors
test plan:
* import the package referenced in the ticket
* the link on the wiki front page pointing to
 "Header 3 on Index page (directly)" should work

fixes #CNVS-12812

Change-Id: I2d532442d49fd62efe3a333c215a5349b1629bc7
Reviewed-on: https://gerrit.instructure.com/34192
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
2014-05-06 18:45:59 +00:00
Joseph Rodriguez 2d9cfc5ac4 moved Facebook code into gem
fixes: CNVS-12120

test plan:
- regression test facebook functionality

Change-Id: I041e726ee12f9eca8fc27ccdd049422073d1af15
Reviewed-on: https://gerrit.instructure.com/33595
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-05-05 22:32:15 +00:00
Joseph Rodriguez 02761bce6f pull canvas specific code out of Facebook class
fixes: CNVS-12520

test plan:
- regression test facebook functionality

Change-Id: I0016edccd3186e7d55146bf216ec2b07a369c801
Reviewed-on: https://gerrit.instructure.com/33531
Reviewed-by: Joel Hough <joel@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-05-05 22:32:07 +00:00
Raphael Weiner a13f85e0ed move twitter to gem
fixes: CNVS-12492

test-plan:
* Test that all things Twitter related still work

Change-Id: Ib656c5bfcb2dc8490a6fa6f214b0f6dce25ad181
Reviewed-on: https://gerrit.instructure.com/33193
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
Reviewed-by: Liz Abinante <labinante@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-05-05 20:08:27 +00:00
Nathan Mills 8eeb4f5bf0 refactor twitter to not be a mixin
fixes: CNVS-12118

test-plan:
*twitter integration should work

Change-Id: I44a9011eb451aaa8eb196264bb4b65d1635da083
Reviewed-on: https://gerrit.instructure.com/33065
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
Reviewed-by: Liz Abinante <labinante@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-05-05 20:08:17 +00:00
Michael Nomitch 735d8753d1 allow switching grading from letter grade
fixes CNVS-12822

test plan:
  - use api to update assignment
    - change & remove grading type
    - change & remove gradind standard
    - change both & neither
  - go to assignment edit page
    - set a grading standard (not the default)
    - set grading type to letter grade & save
    - change grading type to points
      - ensure the change works
    - reset to letter grade and try again for other
      types

Change-Id: I24f521f9eeb1215d3d77d575371927667a88ee3e
Reviewed-on: https://gerrit.instructure.com/34226
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cameron Sutter <csutter@instructure.com>
Product-Review: Hilary Scharton <hilary@instructure.com>
QA-Review: Anna Koalenz <akoalenz@instructure.com>
2014-05-02 22:19:22 +00:00
Andrew Leung ab78550748 Add full & sortable name fields to SIS User Import
Both fields are optional. If absent, the user's name and sortable_name
will be set in the same manner as before.

The full_name field takes precedence over first_name and last_name. The
sortable_name field takes precedence over the inferred value.
2014-05-02 14:09:26 -07:00
Jeremy Stanley f84003358f allow zip file import migrations on users and groups
test plan:
 - use the List Migration Systems endpoint on
   a group and a user, and confirm only the
   zip_file_importer is returned
 - use the Content Migrations API to import a zip file
   into folders belonging to Users and Groups
   - try both the POST and the URL workflows
   - ensure migration types other than zip_file_importer
     are rejected in User and Group context

fixes CNVS-11218

Change-Id: I4b407ce76f0b5df60cc9f99795a6d9d3ddf81ae2
Reviewed-on: https://gerrit.instructure.com/33723
QA-Review: Clare Strong <clare@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2014-05-01 15:18:42 +00:00
David Julia 12949cb829 Prefer mp3 for audio comments in api_user_content
When preparing user content for public consumption via the API, we were
hardcoding a media_type of mp4, which prevented clients using API
endpoints (specifically the mobile client) from playing audio comments
which only had mp3 sources.

This adds a new path through media_download that prefers mp3 for audio
media but falls back to the old mp4 behavior. We also maintain backwards
compatibility with other callers using the file_extension based
filtering.

NTRS-43

Test Plan:
 - With both a 'wav' and an 'mp3' sample file:
   - Create an announcement and upload an audio file via the RTE
   - Wait for transcoding to complete in Kaltura
   - The file should play properly in the web browser
   - Open the same announcement in the iOS mobile app
   - The audio file should play properly on the phone

Change-Id: I26735096ea4336cf1acc04eb9649d322f68fa515
Signed-off-by: Paul Hinze <paulh@instructure.com>
Reviewed-on: https://gerrit.instructure.com/33318
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2014-04-30 20:00:13 +00:00
Rob Orton 1951acb152 only allow positive dates in ISO8601 regex
refs CNVS-10087

test plan
 - hit assignments api with valid iso8601 BC date
   example: -2014-10-01T00:00:00-06:00
 - should return 400

Change-Id: Ifc70bb3ce268f2fadc8ed4060ec7925164da5a19
Reviewed-on: https://gerrit.instructure.com/33789
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2014-04-30 19:55:32 +00:00
James Williams 3b6fb6c5e6 rename outcome_gradebook feature flag
fixes #CNVS-11653

Change-Id: I8037521bd6995228271f8bcb66692923d5a779a8
Reviewed-on: https://gerrit.instructure.com/34048
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
2014-04-30 19:07:39 +00:00
Kenneth Romney 31361b5255 extract lib/text_helper to gems/canvas_text_helper
fixes: CNVS-12305

test plan:
summaries email should be formatted correctly with indentations.
twitter messages should not be longer than 140 characters.

Change-Id: I912a63b03c6c14de0c1d678063bb8fa33504d843
Reviewed-on: https://gerrit.instructure.com/33171
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-04-30 15:18:40 +00:00
James Williams 1aa4f25a65 move user attachments on user merge
test plan:
* create two users
* upload files as both users
* merge one user into the other user
* confirm that the final user has the attachments
 from the merged user (after jobs have run) and that
 files with duplicate filenames are renamed
 (however, note that files that have identical content
 and names will not be duplicated)

fixes #CNVS-12264

Change-Id: Id699c24c804808737b763ec37316e03bd1f3c59f
Reviewed-on: https://gerrit.instructure.com/33769
QA-Review: Clare Strong <clare@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2014-04-28 16:47:55 +00:00
Eric Adams 13296197fb add feature flag for post grades passback
fixes SIS-226

TestPlan:
 - verify Post Grades is now available from the root account settings
 - verify Post Grades is off by default and shows hidden and development
 - verify Post grades is viewable from a course once it is enabled from the root account
 - verify that once turned on in a course post grades button is now visible

Change-Id: I58ad6145bda8a1da11d240cf878ff378ce5fac36
Reviewed-on: https://gerrit.instructure.com/33370
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Duane Johnson <duane@instructure.com>
Product-Review: Eric Adams <eadams@instructure.com>
QA-Review: Eric Adams <eadams@instructure.com>
2014-04-26 04:12:54 +00:00
Raphael Weiner 5553f62357 extract incoming mail into gem
fixes CNVS-12182

test plan
- regression test on incoming mail
- use script/process_incoming_emails to manually trigger the processing
  of incoming mail

Change-Id: Iccd74d8fe2b5af3d5eefe25a2736273e3bf559b0
Reviewed-on: https://gerrit.instructure.com/32794
Reviewed-by: Simon Williams <simon@instructure.com>
Reviewed-by: Braden Anderson <banderson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
2014-04-25 23:06:02 +00:00
Joseph Rodriguez 8554d5c894 moving mail processor to module
fixes CNVS-12174

Test Plan:
Regression test on incoming mail.

Change-Id: I3f5d131ce4a1f4408bf95a5455ffc4baa6bdc85c
Reviewed-on: https://gerrit.instructure.com/32716
Reviewed-by: Braden Anderson <banderson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
2014-04-25 23:05:39 +00:00
Joseph Rodriguez 45bb1107c2 inject instance of ErrorReport::Reporter into IncomingMessageProcessor
fixes CNVS-12150

QA Test Plan:
- regression test incoming mail (check error reports)

Change-Id: Ib25cf1ad78cb76db3da5d97cf6e33740e50d472d
Reviewed-on: https://gerrit.instructure.com/32679
Reviewed-by: Braden Anderson <banderson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
2014-04-25 23:05:13 +00:00
Joel Hough 53db21e37b extract secure-id handling from incoming message processor
fixes CNVS-12147

test plan
- regression test incoming mail

Change-Id: Id3d8a95dda3566bae8d395d1b759c7897ab3c1ee
Reviewed-on: https://gerrit.instructure.com/32671
Reviewed-by: Braden Anderson <banderson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
2014-04-25 23:04:53 +00:00
Joseph Rodriguez a8c90d61df Extract and inject incoming message handler
fixes CNVS-12145

QA Test Plan:
- regression test incoming mail
- ensure that reply to discussion topic works

Change-Id: Iae88aa6da5cfe79e51609e233c05e356feacc198
Reviewed-on: https://gerrit.instructure.com/32610
Reviewed-by: Braden Anderson <banderson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
2014-04-25 23:04:42 +00:00
Joseph Rodriguez d88a31330f convert class methods to instance methods for IncomingMessageProcessor
fixes CNVS-12129

test plan
- regression on incoming mail

Change-Id: Ia9ab3419201c9fdbd89e2483a3fde51f54c7f982
Reviewed-on: https://gerrit.instructure.com/32594
Reviewed-by: Braden Anderson <banderson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
2014-04-25 23:04:27 +00:00
Cody Cutrer 9b703545fb Merge pull request #438 from sfu/feature-sis-user-short_name
Add display name field to SIS User Import
2014-04-25 16:48:13 -06:00
Raphael Weiner 8be0ae37d7 Move google_docs code into a gem
fixes: CNVS-12329

Change-Id: I044725c93582cbca39a61e036bb5f0385e069c1e
Reviewed-on: https://gerrit.instructure.com/32990
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-04-25 21:50:43 +00:00
Raphael Weiner c8d7b9f915 Further decoupling of google_docs from models and controllers.
fixes: CNVS-12328

test plan:
  - as admin enable the google_doc plugin
  - as student visit `/profile/settings`
  - click 'Google Docs' under the 'Other Services' section
  - click 'Authorize Google Doc Access' in modal
  - when redirect to google, click 'Allow access'
  - verify success banner displays

Change-Id: I2b45ffa38ac0d1d810fb988335f4cd39154ae2a6
Reviewed-on: https://gerrit.instructure.com/32949
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-04-25 21:50:34 +00:00
Rob Orton 4e90438d25 ensure assignments API uses correct date time format part2
fixes CNVS-10087

test plan
 - assignments PUT and CREATE request will only
   accept is08601 formatted dates
 - will return 400 bad_request
 - still allow clearing the dates

Change-Id: Ie5e25eb1a5e85e0aec0b934f7a256b7a8b0dc473
Reviewed-on: https://gerrit.instructure.com/32634
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2014-04-25 21:50:00 +00:00
Andrew Leung d495a3223b Rearrange add_user args to maintain compatibility 2014-04-25 14:23:45 -07:00
Eric Adams be040d6713 Added Post Assignment to SIS
fixes SIS-214
fixes SIS-229
fixes SIS-230

TestPlan:
 - go to account settings and verify post grades feature is enabled
 - go to course settings and verify post grades feature is off
 - create a new assignment, verify "Post Assignment to SIS" checkbox is not present in the view
 - go to course settings and enable Post Grades
 - create a new assignment and verify Post Assignment to SIS is present in the view and checked. NOTE: it should be checked by default if this is a NEW assignment
 - save the assignment
 - edit the assignment again and the post grades checkbox should be true
 - uncheck the post assignment to sis checkbox, save
 - re-edit the assignment, the post grades checkbox should be unchecked

Conflicts:
	app/coffeescripts/models/Assignment.coffee

Change-Id: I34cba5add03b3cb935b502e47b4537bf93c5b7c1
Reviewed-on: https://gerrit.instructure.com/33411
Reviewed-by: Eric Adams <eadams@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Reviewed-by: Duane Johnson <duane@instructure.com>
Product-Review: Eric Adams <eadams@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2014-04-25 18:23:04 +00:00
Derek DeVries bcd5bc3594 fix failure of quiz submissions to merge properly in user merge
fixes CNVS-12512

test plan:
  - create two users and enroll them in the same course
  - create a quiz in the course and have User_B take the quiz
  - using the user merge api:
    https://canvas.instructure.com/doc/api/users.html#method.users.merge_into
  - merge User_B into User_A, so that User_A will be the new primary user
  - check the quiz submissions and notice that the user should have submissions

Change-Id: I8c91d61b418ed486956d13f334f71684fa95cfb5
Reviewed-on: https://gerrit.instructure.com/33788
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
2014-04-25 14:48:21 +00:00
Andrew Leung 1b6e4a6ba3 Remove error for setting short_name w/o first+last names 2014-04-24 14:02:31 -07:00
Jeremy Stanley 938543b0ab set Attachment#user_id when uploading files via the API
test plan:
 - upload a file via the API using the POST workflow
 - upload a file via the API using the remote URL workflow
 - examine both Attachment objects via the Rails console.
   the user_id should be set to the uploading user

refs CNVS-11219

Change-Id: Ic61901f7dfac99d74efc57e42e97b90aaf133433
Reviewed-on: https://gerrit.instructure.com/33513
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mark Severson <markse@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2014-04-24 20:58:47 +00:00
Eric Adams 933bff25d3 Add integration Ids to API
fixes SIS-135
fixes SIS-136

Change-Id: Ide2f51765c76a50f09d54d2865357b5ff38bc360
Reviewed-on: https://gerrit.instructure.com/28587
Reviewed-by: Duane Johnson <duane@instructure.com>
Tested-by: Duane Johnson <duane@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Eric Adams <eadams@instructure.com>
2014-04-24 20:43:45 +00:00
Joseph Rodriguez baeeb6efc3 refactor and make gem rake task inclusion explicit
fixes: CNVS-12513

test plan:
- run rake tasks for i18n and jst

Change-Id: Ied2b1d67979e55356adfef1cc7aaed42aa0c4b5a
Reviewed-on: https://gerrit.instructure.com/33501
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
2014-04-24 15:50:31 +00:00
Raphael Weiner 732d4991e5 extract linkedin into a gem and add tests
fixes: CNVS-12119

test plan:
regression test linkedin functionality

Change-Id: I9cec121d641db37d4c8f6a04966e766e9f8b293e
Reviewed-on: https://gerrit.instructure.com/33473
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Jason Madsen <jmadsen@instructure.com>
2014-04-23 20:23:55 +00:00
Raphael Weiner a79605a2ce remove Canvas specific code from LinkedIn
fixes: CNVS-12505

test plan:
regression test linked in functionality

Change-Id: I7d4c327eefb8ac976c1d51e36aa6514c1742f739
Reviewed-on: https://gerrit.instructure.com/33458
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Jason Madsen <jmadsen@instructure.com>
2014-04-23 20:21:47 +00:00
Jeremy Stanley 5ece88c815 return file's uploading user in api
test plan:
 - consult api docs for files index and show actions
 - upload some files via the files page, putting files
   up with at least two different users
 - do index with ?include[]=user
  * user who uploaded each file should be returned
 - do show with ?include[]=user
  * user who uploaded the file should be returned

fixes CNVS-11534

Change-Id: I973f96e67d80a5c000482c60d57f928004901f2a
Reviewed-on: https://gerrit.instructure.com/33622
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mark Severson <markse@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2014-04-23 20:20:52 +00:00
Raphael Weiner 71d9f96279 extract canvas_ext gem
fixes: CNVS-11902

Test Plan:

Make sure Canvas is not broken.  This will break a lot of things if it
does not work correctly.

Change-Id: I8701ff8c271a162a712fe3be05a4fd361430b26e
Reviewed-on: https://gerrit.instructure.com/32113
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Jason Madsen <jmadsen@instructure.com>
2014-04-23 17:39:32 +00:00
Raphael Weiner 19926a2120 Change LinkedIn to be standalone class not mixin.
fixes: CNVS-12498

Test Plan:
* regression test linkedin functionality

Change-Id: I7ba55dea595d6380e68d5a90b272d67807cb55cf
Reviewed-on: https://gerrit.instructure.com/33441
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Jason Madsen <jmadsen@instructure.com>
2014-04-23 17:30:27 +00:00
Raphael Weiner a482d88d21 Remove unused code from Linkedin module
fixes: CNVS-12494

test plan:
* regression test for linkedin

Change-Id: Ibf6c78d767301184bc487813384f7c33ad78997a
Reviewed-on: https://gerrit.instructure.com/33428
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Jason Madsen <jmadsen@instructure.com>
2014-04-23 17:25:32 +00:00
Andrew Leung ba3a347533 Add display name field to SIS User Import
The display name (short_name) field is optional. If absent, short_name
will behave as before. If present, it will explicitly set short_name to
the given value, unless it's a stuck SIS field of course.

Previously, if first and last names were not given, the user's name will
be a single space. The behavior is the same now, except when short_name
is present. In that case, an error will be thrown.
2014-04-22 11:50:18 -07:00
Mark Severson b90c8467cf add lock information to module items api
test plan:
 * create a module
 * add an unlocked module item to the module
 * add a locked module item to the module
 * query the module's item list with include[]=content_details
   - the content_details for each item should include:
     - locked_for_user
     - lock_explanation (for locked items)
     - lock_info (for locked items)

fixes CNVS-12296

Change-Id: I68c994ea5d0323e736388e59e48f2d08539f1b1c
Reviewed-on: https://gerrit.instructure.com/33142
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Sterling Cobb <sterling@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2014-04-22 16:04:24 +00:00
Jason Madsen ec7751f341 move migration importers to app/models/importers
closes CNVS-12404

test plan:
  - verify that importing calendar event data continues to work
  - verify that importing with media tracks continues to work
  - verify that importing discussion topics continues to work

Change-Id: Ia5c88cc179e3cc8075270d0d423e618f80d61234
Reviewed-on: https://gerrit.instructure.com/33314
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
2014-04-22 15:35:09 +00:00
Cody Cutrer c2c12ce84f some optimisations for scheduler api json
refs CNVS-5647

test plan:
 * simple regression test of creating, editing, and signing up
   for appointments

Change-Id: Iee2b30ff2ffcd15e4e0664177052eec0f3e5e22b
Reviewed-on: https://gerrit.instructure.com/33402
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2014-04-21 21:30:05 +00:00
Mark Severson a1dde79530 extract handlebars_tasks gem
fixes CNVS-11180

test plan:
 * ensure the jst rake commands operate correctly
	 * jst:compile
	 * jst:ember

Change-Id: Ibe3109cf2708abf08783e06b180eba9299472ccb
Reviewed-on: https://gerrit.instructure.com/29920
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-04-21 19:48:22 +00:00
Jacob Fugal 2474323372 don't localized datetimes formatted for datepicker
refs CNVS-12398

the eventual complete solution will involve teaching the date picker to
parse the localized datetime, but for now, just format the time in
english if the target is a datepicker's field value.

test-plan:
 - set locale to portuguese
 - datepickers (e.g. assignment due date when editing) populated on page
   load should contain the date time in english (e.g. "<date> at 3:00pm"
   vs. "<date> em 3:00")
 - using the date picker should produce a time in english in the field
 - saving the english time should work
 - non-datepicker field values with the same formatting rules (e.g.
   assignment due date when *not* editing) should display localized

Change-Id: Ibc69d2066518b4875c1f42b794df784c7e70c2c7
Reviewed-on: https://gerrit.instructure.com/33444
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Anthus Williams <awilliams@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2014-04-21 15:23:48 +00:00
Mark Severson a1fac754d2 extract i18n_tasks gem
fixes CNVS-11181

test plan:
 * i18n rake tasks still operate correctly

Change-Id: I261973a947ce28840d6817f5a931f5221192e8db
Reviewed-on: https://gerrit.instructure.com/31441
Reviewed-by: Jon Jensen <jon@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-04-21 03:19:47 +00:00
Mark Severson 4fbe46509c extract i18n_extraction gem
fixes CNVS-11182

test plan:
 * rake i18n tasks work correctly
 * rake jst tasks work correctly

Change-Id: I9777649e338d81cd7129c887acc18d9ef6722a92
Reviewed-on: https://gerrit.instructure.com/31440
Reviewed-by: Jon Jensen <jon@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-04-21 03:19:30 +00:00
James Williams 68094f6217 fix and simplify learning outcomes in selective content import
the current learning outcome selection only occurs during course copy,
and will not bring in any outcomes that are in a group

in the future, we would like to add detailed item selection to the
dialog, but for now, make a simple solution that at least works

test plan:
* for both course copy, and course export/import, confirm that
 the 'select content' option gives you a checkbox to either bring
 in all the learning outcomes (and their groups) or none of them

fixes #CNVS-7464

Change-Id: I06a423ea949442cbba1459e04154681b6b2859bc
Reviewed-on: https://gerrit.instructure.com/33031
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Product-Review: Hilary Scharton <hilary@instructure.com>
2014-04-18 17:29:13 +00:00
Ryan Shaw 95faa5fb36 Convert 'high-contrast' from user pref to feature flag
fixes: CNVS-11426

a few months ago we started trying to enable users to turn
on some "high contrast" css changes. The way we did that was
with a override css file that would go and override existing
style rules to set them to new values.  the main difference
here is that it is done at the *source of where the variable
is declared* instead of *after the fact, overriding what was there*
this will make things a lot easier to maintain.  for example, see
the part where instead of having a huge selector to override a bunch
of things that look like links to be darker, we just go and set the
$linkColor sass variable to be a little bit darker.

test plan:
* before you check out this code, go to /settings and turn on the
  'high_contrast' user theme.
* run the db migration in this commit
* now go to /settings and make sure that the 'high contrast' feature
  is enabled.
* verify that with that feature enabled, when you go to /styleguide
  you should see higher contrast buttons, link text, and backgrounds
* it wont be exactly the same as when you had the 'high contrast' theme
  enabled because some of the high contrast things weren't super important
  (specifically, the darker grey borders on some elements). but the most
  important changes, making the contrast between text and the background
  around it, should be there.

this essentially reverts:
"adds high-contrast theme user preference"
b232dcf448.

this also makes jmadsen's change to make the green
alert bar a little darker (to comply with contrast)
in g/31881 apply across the board to all of our
green things so they are all compliant. (in addition,
now if they have high contrast enabled, it will be
even darker green)

Change-Id: Iee7d81bb5160e86f1900dbf4a249364b1ddfa7f1
Reviewed-on: https://gerrit.instructure.com/32863
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2014-04-17 19:47:38 +00:00
Ryan Shaw 0b4e9fe5d8 make rake canvas:compile_assets a TON faster
...by parallelizing everything I could

fixes: CNVS-12362

`time bundle exec rake canvas:compile_assets`
(on my I7 2.3GHz macbook pro)
before: "322.56s user 26.62s system 173% cpu 3:21.05 total"
after: "425.91s user 30.71s system 413% cpu 1:50.35 total"

If you ever find yourself needing to run everything all
sequentially (and not in multiple threads), you can
set the environment variable CANVAS_BUILD_CONCURRENCY=1
by default it will use all the cores your system has

You're welcome, anyone that has ever had to build canvas
or wait for jenkins to run :)

Test Plan:
* run "time bundle exec rake canvas:compile_assets"
* checkout this code
* run it again
* verify that it is faster, and everything works

Change-Id: Ib01506bc9638e86f4a329284458706279ef751ab
Reviewed-on: https://gerrit.instructure.com/33127
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2014-04-17 19:47:17 +00:00
Ryan Shaw ca503542e2 a way for accounts to opt-in to new styles and users to high-contrast
fixes CNVS-11426

The UI/UX team *really* wants to start doing some major style changes
to the canvas interface. Because it is a very visual change and especially
because we've let people hack the crap out of canvas styles with
their own css override file, any changes we do need to be behind a
feature flag so an institution can opt-in when they are ready.

This commit does some trickery so we actually create 4 different versions
of every stylesheet. one for each variant in:
legacy_normal_contrast legacy_high_contrast
new_styles_normal_contrast new_styles_high_contrast
and then sets the $use_new_styles and $use_high_contrast sass variables
accordingly in each.

now, in any sass file, you can do things like:
  @if $use_new_styles {
    background-color: red;
  } @else {
    background-color: blue;
  }

  @if not $use_high_contrast{
    font-size: 12px;
  }

test plan:

* in a production (minified assets) environment, ensure you see:
  <link href="/assets/common_legacy_normal_contrast.css... in the <head> of the page
* go to the account settings page for the domain_root_account you are on
* turn on the "Use New Styles" feature
* now verify that <link href="/assets/common_new_styles_normal_contrast.css...
  is in the <head>. There should not be any visible differences because we do
  not have any styles that target specifically $use_new_styles yet.
* now, go to /settings and turn on the user feature for "Use High Contrast Styles"
* verify that <link href="/assets/common_new_styles_high_contrast.css..
  is in the <head>
* again, turning that on will not actually change the way anything looks,
  the next commit (g/32863) will take care of that

Change-Id: I45ba4ddfe780c5c819fb995b61ebfc0a5325d418
Reviewed-on: https://gerrit.instructure.com/31881
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
2014-04-17 19:47:05 +00:00
Joseph Rodriguez c6fce9e781 extract bookmarked_collection gem
fixes: CNVS-11645

Test Plan:

Test the groups api endpoint at

api/v1/users/self/groups?context_type=Account

Make sure its not broken.

Change-Id: I2a17672f0e81530aa8623c5ed16b9cb0bb6b3ce5
Reviewed-on: https://gerrit.instructure.com/31417
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
2014-04-17 18:16:13 +00:00
James Williams 1ae166f3ff export/import/copy course tab configuration with external tools
test plan:
* create a course with an external tool (either configured
for the course or on an account-level) that adds a course
 navigation tab
* arrange the tabs in the course settings
* copy the course, or export the course and then import
 into a new course
* should retain the same tab configuration as the original course

fixes #CNVS-8866

Change-Id: I8ee7cb5bd2e098829994e63f4fbd1ca4d0afd701
Reviewed-on: https://gerrit.instructure.com/32906
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mark Severson <markse@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2014-04-17 17:45:46 +00:00
James Williams fbb05045c1 enable domain substitutions in imported urls
test plan:
* create a course with html content, with links pointing to a given
domain (e.g. "http://www.example.com/somewhere")

* in the rails console, manually configure the account settings
as follows, (replacing -COURSEID- with the id of the course):

 a = Course.find(-COURSEID-).root_account
 h1 = {"http://www.example.com" => "https://www.not-example.com"}
 h2 = {:domain_substitution_map => h1}
 a.settings[:default_migration_settings] = h2
 a.save!

* copy the course

* the links should all be translated to the new domain
 (e.g. "https://www.not-example.com")

fixes #CNVS-12325

Change-Id: I0ac2ddf628303ae760995e44c72e2c90a836f966
Reviewed-on: https://gerrit.instructure.com/33472
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2014-04-17 17:24:45 +00:00
James Williams bfbfdf41ee retain assignment muted status on course copy/import/export
test plan:
* create a muted assignment
* copy the course, or use import/export
* the migrated assignment should also be muted

refs #CNVS-12483

Change-Id: I124141ae088cb70a4d93f4270c5ad103c4b24a3a
Reviewed-on: https://gerrit.instructure.com/33415
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
2014-04-17 15:37:14 +00:00
Nick Houle decd207481 support for trusted developer keys
fixes CAT-66

Auto-authorize trusted developer keys during without prompting the end-
user. This will allow for more seamless integrations with other in-house
apps.

Also fix remember-me access so it works when you re-auth into canvas
(previously it only worked if you were already authenticated into
canvas)

Expand test coverage around oauth login scenarios

test plan setup:
* set up a web-based oauth integration with canvas
* ensure your app doesn't currently pass force_login=1 during oauth
* ensure your app doesn't currently delete access tokens during logout
* for part 2, ensure your app uses the /auth/userinfo scope (for part
  1 it doesn't matter)
* for part 3, ensure your app does token request flow (not userinfo)

test plan part 1 (trusted keys):
1. in the canvas console, set trusted=true on the app's developer key
2. do an oauth login as and end-user
3. confirm that you are authenticated into the app without being prompted
   to give it canvas access
4. log out of the app (but not canvas)
5. click to log in again
6. confirm that you are automagically logged in without any prompts

test plan part 2 (remember access):
1. in the canvas console, set trusted=false on the app's developer key (or
   set up your app to use a different one)
2. do an oauth login as and end-user
3. confirm that you are prompted to authorize the app
4. check the box to remember access
5. log out of canvas and the app
6. do an oauth login again
7. confirm you are not prompted to authorize the app
8. log out of the app (but not canvas)
9. click to log in again
10. confirm that you are automagically logged in without any prompts

test plan part 3 (untrusted key, not-userinfo)
1. in the canvas console, set trusted=false on the app's developer key (or
   set up your app to use a different one)
2. do an oauth login as and end-user
3. confirm that you are prompted to authorize the app
4. confirm there is no box to remember access
5. log out of canvas and the app
6. do an oauth login again
7. confirm you are prompted to authorize the app again
8. log out of the app (but not canvas)
9. click to log in again
10. confirm that are prompted to authorize the app again

Change-Id: Ifb2eb29e4da163b595cb070455ebae21a4618ba4
Reviewed-on: https://gerrit.instructure.com/32926
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
2014-04-16 23:18:19 +00:00
Nick Cloward f1009a38fe canvas kaltura gem
fixes CNVS-10479

test plan:
  - in a course with kaltura enabled
    - go to a discussion and add media
    - upload a video (use right tab, not the webcam)
    - save the video/discussion post
    - the video should be saved properly and viewable
      (this sometimes takes a minute of two)

Change-Id: I40b9174807707dd1fb41125e04705422a8711d5d
Reviewed-on: https://gerrit.instructure.com/32024
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-04-16 19:39:45 +00:00
Jason Madsen 306f1583d8 add ember-qunit for ember unit tests
closes CNVS-11294

test plan:
  - enable ember quizzes
  - ensure that existing ember quizzes continue to work
  - all existing ember tests should continue to pass

Change-Id: I4f56b1267504533be8332520ea5f77d2fa566263
Reviewed-on: https://gerrit.instructure.com/33105
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Jason Madsen <jmadsen@instructure.com>
2014-04-16 18:49:45 +00:00
Simon Williams 4da6e615df don't show rubric assess scores in api on muted assignments
fixes CNVS-12403

test plan:
- create an assignment with a rubric, and mute it
- grade the assignment with the rubric for a student
- as the student, query the api for the submission object
- it should not contain the rubric assessment data

Change-Id: Id83a9444f06c59938cd1bd5cac7a6ddb4019d45f
Reviewed-on: https://gerrit.instructure.com/33316
Reviewed-by: Liz Abinante <labinante@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
2014-04-16 04:54:51 +00:00
Brian Palmer 3eb0aa1e54 use the current time for grade change audit events
fixes CNVS-12400

test plan: Enable auditors and trigger some grade change events, such as
auto-graded quiz or teacher-graded submission. They should show up in
the audit logs with the timestamp of the time the event happened.

Change-Id: I596242e09d8acb34443ca0974b7393fc9faa51f6
Reviewed-on: https://gerrit.instructure.com/33342
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
2014-04-15 22:25:15 +00:00
Ahmad Amireh e95305fb7c Quiz Reports API - Index
An endpoint for retrieving all quiz reports for a given quiz.

Closes CNVS-12172

CHANGES
-------

The biggest effort in this patch was to normalize the way QuizReport
objects are interfaced with, and the generation of their CSV attachments
in particular:

  - Quiz#current_statistics_for() now ALWAYS returns a persisted object
    while still considering the freshness of the stats
  - Quiz#statistics_csv() is no longer responsible for testing whether
    the attachment should be generated or not, but instead ensures
    that the CSV will be generated ASAP
  - QuizStatistics#generate_csv() now guards against generating multiple
    attachments
  - QuizStatistics#generate_csv_in_background() now guards against
    queueing multiple generation jobs (by testing the status of the
    Progress object)

QuizReport API changes:

  - new property: "generatable"
  - new property: "readable_type"
  - new property: "url"
  - now accepts JSON-API format for all endpoints:
    - JSON-API allows you to embed file and progress objects directly in
      the QuizReport document, just pass ?include=file,progress

Quizzes API changes:

  - new property (JSON): "quiz_reports_url"
  - new property (JSON-API): "links.quiz_reports"

Some AMS changes:

  - added support for accepting side-loading requests from controllers
    by passing an :includes array to the serializer initializer
  - added support for embedding objects in root, using `embed: :object
    and embed_in_root: true` for has_one associations
  - also, in that same scenario, AMS's default behavior is to wrap
    single objects (has_one) in an array, which didn't work for me, so I
    added a new option called "wrap_in_array" which you can set to false
    when defining the association to override this behavior

Other changes:

  - covered the front-end/javascript that utilizes the reports and
    allows teachers to generate them
  - QuizReport in the front-end no longer relies on magical course_id
    exposed in window.ENV, but instead uses its URL to construct the
    generation URL (see QuizReport#baseURL)
  - Attachment now has a shallow-AMSerializer that proxies to the legacy
    one in lib/api/v1 which allows us to at least side-load them
  - Progress now has an AMS
  - QuizReport legacy serializer in lib/api/v1 removed entirely,
    replaced by the new AMS one

TEST PLAN
---- ----

Endpoint: [GET] /api/v1/courses/:course_id/quizzes/:quiz_id/reports

  - as a teacher, make a request to the endpoint above:
    - it should return a set of two quiz report objects
  - add a parameter "includes_all_versions=true" to the query parameters
    and verify that the "student_analysis" report in the returned set
    now reflects the new value (the reports have a field called
    "includes_all_versions" which should be true in this case, false
    otherwise)
  - as a student, make the request and verify that it rejects you

Endpoint: [GET] /api/v1/courses/:course_id/quizzes/:quiz_id/reports/:id

  - turn on JSON-API mode
  - as a teacher:
    - don't generate the report from the UI yet
    - make the request, and verify that you get only the report
    - generate
    - repeat the request, verify that you still get only the report
    - add a ?include=file query parameter
      - you should read the file document now
    - add a ?include=progress query parameter
      - you should read the progress document now
  - turn off JSON-API mode
  - as a teacher:
    - make the request, and verify you get the "progress_url" field and
      that the file document is embedded automatically without having to
      specify the ?include= parameter

Front-end testing:

  - go to the statistics page
  - generate all reports:
    - verify that the progress bar updates
    - verify that you can download them
    - verify that auto-download occurs unless you refresh the page
      before the report is generated
  - toggle on the "Count All Attempts" button and repeat the above:
    - verify that Item Analysis is not generatable anymore since it's
      not affected by that parameter

Please note that "item_analysis" reports will always have
"includes_all_versions" as true.

Change-Id: I0dc6d5108cbcef78b2fa17ba0476f470d33d402d
Reviewed-on: https://gerrit.instructure.com/32731
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
2014-04-15 19:22:02 +00:00
Jeremy Stanley 94bac92194 make ZipExtractor write files in binary mode
test plan:
 - use rails3
 - create an assignment that accepts file submissions
 - as a student, submit something that isn't plaintext (such as
   an Office document; anything that isn't plain UTF-8 will work)
 - as a teacher, go to the assignment page and select
   "Download Submissions"
 - then refresh the page and select "Re-Upload Submissions",
   and upload the file you just downloaded
 - you should not get a page error

fixes CNVS-12369

Change-Id: I676efc2e8c54419b6bb0ad274d42d0342241a82f
Reviewed-on: https://gerrit.instructure.com/33245
Reviewed-by: Cameron Matheson <cameron@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2014-04-14 23:16:54 +00:00
Raphael Weiner 9a08d9d934 Move time related code into canvas_time gem
fixes CNVS-10748

Change-Id: If9015c54bf54969d8c47e5e39a372e1c5bfe158b
Reviewed-on: https://gerrit.instructure.com/32532
Reviewed-by: Raphael Weiner <instructure@pivotallabs.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: August Thornton <august@instructure.com>
2014-04-14 20:47:01 +00:00
Jeremy Stanley 212287dcab export media comments from copied courses
test plan:
 - attach media comments to a course
 - copy the course
 - export the copy
 - import the package
 - the media comments should be preserved

fixes CNVS-12228

Change-Id: Ie200d65c77856ac0cd8a694c8cb4fb56558cf260
Reviewed-on: https://gerrit.instructure.com/32975
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
2014-04-14 18:05:22 +00:00
Landon Wilkins 4e08f0f7f3 adds completed_at to course_progress API
fixes CNVS-12257

test plan:
* set up a course with modules, module items
** and module completion requirements
* on each module, check the box that says:
** "students must move through requirements in
**  this module in sequential order"
* enroll a user in the course
* with that user's ACCESS-TOKEN, perform:

curl -H "Authorization: Bearer <ACCESS-TOKEN>" \
         -X GET -F 'include[]=course_progress' \
         <canvas>/api/v1/courses

* verify there is a completed_at field in the
** course_progress response
* verify that the completed_at field is nil unless
** the user has completed all the completion_requirements
** for all the modules
* if the user has completed all the completion_requirements
** for all the moduels, the completed_at date should be the
** date associated with the last thing the user did to complete
** the course.
* for example, if the last item is submitting an assignment,
** the completed_at date should be the submission date of that
** assignment
* verify that courses with 0 completion_requirements return
** nil for completed_at date

Change-Id: I6dfd6c7ec4168317cdcac0be13de52e9111f8c13
Reviewed-on: https://gerrit.instructure.com/32983
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Nick Houle <nhoule@instructure.com>
Reviewed-by: Dave Donahue <ddonahue@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
2014-04-14 15:17:15 +00:00
Cameron Sutter e7fcfa00c3 srgb feature flag to say 'Individual Gradebook View'
fixes CNVS-12253

test plan:
 - on the course Feature Options settings page
 - the srgb feature flag should now read:
   'Individual Gradebook View'
 - check the description as well
 - that wasn't so bad, right?

Change-Id: I312fbe0a833fb49aa71d35ab5bec74d655574f9d
Reviewed-on: https://gerrit.instructure.com/33021
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-04-10 23:18:24 +00:00
Joseph Rodriguez 86c8d2a7ed Extract paginated collection gem
refs: CNVS-11648

Test Plan:

Test the sub_accounts api endpoint and make sure the pagination
is not broken.

Change-Id: Ie59674a7a834698ac432307940305d6958cb73f1
Reviewed-on: https://gerrit.instructure.com/31413
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-04-10 20:14:13 +00:00
Rob Orton 42bbe7702d check assignments API date times with api regex
refs CNVS-10087

test plan
 - specs should pass

Change-Id: Ia28a3ec65c24d2e70a5073b5da2caab8b282da9f
Reviewed-on: https://gerrit.instructure.com/33115
Reviewed-by: Anthus Williams <awilliams@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2014-04-10 18:44:16 +00:00
Rob Orton 052509f34e add api date time regular expressions
also add helper method to create error reports

refs CNVS-10087
refs CNVS-9618

test plan
 - specs should pass

Change-Id: I74f40dd16a85a0d95f9b152f6750ec98aade2ba5
Reviewed-on: https://gerrit.instructure.com/33114
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Anthus Williams <awilliams@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2014-04-10 18:43:53 +00:00
Raphael Weiner 101cd37bb6 Cleanup google_docs
Change-Id: Iaa8545a3f39cd8708b1ea20a9c27836dcbdacb0a
Reviewed-on: https://gerrit.instructure.com/32860
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Reviewed-by: Braden Anderson <banderson@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-04-10 17:32:01 +00:00
Raphael Weiner 7054118441 Refactor google docs to be standalone not mixin.
fixes: CNVS-12096

Change-Id: I6fa7d6d57bfc9063b49334a8e528aaaa9fc7f8c2
Reviewed-on: https://gerrit.instructure.com/32715
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Braden Anderson <banderson@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-04-10 17:31:39 +00:00
Michael Nomitch 2cb906d9b5 gpa scale grading standard
fixes CNVS-8931

makes a new grading standard type called "gpa scale"
only allows for grades on the GPA scale
modifies GB2 dom elements if gpa scaled
modifies rubric_assessment response to properly change grade
adds dialog when selecting gpa scale grading type
refactors grading_standard.rb to use instance methods (not class)
added related tests

test plan:
  - As a Teacher, create an assignment with GPA Scaled grading type
    - Enter a grading scheme like the one in grading_standard.rb/default_gpa_scheme
    - Go to GB2 and grade this assignment
      - grades not in the schema should be "-"
      - letters that aren't in the scheme should be a "-"
      - if "3.0" is in the grading standard an input of 3 should
        switch to 3.0 automatically
      - letters in the scheme should work upper or lower case
      - setting default grade should work with the same rules
      - dom elements of this assignment should have a special class
    - Other assignments should work as usual in GB2
    - Go to Assignment Edit Page
      - when selecting Display Grade as "GPA Scale" a ? icon should pop up
      - clicking this icon should open a modal with sane text
    - Go to GB1
      - Grading an assignment should work like GB2
      - GB1 should work as expected for non GPA Scale Assignments
    - Go to the SpeedGrader
      - grading assignments that are GPA Scaled should work similarly to GB2
      - SpeedGrader should work as expected for non GPA Scale Assignments
    - Enable Rubric based grading on an assignment
      - once the rubric is filled out in SpeedGrader, the correctly rounded GPA should be inserted on save
      - once the rubric is filled out in Submission Edit page, the correctly rounded GPA should be inserted on save
      - rubrics should work as expected for non GPA Scale Assignments
    - Other areas in which GradingStandards are used should work as expected

Change-Id: Ide1ea5ca13a70116ae3535b2c8e105ece79a34c8
Reviewed-on: https://gerrit.instructure.com/29742
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Hilary Scharton <hilary@instructure.com>
Product-Review: Mike Nomitch <mnomitch@instructure.com>
2014-04-10 16:00:28 +00:00
Mark Severson abf7daa5dc add lock_version to context module progressions
preparation for rework of the context module progression evaluation

test plan:
 * automated tests pass

refs CNVS-11818

Change-Id: I10618e576c7b44aebce0a9803876b8f543d9b61b
Reviewed-on: https://gerrit.instructure.com/32904
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
Product-Review: Mark Severson <markse@instructure.com>
2014-04-08 23:03:27 +00:00
Jeremy Stanley 6170b20b13 export/import media file captions
test plan:
 - have a course with a video file embedded in content somewhere
   (such as a wiki page)
 - create captions for the video and verify that they play back
 - export this course to an .imscc
 - import it to a new course
 - ensure the captions play back in the copied course

fixes CNVS-10228

Change-Id: Ie15076bc31ad36efabf7a718d12bd8a9b12e45e1
Reviewed-on: https://gerrit.instructure.com/32680
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2014-04-08 20:03:45 +00:00
Dave Donahue 75454df568 Course progress API returns 500 on changed requirements
Fixes CNVS-12210

The course progress API currently works as follows:

- Fetch all the modules for this user
- Get a list of the completion requirements
- Cross-check the requirements against the last known
  list of requirements met
- If there are outstanding requirements, refresh progression
  data, and fetch the URL of the next item

The problem is that in that last step, we refresh the progression
data, which means that the dataset changes mid-method, and it can
cause unexpected behavior.

The solution is to refresh progression data as step 2, so that
the entire method is looking at the same information.

Test plan:
  1. As a teacher, add a couple of modules with completion requirements.
  2. As a student, complete the requirements.
  3. As the teacher, remove one of the modules, and add it again,
     with the same assignment and requirements.
  4. Verify that the Catalog dashboard loads without errors.

Change-Id: If021834d022661ef171167009b7eec79f3f37d83
Reviewed-on: https://gerrit.instructure.com/32870
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
2014-04-08 15:36:18 +00:00
Jason Madsen 9722df7653 add js uploader option to kaltura settings
closes CNVS-12148

test plan:
  - as an admin
    - navigate to plugins/kaltura
    - enter appropriate kaltura settings
    - at bottom of the form select option for html5 uploader
  - as an instructor
    - create an online submission assignment
      - enable Media Recordings under Online Entry Options
  - as student
    - navigate to previously created assignment
    - click Submit Assignment
    - test uploading files from both the RCE button and Media tab
      - verify that uploading works as before

  - with html5 uploader disabled
    - verify that flash uploader continues to work as it did prior

known limitations:
  - html5 uploader does not have a way to filter possible file
    selections the way the flash uploader does. to compensate it will
    check the file type to verify audio / video files.

Change-Id: I53b34f34c6b50b6f2fa45a9cc8ebfd00a80c7eda
Reviewed-on: https://gerrit.instructure.com/32849
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Product-Review: Jason Madsen <jmadsen@instructure.com>
2014-04-07 20:38:35 +00:00
Derek DeVries b2e96d8a32 whitelist allowable data that is being included in quiz questions api for students
fixes CNVS-12231

test plan:
- as a teacher
  - create a quiz with all of the question types

- as a student
  - take the quiz

  - inspect element on the quiz questions
  - find the <div id="question_<number>etc...> or <div class="display_question
    question ...." id=" question<number>
  - expand the <div style="display: none;"> five entries below that & you'll
    see the link to where the quiz question json can be viewed
  - open the link
  - there should be no sensitive information revealed in the question json
  - this includes any answer info or comments by the teacher, etc

Change-Id: I1441b16256040274abae2ae96c9124b825946658
Reviewed-on: https://gerrit.instructure.com/32934
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
2014-04-06 20:07:12 +00:00
Bracken Mosbacker 86a751f493 don't change anchor references to relative urls on import
Test Plan:
 * import a common cartridge package with html that has a
   <a href="#something">hey</a> in it
 * That href value should not change after imported

refs PLAT-433

Change-Id: I84229c5f587020ebc4279baf9bb7138db8c79223
Reviewed-on: https://gerrit.instructure.com/32152
Reviewed-by: Nathan Mills <nathanm@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
2014-04-04 21:20:00 +00:00
Nick Cloward 4748aba483 extract canvas sort gem
fixes: CNVS-11890

Test Plan:

Canvas Should not be broken, test requests that use the SortLast and SortFirst
class.  One is account settings.  Make sure its sorted correctly.  Another is
submissions_controller show method and make sure the visible rubric assesments
are sorted correctly.

Change-Id: I75a61475a928e069d6566fcc51305a6c442ec5a0
Reviewed-on: https://gerrit.instructure.com/32014
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
2014-04-04 14:53:09 +00:00
Simon Williams 935e88b5f0 remove unused patch to ActionController::Session::AbstractStore::SessionHash
fixes CNVS-12175

Change-Id: Ie93e7fb82ad95a827c832bcc912895f03ec4c826
Reviewed-on: https://gerrit.instructure.com/32400
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
2014-04-03 18:04:48 +00:00
Shawn Meredith 2bdf2c09da spec: rspec2 --tags for parallel_excluded specs
Change-Id: I20bf507acb2d0c26d34220d8e52fdf02cbde3e12
Reviewed-on: https://gerrit.instructure.com/32627
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Shawn Meredith <shawn@instructure.com>
Product-Review: Shawn Meredith <shawn@instructure.com>
QA-Review: Shawn Meredith <shawn@instructure.com>
2014-04-03 08:04:52 +00:00
Rob Orton a82a8aed53 ensure assignments API uses correct date time format part1
refs CNVS-10087

test plan
 - assignments PUT and CREATE request will not
   change, but will create error_report when dates
   are not is08601 formatted dates

Change-Id: I83e3621c0604cf91e180f5e59bea2d6e6a164c61
Reviewed-on: https://gerrit.instructure.com/32328
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Reviewed-by: Anthus Williams <awilliams@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2014-04-02 21:51:11 +00:00
Brian Palmer 6036139f49 fix `delayed_job run` stdout logging in rails3
Also fix rails3 not logging to log/delayed_job.log

None of this affects syslog, only when using the local CanvasLogger

refs CNVS-11992

Change-Id: I508fee29316e9a16857576fe0eb542380a42caa0
Reviewed-on: https://gerrit.instructure.com/32710
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
2014-04-02 19:12:44 +00:00
Joseph Rodriguez ccd8b38d6a Extract canvas_http into seperate gem.
Change-Id: Ib90c12b99d30853a0a1a0235c9aa1b5dd645f614
fixes: CNVS-11949
Reviewed-on: https://gerrit.instructure.com/32176
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
Reviewed-by: Stanley Stuart <stanley@instructure.com>
QA-Review: August Thornton <august@instructure.com>
2014-04-02 17:22:38 +00:00
Dave Donahue 0fa0a3dce5 course progress API fixes (CNVS-12156, CNVS-12157)
Fixes CNVS-12156

Problem:
  Removing a module item (ContentTag) should update the completion
  requirements on its ContextModule. This is not directly related
  to the course progress API, but rather a separate bug deeper
  in the code that is affecting the API response.

Test plan:
  1. Add an assignment to a module, and set completion requirements
     on the module.
  2. Assert that the completion requirements are set:
       ContextModule.find_by_name('Module name').completion_requirements
  3. Remove the assignment from the module through the UI.
  4. Assert that the completion requirements no longer reference the
     old assignment:
       ContextModule.find_by_name('Module name').completion_requirements

Fixes CNVS-12157

Problem:
  Obsolete completion requirements were tripping up the progress API
  response. For instance, turning in an assignment that used to be a
  requirement but no longer is would have an impact on the
  requirement_completed_count, sometimes causing it to be larger
  than requirement_count, leading to completion percentages greater
  than 100.

Test plan:
  1. As a student, complete a required assignment on a module.
  2. Using your favorite LTI tool that uses the progress API (e.g. Catalog),
     check the course completion percentage.
  3. As an admin, remove the completion requirement for that assignment.
  4. Check the course completion percentage again and verify that it has
     decreased.

Change-Id: I80a932657eada20717ca2e0df7b57a005a5b276a
Reviewed-on: https://gerrit.instructure.com/32698
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
2014-04-02 17:00:58 +00:00
Jeremy Stanley c084a65edf don't return localized enrollment type in courses api
test plan:
 - have a user whose language is something other than english
 - enroll that user in a course
 - use the courses API as that user
 - the returned enrollment types should be "teacher", "student", etc.
   and not a localized enrollment type
 - consult enrollment api docs: the "type" and "role" fields
   should not have an identical description

fixes CNVS-12065

Change-Id: I572ecd0d9bdadb0da00fe3d8b7359645ad59e183
Reviewed-on: https://gerrit.instructure.com/32550
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
2014-04-02 16:33:43 +00:00
Cody Cutrer 17b844700c merge enrollments in a transaction during user merge
so that a cursor can be used

Change-Id: Ic716f42418962290d5e897df17c82d81bb6516e0
Reviewed-on: https://gerrit.instructure.com/32708
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-04-02 13:23:15 +00:00
Dave Donahue 3e39c5934f bugfix for course progress api (fixes CNVS-12106)
Issue:
  * When creating a module, then a new assignment under that module,
    the ContextModuleProgression.requirements_met field comes back
    as nil, causing course_progress_json to bomb. The previous code
    assumed an array would always be returned, but this is not the case.

Solution:
  * Cast requirements_met to an array.
    + nil.to_a -> []
    + [1].to_a -> [1]

Test plan:
  * Test against Gallery course progress commit (g/32571) with some new modules
    and blank assignments created through the module interface.

Change-Id: Ie666fcc0031009b5ff32ad151659cb2818bf7b6e
Reviewed-on: https://gerrit.instructure.com/32570
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
Reviewed-by: Michael Ziwisky <mziwisky@instructure.com>
2014-03-31 20:58:53 +00:00
Joseph Rodriguez 24680d9925 extract JSONToken gem
fixes: CNVS-11785

Test Plan:
Automated tests will check most of it.  Make sure Canvas is not broken.

Change-Id: I797a71b492a043fc7d14b88457842bbde4295bb2
Reviewed-on: https://gerrit.instructure.com/31719
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
2014-03-31 19:55:29 +00:00
Raphael Weiner 5704e9247d Remove duplicate code for finding uniq array elements.
Change-Id: Ib574f903a52b27d0075029f2afb7845c58d61dba
fixes: CNVS-11932
Reviewed-on: https://gerrit.instructure.com/32153
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
2014-03-31 16:21:35 +00:00
Brandon Broschinsky 9876ed921f api to create grading standard
refs: PS-923, PS-924

**test plan
1. create account and course level grading
standards via api, see docs for example
2. associate course and account level
grading scheme to course via course
update api, see docs
3. associate course and account level grading
scheme to assignment via assignment update api,
see docs

Change-Id: Ib4d7606e23115376f111f3aabbbd8c51e102fe1b
Reviewed-on: https://gerrit.instructure.com/30601
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Adam Phillipps <adam@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2014-03-31 15:45:42 +00:00
Braden Anderson 4f52a5e4c3 outcome gradebook: add export link
fixes CNVS-10638

test plan:
  * open outcome gradebook
  * select a section
  * click on "export report"
  * download and open the export
  * verify that the export format matches the Jira documentation
  * verify that the export data matches the data from your browser

Change-Id: I35bd78719880026b71b30da5794c9afe7dd31868
Reviewed-on: https://gerrit.instructure.com/31774
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Reviewed-by: Jon Willesen <jonw@instructure.com>
Product-Review: Braden Anderson <banderson@instructure.com>
2014-03-28 20:37:03 +00:00
Ahmad Amireh 8d7a11e132 Update API docs to include namespaced Quizzes
Closes CNVS-12019

Test plan:

  - generate the API docs using `bundle exec rake doc:api`
  - verify that all the quiz APIs are included in the docs
  - verify that the appendices are functional (in the QuizSubmissions
    API for example)

Change-Id: I80c6a10c13777d0b88fe96a8114f25b9a2a6f007
Reviewed-on: https://gerrit.instructure.com/32490
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
2014-03-28 18:35:29 +00:00
Landon Wilkins f25a822cbc course progress api
fixes CNVS-11526

test plan:
* set up a course with modules, module items
** and module completion requirements
* on each module, check the box that says:
** "students must move through requirements in
**  this module in sequential order"
* enroll a user in the course
* with that user's ACCESS-TOKEN, perform:

curl -H "Authorization: Bearer <ACCESS-TOKEN>" \
         -X GET -F 'include[]=course_progress' \
         <canvas>/api/v1/courses

* verify that in the response for all the courses
** for that user, there is a "course_progress"
** object.
* verify that the "requirement_count" is the
** total number of requirements for all the modules
** combined.
* verify that the "requirement_completed_count" is
** the number of requirements completed by this user.
* verify that the "next_requirement_url" is the url
** to the module item for the next requirement the
** user needs to complete for the course
* verify that the "next_requirement_url" is null
** if the user has completed all the course's
** requirements
* verify that "course_progress" returns an error message
** if the course is not module based (has no modules)

example:
"course_progress": {
  "requirement_count": 23,
  "requirement_completed_count": 1,
  "next_requirement_url":
    "http://localhost/courses/23/modules/items/31"
}

in this example, there are 23 total requirements for
the course. the current user has completed 1. the
"next_requirement_url" is a link to the next module
item in the sequence that still does not have its
requirement(s) completed by the current user.

Change-Id: I05897a263ea68a72c1583a9e5c19e32b685ec037
Reviewed-on: https://gerrit.instructure.com/31616
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
2014-03-27 18:14:23 +00:00
Bracken Mosbacker 7c13f06310 add an alternate video recording widget for testing
We fixed some problems in the video recording widget that
we want to test in a real production environment. So the
updated widget is behind a flag in the plugin settings

Test Plan:
 * Enable the "Use alternative flash recording widget"
   checkbox under kaltura plugin settings
 * You can tell it's the new widget if when it loads, and
   you have 2 cameras, it'll present with an option to choose

closes CNVS-12037

Change-Id: Iaf360874c5c3078ae421dfce1977579fedf1f19c
Reviewed-on: https://gerrit.instructure.com/32417
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2014-03-27 16:33:33 +00:00
Bracken Mosbacker 658cd27ba3 add a kaltura plugin option to hide RTE record icon
As an intermediate step to making the canvas video integration
more extensible, this allows the video button to be hidden
in the RTE but not in the other areas that you can record
video in: conversations, SpeedGrader, Media Recordings homework
submissions.

Test Plan:
 * Enable the kaltura plugin option to "Hide the video icon in the RTE"
 * The video icon should not show up in any RTE
 * Video recording should still work in conversations, SpeedGrader,
   and as homework submissions. (but not in "text" homework submissions)

closes CNVS-12040

Change-Id: Ib2599e2248d9931df006da8ec1deec85eb050751
Reviewed-on: https://gerrit.instructure.com/32010
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2014-03-27 16:26:14 +00:00
Jeff Belser e86684392e includes enrollment_state with course_json
Test Plan
  1. Enroll a user as a student in a canvas course and log in as that user
  2. Open the web console, $.get('/api/v1/courses')
  3. Inspect the returned data and ensure the existance of an enrollments
     property: an array that includes an enrollment_state property reading 'active'
  4. Un-enroll the user from the course and repeat the request in the console
  5. The returned data should be the same with the enrollment_state property
     now reading 'deleted'

Change-Id: I0c5ec338fd2eb9ed0ecce8c9ee364a747238ab0b
Reviewed-on: https://gerrit.instructure.com/32350
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Dave Donahue <ddonahue@instructure.com>
Tested-by: Dave Donahue <ddonahue@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
2014-03-26 19:53:53 +00:00
Brad Humphrey ce66769b69 implement lti outbound adapter
also, refactor lti outbound adapter parameters and
convert integration tests to use lit outbound adapter

test plan
 - Ensure that LTI launch parameters are the same before and after this change.
 - Test all of the different kinds of launches for differences

Change-Id: I749e7f7b887eaac87dd104f195b526b18040a2b9
Reviewed-on: https://gerrit.instructure.com/30087
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
2014-03-26 16:49:22 +00:00
Simon Williams 4f1b79337c fix Multipart::Post Content-type header
This reverts commit e3148346df
This reverts commit 16f518a130
This partially reverts 9d34baed66

fixes CNVS-12021

test plan (e3148346df)
 - rails 3 specs should pass
test plan (9d34baed66)
 - import content including a video file into a course
      (such as the QTI file attached to CNVS-11602)
 - the import should complete
test plan (16f518a130)
 - submit a document to turnitin
 - it should successfully receive a score

Change-Id: I0622d9eceee4b94e488f103db68290f1b641b555
Reviewed-on: https://gerrit.instructure.com/32333
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2014-03-26 15:21:09 +00:00
Michael Nomitch 1c0d1efcb5 show download submissions iff submissions exist
fixes CNVS-11691

test plan:
  - go to GB2
    - assignment with turned in submissions
      - should show Download Submissions in dropdown (even if none are graded)
    - assignments with submissions enabled but w/out submissions
      - shouldn't show Download Submissions in dropdown
    - assignments without submissions enabled
      - shouldn't show Download Submissions in dropdown
  - a large course with many assignments should load normally on GB2
  - srgb shouldn't blow up (testable changes will come with cnvs-11549)

Change-Id: Ia2619828640bfaa04d73192e881a6d2ce0e97f3e
Reviewed-on: https://gerrit.instructure.com/31718
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Cameron Sutter <csutter@instructure.com>
Product-Review: Mike Nomitch <mnomitch@instructure.com>
2014-03-26 14:37:20 +00:00