Commit Graph

1673 Commits

Author SHA1 Message Date
Bryan Madsen e0e55b53be spec: add respodus specs to parallel exclude
Change-Id: I59bed51cb593c6805a1835aa009ecbcb3820d934
Reviewed-on: https://gerrit.instructure.com/22334
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bryan Madsen <bryan@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
2013-07-15 23:21:18 +00:00
James Williams bda5b07f40 fix typo in wiki pages controller
also rename method to prevent future mishaps

test plan:
* try to visit a deleted page (that is not the
front page)
* should not get a page error

fixes #CNVS-6868

Change-Id: If0bea59d810fc0d41d3e9169fffc58fa20d74cd9
Reviewed-on: https://gerrit.instructure.com/22309
QA-Review: August Thornton <august@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-07-15 19:37:50 +00:00
Jacob Fugal 2b0b895643 propagate cached_due_date to submission versions
not all old submission versions will have cached_due_date populated.
backfill it while rendering them to json for api calls. there may be
other non-api places that need this as well, so a more complete fix in
the future will replace this with some backfilling during version
loading, but this will fix the speedgrader and gradebook history for
now.

test-plan:
 - find a submission created late before the initial DueDateCacher data
   fixup ran
 - load the submission in speedgrader
 - should show as late

Change-Id: Ibbb52468a1b991fc90f4671fd7412860fde8b5e4
Reviewed-on: https://gerrit.instructure.com/22303
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-07-13 16:13:38 +00:00
Jon Willesen 26de44c74e add published flag to discussion topic api
fixes CNVS-6737, CNVS-6746

test plan:
 - check the discussion topic api documentation for the
   published flag.
 - use the create and update api to twiddle the published flag
   as a teacher. this should change the student visibility of
   the topic and change the value of the published flag
   returned by the api.
 - use the create and update api to twiddle the published flag
   as a student. Trying to set the published flag to false as a
   student should result in an error in both create and update,
   and the topic should remain published.
 - create a topic and and add a post to it. try to use the
   update api to set published to false. this should result in
   an error and the topic should remain published.
 - you should not be able to create a draft state announcement
 - you should not be able to update an announcement to be draft
   state, even if it has no posts.
 - generally test creating and editing discussions to make sure
   nothing has broken, especially locking, unlocking, and the
   "available from" and "until" dates (see CNVS-6762).
   - make sure when editing a topic, it retains the available
   from and until dates when you don't specifically edit them.

Change-Id: Ie1591f380bff45f6ad6a7d7c83bc1d55947293a0
Reviewed-on: https://gerrit.instructure.com/22123
Reviewed-by: Joel Hough <joel@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Jon Willesen <jonw@instructure.com>
QA-Review: Jon Willesen <jonw@instructure.com>
2013-07-12 23:25:12 +00:00
Jon Jensen 931276caf5 normalize group sorting, add SimpleBookmarker for common case
refs CNVS-6219

what's different in this change:
1. /groups now sorts by name. previously there was no guaranteed order.
2. /api/v1/users/self/groups should now sort by name (was id).
3. /api/v1/group_categories/:group_category_id/groups now sorts groups.
   previously there was no guaranteed order, making pagination unreliable.
4. /api/v1/accounts/:account_id/groups and /api/v1/courses/:course_id/groups
   are no longer case-sensitive, and sort by id in the event of a tie.

test plan:
* see specs
* ensure groups are sorted alphabetically (case insensitive) in the
  following places:
  1. /groups page
  2. /api/v1/users/self/groups
  3. /api/v1/accounts/:account_id/groups
  4. /api/v1/courses/:course_id/groups
  5. /api/v1/group_categories/:group_category_id/groups

Change-Id: I9c4cb34ead05f72640db43d40a67dcef97643de0
Reviewed-on: https://gerrit.instructure.com/22210
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
2013-07-12 23:09:50 +00:00
Joel Hough e3368ad358 backbonify subscription icon
test plan
- ensure subscription icon behavior is unchanged

Change-Id: I4d43401b729a84190af569199b79acf1eba60671
Reviewed-on: https://gerrit.instructure.com/22110
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mark Ericksen <marke@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
2013-07-12 23:05:33 +00:00
Brandon Broschinsky 831b6d325e updates to provide SIS meta-data to Kaltura
--test plan
enable SIS meta-data through kaltura plugin settings
upload or record file via tinyMCE media widget
additional partner_data should be available on kaltura
should include sis_course_id, sis_user_id where applicable
and also a context_source including where media uploaded from
perform same steps for regular canvas file uploads

fixes PS-321

Change-Id: Ie6fc64c9e212f72a9844720e3f6e8ecf993545a0
Reviewed-on: https://gerrit.instructure.com/21883
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Brandon Broschinsky <brandonbr@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2013-07-12 22:12:30 +00:00
Jacob Fugal 1e5e926103 fix cassandra db fingerprinting
test-plan:
 - specs don't blow up

Change-Id: Ie8145ff15908c9ad338e954bcaea7a312da22778
Reviewed-on: https://gerrit.instructure.com/22284
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
2013-07-12 22:02:53 +00:00
Simon Williams 00f1f574d5 cc_worker should honor skip_job_progress
fixes CNVS-6789

test plan:
- run an academic benchmark import
- the job should succeed

Change-Id: Ia716a781ca03d6a70db748a08bec6397850f9a94
Reviewed-on: https://gerrit.instructure.com/22167
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2013-07-12 21:47:27 +00:00
Cameron Matheson 15868bee11 Faster AssignmentGroupsController#index
refs CNVS-2500, closes CNVS-6577

Test plan:
  * make sure the assignment groups index api action still works
    - be sure to include assignments
      * test with and without overrides
  * make sure gradebook2 still works (focus on anything related to
    assignment due dates)

Change-Id: I440a8fdeffdb497884356f08c19b5b7792566a3a
Reviewed-on: https://gerrit.instructure.com/22102
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
2013-07-12 17:47:29 +00:00
Jacob Fugal 59737086e7 Auditors::Authentication
fixes CNVS-390

stores and allows querying by user/account/pseudonym of login/logout
events.

test-plan:
  [setup]
    - set up an 'auditors' keyspace in cassandra and run migrations
    - have shardX and shardY on one database server, and shardZ on a
      different database server
    - have accountW and accountX on shardX
    - have accountY and accountZ on shardY and shardZ, respectively
    - have userA on shardX with pseudonymAW in accountW and pseudonymAX in
      accountX (cross-account, single-shard user)
    - have userB on shardY with pseudonymBY in accountY and pseudonymBX in
      accountX (cross-shard user)
    - have userC on shardZ with pseudonymCZ in accountZ and pseudonymCX in
      accountX (cross-db-server user)
    - log in and out of each pseudonym above multiple times

  [index isolation]
    - /api/v1/audit/authentication/pseudonyms/<pseudonymAX> should
      include logins and logouts from pseudonymAX only
    - /api/v1/audit/authentication/accounts/<accountX> should include
      logins and logouts from pseudonymAX, pseudonymBX, and pseudonymCX
      but not pseudonymAW
    - /api/v1/audit/authentication/users/<userA> should include logins
      and logouts from both pseudonymAW and pseudonymAX but not
      pseudonymBX or pseudonymCX

  [permission isolation]
    (in each of these, either :view_statistics or :manage_user_logins on
    an account qualifies as "having permission")
    - /api/v1/audit/authentication/pseudonyms/<pseudonymAX> should be
      unauthorized if the current user doesn't have permission on
      accountX
    - /api/v1/audit/authentication/accounts/<accountX> should be
      unauthorized if the current user doesn't have permission on
      accountX
    - /api/v1/audit/authentication/users/<userA> should be unauthorized
      if the current user doesn't have permission on either of accountW
      or accountX
    - /api/v1/audit/authentication/users/<userA> should include logins
      and logouts from accountW but not from accountX if the current
      user has permission on accountW but not on accountX

  [sharding]
    - /api/v1/audit/authentication/users/<userB> should include logins
      and logouts from both pseudonymBY and pseudonymBX
    - /api/v1/audit/authentication/users/<userB> should not include
      duplicate logins and logouts from either pseudonymBY and
      pseudonymBX (potential for bug due to both pseudonyms' shards
      being on the same database server)
    - /api/v1/audit/authentication/users/<userC> should include logins
      and logouts from both pseudonymCZ and pseudonymCX

Change-Id: I74b1573b346935f733fe5b07919d2d450cf07592
Reviewed-on: https://gerrit.instructure.com/21829
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
2013-07-12 16:10:33 +00:00
Jacob Fugal a91e6c32b5 add time_to_live config to EventStream
and plumb it through Canvas::Cassandra::Database's *_record methods

refs CNVS-390

Change-Id: I47a19a7040021d58c242f9cb483dd6f029298d84
Reviewed-on: https://gerrit.instructure.com/22155
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
2013-07-12 16:10:04 +00:00
Cameron Sutter 9dfd9c7c42 assignment settings modal
fixes CNVS-6676

test plan
 - open the assignments settings modal with the cog menu at the top
 - change the assignment group weighting with the checkbox
 - change the assignment group weights
 - click 'done' and then re-open the dialog to verify changes

Change-Id: I7cf09d7796b0c47c5ec75d79ea7bba33bc7ddcaf
Reviewed-on: https://gerrit.instructure.com/21922
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Cameron Sutter <csutter@instructure.com>
2013-07-10 17:24:24 +00:00
Cameron Matheson aadfbcded4 fix assignment_json's terrible signature
Change-Id: Iae62e4f2be4cffc4776ca11953623ddee7dd1449
Reviewed-on: https://gerrit.instructure.com/22170
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Cameron Matheson <cameron@instructure.com>
2013-07-10 17:03:06 +00:00
Simon Williams d733314354 configurable turnitin api endpoint
closes CNVS-5992

test plan:
- make sure existing turnitin still works
- go to account settings, leave turnitin host blank, save
- it should still work
- change it to api.turnitin.com
- it should still work
- change it to another valid turnitin endpoint
- it should still work

Change-Id: I442871d35f3a8440f49485252cf88dd4cd441ec2
Reviewed-on: https://gerrit.instructure.com/21969
Reviewed-by: Cameron Sutter <csutter@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2013-07-08 20:25:41 +00:00
Shawn Meredith 51d2968f84 simplecov formatter tweak
Change-Id: I0ecacd2dbc7cb89fa9ef5b17c0b1d69befd90ad1
Reviewed-on: https://gerrit.instructure.com/21555
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bryan Madsen <bryan@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
2013-07-08 19:39:41 +00:00
Kyle Rosenbaum bcc7b7b995 spec: split selenium build by file size of specs
Change-Id: Ied21cf362eee402e5af4ef6f4d8130be44cd87ad
Reviewed-on: https://gerrit.instructure.com/22005
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>
Tested-by: Shawn Meredith <shawn@instructure.com>
2013-07-08 19:07:06 +00:00
Brian Palmer d1486b6930 remove last_activity from CountsReport
This data point is difficult to get with the new page views
infrastructure, and isn't displayed anywhere anyway.

fixes CNVS-6731

test plan:
* with cassandra page views enabled, open a rails console and run
  Reporting::CountsReport.process
* once that completes, go to /accounts/X/statistics and verify that the
  stats have been updated (there is a generated timestamp at the top)

Change-Id: I7f1144cd6dab9b68478a79e3f7f82bc6d8feb0b3
Reviewed-on: https://gerrit.instructure.com/22046
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
2013-07-05 21:41:31 +00:00
Cameron Matheson e158d09d19 faster SubmissionsApiController#for_students
fixes CNVS-6576

Test plan:
  * run the SubmissionsApiController#for_students action as a teacher
    (it's part of gb2)
    * make sure some/all of the submissions have attachments
    * you should see a reasonable amount of queries (not hundreds or
      thousands)
  * make sure gradebook2 correctly displays student submission data

Change-Id: If301a70eb001f7876aa94e476b2c76dfa664ae05
Reviewed-on: https://gerrit.instructure.com/21790
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
2013-07-05 21:00:36 +00:00
Jeremy Stanley 0a520cb9ec add api option to return module items inline
test plan:
 - refer to the documentation for 'List modules' and 'Show module'
 - verify that adding ?include[]=items causes module items to be
   included in both endpoints
 - verify that modules with more than 50 items do not get items
   returned directly in the json
 - also check that new Module fields are returned, whether or not
   "include[]=items" is given:
   - items_count: the number of items in the module
   - items_url: the api endpoint to retrieve the module items

fixes CNVS-6598

Change-Id: Ifd20da2588b0afd20ec2781319ddfb93924666e2
Reviewed-on: https://gerrit.instructure.com/21919
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-07-03 14:32:37 +00:00
Rob Orton 90a93a4fec make temp table use a transaction by default
fixes CNVS-6661

test plan
- specs should pass

Change-Id: Ifaef26e7aea7419154085a1917f8b64735db1a0c
Reviewed-on: https://gerrit.instructure.com/21951
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2013-07-02 16:44:49 +00:00
Kyle Rosenbaum ef5e6f8fdf add canvas:check_syntax positive logging
Change-Id: If39cccc10e00cfb833a261185a730477a0e952f5
Reviewed-on: https://gerrit.instructure.com/21836
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bryan Madsen <bryan@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
2013-07-01 20:33:40 +00:00
Brian Palmer de3a523ad1 fix up scribd config setting and caching
fixes CNVS-6562

there were three problems:

1. ScribdAPI was caching the config locally for all root accounts,
preventing any other account plugin settings from overriding the first
config found. I removed that so it uses the normal rails cache behavior.
2. It was falling back to config/scribd.yml if the plugin was disabled
on an account, rather than correctly disabling it. I just removed the
yml support completely, it's been a plugin setting for a long time now.
3. If you tried to configure the scribd plugin on a new install, without
a scribd.yml it'd fail with a 500 error trying to validate the new
config.

test plan:

remove any local config/scribd.yml file, and configure scribd through
the /plugins interface. Upload a scribd-able file and verify it is
processed as expected.

Change-Id: I85573e27de074c69e263941012992aefc86e823a
Reviewed-on: https://gerrit.instructure.com/21853
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
2013-07-01 19:42:47 +00:00
Cameron Sutter b7da647e93 add apply_assignment_group_weights to course api
fixes CNVS-6515

test plan:
 - read, create, and update the apply_assignment_group_weights
   flag within a course with the api

Change-Id: I29b15ddafa9403a7434f8692b53ce31f1645626f
Reviewed-on: https://gerrit.instructure.com/21795
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2013-07-01 15:45:52 +00:00
Mark Severson 8467c25079 add viewing of wiki pages using new page routes
test plan:
 - on the root account:
   * settings[:enable_draft] = true
 - on a course without wiki pages:
   * navigate to '/courses/:id/pages'
   * ensure a friendly message is displayed indicating no pages
 - on a course with wiki pages:
   * navigate to '/courses/:id/pages'
   * ensure all pages are represented and paginate properly (30 at a time)
   * validating styling
   * ensure wiki page links work correctly
 - for each page:
   * ensure the wiki pages display properly
   * ensure the publish/unpublish buttons work properly
   * ensure the 'View All Pages' button works properly
   - note: Edit and Settings are currently unimplemented
 - for an unauthenticated session:
   * ensure no access is allowed to any of the pages
 - for an unauthenticated session, but a public course:
   * ensure the pages index and the individual pages show properly

fixes #CNVS-5272

Change-Id: I7658e43b6fe09ce9b9ebf0446dbded2f0d4ff0e1
Reviewed-on: https://gerrit.instructure.com/21811
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Bracken Mosbacker <bracken@instructure.com>
2013-07-01 01:02:26 +00:00
Jacob Fugal 868d9a85e5 ignore bad file ids
if a file_id is given to show_relative in addition to a file_path, but
that file_id is invalid, treat is just like as if they'd given an
incorrect-but-valid id (i.e. doesn't match the path).

fixes CNVS-6148

test-plan:
  - create a file
  - get a link to the file that includes both the file_id and file_path
  - change the file id to an invalid string
  - should still load the file
  - should not generate a page error

Change-Id: Ifed3fbd9ef9fe2c5a4fd951f2de5facdf38e28d0
Reviewed-on: https://gerrit.instructure.com/21556
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
2013-06-28 22:08:06 +00:00
Jon Jensen 598452df45 ensure _core_en.js is up-to-date, i18n:generate_js tweaks
* add a spec to keep _core_en.js current
* remove a couple unnecessary requires
* I18n.load_path parity (we don't need generated/en.yml here)
* don't bother trying to load plugin yml files because we don't do those

test plan:
1. specs should pass
2. localized canvas should also work, i.e.
   1. run rake i18n:generate_js
   2. run canvas with RAILS_LOAD_ALL_LOCALES=true and USE_OPTIMIZED_JS=true
   3. switch to spanish
   4. go to a localized js-heavy page (e.g. conferences)
   5. you should see translated stuff

Change-Id: Ia368c11f72fdc7395e4cbf82c3385d0c997b0dd4
Reviewed-on: https://gerrit.instructure.com/21788
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
2013-06-28 20:52:09 +00:00
Sterling Cobb 2bbe9eff30 Serialize radio button values and add styles
fixes #CNVS-6405

Change-Id: Ia8fa25d00997b333a6fce0082877ef038948136f
Reviewed-on: https://gerrit.instructure.com/21709
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
2013-06-27 18:39:20 +00:00
Cody Cutrer 011cd66860 strand per shard for due date cacher
Change-Id: I6e4ba16a3108af9ea462ebfc3ee30e4d65ac54d6
Reviewed-on: https://gerrit.instructure.com/21763
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2013-06-26 21:42:15 +00:00
Brian Palmer d2bbc3e0be integrate fake_rails3_routes
This allows us to upgrade our routes file to rails 3 syntax while still
staying compatible with rails 2.3

refs CNVS-5146

test plan:

This affects literally every URL in Canvas, but shouldn't introduce any
new behavior. The automated integration and selenium tests still pass,
which is a good smoke test. Other than that, it's really just making
sure that routes are generated and recognized as before (regression
testing).

Change-Id: I443d006e3fcb5a0a0f8d6db46a8873a498ae7fd4
Reviewed-on: https://gerrit.instructure.com/21729
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
2013-06-26 21:22:20 +00:00
Brian Palmer 89ec89930c rails3 fixes
* disable i18nema until we're on rails 3.2
* fix how we access session_options
* fix how we access the basic auth header
* fix attachment_fu callbacks

test plan: none of these fixes should affect rails 2

Change-Id: I7f9b6f18c04d51284ec3e5e9fdd39fb93539c91b
Reviewed-on: https://gerrit.instructure.com/21728
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
2013-06-26 20:22:26 +00:00
Cody Cutrer e9f84c71b7 fix DueDateCacher range creation
Change-Id: I8ca00d0d96acfeab5f0e9c79231866bed941c2a2
Reviewed-on: https://gerrit.instructure.com/21756
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2013-06-26 19:35:55 +00:00
Rob Orton 112d70cc6c add attachment object to account reports api
closes PS-438

test plan
 - do a GET to an account report
 - the results should include the attachment object

Change-Id: I260b7a445c606877882d567a10348e5838392523
Reviewed-on: https://gerrit.instructure.com/21686
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Tyler Belnap <tyler@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2013-06-26 17:25:19 +00:00
James Williams 6c7598144d create course and group endpoints to preview html processing
test plan:
* use the course and group API to preview html content
through the preview_html action
* should return html processed in the same fashion
that other html content is (such as assignment descriptions)

closes #CNVS-6413

Change-Id: Ibfaea9d8b0ccfd45938e5bf91b03980597428516
Reviewed-on: https://gerrit.instructure.com/21701
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: August Thornton <august@instructure.com>
2013-06-26 16:52:51 +00:00
Cody Cutrer cae52b935d optimize DueDateCacher
don't load 1000 assignments, just use a range of ids

test plan:
 * data migration should not fail
 * on-demand recalculations should not fail

Change-Id: I7da3244a08ab6f61b8393c9f9d85257b181157cc
Reviewed-on: https://gerrit.instructure.com/21738
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2013-06-26 16:21:08 +00:00
Jon Jensen b38630148b image upload model, refs CNVS-2858
also tweak local file api uploads to accept either file or
attachment[uploaded_data] param

ensure File models don't pass along any superfluous attributes to s3

test plan:
* see specs and corresponding plugin commit
* also, do a regression of the quiz file upload types (see g/21586 test
  plan)

Change-Id: I496b150dbdc0684083bf320c77cced4c3b8eeaa0
Reviewed-on: https://gerrit.instructure.com/21434
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
2013-06-26 15:37:50 +00:00
James Williams e370322471 prevent incompatible character encodings errors
refs #CNVS-5828

Change-Id: Id0a165363de05f000eee956bf976ffcff70adfc7
Reviewed-on: https://gerrit.instructure.com/21674
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
2013-06-25 19:13:13 +00:00
Bracken Mosbacker d1ecb63094 add lis_outcome_service_url to assignment launches for teachers
per the LTI spec the lis_outcome_service_url should always
be sent, and we were only sending it for students.

Test Plan:
 * Do an LTI assignment launch as a teacher or admin
 * Make sure the lis_outcome_service_url value is sent
 * Also check that the custom_canvas_assignment_title/points_possible are sent

closes CNVS-6392

Change-Id: If69875884029e5cba9fb329f09c21d2220fcdfd0
Reviewed-on: https://gerrit.instructure.com/21652
Reviewed-by: Brad Humphrey <brad@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-06-24 22:36:31 +00:00
Brian Palmer 8df5fe6d2d don't require full rails+canvas env for rake i18n:generate_js
The full env isn't available on our release packaging servers

Change-Id: I5b9b6c878d061ae4d2ae75739a46c5bc22e0d639
Reviewed-on: https://gerrit.instructure.com/21675
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
Tested-by: Brian Palmer <brianp@instructure.com>
2013-06-24 21:08:46 +00:00
Jeremy Stanley 2708885166 Revert "add metadata to kaltura file upload"
This reverts commit 7a89817a25

Change-Id: Iacd4759bed8e21763538b8c3b98a4f90e79ae149
Reviewed-on: https://gerrit.instructure.com/21684
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Bracken Mosbacker <bracken@instructure.com>
2013-06-24 19:01:33 +00:00
James Williams ef90ab60e2 preserve links to other content in quizzes on course copy
test plan:
* create a quiz that includes a link to other content
in the course, such as an assignment or a wiki page
* copy the course
* the links should be copied correctly

fixes #CNVS-2303

Change-Id: Ie5eb41c9193bad4d3786d2cd312b31a3be6c4ddf
Reviewed-on: https://gerrit.instructure.com/21600
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>
2013-06-24 18:54:31 +00:00
Brian Palmer 9050f75fcb Revert "add debugging information to track down an issue"
This reverts commit aecb27989946841fc56cb31cc288f5359f4133d6.

Change-Id: I8d90d948208396b18023340d4ba832481f09ed40
Reviewed-on: https://gerrit.instructure.com/21663
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-06-24 14:47:29 +00:00
James Williams 566f023bad add vendor_guid to api for outcomes and outcome groups
test plan:
* confirm that the 'vendor_guid' property is accessible
and editable through the API for outcomes and outcome
groups

* confirm that in the api, if an assignment's rubric
criterion is associated with a learning outcome, that it
returns the vendor guid

closes #CNVS-6387

Change-Id: I28d4cfb42172e69f07a03a398ba15011aaab4f7c
Reviewed-on: https://gerrit.instructure.com/21642
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
2013-06-22 03:21:17 +00:00
James Williams 01b4192045 add custom_time_zone parameter to lti launches
test plan:
* create a external tool with a custom field keys like:

custom_time_zone=$Person.address.timezone
custom_time_zone2=$Canvas.user.timezone
custom_offset=$Canvas.user.timezone.offset

* confirm that the tool launch parameters includes the
custom keys substituted with the current set time zone
or time zone offset (which derives from the user,
or the root account)

fixes #CNVS-6281

Change-Id: I9bf44f7ba10b2c7f68cae65496caba30ff601f15
Reviewed-on: https://gerrit.instructure.com/21621
QA-Review: Clare Strong <clare@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-06-21 22:45:58 +00:00
Brandon Broschinsky 7a89817a25 add metadata to kaltura file upload
**test plan
upload a media file through file upload
validate additional metadata for sis_id, sis_user_id, and context
are available in partner data

fixes PS-322

Change-Id: Ia7c3b3e05ce08e40baf14527f4cbdcea6cd67bb4
Reviewed-on: https://gerrit.instructure.com/21334
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
2013-06-21 22:15:40 +00:00
Jacob Fugal 043b797257 proper handling of cross-shard admin visibility
when querying common contexts between user A and messageable user B, "0"
is used as a special course id to indicate user B has at least one
enrollment in an account A admins -- no actual course involved.

to manage common contexts cross shard, they are stored with global ids.
this was "globalizing" 0 to no longer be zero, causing problems. fix
that edge case.

additionally, if there were multiple shards with accounts in which B has
and enrollment and A is an admin, it would overwrite (given corrected
handling of the 0) with the last queried shard's values, rather than
combining them.

fixes CNVS-6303

test-plan:
 - have at least two shards
 - create user A on shard 1, user B on shard 2
 - enroll user B as a teacher in a course under account X on shard 2
 - add user A as an admin of account X
 - on shard 1, reload user B via user A's messageable users, e.g.:
     userB = userA.load_messageable_user(userB)
 - userB's common courses should include a key of 0 with
   'TeacherEnrollment' as the only value
 - repeat on shard 2
 - enroll user B as a student in a course under account Y on shard 1
 - add user A as an admin of account Y
 - on shard 1, reload user B via user A's messageable users (again)
 - userB's common courses should include a key of 0 with both
   'TeacherEnrollment' and 'StudentEnrollment' as values
 - repeat on shard 2

Change-Id: I014d1f0d7793889de512a4a0262e32027ee5702e
Reviewed-on: https://gerrit.instructure.com/21542
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
2013-06-21 20:40:00 +00:00
James Williams 4a8328927b preserve account-level rubric associations on course copy
test plan:
* create an account level outcome
* create an account level rubric
* attach the outcome to the rubric

* in a course, attach the rubric to an assignment
* copy the course
* check the new assignment in which you linked the rubric to
  the outcome was carried over, and the association with
 the account-level rubric should be preserved,
 (and by extension the association with the learning
 outcome)

fixes #CNVS-4200

Change-Id: I0bfa11124d599ca1a96ed3b6e684b966974e397b
Reviewed-on: https://gerrit.instructure.com/21548
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
2013-06-19 19:23:48 +00:00
James Williams 584edf0c65 add with_exclusive_scope to wiki page datafix
Change-Id: Id20b9c17293501e45287f8efa2dff262ea18c922
Reviewed-on: https://gerrit.instructure.com/21597
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
2013-06-19 18:59:20 +00:00
James Williams e6fa4abc4b fix imported wiki pages that were set to unpublished
data fixup for wiki pages that were imported during a
certain period when they were set to unpublished by default
but linked to active module content items

test plan:
 (Note: the problem should no longer occur, so we will have
 to manually re-create the problem)

* create a wiki page
* add the page as a module item
* identify the item id by observing the module item's url
 on the modules page -
 e.g. (/courses/:course_id/module/items/:item_id)

* open the console and run the following instructions:

id = [INSERT THE ITEM ID HERE]

WikiPage.where(:id => ContentTag.find(id).content_id
).update_all(:workflow_state => 'unpublished')

* now, as a student, clicking the link should give an
 'unauthorized' message, as in #CNVS-6177

* run the data fixup by running the following command in
the console:

DataFixup::FixImportedWikiPageWorkflow.run

* now the page should be accessible by students

closes #CNVS-6323

Change-Id: Iffb74de96cb4d3603ccd8a6ecb55567714d95db4
Reviewed-on: https://gerrit.instructure.com/21513
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Clare Strong <clare@instructure.com>
2013-06-19 01:10:21 +00:00
Cody Cutrer 4c6294bdef extend versions index to include number, and uniqueify it
also improve find_each_with_temp_table to support sqlite
and non-transactional

Change-Id: Ie5b9dfe3fc619fd2fcc4350612dceed1e385c5cf
Reviewed-on: https://gerrit.instructure.com/20919
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Duane Johnson <duane@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2013-06-18 21:06:27 +00:00
Cody Cutrer 5d16bd674b minor optimizations around simply_versioned
refs CNVS-5805

first, don't do a count if we're just going to load the whole association anyway

second, don't use empty? on an association - that does a count. instead you
should use exists?, but the next branch does another query anyway that
would tell us the same information, and still only query one row

test plan:
 * basic regression testing around versioned models (assignments, overrides,
   wiki pages, etc.)

Change-Id: I9d29eacbaa67dbc267ee09400d62651ef6ccdc0a
Reviewed-on: https://gerrit.instructure.com/20901
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-06-18 21:05:27 +00:00
Jeremy Stanley 4135fa6e2d leave user-context file links alone in process_incoming_html
fixes CNVS-6168

test plan:
- as a teacher:
 - upload a file to your own files
   (/users/self/files)
 - use the RCE embed-image button to embed this image in various
   places, including but not limited to:
   - wiki page
   - assignment description
   - discussion topic
   - discussion reply
- as a student:
 - make sure the embedded images are visible

Change-Id: I93b103041f44a385b1652f2bd48aeb4b9dec8147
Reviewed-on: https://gerrit.instructure.com/21549
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
2013-06-18 17:50:48 +00:00
Cody Cutrer e852ebb6da delay creating jobs in other dbs until transaction completes
this prevents the job from accessing data that hasn't committed yet,
as well as many instances of it waiting for the first transaction to
release a lock cause the two transactions are referencing the same
data

test plan:
 * general smoke test in a production environment (since lots of
   things run sync in non-production environments)

Change-Id: I7b132b6119f60e38ae1ba4d17dea18ac49114960
Reviewed-on: https://gerrit.instructure.com/21168
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Cody Cutrer <cody@instructure.com>
2013-06-17 20:19:08 +00:00
Brad Humphrey afa79ad601 backbone dialog for lti content return
additionally added some denormalization to the external tools api
calls.  This explicitly defines properties for each extension that
are normally just inherited from the general extension settings.

test plan:
  -test a resource selection tool
  -test a homework submission tool
  -test a editor button tool
    * they should all still work

  - create a tool with selection_width, selection_height, and icon_url defaults
  - add a tool extension with no extra properties to this tool
  - make a get api call for the new external tool
    * it should have added the width, height, and icon to the extension

Change-Id: I25f7d31b5c4e21b1873d41e6ea4c39b4bd0e1a24
Reviewed-on: https://gerrit.instructure.com/21383
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-06-17 19:00:55 +00:00
Sterling Cobb f629d8f0fa Add style fixes to new content migration page
* Add icons to checkboxes when selecting content
* Truncate long folder names in reverse
* Add tooltips to folders with long names.
* Style top part of migration page including
adding a cancel button, formatting options and
re-doing the date-shift view.
* Add styling to bottom portion of the migration
page including an additional "orange" color to
completed migrations with issues.

fixes #CNVS-6252

Test Plan
1. Go to the new migrations page
2. Make sure there are icons next to checkboxes
when selecting content.
3. Make sure due date shifting is all still
working
4. Ensure other styles are looking and functioning
correctly.

Change-Id: I7a1b6d6b6ffbd3a3bcd0bd9ac0577e4a5ef28000
Reviewed-on: https://gerrit.instructure.com/21503
QA-Review: Clare Strong <clare@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-06-15 02:16:11 +00:00
Joel Hough 65986cfaac discussion topic subscription flag and api
fixes CNVS-6238

test plan
using the api:
- view a discussion topic as a user that did not author it
- ensure that subscribed: false

- view a discussion topic as the authoring user
- ensure that subscribed: true

- unsubscribe from a discussion topic that the user authored
- ensure that subscribed: false

- subscribe to a discussion topic
- ensure subscribed: true

- subscribe to a topic that requires an initial post with a user
 that hasn't posted yet
- ensure that it is an invalid request

- subscribe to a topic that requires an initial post with a user
 that has posted
- ensure subscribed: true

Change-Id: Ie76a046bb6e9b5253088c371ffdc4dc6ddf08231
Reviewed-on: https://gerrit.instructure.com/21402
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mark Ericksen <marke@instructure.com>
QA-Review: Cam Theriault <cam@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
2013-06-14 21:40:50 +00:00
Cody Cutrer 0d612a2784 account user search API
fixes CNVS-5821

test plan:
 * make API requests to /api/v1/accounts/<id>/users?search_term=bob
 * verify it returns users with names or ids matching the search term

Change-Id: Ica91ffce6f2a381445985b4b02231a380ce820d0
Reviewed-on: https://gerrit.instructure.com/21487
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-06-14 20:36:58 +00:00
Cody Cutrer f0a0ec6741 allow inferring authenticity token from upload policy even if a session exits
Chrome and Firefox send the session from Flash, Safari does not. So allow
inferring the authenticity token whether a session exists or not

Also, the JS no longer needs to worry about if uploading to local or remote
and adding/filtering the authenticity token - just do the same every time.

test plan:
 * use local storage
 * upload a file by clicking "Upload Files"
 * it should work in Safari, Firefox, Chrome, and IE

Change-Id: Ia46bde6ab042f21cd0643d4f5a1dbd2f7f9cee66
Reviewed-on: https://gerrit.instructure.com/21100
Reviewed-by: Jon Jensen <jon@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-06-14 14:43:00 +00:00
Landon Wilkins 6441ef9d14 api functionality: unassigned group members, with search
adds list and search users functionality to group_category api,
  including the ability to filter to only list/search unassigned
  users.

depends on #CNVS-6152

test plan)

0) verify that the api doc is error free and makes sense
1) make the following requests for both a course and an acccount
     group category, then verify the results:
  a) list all the users (i.e. no search_term)
  b) list all the unassigned users (i.e. no search_term)
  c) search users (e.g. search_term=bob )
  d) search unassigned users (e.g. search_term=bob&unassigned=true)

fixes #CNVS-6151

Change-Id: I99b33f29531579478ccece595a20971a1f8ad914
Reviewed-on: https://gerrit.instructure.com/21292
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>
Tested-by: Landon Wilkins <lwilkins@instructure.com>
2013-06-13 18:04:38 +00:00
Jon Willesen 8f95d3b6de add checkbox to enable BBB recording to BBB plugin settings
fixes CNVS-6232

test plan:
 - go to existing BBB plugin settings, make sure recording
   checkbox is unchecked by default.
 - go to conferences page and open new conference dialog.
   select the BBB conference type. verify you do not see the
   record checkbox.
 - edit an existing BBB conference. verify you do not see the
   record checkbox.
 - verify you can still view pre-existing recordings.
 - start and end a BBB conference, make sure it is not recorded.
 - go back to BBB plugin settings and enable recording.
 - go back to conferences page and refresh. verify the record
   checkbox is now visible when creating and editing BBB
   conferences.
 - start and end a BBB conference with the record setting
   checked. verify the conference is recorded.
 - with MRA, configure BBB for all accounts, do not allow
   recording.
 - configure BBB plugin for a specific account that did not
   already have it configured.
 - verify the secret field is not populated with a default.
 - populate the secret field, check allow recordings, and apply.
 - verify that account can now access the BBB recording
   feature, but other accounts can't.
 - refresh BBB plugin settings for the configured account and
   verify the secret field appears populated.

Change-Id: I86cea399669f9732b81e784646921e4ef8b4b9a2
Reviewed-on: https://gerrit.instructure.com/21369
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
QA-Review: Cam Theriault <cam@instructure.com>
Product-Review: Jon Willesen <jonw@instructure.com>
2013-06-13 17:53:46 +00:00
Brian Palmer f0910c8781 don't send attachment verifier for files#api_show if locked_for is true
fixes CNVS-6088

test plan:
* lock a file manually as a teacher, and note the file id
* as a student, visit /api/v1/files/<fileid> and verify no download information
* do the same with a file locked by date, rather than manually
* verify that students still get api download info for unlocked files

Change-Id: I9519775b19017a72eb15d7da815a58a54df6dedb
Reviewed-on: https://gerrit.instructure.com/21403
Reviewed-by: Zach Wily <zach@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-06-12 04:26:37 +00:00
Brian Palmer 52b4ddc57a add attr_accessible to EventStream::Failure model
test plan: spec/lib/event_stream/** specs should still pass

Change-Id: I02418dde483ff7824bff2ee0eb088295422bb415
Reviewed-on: https://gerrit.instructure.com/21347
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
2013-06-11 14:56:09 +00:00
Landon Wilkins 4c7ab5a576 adds user search functionality to the group api
see the @argument search_term in the following doc:

  # @API List group's users
  #
  # Returns a list of users in the group.
  #
  # @argument search_term (optional)
  #   The partial name or full ID of the users to match and return in the results list.
  #   Must be at least 3 characters.
  #
  # @example_request
  #     curl https://<canvas>/api/v1/groups/1/users \
  #          -H 'Authorization: Bearer <token>'
  #
  # @returns [User]

test plan)

1) verify the specs work
2) make a request (see above)
   (e.g. https://<canvas>/api/v1/groups/1/users?search_term=bob)
3) verify it returns the users in the specified group with the related name or full ID

fixes #CNVS-6152

Change-Id: I034b8b6ec2779895408276a894a3cf978baee12b
Reviewed-on: https://gerrit.instructure.com/21252
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Landon Wilkins <lwilkins@instructure.com>
2013-06-10 21:03:57 +00:00
Jacob Fugal a771fe00ef replace submissions.late column with .cached_due_date
refs CNVS-5805

with efficient calculation of all due dates for any submissions for a
given assignment when related records (the assignment, its overrides,
related enrollments, and related group memberships) changes.

compares this cached due date to the submitted_at or current time when
determining lateness.

populates the column for existing submissions in a post-deploy
data-fixup migration.

test-plan:
  - run lib/data_fixup/initialize_submission_cached_due_date.rb
  - all submissions' cached_due_dates should be updated over several
    jobs
  - enroll a student in a course and create submissions in that course
    - create a second enrollment in a second section; the
      cached_due_dates for the user's submissions should recalculate
    - destroy the second enrollment; the cached_due_dates for the user's
      submissions should recalculate
    - create a group assignment
      - add the student to a group in the assignment's category; the
        cached_due_dates for the user's submissions should recalculate
      - remove the student from the group; the cached_due_dates for the
        user's submissions should recalculate
  - enroll more students in the course
    - change an assignment's due date; the cached_due_dates for the
      assignment's submissions should recalculate
    - create an override for the assignment; the cached_due_dates for
      the assignment's submissions should recalculate
    - change the due date on the override; the cached_due_dates for the
      assignment's submissions should recalculate
    - delete the override; the cached_due_dates for the assignment's
      submissions should recalculate
  - during any of the above recalculations:
    - the most lenient applicable override should apply
    - if the most lenient applicable override is more stringent than the
      assignment due_at, it should still apply
    - the assignment due_at should apply if there are no applicable
      overrides

Change-Id: Ibacab27429a76755114dabb1e735d4b3d9bbd2fc
Reviewed-on: https://gerrit.instructure.com/21123
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
QA-Review: Jacob Fugal <jacob@instructure.com>
Tested-by: Jacob Fugal <jacob@instructure.com>
2013-06-10 19:11:31 +00:00
Bracken Mosbacker 93afcafa53 return selective sub-item urls
for the convenience of api users

Test Plan:
 * The top-level return value of the selective api call
   should include urls to the sub-items lists
 * the top-level url is: api/v1/courses/:course_id/content_migrations/:id/selective_data

refs CNVS-6061

Change-Id: I35b9288a1471dcbe66462703636e9b45dcafa31e
Reviewed-on: https://gerrit.instructure.com/21249
QA-Review: Clare Strong <clare@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
2013-06-08 00:56:58 +00:00
Cody Cutrer 90819aa900 don't load entire submissions and quiz_submissions into memory
for user merge

test plan:
 * merge together some users that have both taken the same quiz
 * it should not fail

Change-Id: I57c9624b6f41d903b7e6bcc6436da348dddd1ccd
Reviewed-on: https://gerrit.instructure.com/20770
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-06-07 22:31:28 +00:00
James Williams 35bc9d1e36 add section to set course and group quota directly from accounts
test plan:
* go to the accounts settings -> quotas tab
* note the new section on the bottom
 ('Manually Settable Quotas')
* should be able to select a course or group
 by their ID, and set their quota

closes #CNVS-271 #CNVS-6060

Change-Id: Iaa5336c792aa0447bc96f8b61260ee655ad40adc
Reviewed-on: https://gerrit.instructure.com/21285
QA-Review: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-06-07 22:14:48 +00:00
Mark Severson 5f9fcb977c change APIs to return consistent locking information
affected apis:
 * assignments
 * discussions
 * files
 * pages
 * quizzes

test plan:
 * verify returned attributes:
   * locked - manually locked state of the item
   * locked_for_user - user's access to the item
     (false will always be returned for a teacher)
   * lock_explanation - explanation of the reason for the lock
     (if locked_for_user)
   * lock_info - detailed information about the reason for the lock
     (if locked_for_user)

fixes #CNVS-5837

Change-Id: I0c397a218180d58da7a2f710d9977d9ddb7745fc
Reviewed-on: https://gerrit.instructure.com/21212
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-06-07 21:41:31 +00:00
James Williams 94d1f2ee97 add default_group_storage_quota setting to accounts
test plan:
* in account settings - quotas tab,
 set the default group storage quota
* attempt to upload files to a new group (without a set
quota) until the quota is hit or exceeded, confirming
that the set default is in effect

refs #CNVS-271

Change-Id: Ia4cbd84da19eb07d188dcc85c81c6b45bc2fa7ce
Reviewed-on: https://gerrit.instructure.com/21191
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
2013-06-07 21:11:57 +00:00
Zach Pendleton 1a1c2d294b add "pinned" discussions to index view.
fixes CNVS-5708

discussion topics can now be pinned to preserve their
position at the top of the discussion topics index page.
pinned discussions can be manually sorted, while all
other topics remain sorted by most recent activity.

test plan:
  * in a course with existing discussion topics, attempt
    to drag a topic into the pinned area and verify that
    it properly moves to that group and persists on page
    refresh;
  * move multiple topics into the pinned area and verify
    that they can be manually sorted and that the sort
    persists on page refresh;
  * drag a pinned topic to the open discussion area and
    verify that it properly moves there and persists on
    page refresh;
  * verify that pinned and open topics cannot be dragged
    into the locked area;
  * verify that open topics offer a pin option in their
    gear menus and that pinned topics offer an unpin
    option. verify that these options work as expected.

Change-Id: I65dccba5eed11dd8b0996ecd930b93a1d61dbebc
Reviewed-on: https://gerrit.instructure.com/21260
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Product-Review: Zach Pendleton <zachp@instructure.com>
QA-Review: Zach Pendleton <zachp@instructure.com>
Tested-by: Zach Pendleton <zachp@instructure.com>
2013-06-07 20:00:26 +00:00
Brian Palmer b80fd60ced add cassandra cluster info to CQL log lines
test plan:
  * enable cassandra page views
  * visit /users/X for a user with page views
  * search the rails log file for CQL lines, they should include the
    cluster name and the environment name like "[page_views development]"

Change-Id: I61903e55c01c818f33022f2971905951a31b8f0e
Reviewed-on: https://gerrit.instructure.com/21302
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
2013-06-07 19:09:39 +00:00
Cody Cutrer 3e3520c9d6 improve Cassandra helper methods
refs CNVS-6018

 * allow specifying which environment you want to check is configured/
   get a connection for
 * properly cache nil results

test plan:
 * cassandra page views should still save and load

Change-Id: I14c667182a38da4a5c64e7685dc9db81d45fcf07
Reviewed-on: https://gerrit.instructure.com/20978
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-06-07 16:54:16 +00:00
Cody Cutrer 2ac4618fab activate the user's shard when consulting cassandra
refs CNVS-6018

test plan:
 * saving and loading of cassandra page views should work

Change-Id: Ic9730371bb1f4207cb06aa6da30baee9f4232d8f
Reviewed-on: https://gerrit.instructure.com/20979
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-06-07 16:53:22 +00:00
Bracken Mosbacker 5a689faa6d add lti variable substitution support
Added a basic variable substitution framework and implemented
a few variables as examples: $Person.name.full,
$Person.name.given, $Person.name.family

Added a concluded enrollment roles variable so that a tool
can know what a users concluded roles were. The variable is
$Canvas.membership.concludedRoles

Variable names are case sensitive.

Test Plan:
 * Create an lti tool launch with a custom key like this:
   * custom_my_var=$Person.name.full
 * With a concluded user do a tool launch that has the
   $Canvas.membership.concludedRoles variable
	 * it should list the concluded roles
 * Configure tools through an XML file with a custom param
   and make sure it works

Change-Id: Iefb85c441680c7ab3623ce85e405e1c48cda837c
Reviewed-on: https://gerrit.instructure.com/21193
QA-Review: Clare Strong <clare@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brad Humphrey <brad@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-06-07 15:49:47 +00:00
Cody Cutrer 36d8bdb9d6 only select necessary columns for gradecalculator
instead of fulling in some possibly large columns that we ignore

also, we don't care about the order, so don't make the db sort
them

test plan:
 * change some scores
 * final scores as shown on csv exports or other places should
   reflect said changes

Change-Id: Ic5c8876aab3d3eed261d9b4714642302f25e0f3e
Reviewed-on: https://gerrit.instructure.com/21153
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Duane Johnson <duane@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-06-06 20:46:35 +00:00
Jon Jensen 81e50dbc71 switch out i18n backend, closes CNVS-5938
test plan:
1. specs should pass
2. run canvas with RAILS_LOAD_ALL_LOCALES=1
3. you should be able to switch locales and see translations
4. run i18n:generate on the parent commit and on this commit, the
   resulting config/locales/generated/en.yml should be identical

Change-Id: I5164943dc6e682c663145e91d7a9791331e9b4cc
Reviewed-on: https://gerrit.instructure.com/21014
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
2013-06-06 18:11:28 +00:00
Brian Palmer f81ab5f5d9 add debugging information to track down an issue
Change-Id: I8bdf9efcfc8a03478bfa8f99e5cd82a4d6ff4d13
Reviewed-on: https://gerrit.instructure.com/21251
Reviewed-by: Paul Hinze <paulh@instructure.com>
Product-Review: Paul Hinze <paulh@instructure.com>
QA-Review: Paul Hinze <paulh@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-06-06 02:00:00 +00:00
Bryan Madsen 439b4a003e spec: redirect stderr to stdout for rake js:test
Change-Id: I8e42f0ff18124a06cfbc0ea320bbce0e13491fa6
Reviewed-on: https://gerrit.instructure.com/21237
Reviewed-by: Shawn Meredith <shawn@instructure.com>
QA-Review: Shawn Meredith <shawn@instructure.com>
Product-Review: Shawn Meredith <shawn@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-06-05 23:40:47 +00:00
Duane Johnson 8cf1184312 adds an autoimport rake task and :discard option
Since there is a low signal-to-noise ratio on warnings from
translation files, we sometimes want to just import the file
regardless of warning status. This patch enables command-line imports
like so:

$ rake i18n:autoimport[config/locales/my-new-chinese-translation.yml]

The task discards translation keys that have wrapper or markup errors.

Also fixes a longstanding bug in the translation import that accepted
underscores in placeholder names as the beginning or ending of a
wrapper.

Test Plan:
- Import a new translation file. It shouldn't ask you for feedback on
  warnings, and the file should import and augment whatever
  translation file was there before (e.g. if you're importing chinese,
  check the config/locales/zh.yml file for changes)
- If a placeholder name has an underscore in it (e.g. %{android_url}),
  it should not show up in the mismatch report when autoimport runs.

Fixes CNVS-6139

Change-Id: I0c4c45530908e975ab1eaee0e28b9d5f0a3489be
Reviewed-on: https://gerrit.instructure.com/20940
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Duane Johnson <duane@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
2013-06-05 22:02:47 +00:00
Jon Willesen 6afca65c49 incoming message processor should ignore harmless parsing errors
fixes CNVS-6138

test plan:
 - use a directory test to check:
   - normal emails are still processed correctly.
   - emails with irrelevant parsing errors (like a bad
     Received header) get processed normally and aren't treated
     like as errors.
   - emails with relevant parsing errors (like a badly
     folder To header) are treated as errors.
 - make sure receiving actual email isn't broken.

Change-Id: Ifbe8480de4546ec1b6205ebbdfef8d7ea72d3284
Reviewed-on: https://gerrit.instructure.com/21170
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
QA-Review: Cam Theriault <cam@instructure.com>
Product-Review: Jon Willesen <jonw@instructure.com>
2013-06-05 19:18:09 +00:00
Jeremy Stanley 1cd3580615 add data-api-endpoint for quiz / quiz list links
test plan:
 - have a course with a quiz
 - in rich content (like a wiki page), use the wiki sidebar
   to insert a link to the quiz list and a link to the quiz
 - retrieve the wiki page via the pages API
 - the quiz list link should have added attributes
   * data-api-returntype="[Quiz]" (with brackets)
   * data-api-endpoint: valid API link to the quiz index
 - the quiz link should have added attributes
   * data-api-returntype="Quiz"
   * data-api-endpoint: valid API link to the quiz
 - the API documentation should mention "Quiz" in the list
   of supported data-api-returntype values, found in the
   "Basics" section under "API Endpoint Attributes"

fixes CNVS-6115

Change-Id: If405f6779f1b3f3719503a9987cceaf29a508ed8
Reviewed-on: https://gerrit.instructure.com/21080
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-06-04 20:34:24 +00:00
Jeremy Stanley c56ad5bdcb add data-api-endpoint for external tool launch links
test plan:
 - in rich text somewhere (wiki page, assignment, etc.),
   embed a link to launch an LTI tool.
   a suitable test tool can be found at
   http://lti-tool-provider.herokuapp.com
 - retrieve that text through the appropriate API
   (pages, assignments, etc.)
 - the link should have added data-api-return-type
   (SessionlessLaunchUrl) and data-api-endpoint attributes.
 - the data-api-endpoint should contain a link to the
   generate-sessionless-launch API. hit this link with
   curl or postman or whatever (authenticating with your
   token as is normal for API requests)
 - the above API should return a URL with a big scary
   verifier in it.  (you should be able to launch *that*
   URL to get into the LTI tool without a Canvas session)

fixes CNVS-5944

Change-Id: I2e51312341b08f87ff2be7bee57370318be72b65
Reviewed-on: https://gerrit.instructure.com/21075
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-06-04 20:33:57 +00:00
Stanley Stuart bbec6ea08c remove openobject from turnitin
Replaces OpenObject with a struct in order to gain performance.

test plan:
  - as a site admin, go to the account settings page
  - under the Turnitin settings, set it up with valid turnitin settings
  - make sure the turnitin confirmation link works

Change-Id: Ie71cc2faf8c34c3c43de66b133058c7781c4e86b
Reviewed-on: https://gerrit.instructure.com/16483
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
2013-06-04 19:55:52 +00:00
Eric Berry ba0dd818a5 added the ability for users to review app center apps
test steps:
- enable the app center with a valid access token
- visit the app center under account settings
- click on a tool and ensure the reviews appear in the list at the
  bottom
- click the link 'Rate this tool' and add a review
- ensure that the review list reloads

** note: you will not see the actual app star rating or review
count change when you add/modify a review. this is expected behavior.

Change-Id: I79ab0769f56b3a17b6eb2056de1416eb1a0a71ca
Reviewed-on: https://gerrit.instructure.com/21054
Reviewed-by: Brad Humphrey <brad@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Brad Humphrey <brad@instructure.com>
2013-06-04 19:16:20 +00:00
Simon Williams d96ba9c601 finish removing course.publish_grades_immediately
this was removed from the UI in Mar 2011 but was never completely ripped out.
we'd like to remove it now since it was adding extra complexity for no benefit.

closes CNVS-5929
refs #3974

test plan:
- create/update/delete an assignment from the index page, and the show page
- grade an assignment (with and without muting)
- test assignment notifications (with and without muting)
  - creating an assignment
  - editing an assignment
  - changing a due date (after 3 hours of being edited)
  - grading an assignment

Change-Id: Ie455bed41154018b5bd2c9c0e69e1e3285a0ac09
Reviewed-on: https://gerrit.instructure.com/20778
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>
2013-06-04 18:11:08 +00:00
Cameron Sutter e7c24b05eb assignment groups API
fixes CNVS-6064

test plan
- using the API, create, get, and update an assignment group
- using the API, delete an assignment group with and without assignments
and both specify an assignment group to move the assignments to
and don't specify an assignment group
- it should throw an error if there are no other active assignment groups

Change-Id: I0d637d73255115258dc42e73541146c889a68afc
Reviewed-on: https://gerrit.instructure.com/20993
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2013-06-03 18:02:46 +00:00
James Williams 9c0e883a7f add warning popover for 'crowdsourced' locales
test plan:
* there are no crowdsourced locales currently, so
 before starting the server,
 add one by manually editing config/locales/locales.yml
 and adding "crowdsourced: true" under a language, e.g.:

>en:
>  locales:
>    en: English
>  crowdsourced: true

* for each area where a language is selectable:
 * use the select box to select a crowdsourced language
 * and confirm that an icon appears, and that hovering over it
reveals a popover warning box about selecting a crowdsourced
language

* areas to test:
 * current user's profile settings
  (visit '/profile/settings' -> click "Edit Settings")
 * account settings
 * course settings

closes #CNVS-4967 #CNVS-4278

Change-Id: I2e83df950b815fb01e5f0a2aa324020415198e5a
Reviewed-on: https://gerrit.instructure.com/21019
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Matt Goodwin <mattg@instructure.com>
2013-05-31 18:44:30 +00:00
Shawn Meredith e1cb5465aa simplecov update
Change-Id: Ie61a2ec6d9f460b1cc7f448e3d658c8c552675b5
Reviewed-on: https://gerrit.instructure.com/21064
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>
2013-05-31 05:01:55 +00:00
Shawn Meredith e3c113c640 simplecov implementation
Change-Id: I8528b62abce60e25777f5c5210c6e38a6d809455
Reviewed-on: https://gerrit.instructure.com/20882
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bryan Madsen <bryan@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
2013-05-30 17:30:45 +00:00
James Williams d71b258ed2 allow any wiki page to be set as front page
test plan:
* confirm that wiki pages can be created and updated
with the parameter wiki_page[front_page]
 * if true, this will set the wiki page as the
 front page for the context (assuming the page is
 not hidden to students)
 * if false, this will unset the page as the front page
 (assuming it was the front page to begin with)

* confirm that /courses/:course_id/front_page acts
as a proper endpoint for show/update/destroy and
acts just as /courses/:course_id/pages/:url
for whichever page is set as the front page

* confirm that none of the above page breaks
normal wiki functionality

closes #CNVS-5528

Change-Id: I3f51d740e90ff0a5a39f2aafc988a1a33947ca18
Reviewed-on: https://gerrit.instructure.com/20938
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>
2013-05-30 02:51:35 +00:00
Brad Humphrey 13f9309a5c show canvas login id on lit tool launch
test plan:
 - Create a tool (http://lti-tool-provider.herokuapp.com/)
 - Create a user with a pseydonym that doesn't have an sis id
 - Launch the tool as the new user
 - The launch should contain custom_canvas_user_login_id and should not contain lis_person_sourcedid

Change-Id: I3aa8618ac656eb475e8e2d26924634ff07943860
Reviewed-on: https://gerrit.instructure.com/20958
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mark Severson <markse@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
2013-05-29 20:05:03 +00:00
James Williams cca7214861 remove unpublished module items from active scope
keep module items in the 'unpublished' state from
being viewed by students or factoring into progressions, etc

test plan:
* create an unpublished module item
* ensure that as a student:
 * the module item is not viewable, either through the site
 or through the api
 * that it is not factored into the progression for the module

* also confirm that the unpublished module item carries over
on course copy

closes #CNVS-5491

Change-Id: I60e19ea49386e0e6c60c4a86b1a34979b4c0664d
Reviewed-on: https://gerrit.instructure.com/20834
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2013-05-29 19:22:39 +00:00
Jon Jensen 8710cb94b2 stream item summary api, fixes CNVS-5779
new endpoints for getting totals/stats of stream items. for each asset
type (e.g. DiscussionTopic), you can get the total count and the unread
count

test plan:
see specs. also, hit the following endpoints in a browser:
/api/v1/users/self/activity_stream/summary
/api/v1/courses/:id/activity_stream/summary
/api/v1/groups/:id/activity_stream/summary

Change-Id: I101d239a788c28d2cd4c39230a401e36a31007f5
Reviewed-on: https://gerrit.instructure.com/20836
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-05-29 03:37:58 +00:00
Kyle Rosenbaum 32bd7ebe12 js:test timeout moved into rake tasks
Change-Id: I39fb92296b0d8f5aba090e48fa79440376e764f6
Reviewed-on: https://gerrit.instructure.com/20955
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bryan Madsen <bryan@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
2013-05-28 21:12:54 +00:00
Cody Cutrer 8f4b2fc595 fix merging a user associated with multiple shards
test plan:
 * have a user associated with shards A and B into a user on shard C
 * the resulting user should show enrollments and stuff from all
   three shards

Change-Id: Ib094179f56d221253e65ae8756b15dcabfa373da
Reviewed-on: https://gerrit.instructure.com/20843
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-05-28 16:33:26 +00:00
Brad Humphrey 6b3274a095 sessionless launch of LTI tools
test plan:
 * add an external tool to each of:
   - context module item
   - course navigation (tabs)
   - assignment
 * exercise the index methods for each API
 * ensure a url is returned for each external tool
   - this url should be to the sessionless launch API
 * query the sessionless launch API with the url
   - this call will return another url which allows a launch of the LTI tool in a browser not logged into Canvas
 * copy/paste the url into a browser that is not logged into Canvas (incognito)
 * ensure the LTI tool launches correctly

fixes #CNVS-5854

Change-Id: I6b50f965f4714e7efb9cfe0f99e1cd0b5f2055f2
Reviewed-on: https://gerrit.instructure.com/20868
QA-Review: Clare Strong <clare@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-05-25 00:06:39 +00:00
Landon Wilkins 5a30f81b49 extends the stream item api for read status (read_state)
fixes #CNVS-5939

test plan - see specs

Change-Id: Iec1be46a9463f1427f1726098c8997a91b692aa7
Reviewed-on: https://gerrit.instructure.com/20792
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>
Tested-by: Landon Wilkins <lwilkins@instructure.com>
2013-05-24 20:54:42 +00:00
Bracken Mosbacker b885d5cb8f add api endpoint for selective content migration data
this endpoints returns all the items for a migration so
that you could build a UI around selecting what to copy
when importing/copying courses

Test Plan:
 * Start a content migration but don't finish the selection part
 * use the /api/v1/courses/:id/content_migrations/:id/selective_data endpoint
   * if called without args you should get the top-level areas
	 * if called with ?type=assignments (or the types in the top-level list)
	   you should get a list of just the specified type

closes #CNVS-5940

Change-Id: Idfc8bd9b02738801a3bf5b18df25314350929762
Reviewed-on: https://gerrit.instructure.com/20873
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Sterling Cobb <sterling@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-05-24 19:59:34 +00:00
Stanley Stuart a7e713fab9 draft state: add delete action to quiz api and published field
test plan:
  - As a student, try to publish/unpublish a quiz through the api. You
    should get unauthorized errors.
  - As a teacher, try deleting a quiz through the API. It should be a
    successful response, and you should not see the quiz in the course
    index after you delete it.
  - As a teacher, try publishing/unpublishing a quiz through the api.
    To do this, simply make an update request to the api and pass a
    field called "published" which has the value true or false. When you
    get a response back, the "published" field should reflect the value
    you sent to the API. For good measure, make the same request against
    the show action in the API.
    (/api/v1/courses/:course_id/quizzes/:quiz_id) and the "published"
    field should have the same value.
  - As a teacher, create a quiz, and make sure it's published. As a
    student, take the quiz.
  - As a teacher, edit one of the quiz questions. You should see the
    normal "You have made unpublished changes to this quiz" message on
    the quiz show page, but when you query the API for the quiz the
    "published" parameter should be true.
  - As a teacher, try to unpublish the quiz from the API by including a
    "published" parameter with a value of "false". You should get an
    error response. The quiz should still be published in Canvas when
    you go back to it.

fixes CNVS-5673

Change-Id: Ie32aa48e0976374605419d180c373861a1397aa9
Reviewed-on: https://gerrit.instructure.com/20773
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Ryan Florence <ryanf@instructure.com>
2013-05-24 19:42:00 +00:00
Brad Humphrey b30149a543 initial implementation of the app center
there is now a plugin that can be used to enable the app center.
this pulls data in from edu-apps.org which will be presented
under the account settings 'External Tools' tab for the user.

Testing (with plugin disabled):
- disable the plugin and visit an account settings page external
  tools tab
- ensure that there is a list (table view) of installed external
  tools no buttons to the right of 'External Tools'
- Click on 'Add External Tool' and add a new tool:

    Name: Public Collections
    Consumer Key: N/A
    Shard Secret: N/A
    Configuration Type: By URL
    Configuration URL:
    http://www.edu-apps.org/tools/public_collections/config.xml

Testing (with plugin enabled):
- Enable the plugin for the account by going to /plugins and click
  on 'App Center' cog. Enter the following:

    Access Token: N/A
    Base URL: https://www.edu-apps.org
    App Index Endpoint: /api/v1/apps
    App Show Endpoint: /api/v1/apps/:id/reviews

- Save the plugin and go to the external tools view again for the
  account
- Ensure the first page you see is the app center page (box view)
- Ensure there is a button 'View Installed Tools' to the right of
  the 'External Tools' header
- Click on 'YouTube'
- Ensure that the show page appears with star ratings and reviews
  at the bottom
- Click 'Back to App Center' and ensure it returns to the prior
  view. Click on YouTube again to return here.
- Click 'Add Tool' and then 'Submit'
- Ensure that there is notification that the tool was added and
  the table with the installed external tools are visible (inc.
  YouTube)
- Click the trash icon next to YouTube and confirm you can delete
  the tool
- Click on 'View App Center' to return to the App Center view
- Click on 'Prula'
- Click 'Add Tool'
- Click 'Submit' and ensure that there are missing required fields
  feedback
- Enter the following:

    Name: Prulu
    Consumer Key: ABCDE
    Shared Secret: FGHIJ
    Show Course in Navigation (check this)
    Course Nav Link: http://google.com

- Click 'Submit' and ensure it saved
- On the table view, ensure that 'Course Navigation' appears next
  to 'Prulu' on the installed tools table view

Change-Id: Icbc5516e93ca2586cc3a8e9a78b877e30607026c
Reviewed-on: https://gerrit.instructure.com/20165
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Product-Review: Eric Berry <ericb@instructure.com>
Reviewed-by: Eric Berry <ericb@instructure.com>
2013-05-24 19:37:29 +00:00
Simon Williams 4614b959a5 api: return assignment due dates as they apply to the user
test plan:
- as a teacher, create multiple assignments with assignment overrides
- as a student in each section with an override, request the index
  (/ap1/v1/courses/:course_id/assignments), making sure that each
  assignment in the list has the due_at, lock_at, unlock_at dates as
  they apply to the user
- Do the same check for the show action
  (/api/v1/courses/:course_id/assignments/:assignment_id)
- make sure editing exising assignments with overrides works
- test override assignments with calendar 2 (including editing)

fixes CNVS-5537

Change-Id: If0f673236ccc95d276b5624d65e323118b0573b5
Reviewed-on: https://gerrit.instructure.com/20104
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2013-05-24 17:05:02 +00:00
Cameron Sutter fa0d3499fe update assignments' published flag via api
and only show published assignments to students

fixes CNVS-5681

test plan:
- create an assignment as a teacher
- using the api, set the published flag to true
- using the api, set the published flag to false
- as a student, using the api, get the assignments in that course
- only the published ones should be shown

Change-Id: Ie01a2de3c829a3f830053b3b660a835f4fe1988c
Reviewed-on: https://gerrit.instructure.com/20812
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>
2013-05-24 15:26:34 +00:00
James Williams 2ecc8bc16b allow module items to be published/unpublished through API
adds undocumented arguments to context module items API
update action, identical to the context modules API

test plan:
* to publish a module item, update through the API
 with the argument 'module_item[published]=1'
* to unpublish an item, use
 'module_item[published]=0'

* NOTE: the published/unpublished status of an item
will not affect whether the item is viewable/usable by students

* confirm that publishing/unpublishing an item syncs the
state with the associated content (e.g. a wiki page's
published/unpublished state)

closes #CNVS-5943

Change-Id: I80c45a787a5cf8ac7b3bc569056d9590ab2f74bc
Reviewed-on: https://gerrit.instructure.com/20633
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-05-24 14:00:31 +00:00
Sterling Cobb 691c6be9a6 Save selected content durring migration
Pause the migration workflow to allow a user to select content that they
want to migrate.

Change-Id: I1196f8c6c62aa6cae5ffb8a0925cb898f78f8137
fixes: #CNVS-5941
Reviewed-on: https://gerrit.instructure.com/20817
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
2013-05-24 05:00:26 +00:00
Brian Palmer 02e8efdcd7 skip checking override versions when not needed
if we're dealing with the actual assignment/quiz instead of the model
from one of its versions, we don't need to align the history of the
overrides with the history of the assignment/quiz. we can just use the
most recent version of each override.

refs CNVS-5805

test plan: existing specs cover that this optimization doesn't break
reading overrides of older versions

Change-Id: I52d55da0619688744d63d6523e1bc055ecdaa667
Reviewed-on: https://gerrit.instructure.com/20813
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
2013-05-23 20:46:49 +00:00
Duane Johnson f100d205f3 refactor redis config loading
Refs CNVS-5333

Change-Id: Ie5104082a70604660537aa707ca012d055705150
Reviewed-on: https://gerrit.instructure.com/20514
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Duane Johnson <duane@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
2013-05-23 19:04:35 +00:00
Jon Jensen 53dc3ad6a6 fix various i18n issues
fix all the places we incorrectly translate during rails initialization
rather than at runtime

test plan:
1. canvas should work
2. those strings should now get translated

Change-Id: I1c0e3b9513103cfddfd4ad94dde4b3a0dd49203e
Reviewed-on: https://gerrit.instructure.com/20468
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2013-05-23 18:54:55 +00:00
Cody Cutrer 6ecd94030e cassandra migrations are kept track of in the birth shard
Change-Id: I957f8331a3b707955c9a6f7109bead2519c33af5
Reviewed-on: https://gerrit.instructure.com/20859
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2013-05-23 16:05:51 +00:00
Ryan Florence 534d92b5b3 added tour guide libs
closes CNVS-5736

test plan:
1. see specs

Change-Id: I1edbd4062d3c1a25394bdaaf028fa8198609a881
Reviewed-on: https://gerrit.instructure.com/17312
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Stanley Stuart <stanley@instructure.com>
Product-Review: Ryan Florence <ryanf@instructure.com>
QA-Review: Ryan Florence <ryanf@instructure.com>
2013-05-22 19:30:13 +00:00
Joe Tanner d273a6788b move cog menu from course settings to people page, closes #CNVS-5752
test plan:
	verify that the cog menu functions as it did on the course settings users tab
	some good edge cases to test are:
	- user enrolled as Student and TA (or other roles) in same (or different) sections
	- user enrolled as Observer and other roles (should see 'Link to Students' and 'Edit Sections')

Change-Id: I2bf7546b8a5f63ffd603fe4ee9055595089a99eb
Reviewed-on: https://gerrit.instructure.com/20523
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
2013-05-21 19:18:24 +00:00
Rob Orton 1cc013d539 removes a race condition for report file downloads
spec plan
-specs should pass

Change-Id: Ia85b8976b07619cacbf3865dea197454ac15c0a3
Reviewed-on: https://gerrit.instructure.com/20691
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2013-05-20 21:17:17 +00:00
Sterling Cobb 947f458d85 Add new content migration UI
This adds the ability for you to process migrations quickly. Includes a
paginated list for migrations and issues.

Test Plan:
 * Make sure old migrations UIs work the same
 * Make sure new UI works wonderfully
   * go to /courses/:id/content_migrations to see the new UI

fixes: CNVS-4732

Change-Id: I7cabc51348c32ed03d581e495756eefbf1060ad3
Reviewed-on: https://gerrit.instructure.com/20349
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-05-18 04:58:35 +00:00
Bracken Mosbacker 98bb4c7980 add migration endpoint to list available migrators
allows api users to find available migrators since different
canvas installs can have different oens available.

Test Plan:
 * Hit the api/v1/courses/:id/content_migrations/migrators
   endpoint and verify it works

refs #CNVS-4228

Change-Id: I3a2585cea8286b09c9e1039fd722d05a2e82d558
Reviewed-on: https://gerrit.instructure.com/20318
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
2013-05-17 22:34:25 +00:00
Bracken Mosbacker 3f94f55256 create course copy and zip migration workers
Course copying and importing .zip files will now work the
same as other content migrations.

Test Plan:
 * Using the ContentMigration api test course copy and zip imports
 * Make sure the current course copy and zip import UIs still work
   * for course copy make sure selective options work

closes CNVS-4228

Change-Id: I80a849471dffaf44d683e980cf0b73505b353d83
Reviewed-on: https://gerrit.instructure.com/19740
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
2013-05-17 22:34:15 +00:00
Bracken Mosbacker 93643f6d6c content migration creation api
allows creating content migration through the api

Test Plan:
 * Create a content migration through the api along with a file upload
 * You should be able to follow along with the progress and
   the migration should be complete when the progress is done
 * Try to update the migration type, you should get an error
 * Upload a wrong file type the first time, then go through
   the file upload process again on the update endpoint.

refs CNVS-4228

Change-Id: Iab1082ca68b61d1b0493c191b48169a164444d06
Reviewed-on: https://gerrit.instructure.com/19108
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
2013-05-17 22:34:09 +00:00
Cameron Sutter 648c3c3aab add publish state to assignments
fixes CNVS-5680

test plan:
- create an account that has enable_draft enabled
- as a teacher within that account, create an assignment
- using the api, get that assignment and check for the 'published' flag
- there should be a 'published' flag that is either true/false
- now, turn off enable_draft on the account
- using the api, get that assignment and check for the 'published' flag
- there should not be a 'published' flag

Change-Id: I161e3144ca6b82e41e72d5dbb56bebcee03e6fa4
Reviewed-on: https://gerrit.instructure.com/20609
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>
2013-05-17 13:44:19 +00:00
Stanley Stuart 5ad43c33bd add ability to download all file uploads for a quiz as a zip
test plan:
  - as a few different students, take a quiz with at least two questions
    that are file upload questions. Answer each question as each
    student.
  - as the teacher, you should see a "Download All Files" button on the
    right on the Quiz Show Page next to "Quiz Stastics" and "Moderate
    This Quiz".
  - You should get a pop up that successfully downloads all the zips
    (make sure you have delayed jobs running!). Make sure all the files
    you submitted as the students are there, with the student's name,
    user id, question number, and attachment display name in the
    filename of each file.

closes CNVS-3048

Change-Id: I23cb2d4262bb0446476eeac4fdcb356e604e6a05
Reviewed-on: https://gerrit.instructure.com/20495
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Reviewed-by: Eric Berry <ericb@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
2013-05-16 21:14:19 +00:00
James Williams 07d6edf49c create 'page' type module items through API using wiki page url
test plan:
* create a module item through the api of type 'page' by
setting the 'page_url' attribute to the 'url' of the
desired wikipage (since the id is not exposed in the api)
* in index and show actions, confirm that the 'page' item
includes a 'page_url' attribute

Change-Id: Ie39bf8b4b58eeed3d98e51843a26b592cc2746b0
Reviewed-on: https://gerrit.instructure.com/20608
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2013-05-16 16:08:01 +00:00
Jeremy Stanley 281b72673d return content_id in module items api
fixes CNVS-5807

test plan:
 - index or show action for module item should show the id
   of the referenced object (content_id), if it has one
   - note that wiki page ids are not exposed by the api

Change-Id: I05748fa562b9e7cb5a775b6c8e40a5ff2e835f01
Reviewed-on: https://gerrit.instructure.com/20525
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2013-05-15 20:55:34 +00:00
Brad Humphrey be800d1e1f adding additional api support for the app center
Reworked how the calls were passed through to take advantage of the
app center pagination.  Also added an endpoint for retrieving app reviews.

The following canvas api calls should work, after configuring the app center plugin
 - /api/v1/accounts/:account_id/app_center/apps
 - /api/v1/accounts/:account_id/app_center/apps/:app_id/reviews
 - /api/v1/courses/:course_id/app_center/apps
 - /api/v1/courses/:course_id/app_center/apps/:app_id/reviews

These should also accept a page and per_page params

Change-Id: I15fe1225c01d04bc2ad6efa1736013b88e541c51
Reviewed-on: https://gerrit.instructure.com/20455
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Brian Whitmer <brian@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
2013-05-15 17:22:31 +00:00
Jon Jensen d10b4bad59 better i18n wrapper inference
* actually check if tags are balanced (not just innermost tag)
* allow single closed tag on either side of content (e.g. for an icon)

test plan:
N/A, see specs. i18n:check should also pass

Change-Id: I1ecbce833ab35955e21e40a2d2404de4aa1b359f
Reviewed-on: https://gerrit.instructure.com/20565
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Reviewed-by: Joe Tanner <joe@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2013-05-15 15:25:40 +00:00
Rob Orton 8ff00b0299 fixes mysql bug in temp table for reports
mysql requires auto_increment columns to be defined as a key

test plan
 - using mysql run the Student Assignment Outcome Map Csv report
 - report should not fail

Change-Id: I092e66e3e108e677b24a773bc5a46f118110ef8a
Reviewed-on: https://gerrit.instructure.com/20261
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2013-05-14 19:08:27 +00:00
Brandon Broschinsky 76320cf94f should return admin for custom admin
fixes PS-271

test plan
-create custom admin role
-launch lti tool, admin role is avail.

Change-Id: I4f93eee990e8b89cf6265a3fee19bafdb7ef62a4
Reviewed-on: https://gerrit.instructure.com/20017
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2013-05-14 18:10:48 +00:00
Mark Severson 88ca0e82da add account quotas tab
test plan:
 * account admins with 'Manage storage quotas' should:
   * see the 'Quotas' tab in account settings
   * be allowed to modify quotas on the 'Quotas' tab
   * be allowed to modify quotas through the accounts api
 * admins without 'Manage storage quotas' should:
   * not see the 'Quotas' tab in account settings
   * not be allowed to modify quotas through the accounts api
 * accounts api should
   * allow updating the default_storage_quota_mb
   * allow updating the default_user_storage_quota_mb
   * reject values for these fields that are too large

closes #CNVS-4798

Change-Id: Icebe863b8e155efac1849a387b0bd7b3f47590fd
Reviewed-on: https://gerrit.instructure.com/19849
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2013-05-11 02:56:32 +00:00
Jon Willesen a65f2acb7a add forced_read_state to DiscussionEntryParticipant and APIs
Don't automatically mark a discussion entry as read if the user
manually marks the entry as unread.

fixes CNVS-5705

test plan:
 - As one user, create a discussion with lots of posts.
 - As a different user, go to the discussion, see the entries
   are automatically marked as read. Don't scroll all the way
   to the bottom of the discussion so there are still some
   unread posts.
 - Click the gray circle to manually mark some of the read
   entries as unread.
 - Refresh the page. The manually marked entries should show
   as unread and should not be automatically marked as read.
 - Scroll down. Unread entries that were not manually marked as
   unread should still be automatically marked as read.

Change-Id: I963d1dea9fc961a28a0a5c488399d4e3964c8d10
Reviewed-on: https://gerrit.instructure.com/20414
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
2013-05-10 21:45:23 +00:00
Rob Orton 60b101d86d exclude student view student from reports
also removes a race condition for report file downloads

fixes CNVS-5768
fixes CNVS-5769
fixes CNVS-5784

test plan
 - in a course use the student view student
 - in the account for that course run the users, and enrollments provisioning report
 - neither report should include the student view student 

Change-Id: I03544c7a38d91bd7d356c4ae73ea8857f948da7e
Reviewed-on: https://gerrit.instructure.com/20517
QA-Review: Clare Strong <clare@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2013-05-10 21:00:12 +00:00
Eric Berry ee59a60e66 resolved html emails including html tags
fixes CNVS-5493

test steps:

Trigger the following emails and ensure that the HTML and plain text
versions of the email appear proper.

* conversation message received
* new announcement
* new discussion entry
* new discussion topic
* updated wiki page
* summary (daily or weekly)

Change-Id: I9638badb500eeb6cb23e4a83bd8395cd5dc40608
Reviewed-on: https://gerrit.instructure.com/20296
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Eric Berry <ericb@instructure.com>
QA-Review: Eric Berry <ericb@instructure.com>
2013-05-10 16:48:50 +00:00
James Williams f9237bc856 add create/update/delete to api for context modules and items
test plan:
* refer to the API documentation to:

 * create a module
 * update existing module
 * delete a module

 * create a module item
 * update a module item
 * delete a module item

closes #CNVS-5534 #CNVS-5555

Change-Id: Icf13300d015e37bae636324a218ecf9ab9f2f8d0
Reviewed-on: https://gerrit.instructure.com/20200
QA-Review: Adam Phillipps <adam@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-05-10 15:16:34 +00:00
Eric Berry 5469a312ab fixed calculation of variance and standard deviation
fixes CNVS-5744

test steps:
- visit the 'quiz statistics' page on a quiz
- ensure that the 'Standard Deviation' and 'Mean Score' on the
  right side appears to be accurate

Change-Id: Ib9b2da07f0280852fe2f979f1ed159e22809577e
Reviewed-on: https://gerrit.instructure.com/20445
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
2013-05-09 18:50:05 +00:00
Jon Jensen a07b2ee772 async quiz report generation UI, fixes CNVS-4512
add button to create item analysis report, and make student analysis
creation async. make both buttons show a progress indicator, and auto-
download the file when it's ready (or not, if you refresh the page)

test plan:
1. make sure delayed jobs are running
2. create a quiz that allows multiple submissions
3. have some students take the quiz
4. go to the quiz statistics page
5. click "Generate Item Analysis"
6. it should be generated and prompt you to download
7. the data should be useful/correct
8. click "Generate Student Analysis
9. it should be generated and prompt you to download
10. the data should be useful/correct
11. have another student take the quiz
12. you should be able to regenerate both reports
13. have a student retake the quiz
14. you should get the link to view stats for all submissions
15. you should be able to download a different "Student Analysis" report
    for all submissions vs latest submission
16. the "Item Analysis" report should be the same for all submissions and
    latest submissions

Change-Id: Ib6bfa259f386a6660a41cd7e093d3a6eb0119eda
Reviewed-on: https://gerrit.instructure.com/20137
Reviewed-by: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
2013-05-08 23:11:52 +00:00
Cameron Sutter b6a122be4e added submission comment id to submission api
fixes CNVS-5553

test plan
- as a teacher create an assignment
- as a student submit that assignment with a comment
- a call to the submission api that includes submission comments
  should include the id of the submission comment

Change-Id: I2f207a7db3e0de2f9f3deb3a8f04467b2e7950bc
Reviewed-on: https://gerrit.instructure.com/20454
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>
2013-05-08 22:55:33 +00:00
Jacob Fugal 7a6a816715 invalidate all sessions on explicit logout
when a user explicitly logs out of one pseudonym session, invalidate all
the others

fixes CNVS-1923

test-plan:
  - create a user in two different accounts
  - log them in to both accounts
  - click "log out" in one account
  - should be logged out of both accounts

Change-Id: I79e70017d753c8201429901421e015f5d20e2000
Reviewed-on: https://gerrit.instructure.com/20096
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
2013-05-08 19:43:55 +00:00
Eric Berry ac76eaf598 added auto lock discussions on specified date
fixes CNVS-4106

test steps:
- go to create a discussion topic and ensure that you can toggle between
  the 'Graded' and non-graded availability dates. If the Graded is not
  checked, you should see the Available From/Until.
- create a discussion topic with a past from and past until. ensure that
  the discussion is locked for a student
- create a discussion topic with a future from and future until. ensure
  the discussion cannot be seen by the student
- update the above created discussion topic and switch it to be graded
  and set a future due, from, until date. ensure that the student cannot
  see the discussion.
- edit the discussion and ensure that the graded checkbox is checked and
  the group assignment fields are showing
- update the assignment with a past due, from, until and make sure the
  discussion is locked for the student.
- do all above with current dates (from in past, until in future) and
  make sure the student can see and reply to them.
- create an announcement and ensure that the functionality and forms are
  the same as before
- verify that you are able to lock and unlock discussion topics on the
  show view by using the gear drop-down

Change-Id: I99c9d54763fe3a74aa8a4bb37c22f09d4765d41e
Reviewed-on: https://gerrit.instructure.com/20339
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Willesen <jonw@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
2013-05-08 17:49:11 +00:00
Brad Humphrey 5e109f4434 show validation errors when configuring external tools
fixes #9725, fixes #9776, fixes #7311,
Test plan:
* go to the 'external tools' tab on the 'course settings' page
* create and edit some external tools
- make sure to omit fields or input invalid data and make sure you
get sensible error messages back

Change-Id: I88a7d5e439a27a599cbcfcfbd576434386949d35
Reviewed-on: https://gerrit.instructure.com/13332
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-05-08 15:44:44 +00:00
Eric Berry 0cb619ce64 quiz api url returned in module item api response
fixes CNVS-5458

test steps:
- create a module with a quiz
- perform an API call to module items and ensure the quiz url is
  part of the response

Change-Id: Ic0f4235ae76a1a729cb0fcbb0a9f588218c4016e
Reviewed-on: https://gerrit.instructure.com/20396
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Stanley Stuart <stanley@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Eric Berry <ericb@instructure.com>
2013-05-08 15:34:29 +00:00
Simon Williams c94efe04f2 fix override applicator if students don't have :read_roster
fixes CNVS-5650

test plan:
- go to the root account permission page and turn off "see the list of users"
  for students
- then create an assignment with only overrides (no default)
- the students should see the due date

Change-Id: I518f651db96b14509c997628575834943042117f
Reviewed-on: https://gerrit.instructure.com/20395
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
Reviewed-by: Cameron Sutter <csutter@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2013-05-08 03:20:27 +00:00
Brian Palmer 1163b408bf update cassandra-cql gem and set encoding of cassandra.rb
The combination of these two changes fixes an issue with using extended
utf-8 chars in cql queries (including inserts)

fixes CNVS-5719

test plan: enable cassandra page views, and from a script/console run a
test query with extended utf-8 data, for instance:

PageView::EventStream.database.execute("SELECT * FROM page_views WHERE request_id = ?", "test \xEF\xBF\xBD one")

This will return no results since that request id isn't a UUID, but the
key is it shouldn't error.

Change-Id: I1dafb6165cdda65ab64267edbf9fabc4fccd783c
Reviewed-on: https://gerrit.instructure.com/20397
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
2013-05-08 01:04:48 +00:00
Stanley Stuart 552dae8070 implemented ui for quiz file upload question type
test plan:
  - enable the quiz file upload feature for your account.
  - make sure you have s3 credentials for your Canvas installation
  - as a teacher, create a quiz with some file upload questions
  - as a student, take the quiz, making sure the following works:
    - you should get a warning if you leave any questions unanswered
    - you should see your file in the right spot if you refresh the page
  - when you finish the quiz, make sure a link to the file shows up on
    the quiz show page and the display name for that file is the same
    name of the file you uploaded
  - take the quiz again and make sure files you uploaded for hte
    previous submission don't show up when you first take the quiz.

closes CNVS-1153
closes CNVS-5331

Change-Id: Id3f8706e87cef9876946b52fd564caf31f31e4b5
Reviewed-on: https://gerrit.instructure.com/20174
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
2013-05-07 17:34:03 +00:00
Cody Cutrer 6a08e9058b use the birth shard so that the default shard can be changed
Change-Id: Ia7684c0b50df9d5fae4608b7e8e3d8d6dea291cc
Reviewed-on: https://gerrit.instructure.com/19748
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2013-05-07 15:44:17 +00:00
Jeremy Stanley 457bc0b15d a new [image] button in tinyMCE's toolbar
fixes CNVS_5151

test plan:
by using the new image button in the tinymce toolbar, you
should be able to:
 * insert an image from Canvas content (course or group files;
   whatever the context for the editor is)
   * test in wikis, discussions, quizzes, eportfolios...
     anywhere you can find a rich content editor
   * if you're in a course or group context, you should be
     able to add course/group files.  otherwise (in account
     context, for instance) you will only see "my files".
   * also, pls to test that subfolders work
 * single-click an image to select it (and set size/alt text etc.
   before pressing Update)
 * double-click an image to select it and insert with the
   default alt-text and size
   * note that the size is constrained to the image's aspect ratio
 * insert an image from the user's own files
 * insert an image by URL
 * insert an image from Flickr via search
   * images inserted from flickr should link to the source flickr page
     (this is part of flickr TOS, and is not a new behavior, but should
     be tested explicitly)
   * make sure if you change to a different flickr image, the link
     is updated
   * also test that if you change a flickr image to a canvas image
     or url image that the flickr link goes away
 * NOTE: also test the old flickr search dialog on the wiki sidebar
   (the blue magnifying glass thing) for possible regressions.
   (the tinymce plugin that powers this thing was modified.)
 * create or edit alt text for any image type

(note, it does not add uploading new files, that will come in another commit)

Change-Id: I2d5f8ca9f2301168f442955fda791631ee886636
Reviewed-on: https://gerrit.instructure.com/14391
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2013-05-06 19:20:14 +00:00
Cameron Matheson 63bde155b4 include points accumulated in gradebook csv
closes CNVS-2049

Test plan:
  * download the gradebook csv in a course with unweighted assignment
    groups. you should see "Current Points" and "Final Points" columns
  * download the gradebook csv in a course with weighted assignment
  * groups. there should not be any points columns

Change-Id: If795ab3dc0ae8a4fb84f29c9e759b463b7a14d04
Reviewed-on: https://gerrit.instructure.com/20189
Reviewed-by: Simon Williams <simon@instructure.com>
Reviewed-by: Stanley Stuart <stanley@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
2013-05-03 22:28:13 +00:00
Brad Humphrey 6c02d94551 app center external apps endpoint
provides an unpublished, backbone accessible api endpoint for the app center to consume.
In this commit the apps api just acts as a proxy to the external apps website based on plugin
settings, but in the future this endpoint will be able to match up data to tools installed in the
current context, cache data from the external website, return data to the external website,
and so forth.

Test Plan:
  - Before installing the plugin:
    * Visit /api/v1/accounts/:account_id/app_center/apps
    * You should get an empty json array
  - Enable the app center plugin
    * Visit /api/v1/accounts/:account_id/app_center/apps
    * You should get a json formatted array of app data

Change-Id: I48072053950e67aa583a3c79e2a582d30e7cd409
Reviewed-on: https://gerrit.instructure.com/20161
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Bracken Mosbacker <bracken@instructure.com>
2013-05-03 15:16:30 +00:00
Brian Palmer 31f33164b5 remove 1.8 compatibility shims
- update the Gemfile to be 1.9 only, and raise an exception on wrong
  ruby version
- remove RUBY_VERSION checks, replacing with the applicable code
- remove the FasterCSV compatibility shim, just use CSV now

test plan: trying to bundle install on ruby 1.8 or 2.0 should raise an
exception, specs should pass, canvas should work as normal on 1.9

Change-Id: I49088e9d227c59c6d5d5acb417c2df971129474a
Reviewed-on: https://gerrit.instructure.com/19806
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
2013-05-03 01:43:52 +00:00
Cody Cutrer 3431c2aa35 don't be ultra-smart about includes with pluck
Rails 3 doesn't handle them, so just ignore them.

also fix api usage of pluck depending on an include

Change-Id: Ia39b8ef6e5f442f4f7b873ae3bd6839f0422b906
Reviewed-on: https://gerrit.instructure.com/20071
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mark Ericksen <marke@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-05-02 23:13:33 +00:00
Eric Berry 48ca088666 Locked graded discussions are now visible to students
fixes CNVS-5309

test steps:
- as a teacher, create a few discussion topics with graded
  checked and due, begin and until dates are in the future, past
  and current.
- as a student, view the discussions list and ensure that the
  present and past topics are visible but the future is not.
- click the past discussion topic and make sure you are able to
  view the discussion but not reply to it.
- click the present discussion and make sure that you can reply
  to it.
- as the student and teacher, ensure that the visible discussion
  topics appear in the stream items (dashboard) and the future
  do not (for the student).

Change-Id: Ibb0a3d05ae830e764c8068a6c9d4ead804e91139
Reviewed-on: https://gerrit.instructure.com/20082
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
2013-05-02 17:21:31 +00:00
Jeremy Stanley 808a959904 hide course-level events when section-level events apply
test plan:
 - create a calendar event with section-specific times
 - the teacher should see all times
 - the student should see only the time for their section
   (this is the bug being fixed here)
 - if the syllabus is public and no user is logged in,
   the event should show up just once, beginning at the
   earliest section time and ending at the last
   (this is not new behavior, but needs to be retested)

fixes CNVS-5087

Change-Id: Idb34a5e972256e38565ad2cc1c4ab4dae886b740
Reviewed-on: https://gerrit.instructure.com/20128
Reviewed-by: Mark Severson <markse@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Product-Review: Mark Severson <markse@instructure.com>
2013-05-02 02:11:24 +00:00
Eric Berry 2ed5b47893 facebook list view fixed by replacing attribute being called
fixes CNVS-5514
fixes CNVS-4487

testing this is very cumbersome. currently there is no way to test
the facebook app on any environment other than production. here are
the steps required to get it tested locally:

1. start up your server. if you are using localhost:3000, you can
   use localtunnel (http://progrium.com/localtunnel/) to set up a
   proxy to your server. once you have the localtunnel gem installed,
   run the command to have your port broadcast. copy the url it
   returns
2. create a new facebook app. make sure the app domain includes the
   domain you are using. if you are using localtunnel, put
   'localtunnel.com' for the app domain. for the app on facebook
   settings, use the full url with /facebook after it. for example,
   'http://3s2r.localtunnel.com/facebook/'. trailing slash is
   important. make sure you have 'sandbox mode' enabled.
3. in your facebook account, go to 'security settings' and change
   the 'secure browsing' to disabled. not log off and log back in
   to facebook making sure that the url is http://www.facebook.com
   and not https://www.facebook.com
4. in canvas, set up the account to use facebook (/plugins/facebook).
   use the app ID, key and secret from your facebook app you created.
   for the canvas name, use the namespace you set up on the canvas
   app. for the canvas domain, use 'localhost:3000'. Make sure SSL is
   disabled.
5. log into your local canvas as a user and link your account to
   facebook.
6. log into facebook and you should see the canvas app on the left
   side with the name that you provided in the facebook app config.
   click on this and make sure the page loads.

Change-Id: I19ac7d3a7ddb44990f82071514057ac84f4e8dae
Reviewed-on: https://gerrit.instructure.com/20220
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-05-01 20:58:19 +00:00
Brian Palmer 48d2324a1c standardize the submission history api response format
The submission history formatter was returning a lot of data that it
shouldn't, and it wasn't going through the standard api_json helpers.
This commit modifies Api::V1::SubmissionHistory to use
Api::V1::Submission for the json formatting with the extra fields added
afterwards, and updates the documentation and tests to match.

fixes CNVS-5581

test plan: use the submission history api endpoints, including the new
feed endpoint. you should get submission history objects back in the new
format described -- it's a superset of the normal submission api
response object.

Change-Id: I01f6a1eacae5a1d6644dbd5b151fb41fe04eb469
Reviewed-on: https://gerrit.instructure.com/20184
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
2013-05-01 18:00:41 +00:00
James Williams 67660ed8f0 fix non-integer rubric point values in course copy
test plan:
* create a rubric using non-decimal point values
 (e.g. '1.5')
* copy the course
* should retain the same values

fixes #CNVS-1625

Change-Id: I23031bdf10c8ea2932bdd7c770ece14fddc3a12e
Reviewed-on: https://gerrit.instructure.com/20150
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2013-04-30 19:46:24 +00:00
Stanley Stuart 8a4bdd14e2 fix rake js:generate_runner
test plan:
  - run rake js:generate_runner
  - it generates a working runner

Change-Id: I38a53dddaae1526aaf5b9f998e07f271efaac6a7
Reviewed-on: https://gerrit.instructure.com/20197
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
QA-Review: Stanley Stuart <stanley@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-04-30 17:02:21 +00:00
James Williams a2b3c60902 copy discussion_type in course copy
test plan:
* create a discussion topic in a course, checking
 "allow threaded replies"
* copy the course
* the new discussion topic should retain the option

fixes #CNVS-1589

Change-Id: I0a37babac340c1f6ee869e4805217553d954e165
Reviewed-on: https://gerrit.instructure.com/20152
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2013-04-30 16:33:31 +00:00
Duane Johnson 9c54523309 make assignment_override_applicator cacheable
Currently, when an Assignment is replaced by a cloned version via
AssignmentOverrideApplicator, the new object is a singleton and there-
fore cannot be serialized / cached.

This patch removes the creation of the singleton and uses instance
variable @new_record to get the same effect.

Refs CNVS-5253

Change-Id: Id26377b6f9c4cd226d0144ccaf33452de1148050
Reviewed-on: https://gerrit.instructure.com/20158
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Duane Johnson <duane@instructure.com>
2013-04-30 15:42:12 +00:00
Jacob Fugal 261e983f61 capture failed EventStream operations in DB
Create an event_stream_failures table, and add to it when an EventStream
operation intended for cassandra fails. intentionally swallows the
error, so the code inserting/updating the event stream doesn't notice
and bail on the failure, but we can keep an eye our for new rows and
also have enough data to replay those failures once fixed.

fixes CNVS-4161

test-plan:
 - enable cassandra page views but intentionally misconfigure so that
   inserts into cassandra fail
 - generate traffic in canvas that should create page views
   - the browsing user should not notice any errors
   - but page views should stay empty
   - event_stream_failures should be getting new rows

Change-Id: I1acabfef785ee0637b241924c6ff254c41d3d1e3
Reviewed-on: https://gerrit.instructure.com/19975
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
2013-04-30 15:04:16 +00:00
Brad Humphrey 45f3bb468b lti configuration refactor
this commit is to help make canvas extensions more robust by
allowing tool level defaults and allowing both tool domains and launch
urls. Also added some helper methods for getting the correct properties,
and refactored to use the new helper methods.

Test Plan:
- Add a tool with both a domain and an launch url
- It should not give an error

- Add a tool configured with defaults for for canvas extensions
(such as icon_url, url, selection_height, selection_width, etc)
- Add a canvas launch (resource_selection, editor_button, course_navigation, etc)
with minimal configuration
- The canvas launch should inherit the properties from the extensions default
- Add an launch that has its own properties
- The launch should prefer its properties over the defaults

* should test that all launch types are accepting defaults

closes #CNVS-4498

Change-Id: I0dd4e78efb54db9c0cd1204383934db50f402674
Reviewed-on: https://gerrit.instructure.com/17715
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2013-04-29 21:05:58 +00:00
Jacob Fugal ff6449f879 encourage reusing MessageableUser::Calculators
fixes CNVS-5552

some requests may need to make several messageable_user related calls
for the same user. using a new calculator object for each skips any
in-object caching we've done, resulting in excessive cache traffic.
instead, reuse the same calculator object for any calls for the same
user during a request.

removes the convenience class methods on MessageableUser::Calculator
since (1) they're no longer used, and (2) the user's
messageable_user_calculator should be used instead.

test-plan:
 - general conversation regression
 - have redis caching set up
 - create a user with multiple courses all with a common letter in the
   title
 - create multiple sections for each of those courses
 - in the recipients field search for that character
 - check logs; should not have excessive
   context_permissions/courses/X/users/Y cache lookups

Change-Id: Ib015c59e7c735fca8ec5ba1998f08dff609e29d2
Reviewed-on: https://gerrit.instructure.com/20126
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
2013-04-29 18:53:23 +00:00
Brian Palmer 0c360565a9 don't send nils to cassandra driver on eventstream insert
During the EventStream refactor we changed the page view inserts from
using PageView#changes to PageView#attributes. This was the right thing
to do, because #changes won't include columns that have the
default value for that column, but cassandra needs to be given any
non-nil default values. Not a problem for PageView, but it could be for
other models.

However, this introduced a performance regression, because #attributes
includes nil attributes which means the cassandra driver was sending a
DELETE (list of columns) command, creating a new tombstone record in
cassandra. The new insert_record() method on the driver removes any nil
values before calling update_record.

test plan: enable cassandra page views, then visit some pages. after the
insert job runs, the page views should have been created properly and
still display properly in the history.

Change-Id: Iccb967d3ec1f6b295d98b3f330b4b8ffe4508437
Reviewed-on: https://gerrit.instructure.com/20151
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
2013-04-29 16:59:32 +00:00
James Williams b993954788 enable import/export with file_upload_question types
test plan:
* Enable the file_upload_question type for
 the root account in the console:
 > a = LoadAccount.default_domain_root_account
 > a.settings[:file_upload_quiz_questions] = true
 > a.save!

* Create a course with a question of type
"File Upload Question"
* Copy the course
* Confirm that the course copies successfully
 and that the new question is the same type

closes #CNVS-1158

Change-Id: I99d872ee8557a83647fb2fa1425050c20a4ba518
Reviewed-on: https://gerrit.instructure.com/20013
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2013-04-29 15:57:44 +00:00
Jon Willesen d8efd3e805 improve robustness of incoming message processor
replaced the mailman gem with custom code with more error
handling. this will allow the incoming message processor to
continue processing messages after encountering a message with
an encoding or parsing error. the broken messages will be moved
aside to a separate folder for later inspection.

fixes CNVS-4970

test plan:
 - read up on the new incoming_mail.yml configuration settings.
 - configure incoming_mail.yml with the test imap accounts
   using legacy settings and check for regressions.
 - reconfigure incoming_mail.yml to read from a directory.
 - copy some testing email files into the configured directory.
   test files should be a mix of:
   - emails with encoding errors
   - emails with syntax errors
   - normal emails
 - all of the normal emails should be processed normally
 - all of the error emails should be moved into the error
   subdirectory

Change-Id: I0f946a56b41492f007db2775aa6da3cdfa4fdd3f
Reviewed-on: https://gerrit.instructure.com/19729
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
2013-04-29 14:47:09 +00:00
Jacob Fugal 69a0254845 add gradebook history feed API endpoint
fixes CNVS-2802

test-plan:
 - create a course with multiple students and assignments
 - create submissions for those students and assignments
 - grade the submissions, including multiple gradings of some of them
 - GET /api/v1/courses/X/gradebook_history/feed
   - each grading should match the SubmissionVersion object described in
     the API docs
   - should include gradings for any assignment and student in the
     course
   - should include all gradings for any submission that's been graded
     multiple times
   - should paginate the returned gradings
   - should order the most recent gradings first
 - GET /api/v1/courses/X/gradebook_history/feed?assignment_id=Y
   - should only return gradings for submissions on that assignment
 - GET /api/v1/courses/X/gradebook_history/feed?user_id=Z
   - should only return gradings for submissions by that user
 - GET /api/v1/courses/X/gradebook_history/feed?ascending=1
   - should order the oldest gradings first
 - Repeat with combinations of the various parameters

Change-Id: I44aae11919116519f87a097f2d5cf1849acc4db3
Reviewed-on: https://gerrit.instructure.com/19680
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
2013-04-27 03:41:05 +00:00
Stanley Stuart 2dde76096d add basic grading info to assignments api for index action
test plan:
  - as a teacher, grade some students submissions for some assignments.
  - for good measure, make sure there is at least one student who hasn't
    been graded for each of the assignmetns
  - query the assignments index api
    (/api/v1/courses/:course_id/assignments) and pass an include
    parameter that is an array that has the string 'submission'
  - you should see a submission object in the response for each student
    with a submission.
  - the student who was not graded should not have the 'submission' field
    for each of his or assignments
  - make sure the api works both from the perspective of the teacher and
    student (teachers should not see the "grade" field in each of the
    assignments unless they have submitted and have beeng graded on that
    assignment)

closes CNVS-5316

Change-Id: I8f6f2c559a3355de4e3ad178c9ade695d7fe5b3a
Reviewed-on: https://gerrit.instructure.com/20006
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
2013-04-26 22:03:44 +00:00
Jon Jensen 3aee720269 registration refactor, refs CNVS-5434
* expose templates so plugins can override them
* tweak ENV data we pass into js
* basic cilent-side field validations

test plan:
N/A, see plugin commit

Change-Id: Ic3998affc99e24f9c8d57b8f0068d03ae3be9fef
Reviewed-on: https://gerrit.instructure.com/20056
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
Reviewed-by: Joe Tanner <joe@instructure.com>
2013-04-26 21:48:23 +00:00
Brian Palmer de0574994c keep media comment information in API round trip
closes CNVS-5218

test plan: insert audio and video comments into rich text that goes
through the api (for instance assignment descriptions, and discussion
entries). modify the content multiple times, the audio and video should
still play correctly. use the api to pull the same content, modify it,
and push it back through the api. the content should still play
correctly.

Change-Id: Id38ef78aaa478c66ae2314b30d33ec3f2199a6bd
Reviewed-on: https://gerrit.instructure.com/19598
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
2013-04-26 19:39:08 +00:00
Jeremy Stanley 8bdfdd3103 wiki pages CRUD API
fixes CNVS-5279

test plan:
 - see API documentation to create/retrieve/update/delete pages
 - exercise endpoints, including
   - CRUD functionality (above)
   - test renaming page
   - test publishing / unpublishing
   - test creating the front page in a new course or group

Change-Id: I5d3b36615b7bdbfda0d4781db14cd7d49d32eba1
Reviewed-on: https://gerrit.instructure.com/19952
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2013-04-26 18:17:25 +00:00
Mark Severson 83e192a7e8 updated the syllabus to better handle public courses
- added assignment links for public courses
- fixed images in the syllabus body for non-enrolled admins

test plan:
 * syllabus page is shown (including when the course home page is set to the syllabus)
 * images in the syllabus body are shown
 * links are presented when the user has access to the content (assignment, event, etc)

public and non-public courses for all role types, including:
 * teacher, ta, etc
 * student
 * anonymous (not logged in)
 * admin (with & without 'View Course Content' right)

fixes: CNVS-5364

Change-Id: Ieea5987530e67563c97eec2b495cfb8b712f8a03
Reviewed-on: https://gerrit.instructure.com/19822
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Product-Review: Matt Goodwin <mattg@instructure.com>
2013-04-26 17:57:37 +00:00
Bracken Mosbacker 83455f2252 wiki page draft state support
wiki pages can be unpublished but will still default to
active until the feature is enabled.

Test Plan:
 * make an unpublished course in the console
 * using the wiki api make sure students can't see it in
   the index or show actions

closes CNVS-5270

Change-Id: I48970ce9c6b86a3039432b6d7647810b434bfdfc
Reviewed-on: https://gerrit.instructure.com/20014
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-04-26 16:31:27 +00:00
Jon Jensen e6b36d6817 js extension mechanism for plugins, refs CNVS-5434
given app/coffeescripts/foo.coffee in canvas-lms, if you want to monkey
patch it from your plugin, create app/coffeescripts/extensions/foo.coffee
(in your plugin) like so:

define ->
  (Foo) ->
    Foo::zomg = -> "i added this method"
    Foo

and that's it, no changes required in canvas-lms, no plugin bundles, etc.

note that Foo is not an explicit dependency, it magically figures it out.
also note that your module should return a function that returns Foo.
this function will magically wrap around Foo so you can do stuff to it
anytime somebody requires "foo" as per usual.

test plan:
1. use it as explained above
2. it should work

Change-Id: If3b21782c0e79bb0ce55b4f16804047a2c2e2143
Reviewed-on: https://gerrit.instructure.com/20004
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2013-04-26 16:23:35 +00:00
Eric Berry acfe36bcc5 twitter link sending to correct url
fixes CNVS-5147

test steps:
- trigger a twitter notification and ensure the link is pointing to
  the correct url (without 'mr' in the url)

Change-Id: Ib70b67039e919720c941c15ec1d20eca652d478b
Reviewed-on: https://gerrit.instructure.com/19882
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
2013-04-26 16:02:03 +00:00
Jim Gay 09ef676a0c fix loading of hair_trigger gem rake tasks
update the loading of tasks to work with Gem::Specification
fix gem name and properly load hairtrigger by it's name

Change-Id: I7ce10c0688991555e9be47c7b17157ccd5063a96
Reviewed-on: https://gerrit.instructure.com/20090
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
2013-04-26 02:37:18 +00:00
Simon Williams b35b70580d fix performance regression in gradebook csv
fixes CNVS-5492

test plan (external):
- download the gradebook csv with and without sis ids
- it should still work

test plan (internal):
- run gradebook csv with sis ids from the console and watch the db queries
- it should not load quiz submissions
- it should not load the account once per student

Change-Id: I2665041d8733856d8b32547b49d5af5b69292076
Reviewed-on: https://gerrit.instructure.com/20007
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
Reviewed-by: Stanley Stuart <stanley@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2013-04-25 15:33:49 +00:00
Jon Jensen c7af8a58a9 fix i18n extraction scoping bug, fixes CNVS-5451
ensure that we infer absolute keys for I18n.t calls, regardless of the
current file's scope

test plan:
1. run rake i18n:generate
2. open config/locales/generated/en.yml
3. search for "was added to the conversation"
4. its scope should be en.conversation_message.users_added.one, rather
   than en.conversation_message.conversation_message.users_added.one

Change-Id: Ie35828738dbf09fb928f49d4635701d8f1c10ade
Reviewed-on: https://gerrit.instructure.com/19893
Reviewed-by: Joe Tanner <joe@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Cam Theriault <cam@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
2013-04-23 18:25:26 +00:00
Zach Pendleton 5f3bc458b4 fix dissociated discussion topics.
fixes CNVS-5339

a previous datafix dissociated some discussion topics from
their related assignments; this fix restores the
assignment_id for those discussions.

test plan:
  * run specs

Change-Id: I5deaea1b4969588b2bcc12e62de063c6e47a48f8
Reviewed-on: https://gerrit.instructure.com/19671
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Zach Pendleton <zachp@instructure.com>
QA-Review: Zach Pendleton <zachp@instructure.com>
2013-04-23 18:06:22 +00:00
Jon Jensen d70ce51b37 disallow html in translations, fixes CNVS-5413
make i18n:check reject anything that looks html-y, since we should be
using wrappers (or markdown) instead

test plan:
1. generate the following emails and confirm that the html version is ok:
   * content_export_failed
   * content_export_finished
   * merge_email_communication_channel
   * migration_export_ready
   * migration_import_failed
   * new_context_group_membership
2. go to the quiz detail page as a student and confirm it loads/looks
   correct (specifically where it says the number of questions below the
   title)

Change-Id: I0b8bfb0628a081859915c33764bfc3ce49690e8d
Reviewed-on: https://gerrit.instructure.com/19823
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Cam Theriault <cam@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
2013-04-23 16:56:51 +00:00
Brian Palmer 71b69df41c increase the parsing timeout in ruby i18n generation
also give the source filename

Change-Id: I7e2dd093968093108f808a00be1004a3e158a475
Reviewed-on: https://gerrit.instructure.com/19948
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
2013-04-23 16:25:48 +00:00
Jon Jensen b420729e61 quiz item analysis generation, closes CNVS-3421
report generator to do quiz item analysis

usage:

quiz = Quiz.find(<id>)
summary = QuizStatistics::ItemAnalysis::Summary.new(quiz)
summary.each do |item|
  puts item.question_text
  puts "respondents: #{item.num_respondents}"
  puts "correct: #{item.num_respondents(:correct)}"
  puts "standard deviation: #{item.standard_deviation}"
  ...
  puts "----------------"
end

test plan:
N/A, see specs

Change-Id: Id36e4ef404af089f526cf9243a14d42eb52064a6
Reviewed-on: https://gerrit.instructure.com/18494
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Joe Tanner <joe@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2013-04-23 15:50:36 +00:00
Zach Pendleton 0fe154f15e remove import and external_feed_id from calendar_events.
removed unused code to import an ical feed into a calendar,
and dropped the external_feed_id from the calendar_events
table because it isn't being used.

Change-Id: I9c093f4f2f63cc503d74bfc1cde089bf24ea0d73
Reviewed-on: https://gerrit.instructure.com/19615
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Eric Berry <ericb@instructure.com>
QA-Review: Zach Pendleton <zachp@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
2013-04-22 22:19:00 +00:00
Bryan Madsen 232cf73dec spec: add a rake task to execute migration_lint
this will allow it the script to be easily chained with other test
related rake tests

test-plan:
* modify a migration to have syntax that will migration_lint
* execute 'bundle exec rake db:migration_lint', should return an error
* revert migration change
* execute 'bundle exec rake db:migration_lint', should not return an
* error

Change-Id: I5b0dc9d27759662141e11bf1f42cdf376b67ad96
Reviewed-on: https://gerrit.instructure.com/19885
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jake Sorce <jake@instructure.com>
Product-Review: Jake Sorce <jake@instructure.com>
QA-Review: Jake Sorce <jake@instructure.com>
2013-04-22 21:39:53 +00:00
Simon Williams 105026bf21 redirect to referrer after unauthorized post/put
fixes CNVS-5248

test plan:
- start taking a one-question-at-a-time quiz
- log out in another tab
- hit the next or previous button
- re-login
- you should land back in the quiz

Change-Id: I578d6803bd6deb90ec3c82153d999b478e42a199
Reviewed-on: https://gerrit.instructure.com/19539
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2013-04-22 16:19:13 +00:00
Simon Williams dfd6f86bf9 support persistent headless state for quizzes
also supporting forcing the quiz show page to require a user even in a public
course.

closes CNVS-5250

test plan (api):
- make sure the quiz api returns a mobile_url that sets these parameters

test plan (headless):
- go to a one question at a time quiz
- add ?headless=1 to the url
- notice that the quiz loads without top/side bars
- start the quiz
- the top/side bars are back
- now go back to the show page and add ?persist_headless=1
- start the quiz
- the top/side bars should still be gone

test plan (force user):
- as a logged-out user, go to a quiz show page in a public course
- it should work
- now add ?force_user=1 to the url of the show page
- it should redirect to the login page
- after logging in, you should end up back at the show page

note: please also check that getting notified when logged out of a quiz still
work, as that code was refactored slightly.

Change-Id: Id17ce336f8d12a6f4dd0f4d1324e7b4dd5cca1d0
Reviewed-on: https://gerrit.instructure.com/19597
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Reviewed-by: Stanley Stuart <stanley@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2013-04-21 00:03:02 +00:00
Jacob Fugal 6465b20ec0 populate submission versions
back-populate submission_versions from existing versions for
submissions, and insert new index rows when new versions for submissions
are created.

refs CNVS-2802

test-plan:
  migration:
    - have at least two submission with at least one submission with
      multiple versions in your database before introduction of this
      code
    - run the migration
    - for every existing submission version record, there should now be
      a submission_versions record
    - the submission_versions records should have the correct metadata
      for the submission version
  trigger:
    - create a new submission
    - should create a new submission_versions record
    - modify the submission in a way that triggers a new version
    - should create a new submission_versions record

Change-Id: I9c4c39fa60926b037142abf3f01572c9deaa0643
Reviewed-on: https://gerrit.instructure.com/19605
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Duane Johnson <duane@instructure.com>
Product-Review: Duane Johnson <duane@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
2013-04-20 13:20:47 +00:00
Jeremy Stanley bd5c66011a use 'unpublished' (not 'created' or 'claimed') in courses api
test plan:
 - courses api should return 'unpublished' workflow_state for
   courses in 'created' or 'claimed' state

Change-Id: I927cd6d4b66556c1d0762ad16433f69764d6a050
Reviewed-on: https://gerrit.instructure.com/19574
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-04-20 01:36:23 +00:00
Brian Palmer 59841e884c migration fixups
make this data fix postdeploy, and avoid find_in_batches issues
also remove :concurrently from a index created transactionally (on a new table)

Change-Id: If9744e13b2387eb1a310f19629fff6327000add5
Reviewed-on: https://gerrit.instructure.com/19834
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
2013-04-19 22:31:26 +00:00
Joel Hough 7646eff6d8 delay loading of appointments in scheduler
fixes CNVS-5288

added a couple of fields to appointment group json so that we
 don't need all the child events up front
stopped loading all the child events up front

test plan
- ensure scheduler works as before, especially the participant
 count under appointment groups on a teachers view and the
 signed up for times on a student view

Change-Id: I59d05484b3fdf43fdd38442e37d4a8fa98616f51
Reviewed-on: https://gerrit.instructure.com/19573
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
2013-04-19 21:33:56 +00:00
James Williams 8b872ff1aa fix relative urls with parameters in imported html
in particular, fixes a problem where having any parameter
in import html content would cause "/preview" to not
be appended

test plan:
 * import the package referenced in the ticket
 * the wiki page 'coverslip smears' should have
functioning images

fixes #CNVS-5230

Change-Id: Ifd45efd841fa94f54d0478d040709d32b6b5fc5e
Reviewed-on: https://gerrit.instructure.com/19741
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2013-04-19 21:03:58 +00:00
Jacob Fugal 45aec302c4 EventStream abstraction
fixes CNVS-4159

Change-Id: I8a1ce45bd8d50bd767dfaaa6ca51dff6a0bdffd5
Reviewed-on: https://gerrit.instructure.com/19103
QA-Review: Clare Strong <clare@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Brian Palmer <brianp@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
2013-04-19 19:05:14 +00:00
James Williams 25c606f890 clean attachment links in incoming user content through api
test plan:
* create an assignment, link an attachment
 in the description, and save
* open the assignment editor up again and save it
* delete the attachment and re-upload another
 file with the same name
* preview the assignment
* the link should take you to the updated
 attachment instead of failing

fixes #CNVS-5216

Change-Id: I7258d4ca35f6d34594bd32bd77e86c2e61262ea4
Reviewed-on: https://gerrit.instructure.com/19594
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-04-19 18:20:05 +00:00
James Williams bb6527f248 fixes for api translation of attachment links
test plan:
* create an object with html user content (such as an
assignment description)
* include a file download link (e.g.
 "/courses/:id/files/:file_id/download")
* retrieve the object through the API
* confirm that the translated link (that includes
a verifier param), still has "/courses/:id"
rather than just "/files/:file_id/download"

* include a file preview link (e.g.
 "/courses/:id/files/:file_id/preview")
* retrieve the object through the API
* confirm that the translated link has
"/courses/:id" and still has "/preview"
 as well as a verifier param
* confirm that following the link in the browser
results in downloading the file

closes #CNVS-5213 #CNVS-5214 #CNVS-5215

Change-Id: Ib2bb6b1857055dbfe2d1b9e0873600beaa70bf75
Reviewed-on: https://gerrit.instructure.com/19512
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-04-19 18:20:01 +00:00
Jon Jensen 90006b0dc0 fix various handlebars i18n bugs
fixes CNVS-1641, CNVS-3143, CNVS-5356

now it actually works :-/

* fix key getting stomped by iteration of options
* fix double-scoping (explicit and in options)
* fix absolute key bug (they were getting scoped)
* fix camelCased filenames having the wrong scope
* support single-quoted keys

test plan:
1. change your language
2. go to pages where translations didn't show up (e.g. outcomes, calendar2)
3. use optimized js, or tack on ?use_js_translations=1
4. the content should be translated

Change-Id: I9742d60e5dcbccf971ce30b1302e85d4f4033b77
Reviewed-on: https://gerrit.instructure.com/19717
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-04-18 20:22:59 +00:00
Bracken Mosbacker 1f9cf77f0f use exclusive scoping on api html datafix
The find_in_batches scope was applying to the self.assignment
when a discussion topic was saving itself. So the topic
wouldn't find the assignment and would set its assignment_id
to nil.

This also just updates the specific column for the assignment.
Either of these would fix the problem, but I added both anyway.

refs CNVS-5217

Change-Id: Ic77704999b6835688d9c3c88dbfce9607fe4c662
Reviewed-on: https://gerrit.instructure.com/19664
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Bracken Mosbacker <bracken@instructure.com>
2013-04-18 19:58:39 +00:00
Jeremy Stanley 8dce27bda8 add thumbnail_url to files api
test plan:
 - upload images to a course
 - retrieve these files via the files api
 - a thumbnail_url should be in the response
 - confirm that this thing is downloadable

fixes CNVS-5329

Change-Id: I583cba7d08566770223821de554b76f9c767b38f
Reviewed-on: https://gerrit.instructure.com/19612
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-04-18 16:36:14 +00:00
Brian Palmer fa2dab1a65 upgrade ruby_parser for 1.9 syntax support
fixes CNVS-5367

this allows hairtrigger and our i18n extraction code to parse 1.9 syntax
correctly.

also fixed a issue with the i18n rake tasks, so symlinks in
vendor/plugins are now followed.

test plan: without this commit, run rake i18n:generate. then copy
config/locales/generated/en.yml somewhere.

then apply this commit, update your bundle, and run rake i18n:generate again.

compare the new en.yml against the saved one, they should be the same
(unless you have symlinks in vendor/plugins, in which case the new one
will have more strings but existing strings should be the same)

Change-Id: If0df5eae25c59822a9d3c2738fe9549a756ff9e9
Reviewed-on: https://gerrit.instructure.com/19693
Reviewed-by: Brian Palmer <brianp@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
2013-04-18 16:08:55 +00:00
Brian Palmer c3f897e093 extract out the where clause building from a hash
so that it can be used elsewhere

refs CNVS-4466

test plan: specs

Change-Id: I7246e5f878867c839bf276ffc857f30ee47b5bc8
Reviewed-on: https://gerrit.instructure.com/19646
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
Tested-by: Brian Palmer <brianp@instructure.com>
2013-04-17 16:43:15 +00:00
Cody Cutrer 6e9c843b3d switch to Shackles gem
extracted out of canvas-lms

refs CNVS-4713

test plan:
 * actions that use a slave should still work (dashboard render)
 * you should be able to switch envs and users in console

Change-Id: I07dda8057cf94383bc4579f1ef6b5a4b3ffc20b5
Reviewed-on: https://gerrit.instructure.com/19287
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-04-17 16:25:06 +00:00
Mark Ericksen 828b42ce30 ui enabling admins to search notifications
adds account setting and new user permission

fixes CNVS-4726

Testing Notes:
============
* To enable...
  * Account Settings, check Feature
    "Admins can view notifications"
  * Account permission under "Account Roles"
    becomes available under "Admin Tools"
    group. Check "View notifications"
  * appears under account "Admin Tools"
    sidebar area on "View Notifications"
    tab.
    (EX: /accounts/[account_id]/admin_tools)
* Verify "View Notifications" tab does not
  appear if either account setting or user
  permission is disabled. (For AccountAdmins)
* Verify a SiteAdmin is able to access the
  feature.
* Verify that notifications are returned
  and displayed for a selected user
  and date range.
* Verify it displays "No messages found"
  when user doesn't exist or the user
  exists but the date range doesn't
  return data.
* Verify that the user_id is required when
  searching
* Verify that the "To Date" cannot be before
  the "From Date".
* Verify an invalid date like the word "couch"
  gets ignored and the actually used date/time
  is displayed in the overview text description.
* Verify searching by dates when either or both
  are left blank and when both are used.
* Verify that the messages automatically
  fetch more when you scroll down.
* Verify that before the results, it displays
  the user's name and the dates used for the
  results.

Change-Id: I9d2689b4760af57bbc2d15fd7d50610dcf593a7e
Reviewed-on: https://gerrit.instructure.com/18629
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
Reviewed-by: Mark Ericksen <marke@instructure.com>
2013-04-16 22:11:16 +00:00
Brian Palmer 0cb0449cd3 default the user_search settings to true
refs CNVS-5336

test plan: you should be able to use the user search api to find users
by last name and sis id even without explicitly enabling the
user_search_with_gist and user_search_with_full_complexity Settings.

Change-Id: I1d7349ddfa80987c0950b80aff189339cdd42796
Reviewed-on: https://gerrit.instructure.com/19621
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
2013-04-16 20:38:34 +00:00
Duane Johnson f1fb1fdb4d add computed_(current|final)_grade to users for courses api
also add computed_current_grade to the my-courses api

Adds tests for both the computed scores on the course listings as well
as the computed scores on the users listing for the course. Also adds
API documentation.

Test Plan:
- An api call to /api/v1/courses/N/users?include[]=enrollments will
  include 'grades' key with 'current_score', 'current_grade',
  'final_score', and 'final_grade'

fixes CNVS-5101

Change-Id: I26e3cb069e3a9ce9a80c966017251e627a7b30d1
Reviewed-on: https://gerrit.instructure.com/19466
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
2013-04-15 23:19:26 +00:00
Mark Severson 19757eebba allow public access to the syllabus page on a non-public course
also cleaned up the calendar events api specs to make them a
little less error prone

test plan:
 * syllabus page:
   note: please verify against published courses
   * standard access (calendar events, assignments, appointment groups)
   * public course (calendar events, assignments)
   * public syllabus (calendar events, assignments)
 * courses api:
   * create w/public_syllabus
   * update w/public_syllabus
   * get w/include[]=public_syllabus
 * calendar events api (for public courses/public syllabus courses):
   * calendar events and assignments

fixes #CNVS-4811

Change-Id: I17e9f260117c031af008592a470b6e17df93c1d5
Reviewed-on: https://gerrit.instructure.com/19376
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-04-15 15:42:33 +00:00
James Williams 3cb3d81860 fix broken assignments data fixup again
fixes CNVS-5212

Change-Id: I1045957567b56f7f427b2ba6bbb6c6ba6cfc8d63
Reviewed-on: https://gerrit.instructure.com/19565
Reviewed-by: Zach Wily <zach@instructure.com>
Reviewed-by: Paul Hinze <paulh@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
2013-04-13 04:09:43 +00:00
James Williams 7049ec1e70 fix the broken assignments datafixup
Change-Id: I1d2c4e703dfc2941430bdffd431ec8e9fe2bea73
Reviewed-on: https://gerrit.instructure.com/19549
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-04-12 18:05:43 +00:00
James Williams 73dc10c928 fix assignment descriptions with broken file references
test plan:
* in an assignment description, add a link to an attachment
* delete the attachment
* re-upload the attachment with the same name (but different id
now)
* should be able to use the link still
* switch views and edit the link to break it by
adding "?verifier=somethingsomething" on the end of it
or shortening "/courses/:id/files/:file_id/download"
to "/files/:file_id/download"
* now run the migration/datafixup
* should be able to use the link again

fixes #CNVS-5137 #CNVS-5217

Change-Id: Ic7cd5f1acdecffce0e9ee953ca0dd732c65f2a75
Reviewed-on: https://gerrit.instructure.com/19377
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2013-04-12 14:46:19 +00:00
Jon Willesen 495db783d5 Add API for admins to access user messages
There are three parts to this:
 - API access for site admins and account admins. Account
   admins can only see messages for their account.
 - Includes start and end time parameters for basic searching
 - Summary notification are gathered up per account now, so
   account admins will not see a summary notification from
   multiple accounts.

fixes CNVS-3695

test plan:
 - Verify Admin Access:
   - Have a user enrolled in two courses in separate root
     accounts.
   - Send the user ASAP notification from each account.
   - Go to /users/:id/messages (the old interface) and verify
     the messages appear there.
   - As a site admin, get /api/v1/comm_messages for the user
     (see documentation for the api).
   - Verify that data for both messages are returned.
   - Use the console to give an account admin on one of the
     accounts :read_messages permissions.
   - As the account admin, get /api/v1/comm_messages for the
     user.
   - Verify that only the message for the admin's account is
     returned.
 - Verify start_time and end_time parameters
   - Use the console to modify the created_at field for the
     user's messages
   - As a site admin, get /api/v1/comm_messages for the user,
     specifying various combinations of start_time and
     end_time, and make sure the appropriate messages are
     returned.
 - Verify account based summaries
   - Set the notification policies for the user to a summary
     setting (daily or weekly)
   - Send multiple notifications to the user from each account.
   - Use the console to run the
     SummaryMessageConsolidator::process function.
   - View /messages for the user and verify that separate
     summaries are sent for each account.

Change-Id: Ie33ec02cc2033a1cc2f1fcbe538b76792aab0e6c
Reviewed-on: https://gerrit.instructure.com/18586
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mark Ericksen <marke@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
2013-04-11 19:38:02 +00:00