Commit Graph

1673 Commits

Author SHA1 Message Date
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
James Williams 21d1788f22 add migration warnings for missing references in html content
adds migration warnings when links and other references point
to missing or unknown internal content

test plan:
* upload a content migration with missing relative links
 (an example is attached in the ticket)
* import all the content
* view previous migrations for the course
 (at "/courses/:id/imports/list")
* confirm that warning messages are shown
* the ui in in progress, but the warnings should
 have links associated with them that point to the
 content with missing links. to see them, use the
 migration issues API

closes #CNVS-134

Change-Id: I1d0a9217fe0c1678968410be8b2eba5b990b8305
Reviewed-on: https://gerrit.instructure.com/19367
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-11 18:28:59 +00:00
Bryan Madsen 9d129a94e4 Revert "update para exclude rake tasks to use parallelized runtime"
This reverts commit 4c0f8d44a6

Change-Id: I26913b2533dd18f750a81fb3f08c234839d508ad
Reviewed-on: https://gerrit.instructure.com/19480
Reviewed-by: Bryan Madsen <bryan@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
Tested-by: Bryan Madsen <bryan@instructure.com>
2013-04-10 17:05:43 +00:00
Joel Hough 796dece4fc always return a child_events element if it is requested
the calendar event api has an option for including child events
if it is specified, we should return the field

if permissions are such that no child events are readable, return
an empty array

test plan
there aren't many places where this edge case comes up. the
easiest to get at is the json returned from reserving an
appointment slot
- as a student, use the api to reserve an appointment slot
- ensure the returned json includes a child_events element

Change-Id: I7a921e9ea68ae7896fd9c8197dc9ac91d0cfa979
Reviewed-on: https://gerrit.instructure.com/19390
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
2013-04-10 15:04:26 +00:00
Shawn Meredith 4c0f8d44a6 update para exclude rake tasks to use parallelized runtime
Change-Id: Idf7b1abbccc83800bc3582e8713641c7a8b71139
Reviewed-on: https://gerrit.instructure.com/19462
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-04-10 00:44:08 +00:00
Ryan Florence 6601753eb7 implemented dress_code
also added styles to make .form-controls look
good in dialogs.

closes #CNVS-4302

Change-Id: Ibe54ee4046ac255b0b0ea83d32afc88e4a820464
Reviewed-on: https://gerrit.instructure.com/19331
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
QA-Review: Ryan Florence <ryanf@instructure.com>
Product-Review: Ryan Florence <ryanf@instructure.com>
2013-04-09 15:43:16 +00:00
Joel Hough 525c1e9111 speed up scheduler
fixes CNVS-4561

removed some duplicate work
memoized a couple of methods
now bails early when there are no slots signed up for
added a couple of indices

test plan
- make sure scheduler works the same as it used to

Change-Id: I9bea3daa5706eb5dba83d8112ea2ef8229ca0e0e
Reviewed-on: https://gerrit.instructure.com/19192
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
2013-04-05 23:03:53 +00:00
Jon Jensen 2f17a059e7 account-level password policy support, fixes CNVS-4211
test plan:
1. set up a new password policy via the console, e.g.
   a = Account.default
   a.settings[:password_policy] = {:min_length=>6, :max_sequence=>3, :max_repeats=>3, :disallow_common_passwords=>true}
   a.save!
2. go to /register and sign up as a student
3. make sure the password policy is enforced, i.e.
   1. confirm that the password must be at least 6 chars
   2. confirm that the password cannot be a common one (e.g. football)
   3. confirm that the password cannot contain a run of 4 or more chars
      (e.g. abc123lol is ok, abcd1234 is not)
   4. confirm that the password cannot have the same char repeated 4 or
      more times (e.g. aaa000bb is ok aaaabbbb is not)
4. verify the password policy is enforced when changing your password as
   an existing user (via user profile/settings)
5. verify the password policy is enforced when adding a login for a user
6. verify the password policy is enforced when resetting your password
   (via forgot password on login page)
7. invite a new user into a course, and as that user verify the password
   policy is enforced when you set up your account

Change-Id: Ie619fc255dc940249676bf5e510ce68eaf17441c
Reviewed-on: https://gerrit.instructure.com/19104
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
Tested-by: Jon Jensen <jon@instructure.com>
QA-Review: Cam Theriault <cam@instructure.com>
2013-04-05 20:13:26 +00:00
Brian Palmer 8aefb867c4 optionally don't append hostname to statsd keys
test plan: add "append_hostname: false" to your statsd config and
generate statsd metrics by visiting canvas pages. no hostname should be
appended to the key, so all servers in the environment will write to the
same metric.

Change-Id: I4662601ae04661aee2a75b39eeb58c7902870a38
Reviewed-on: https://gerrit.instructure.com/19342
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
2013-04-04 19:14:49 +00:00
Eric Berry 8ce983ecd7 resolved issue where SecureRandom was not found
Change-Id: Ic032937ea0320324a8515ea555cef9806beb00df
Reviewed-on: https://gerrit.instructure.com/19327
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Eric Berry <ericb@instructure.com>
Product-Review: Eric Berry <ericb@instructure.com>
QA-Review: Eric Berry <ericb@instructure.com>
Tested-by: Eric Berry <ericb@instructure.com>
2013-04-04 14:06:12 +00:00
Brian Palmer 666ecf77d3 rename SIS::CSV::BaseImporter to SIS::CSV::CSVBaseImporter
There is also a SIS::BaseImporter in the outer module/namespace, which
makes having the same class name in a nested module really error prone.

Change-Id: Ia61f87088748212f855577570a28871c06fe87d9
Reviewed-on: https://gerrit.instructure.com/19292
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Duane Johnson <duane@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
2013-04-03 22:30:57 +00:00
Jacob Fugal d67fe68102 fix messageable_users query for mysql
fixes CNVS-5067

test-plan:
  - use mysql database
  - create an account admin
  - create a course with a teacher in that admin's account
  - as the account admin
    - go to the conversation inbox
    - open the recipient browser for a new conversation
    - search for the teacher
  - should find the teacher without any server errors

Change-Id: Iff383bb8eff62dd1caf27f57b3300675a1ca1dbb
Reviewed-on: https://gerrit.instructure.com/19306
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
2013-04-03 16:59:40 +00:00
Cody Cutrer 2028d0d0fa missed arel-ify datafixup
refs CNVS-4506

Change-Id: I7bf4b823e5b9ef2133d385feb5759347e0863b5f
Reviewed-on: https://gerrit.instructure.com/19233
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2013-04-03 14:25:07 +00:00
Brian Palmer 35e19040ba remove unnecessary lib/sis requires
We were inconsistent about whether to require
'lib/sis/csv/base_importer' or 'sis/csv/base_importer', causing warnings
in the logs about already initialized constants (not to mention
evaluating the same file twice, though that seems to be ok in this
case).

rather than fix the requires to be consistent, i've just removed them,
as rails autoloading works for all but the sis/common require (doesn't
work for sis/common because that defines things other than a SIS::Common
module)

test plan: doing SIS imports should still work as normal, and you
shouldn't see any warnings in the logs about already defined constant
PARSE_ARGS

Change-Id: I787ee7486d967201bfb360bc95e61e48b385c449
Reviewed-on: https://gerrit.instructure.com/19190
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
2013-04-02 15:58:29 +00:00
Stanley Stuart be37cbb8f2 refactor + fix message students who dialog for quiz show
test plan:
  - as a teacher make a new quiz and publish it.
  - make sure one or two students in the course have taken the quiz
  - in the cog menu on the quiz show page
    (/courses/:course_id/quizzes/:quiz_id), click on "Message Students
    Who..."
  - You should see students who have taken the quiz in the dialog when
    you select "Have taken the quiz". You should see students who
    haven't taken the quiz when you select "Have NOT taken the quiz"
  - Try submitting the message with a blank message. You should get a
    warning box. Now, make a message to each group of students and save
    the message. Check that each student received the message.
  - Now make the rest of the students finish the quiz. Open the dialog
    again and fill out a message in the textbox. Select "students who
    have NOT taken the quiz". It should be empty. Try sending the
    message by clicking "Send Message". You should immediately get an
    error that the group of students you selected is empty and you
    should choose a different group of students.

fixes CNVS-4743

Change-Id: I2199bd7a18089726251bd0244bc618446db26d07
Reviewed-on: https://gerrit.instructure.com/18869
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-04-02 06:15:25 +00:00
Cody Cutrer 947bf0d0b7 fix datafixup broken by arel-ifying
Change-Id: I44dd976aa4e4ea687f69cc11de2383c5c2ccae5f
Reviewed-on: https://gerrit.instructure.com/19229
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Cody Cutrer <cody@instructure.com>
2013-04-01 22:06:13 +00:00
Cody Cutrer 8c94e53dc7 arel-ify scopes
s/named_scope/scope/g

refs CNVS-4707

Change-Id: I930d229fc9985c7c0096a0f4888933addd4f3aee
Reviewed-on: https://gerrit.instructure.com/18834
Reviewed-by: Duane Johnson <duane@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-04-01 21:57:16 +00:00
James Williams de2ce63ee0 raise error for unescaped ampersands in external tool urls
test plan:
* Create an external tool "by xml", with a "launch_url" tag
(or any custom property of name "url"),
that includes an unescaped ampersand:
 (e.g. "www.example.com?a=1&b=2")
* Confirm that an error is raised indicating
the ampersand needs to be escaped
 (e.g. "www.example.com?a=1&amp;b=2")

fixes #CNVS-1324

Change-Id: Id90d216e2d9039187e8a8f4327e2413d07164b04
Reviewed-on: https://gerrit.instructure.com/18872
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Reviewed-by: Brad Humphrey <brad@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2013-04-01 20:28:27 +00:00
Cody Cutrer 5ffbcbeb05 arel-ify lib
excluding api_find, which needs more work

refs CNVS-4706

Change-Id: I013d0660ff2b8dbe2abf6a5c973bd1203f432f99
Reviewed-on: https://gerrit.instructure.com/18921
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-04-01 19:12:22 +00:00
Brian Palmer ee2faf03e1 change class_inheritable_accessor and write_inheritable_hash to class_attribute
for rails 3.1+ compatibility

Change-Id: If86dbf1c3fe9d2f42aac16726c02af1eb5a7b86c
Reviewed-on: https://gerrit.instructure.com/19095
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
2013-04-01 18:41:30 +00:00
Brian Palmer 42ef2bad2e fix CanvasLogger for rails 3.1+
The implementation of ActiveSupport::BufferedLogger changed quite a bit.
By delegating to the superclass #add method we can keep working with
both rails 2 and rails 3.

test plan: use the default logger in config/logging.yml , and logging
should still write to log/*.log and include the context ids in both
rails 2 and rails 3

Change-Id: I15864384607bf0fee1a28c0051c75749119b73df
Reviewed-on: https://gerrit.instructure.com/19091
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
2013-04-01 18:41:20 +00:00
Brian Palmer 9b7ac7570c fix logging parameter filtering in rails 3.1+
filter_parameter_logging is deprecated in 3.0 and removed in 3.1

test plan: when logging in, your password should still be filtered from
the log file in both rails 2 and rails 3

Change-Id: I697d5a4aca1a7501fe84a52c0097f8ae81074a0a
Reviewed-on: https://gerrit.instructure.com/19085
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
2013-04-01 18:41:08 +00:00
Jeremy Stanley f2e5c59acf add ability to set/retrieve storage quota to groups API
fixes CNVS-4782

note that setting quotas requires the manage_storage_quotas
permission; not everybody who can create a group has the
right to set the storage quota for that group

test plan:
 * view the API documentation and notice the new
   'storage_quota_mb' field, which represents the group's
   storage quota, in megabytes
 * as an account admin,
  - retrieve a group via the API; verify the storage_quota_mb
    field is returned
  - create a group via the API, setting storage_quota_mb;
    verify the value was set properly
  - update a group via the API, setting storage_quota_mb;
    verify the value was set properly
 * as a teacher,
  - retrieve a group via the API; verify the storage_quota_mb
    field is returned
  - create a group via the API, setting storage_quota_mb;
    verify the value was ignored (but the other values
    were accepted)
  - update a group via the API, setting storage_quota_mb;
    verify the value was ignored (but the other values
    were accepted)

Change-Id: Ia0c6c2ac2cbe85289a2e18d16589e4fe04b08a30
Reviewed-on: https://gerrit.instructure.com/18919
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-03-29 18:27:46 +00:00
James Williams 2c97618f78 create separate permission for managing rubrics
creates new permission :manage_rubrics, which was
previously a subset of the rights in :manage_grades

test plan:
* confirm that a new permission for
outcomes and rubrics is available in the ui
* confirm that this permission restricts the
creation and editing of rubrics

fixes #CNVS-266

Change-Id: I40d108b53e2771890d8fdbb108e1de24364aa055
Reviewed-on: https://gerrit.instructure.com/17763
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-03-29 18:27:21 +00:00
Brian Palmer 82c722e547 switch to ruby stdlib SecureRandom
ActiveSupport::SecureRandom was merged into the ruby stdlib. In rails
3.0 it is just an alias to ::SecureRandom, and is removed completely in
rails 3.1.

This stdlib exists in ruby 1.8.7+

Change-Id: I096b212c020fd60e3799a9d1635129944ac3b6e4
Reviewed-on: https://gerrit.instructure.com/19080
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
2013-03-28 20:49:31 +00:00
James Williams 6b2da819bb translate user content links to replaced files
changes the user content html rewriter so links
to files that were deleted and replaced will still
be translated correctly (rather than pointing to
the old deleted file)

test plan:
* upload a file
* create an assignment
* add a link to the file in the assignment description
* delete the file
* edit the file locally and re-upload it
* edit the assignment and save it
* should still be able to click on the link
 and receive the updated file

fixes #CNVS-4799

Change-Id: I527756f02d7b38dda36dbcc3cfae32a3980a25b3
Reviewed-on: https://gerrit.instructure.com/18992
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2013-03-28 18:57:16 +00:00
Brian Palmer 972a65e4d9 allow for API calls with no auth
This introduces the idea of a public API endpoint, one that doesn't need
an access token or a logged in user session. There aren't yet any
endpoints like this, but there are plans to add some so this lays the
groundwork.

I also cleaned up the permissions checks on some of the existing
endpoints, so that you'll get a 401 and sane error response rather than
a 500 error or empty data now that you can hit them when not logged in.

Also standardized the unauthorized json response. It's now more uniform
in structure, and differentiates between not authenticated and not
authorized. (403 might be more appropriate here, but i'm not going there now)

closes CNVS-4856

test plan: there's not yet an api endpoint you can successfully use
without authentication, but you can hit some of the modified endpoints
such as /users/self/groups or /courses/X/tabs without authentication and
verify that you get a 401 response with a relevant json error message.

Change-Id: I63b12628e95b7e2d9aa06c311078bc8a5170dad4
Reviewed-on: https://gerrit.instructure.com/19008
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
2013-03-28 14:47:10 +00:00
Brian Palmer a9d33591c2 get rspec 2 running with rails 3.0
Not passing, just running

for example spec/models: 2511 examples, 2322 failures, 2 pending

refs CNVS-4711

Change-Id: If744731cf801c47349d2ae49daf43874ae9309dd
Reviewed-on: https://gerrit.instructure.com/18893
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-03-27 15:41:28 +00:00
Brad Humphrey 49c6521ad8 turning in homework from LTI tools
adds a new LTI extension, "content", that
defines the interaction for sending content from
a tool provider to the tool consumer.  This extension
will replace the "embed_content" and '"select_link"
selection_directives, as well as adding allowing
am external tool to submit content for a homework
submission.

also starts sending intended_use, return_types, return_url
and file_extensions as part of the LTI launch with the new
extension.

test plan:
- make sure the "more" tab only shows up when there are valid tools

- install at least one valid tool
  (make a homework_submission tool by taking the xml for
  a resource_selection tool and replace "resource_selection"
  with "homework_submission")
- click "more"
- make sure you can't submit the assignment when no
  resource has been selected

- set an assignment that only allows file uploads
- try selecting a url from the tool
- make sure it errors out

- set an assignment that only allows file uploads
- limit the file types
- try selecting a file with a non-supported file extension
- make sure it errors out

- set an assignment that only allows file uploads
- try selecting an invalid file from the tool
- try submitting the homework
- make sure it errors out gracefully

- set an assignment that only allows file uploads
- try selecting a file from the tool
- make sure the submission works correctly

- set an assignment that only allows urls
- try selecting a file from the tool
- make sure it errors out

- set an assignment that only allows urls
- try selecting a url from the tool
- make sure the submission works correctly

Change-Id: I8df682bc73087681159110ab02f77f0e5a2b3911
Reviewed-on: https://gerrit.instructure.com/13419
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Product-Review: Brad Humphrey <brad@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
2013-03-27 14:52:12 +00:00
Simon Williams 8555a0a7c4 tweak comment wording
Change-Id: I1bd37d2e60590e35477657e0b809c97b73e36093
Reviewed-on: https://gerrit.instructure.com/18627
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
QA-Review: Cameron Matheson <cameron@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
2013-03-27 14:48:51 +00:00
Brad Humphrey 5442d0b35a add ta role to lti launch params
test plan:
 - launch an lti tool as a TA
 - the tool should receive 'urn:lti:role:ims/lis/TeachingAssistant' in the role param

closes #CNVS-4499

Change-Id: Id3a528ef937cd5a7817ae36fa5fcd45910f1e75a
Reviewed-on: https://gerrit.instructure.com/18844
Reviewed-by: James Williams  <jamesw@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2013-03-26 16:57:45 +00:00
Stanley Stuart acb33dd480 fix handlebars/jst compiling in guard
test plan:
  - run bundle exec guard
  - edit a handlebars file that has a SCSS file associated with it and a
    handlebars file that does not have a SCSS file associated with it.
  - the template should have compiled, and the results visible when you
    refresh the page that you edited the template for.

Change-Id: If9804b803c1fb6d204cb808031338aa176a0fa29
Reviewed-on: https://gerrit.instructure.com/18976
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
QA-Review: Stanley Stuart <stanley@instructure.com>
2013-03-26 15:25:41 +00:00
Duane Johnson 53d0b9f9ed update languages from transifex translations
Note: Also adds a rake task to automatically import from Transifex

Test Plan:
 - check that Arabic, Spanish, French, Japanese, Portugese, Russian,
   and Chinese are right

fixes CNVS-4599

Change-Id: Ifc660b9b5463b44239a5e39a2dec3ed164e108e8
Reviewed-on: https://gerrit.instructure.com/18946
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-03-26 14:18:33 +00:00
Cody Cutrer 93de74c8e1 add stub for arel-style shard finder option
Change-Id: I0022ef0526013e6a79ea580fa9da1b10a6c44bd5
Reviewed-on: https://gerrit.instructure.com/18927
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2013-03-25 15:38:20 +00:00
Stanley Stuart 8045a59313 upgrade coffee-script to 1.6.2
test plan:
  - make sure you have the coffee binary from npm:
    `npm install -g coffee-script@1.6.2`
  - run rake js:generate, make sure all coffeescript still compiles
    correctly
  - open a coffeescript file and make sure it still gets automatically
    compiled when saved by guard.
  - rejoice at the arrival of source maps.

Change-Id: I06ce9e83a76be9d4cc0e2b2c80566a0db19f9d7e
Reviewed-on: https://gerrit.instructure.com/18842
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
QA-Review: Stanley Stuart <stanley@instructure.com>
2013-03-22 20:37:52 +00:00
Brian Palmer cb5e957965 start adding rails 3.0 support
This can successfully load rails console and rails server. There are
many, many problems still. The idea is this won't change anything under
rails 2.3, it's all backwards compatible.

closes CNVS-4711

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

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

Change-Id: Idd6f35de88adde84cd2db3a650f44b71bd6e9684
Reviewed-on: https://gerrit.instructure.com/18453
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-03-22 19:08:40 +00:00
Jacob Fugal 64a4a47699 cross-shard filter conversations by user
fixes CNVS-4625

test-plan:
 - create four shards A, B, C, and D.
 - create three users A, B, and C on shards A, B, and C, respectively.
 - create conversation on shard A between users A and B:
   - on shard A as user A, filter by user B
   - on shard B as user A, filter by user B
   - on shard C as user A, filter by user B
   - on shard B as user B, filter by user A
   - on shard C as user B, filter by user A
 - create conversation on shard A between users B and C:
   - on shard A as user B, filter by user C
   - on shard B as user B, filter by user C
   - on shard C as user B, filter by user C
   - on shard D as user B, filter by user C
 - create users D and E on shards A and B, respectively.
 - create conversation on shard A between users A and D:
   - on shard A as user A, filter by user D
   - on shard B as user A, filter by user D
 - create conversation on shard A between users B and E:
   - on shard B as user B, filter by user E
   - on shard C as user B, filter by user E
 - create conversation on shard B between users D and E:
   - on shard B as user E, filter by user D
 - create user F on shard A.
 - create conversation on shard B between users A and F:
   - on shard B as user A, filter by user F

Change-Id: If41a801f5b6b8a79c8fc0717b10293467ba92c19
Reviewed-on: https://gerrit.instructure.com/18522
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
QA-Review: Jacob Fugal <jacob@instructure.com>
2013-03-22 15:26:10 +00:00
Jacob Fugal 69c235ea57 Shard#relative_id_for stub
Change-Id: I39358c7f18054cb17fc260ed9be052e7cc75b76e
Reviewed-on: https://gerrit.instructure.com/18898
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
QA-Review: Jacob Fugal <jacob@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2013-03-22 15:25:58 +00:00
Jacob Fugal 19edc5dcb9 searchable messageable users
fixes CNVS-1170

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

Change-Id: I5c5828a9c66eb3e6eb9f3e713f389723d514784c
Reviewed-on: https://gerrit.instructure.com/18146
QA-Review: Clare Hetherington <clare@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
2013-03-22 00:24:54 +00:00
Brian Palmer cdedd99f90 i18n rake task improvements
* allow passing the source files as rake args
* strip invalid utf8 from the translation file

Change-Id: Icbdd09860c38f5f805e2a81e82f631595d210e27
Reviewed-on: https://gerrit.instructure.com/18754
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
2013-03-21 20:54:08 +00:00
Cody Cutrer a3acc3609c sort CoursesController#users correctly
refs CNVS-4115

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

Change-Id: I7eff0f1832d4494909be62f6d0e8f7baea0aee08
Reviewed-on: https://gerrit.instructure.com/18067
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-03-21 17:25:04 +00:00
Jon Jensen 1261e82bb2 don't warn browsers we don't recognize, fixes CNVS-4754
treat minimums as a blacklist, and assume that anything we don't recognize
is supported

test plan:
1. load canvas in unsupported browsers (e.g. IE 8), confirm you get a
   warning
2. load canvas in supported browsers (e.g. IE 9), confirm you don't get a
   warning
3. load canvas in an unknown browser (e.g. Android), confirm you don't get
   a warning

Change-Id: I87ed90e97d031431f6a48c814dfa874b785ea777
Reviewed-on: https://gerrit.instructure.com/18801
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Cam Theriault <cam@instructure.com>
Reviewed-by: Joe Tanner <joe@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
2013-03-20 22:16:16 +00:00
Erik Lyngved 7dacbab558 adding quiz information to assignments with quizzes
Notes:
* Assignments with an attached quiz will now return a quiz_id
  parameter

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

fixes CNVS-4613

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

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

test plan:
 * test all the things!

Change-Id: I4290d00db407f3250570df4e89c8c78283fe5f5f
Reviewed-on: https://gerrit.instructure.com/18427
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-03-19 11:10:22 -06:00
Jacob Fugal ce674b4e41 make Array#cache_key work with frozen arrays
test-plan (script/console):
 - make an Array (ary = [])
 - freeze it (ary.freeze)
 - try and get a cache_key from it (ary.cache_key)
 - should not raise an error

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

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

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

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

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

Change-Id: I7724988c16ac307be7dd4b762a07e936c3ad38bd
Reviewed-on: https://gerrit.instructure.com/18592
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
2013-03-18 14:53:13 -06:00
Cody Cutrer a5e2379cb7 fix a missed RAILS_ENV call
refs CNVS-4709

Change-Id: Icc2f133ba6bf6817119a38e5f227353ebba2dc56
Reviewed-on: https://gerrit.instructure.com/18699
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2013-03-18 14:30:30 -06:00
Bracken Mosbacker b03b6645fb create migration issues and start content migration api
this will allow migrations to have flexible todo items
and allow us to make a super awesome UI for helping
teachers fix any migration problems

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

closes CNVS-4230

Change-Id: I4577f811dd3b16aa200d381f039632b7cc2cd184
Reviewed-on: https://gerrit.instructure.com/18639
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2013-03-18 12:21:58 -06:00
Brad Humphrey dcb676a3d2 change tool_consumer_instance_guid for a user context launch to be the root account
the guid will come from the external tool's root account if it is launched from a user context

test plan:
  - install a tool that can launch from the account, course, and user navigation
  - launch the tool from each location
  - they should all have the same guid in the launch params

Change-Id: I8760e0e316a32c04930fff4fd28cd4d18fd4c109
Reviewed-on: https://gerrit.instructure.com/18542
QA-Review: Adam Phillipps <adam@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-03-15 16:47:22 -06:00
Cameron Matheson c270f93f8f touch assignment when saving overrides
fixes CNVS-4424

This invalidates some views that were being cached too long.

Test plan:
  * make sure config.action_controller.perform_caching is true
  * make an assignment with one due date
  * add a due date override via the api
  * make sure /courses/N/assignments shows 'Multiple Due Dates' instead
    of the original assignment due date

Change-Id: Ibc6e48cd7bf9457c3ff511987f6d7ca5a95d20c8
Reviewed-on: https://gerrit.instructure.com/18373
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
2013-03-15 15:47:30 -06:00
James Williams de56865d66 copy links to wiki pages that start with numbers correctly
fixes a problem where internal links to wiki pages that
had titles that started with numbers would cause the
regular expressions to break

(also fixes a couple random typos and such)

test plan:
* create a wiki page with a title that starts with a
 numeric character
* create a link to that wiki page (such as on another
wiki page)
* copy the course
* the copied course should have a correct link

fixes #CNVS-4158

Change-Id: I8c6a26feb4766e078f06656e7e26f381ae5934d5
Reviewed-on: https://gerrit.instructure.com/18064
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2013-03-15 14:30:58 -06:00
James Williams 58f6bf1a9d include enrollment_state in lti parameters
adds a parameter to indicate the enrollment state for a course
in the lti launch parameters

test plan:
* create an external tool module item for a course
* check the "open in new tab" option
* click on the module item link
* inspect the source page elements and look for an "input"
tag with "custom_canvas_enrollment_state", that will either
show "active" or "inactive" based on the current user's
enrollment state

fixes #CNVS-4264

Change-Id: I2cff488ef178a87f5aacaadbeeb47338ca41b424
Reviewed-on: https://gerrit.instructure.com/18499
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2013-03-15 11:12:10 -06:00
Joel Hough 909d443e9e refactor notification message creation
fixes CNVS-4544

the bugfix was rolled into a larger refactor. registration
messages should now work as they originally did, before the
last refactor broke them

the refactor consumed three notable methods:
- Notification#create_message (which is still there, but calls
  NotificationMessageCreator#create_message immediately)
- Notification#record_delayed_jobs
- CommunicationChannel#find_all_for

related specs have been adapted and moved to
NotificationMessageCreator's specs

test plan
- ensure that notification messages work as they did before
- particularly ensure that adding additional email addresses send
  registration emails to those addresses, not the default address

Change-Id: Id201abbbc3cdc37305f5cd7125f1e4cb82fe4c96
Reviewed-on: https://gerrit.instructure.com/18561
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Cam Theriault <cam@instructure.com>
Reviewed-by: Mark Ericksen <marke@instructure.com>
2013-03-15 10:26:20 -06:00
Cody Cutrer fec3ae76a7 more aggressively set context on page views
fixes CNVS-4455

you can never have too much context

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

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

Change-Id: I8714de45575123d6877e0265623e0fcaf9e7fa58
Reviewed-on: https://gerrit.instructure.com/18504
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
2013-03-14 17:38:20 -06:00
Duane Johnson 1d97ac0fc7 don't check section homogeneity on group membership update
When a GroupMembership is updated, don't check to make sure the user's
group is within the section, as this could impact SIS imports. We
only care about validating homogeneity when creating a new
GroupMembership.

Test Plan:
  - create a batch import in which a user is enrolled in a class,
    and is also in a group within that enrollment
  - add something else to the batch (to test that the rest of the
    batch is imported even when the error, below, occurs)
  - import the batch
  - mark the enrollment as deleted
  - re-import the batch
  - rather than failing to import the batch, there should be an
    error message indicating the group user had a validation error

fixes CNVS-4225

Change-Id: I2a20756d0464d833ce66e94a4d6c847bfb894f14
Reviewed-on: https://gerrit.instructure.com/18455
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
2013-03-14 16:45:09 -06:00
Brian Palmer 5347ef0fad remove the has_custom_fields plugin from vendor/
This was written 2 years ago and never used, I've verified the DB tables
are empty.

Change-Id: I405e009be2eb657c4ebfb63da21dbcfee92efc0d
Reviewed-on: https://gerrit.instructure.com/18564
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
2013-03-13 13:33:38 -06:00
Jon Jensen c762d2e3a4 show a warning to unsupported browsers, fixes CNVS-4579
test plan:
1. use canvas in any supported browser (including mobile)
2. you should not see a warning
3. use canvas in an unsupported browser (e.g. ie8, old firefox)
4. you should see an orangish warning at the top of every page
5. it should not be dismissable

Change-Id: I092455c416a754d102ddadbda99280856b4082de
Reviewed-on: https://gerrit.instructure.com/18524
QA-Review: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Joe Tanner <joe@instructure.com>
2013-03-13 10:38:32 -06:00
Eric Berry 6cbfef1db0 fixed issue where google doc collaboration links are broken
i was unable to re-create this bug, however on the live server i
was able to step through the code and determine the failure point.

fixes CNVS-4404

Change-Id: Ied185dc829ec1e2b972a102da9426ffab6541895
Reviewed-on: https://gerrit.instructure.com/18423
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
2013-03-12 15:36:42 -06:00
Simon Williams 83793ecbbb fix incorrect media_recording submission types
fixes CNVS-4588

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

Change-Id: Ia166c532f5ede0390afb2226d3cf4fb335814cf2
Reviewed-on: https://gerrit.instructure.com/18525
Reviewed-by: Stanley Stuart <stanley@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
2013-03-12 13:58:01 -06:00
Cody Cutrer 70781c4131 Kernel#returning is deprecated
Change-Id: I3efbab986f887525dc8ac178f1457a7b05aee0e8
Reviewed-on: https://gerrit.instructure.com/18535
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2013-03-12 13:44:03 -06:00
Ethan Vizitei f003eeced8 fix import for unbalanced pluralizations
fixes CNVS-4533

current i18n gem doesn't like pluralization sets
where you specify "other" but not "one".  This
pulls the i18n import into it's own class and
specifically specs out the copying over of the
"other" key into the "one" key in a pluralization
set unless a "one" key already exists.  Importing
any translation set will now solve the pluralization
view errors.

TEST PLAN:
1) confirm that the errors specified in CNVS-4533
are still occurring for the japanese language
set with the current translations.

2) run the i18n import process for the japanese
translations

3) confirm that the view errors are no longer
cropping up under the japanese translation set.

Change-Id: Idb856bd72f4d8e526a645f70a8fcc5556c4a4f98
Reviewed-on: https://gerrit.instructure.com/18526
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ethan Vizitei <ethan@12spokes.com>
QA-Review: Clare Hetherington <clare@instructure.com>
2013-03-12 12:26:18 -06:00
Jacob Fugal 6d5ba26f07 handle bad conversation_id in load_messageable_users
fixes CNVS-4557

test-plan:
 - have two users X and Y such that X cannot normally message Y
 - as user X, attempt to get the following via API:
   /api/v1/search/recipients?user_id=Y&from_conversation_id=bad_value
 - should return an empty result list, rather than an internal server
   error

Change-Id: Iecd1d3869d8e4921efdf129355eddbc0c2dc462c
Reviewed-on: https://gerrit.instructure.com/18490
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
2013-03-12 09:01:24 -06:00
Cody Cutrer b843f68a38 upgrade attachment_fu to use aws-sdk gem instead of aws-s3
closes CNVS-4248

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

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

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

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

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

refs CNVS-3692

Change-Id: I96fb541a829d7c117bfe1afa7a765d35c98cfe5c
Reviewed-on: https://gerrit.instructure.com/18325
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2013-03-11 15:13:10 -06:00
Zach Pendleton 3efc58683b preserve html line breaks in discussion entry emails.
fixes CNVS-4514

test plan:
  * set up a student or teacher with asap notifications
    on discussion entries;
  * as a student or teacher that shares a class with the
    first user, reply to an existing discussion topic and
    include some line breaks in your response;
  * verify that the first user's discussion entry
    notification and verify that line breaks are preserved.

Change-Id: Iabfbc8db55e883d01621434400ce234a9b3a0e33
Reviewed-on: https://gerrit.instructure.com/18467
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Reviewed-by: Joel Hough <joel@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
2013-03-11 14:24:19 -06:00
Brian Palmer 77ca8ac013 remove deprecated rails constant usage
basically convert RAILS_ROOT -> Rails.root , RAILS_ENV -> Rails.env ,
RAILS_DEFAULT_LOGGER -> Rails.logger

This is necessary for rails 3

Change-Id: I138e1aa217fa8fb186d23ac09b04031c1e2b665e
Reviewed-on: https://gerrit.instructure.com/18412
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Eric Berry <ericb@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
2013-03-11 12:14:08 -06:00
Bracken Mosbacker a97298c99b create attribute for lti_guid on accounts
This allows us to make changes with how we generate that
id without breaking tool providers who depend on the old
way

This also sets the lti_quid to the value it was before the
1c6ae6979e change

Test Plan:
 * Exiting root accounts lti_guid attribute should have the domain name in it
 * New accounts will use the accounts UUID and thus have no domain name

refs CNVS-3829

Change-Id: Ib5b10cb097d3f0e5c562d1af70f5770217418e63
Reviewed-on: https://gerrit.instructure.com/18481
Reviewed-by: Zach Wily <zach@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
Tested-by: Bryan Madsen <bryan@instructure.com>
Reviewed-by: Stanley Stuart <stanley@instructure.com>
2013-03-10 22:03:10 -06:00
Mark Ericksen d944b2c5b8 reflect change after edit/delete of discussion entry
Fixes CNVS-4207

After a user edits or deletes a discussion entry, it should
immediately reflect that the change was made and not
wait until the page is reloaded.

Testing Notes:
=========
* As a student, create a discussion entry and delete it.
  It should show the deleting user's name and a current
  time. It should not show deleted by "Unknown".
* As a teacher, create a discussion entry and delete it.
  It should work as with the student above.
* As a teacher, delete a discussion entry created by a
  a student and verify it shows the teacher's name
  as the deleter and a current timestamp.
* As a student, create a discussion entry and edit it
  (try editing both before and after a page reload).
  It should show "edited by" and the user's name
  along with a current timestamp.
* As a teacher, create a discussion entry and edit it
  (try editing both before and after a page reload).
  It should behave like the student scenario above.
* As a teacher, edit a student's discussion entry
  and verify that it shows "edited by" teacher's name
  with a current timestamp.
* Also verify that you can repeatedly edit an entry
  without having to refresh the page.

Change-Id: I18f618ae5e6d30bece35a9c71a4e8ccc808ab604
Reviewed-on: https://gerrit.instructure.com/18352
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Eric Berry <ericb@instructure.com>
Tested-by: Eric Berry <ericb@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
2013-03-08 17:05:35 -07:00
Simon Williams b13eac4562 fix assignment changed notifications with overrides
fixes CNVS-4480

test plan:
- set one of the student's notification policies for "Course Content" to
  immediate
- find an old assignment with overrides (created at least 30 min ago)
- edit it and change something trivial (like the assignment group)
- check the 'notify of update' box
- hit save
- the student should get an 'assignment changed' notification

Change-Id: Ied7c008d1e1f18d1e3f5716968c46593b6d6574f
Reviewed-on: https://gerrit.instructure.com/18419
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Stanley Stuart <stanley@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
2013-03-08 14:33:49 -07:00
Jacob Fugal 48c9286455 optional merge proc for BookmarkedCollection.merge
when provided, duplicates across collections will be collapsed. only the
first instance of an item mapping to a given bookmark will be included,
but for each duplicate, the kept element and the duplicate will be
yielded to the provided block. the block should perform any necessary
merging of the elements so the kept element ends up with all information
from any of the merged elements.

refs CNVS-1170

test-plan:
 - create two BookmarkCollections using scopes and bookmarkers that will
   produce duplicates across the collections
 - merge them with BookmarkCollection.merge(...) and NO block
 - paginating the merged collection should include all elements from
   each collection (properly sorted) with no deduplication
 - merge them with BookmarkCollection.merge(...) and a block
 - paginating the merged collection should include elements from either
   collection (properly sorted) only once

Change-Id: I1cb40b657e0db88d9cb4fa0f7f2d1341cdd71eb5
Reviewed-on: https://gerrit.instructure.com/18248
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Jacob Fugal <jacob@instructure.com>
2013-03-08 09:58:28 -07:00
Stanley Stuart 49f952b1d5 make fancy midnight work for assignment overrides
also fixes an issue where some dates display as "Friday at 11:59pm" instead
of just "Friday"

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

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

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

Change-Id: I8b5e10c074eb2a237a1298cb7def0cb32d3dcb7f
Reviewed-on: https://gerrit.instructure.com/18142
QA-Review: Amber Taniuchi <amber@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2013-03-07 15:53:06 -07:00
Duane Johnson 0f3c5bed6b raise ImportError for invalid sis import data
When unhandled ActiveRecord validation errors occur during SIS import
for a single record, it can prevent an entire batch from importing.
This change catches validation errors in Enrollment and
GroupMembership objects and re-raises them as ImportErrors so that
batch imports can continue.

Test Plan:
  - create a batch import in which a user is enrolled in a class,
    and is also in a group within that enrollment
  - add something else to the batch (to test that the rest of the
    batch is imported even when the error, below, occurs)
  - import the batch
  - mark the enrollment as deleted
  - re-import the batch
  - rather than failing to import the batch, there should be an
    error message indicating the group user had a validation error

fixes CNVS-4226

Change-Id: I87078bd263f2b2487c5a8d41ff41c0ff71cbed95
Reviewed-on: https://gerrit.instructure.com/18271
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
2013-03-07 15:51:08 -07:00
Rob Orton 7f39f14fea use temp table on grade reports
also adds scope helpers and other report helpers
added extra text to reports to give more detail 
about the last run report

test plan
- grade export report should still run
- student competency report should still run
- sis and provisioning reports should still run
- extra text should show on in the ui for 
  grade export, student competency, sis export
  and provisioning report

Change-Id: I9c635790ea46482e0941a134282c8182f9ea8677
Reviewed-on: https://gerrit.instructure.com/18377
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brad Humphrey <brad@instructure.com>
QA-Review: Tyler Belnap <tyler@instructure.com>
2013-03-07 15:35:31 -07:00
James Williams d3eabe6d44 fix a context modules api problem with listing module items
fixes a particular case when the list_module_items action
is called through the api for a module that is locked but
also has completion requirements

test plan:
* create a module, lock it
* add an assignment, list it as a completion requirement
* call /courses/:course_id/modules/:module_id/items in API
* should not receive a server error

fixes #CNVS-4195

Change-Id: I6c619d3687f040c7cd06b2208dec95e619915700
Reviewed-on: https://gerrit.instructure.com/18186
QA-Review: Myller de Araujo <myller@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-03-07 13:57:44 -07:00
Simon Williams 7183962545 api: allow section overrides for group assignments
fixes CNVS-4407

test plan:
- create a new assignment as a group assignment, with section overrides
- it should work

Change-Id: Icb4f497de7ef24b9d9e756b1f0255b4fce16d017
Reviewed-on: https://gerrit.instructure.com/18324
Reviewed-by: Stanley Stuart <stanley@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
2013-03-06 14:52:34 -07:00
Jacob Fugal c85d02f944 fix grouping and common context id interpretation
in messageable users. if a user has multiple enrollments in a course,
don't return multiple MessageableUser rows. also, make sure
interpretation of shard-local common context ids occur relative to the
shard the row comes from.

refs CNVS-3969

test-plan:
 - create a course (course1)
 - create a user (user1) that's enrolled multiple times course1 (e.g. as
   a TA in one section and a student in another)
 - create another user (user2) in course1 that can see both of the first
   user's enrollments (e.g. a teacher without section-limited
   visibility)
 - call user2.messageable_users_in_context(course.global_asset_string)
 - the result should contain user1
 - the result should contain user1 only once
 - the result for user1 should have both roles in the common_courses

Change-Id: Ic8ce5f07e5ce3a0d56998da0876d12333d97f6e6
Reviewed-on: https://gerrit.instructure.com/18238
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
2013-03-06 13:50:09 -07:00
Ryan Florence 3e48cd1baa added testem for fancier JS dev/testing
1. install testem
   `npm install -g testem`

2. start the runner
   `rake js:dev`
   
   run a specific test(s):
   `JS_SPEC_MATCHER=**/*ViewSpec.js rake js:dev`

3. follow instructions on screen

Change-Id: I63c330dc4a92bc2eca70e18c903e497edd5bc453
Reviewed-on: https://gerrit.instructure.com/18291
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
QA-Review: Ryan Florence <ryanf@instructure.com>
2013-03-05 15:42:41 -07:00
Cody Cutrer 39baee8b69 remove TEST_ENV_NUMBER hardcoding in config files
instead, you should be putting ERB in the config files

Change-Id: I75ddb75a77a6c7192583dd5eec88f4686d869e48
2013-03-05 15:02:31 -07:00
Brian Palmer 1418bc3d67 only filter google docs list by extension if extensions are given
This restores the previous filtering behavior that
google_docs_list_deprecated used.

This also fixes a regression with google docs at the top level (not in
any folder) not appearing in the list.

fixes CNVS-4295

test plan:
  - set up an assignment for file upload turn in with no list of allowed
    file extensions, and all your google docs should appear in the list.
  - set up an assignment for file upload turn in with a list of allowed
    extensions for example "doc,ppt" and only the google docs that are
    word processor and presentation files should appear in the list.
  - put some google docs in your top level google docs (not in any
    folder). make sure they show up in canvas and can be submitted.

Change-Id: I71d4f3db7114b427e282be2b1b40e61f1c94f7f7
Reviewed-on: https://gerrit.instructure.com/18280
Reviewed-by: Duane Johnson <duane@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-03-05 12:00:19 -07:00
Stanley Stuart 07b0789148 close file descriptors when compiling coffeescript
test plan:
  - you should not get an error for having too many files open during
    rake js:generate. for good measure, do something that opens a bunch
    of files like rake canvas:compile_assets and make sure you don't get
    an error about having too many file descriptors open.

Change-Id: Ifc08195ba7a9c21176d9fc1990858ded659eefb3
Reviewed-on: https://gerrit.instructure.com/18276
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Stanley Stuart <stanley@instructure.com>
2013-03-05 10:39:57 -07:00
Zach Pendleton a588a03165 update twitter api to v1.1.
fixes CNVS-4219

test plan:
  * from dev.twitter.com, create a twitter app with
    read/write access;
  * configure the app at /plugins;
  * set up a user's twitter service from their profile
    page;
  * take steps to send that user a notification;
  * verify that they receive a twitter DM.

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

fixes #CNVS-3507

Change-Id: If83f8a025a9a6c436b6b3599c1180b9d46b9bf02
Reviewed-on: https://gerrit.instructure.com/17663
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2013-03-01 14:49:00 -07:00
Cameron Matheson fb6fd951f9 set correct due_date for teachers on vdd assignments
closes CNVS-3756

Test plan:
  make sure assignment show up in the correct section of the page in
  /assignments for the following configurations:
    * no overrides
    * has a section override due date before the assignment due date
    * has a section override due date after the assignment due date

Change-Id: I7681416a102c9d8078f433fb03f8667cf2647e98
Reviewed-on: https://gerrit.instructure.com/17968
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Stanley Stuart <stanley@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
2013-03-01 13:33:49 -07:00
Simon Williams b7deea32cf add varied due dates to discussions
closes CNVS-505

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

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

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

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

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

Change-Id: I773bf1dd1c4f8feb4a3df9bf374c6b0b5436a963
Reviewed-on: https://gerrit.instructure.com/17863
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Stanley Stuart <stanley@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
2013-03-01 11:13:42 -07:00
Ethan Vizitei a08075b140 prevent error when google docs plugin not configured
refs #CNVS-3196

simon noted that if the google docs plugin was
not configured, trying to access the config hash
for the google docs library would result in 
a "no such method [] on nil" error.  I placed
specs at the controller level and at the library
level to reproduce the problem and put in a fix
that checks for a google docs config and fails
early if there is not one with a nil return.

Tested manually locally to confirm this solves it.

TEST PLAN:

1) login as any student to a canvas instance
where the google docs plugin is NOT enabled.

2) navigate to the show page for any assignment

3) you should not experience any server errors

Change-Id: I25f90ded428a5a6a9c15ddd625b1a690f6d9077f
Reviewed-on: https://gerrit.instructure.com/18177
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
2013-02-28 15:00:50 -07:00
Ethan Vizitei 15b29294aa google docs front end
FIXES #CNVS-3196

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

TEST PLAN:

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

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

Change-Id: Idd6c85668a40ef37a09631c635f3e83db69178e9
Reviewed-on: https://gerrit.instructure.com/17915
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
2013-02-28 10:45:04 -07:00
Stanley Stuart bb3b65395a add varied due date editor to quiz edit page
test plan:
  - new specs should pass
  - go through and make sure assignment overrides work
    for quizzes by using the editor on the quiz
    edit page.

fixes CNVS-469

Change-Id: I6b647575bb7db34235b2a1742558f6274b2605fc
Reviewed-on: https://gerrit.instructure.com/17437
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
2013-02-28 10:26:06 -07:00
Cody Cutrer f032a82046 paginate and process includes for user_search api
closes CNVS-4115

test plan:
 * set up a course with lots of users that can be searched via this
   API
 * ensure limit param for user search API still works (set it really
   low), even though it's no longer documented
 * test normal pagination (per_page, multiple pages)
 * use an include[] from the list users api; ensure you get the
   expected data in the response

Change-Id: I0d2a44ce96bef5d61cdf666b3bd59c9422952f33
Reviewed-on: https://gerrit.instructure.com/18061
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Duane Johnson <duane@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
2013-02-28 07:56:49 -07:00
Cody Cutrer 56e317e4ab use mysql2 gem for mysql
closes CNVS-4199

Change-Id: I81a14efca365a61ff9e5d29892ec95ace64aabb3
Reviewed-on: https://gerrit.instructure.com/18089
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2013-02-27 14:10:37 -07:00
Brian Palmer b9692005b2 strip invalid utf-8 from AR yaml columns serialized as binary by ruby 1.8
fixes CNVS-4174

Ruby 1.8 somtimes inserted invalid utf-8 into these columns using a
!binary tag, which 1.9 syck deserializes as ASCII-8BIT encoded. But then
it later blows up trying to append to a UTF-8 erb view or json output.

This adds a whitelisted set of columns for which we want to not only
strip invalid utf-8, but convert ascii encoded strings to utf-8 strings
and strip those too. These columns don't contain any binary data, so
that's an OK conversion to make.

Once Canvas only supports ruby 1.9, we shouldn't get any invalid utf-8
inserted even into serialized columns (YAML in 1.9 raises an exception
on serialization), so we won't need to keep this list up to date with
newly added columns, and we'll avoid accidentally converting a
serialized column that does contain binary data to utf-8.

test plan: rather than switching to ruby 1.8 and inserting bad data,
it'll be easier to just munge the database directly. create a
quiz_questions row with question_data that contains something like:

   question_name: !binary |
     oHRleHSg

then load the quiz in the UI using ruby 1.9. verify that you see a
question name "test" rather than a page error.

Change-Id: I8054026a06f28b1b61e05ba187bca8403a07fbb5
Reviewed-on: https://gerrit.instructure.com/18059
Reviewed-by: Paul Hinze <paulh@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-02-27 11:26:35 -07:00
Rob Orton 6aa9e1f8e1 wrap add temp_table in transaction
test plan
-using a temp table should not fail

Change-Id: Ia6d23f9f88aaa18d3676f29f558ac3e2c5d84176
Reviewed-on: https://gerrit.instructure.com/18082
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2013-02-26 10:11:18 -07:00
Duane Johnson 24b36b4aa6 show bad UTF-8 strings on translation files
translation files (such as our recent fr.yml) can have \xNN character
strings in them. If they are invalid UTF-8 byte sequences, the
translation import (rake i18n:import) will fail without any hints
as to what the problematic string is. This fixes it.

Test Plan:
  - run rake i18n:import on a translation file that has \x81 in it
    and you should get a message with the causal string

Change-Id: I412efd1511f80d0e7e5519766a49a25dfa1639b0
Reviewed-on: https://gerrit.instructure.com/17909
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
2013-02-25 14:14:34 -07:00
Nathan Mills 2e0613d34b write reports to file
fixes PS-120

test plan

*reports should all still generate

Change-Id: I0a0dc8fdf298a6bd803bb52a4562a548ef727c6b
Reviewed-on: https://gerrit.instructure.com/17242
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Tyler Belnap <tyler@instructure.com>
2013-02-25 12:20:05 -07:00
Jeremy Stanley dbd3979b22 prefer kaltura-converted assets over the original
there are two reasons why kaltura's processed assets
are preferable to the original:
 1. sometimes the user's uploaded one is in a non-streamable
    container ('mp4c', vs. the 'isom' kaltura uses),
    despite both being .mp4 files
 2. it's possible the original is too high a bitrate to
    stream effectively.  the old logic would prefer it
    nonetheless

test plan:
 - upload an mp4 in the 'mp4c' container format
 - ensure you can start watching it before it finishes
   downloading

fixes CNVS-4146

Change-Id: I6b2b9179b9e37b9a527938f81ace02c8dd6ac211
Reviewed-on: https://gerrit.instructure.com/18027
QA-Review: Clare Hetherington <clare@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-02-23 12:25:33 -07:00
Bracken Mosbacker d3290d2bee don't return invalid kaltura assets
This skips return both no urls and unknown types
also changed the cache key to clean up existing bad data

Change-Id: I59c665d0fffe4f53acf23e451ded5d44e0e657e3
Reviewed-on: https://gerrit.instructure.com/18009
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
2013-02-23 12:25:27 -07:00
Mark Ericksen 91f957bba0 clean up Notification creation in 'rake db:initial_setup'
identify "Reminder" category notifications as deprecated

fixes CNVS-3918, CNVS-3824

Explicitly run through 'rake db:load_notifications'

Testing Notes:
===========
* Run 'rake db:load_notifications'
* verify that it runs without error
* verify the 3 "Reminder" category entries
   have their category changed to "DEPRECATED - Reminder"
   Those are the following entries:
   * Assignment Publishing Reminder
   * Assignment Grading Reminder
   * Assignment Due Date Reminder
* If desired, define a new notification type in
   /app/messages/notification_types.yml
   and verify that after rake task is run,
   the new entry appears.
* Test setup of new database

Change-Id: Ib5dc69c7adc7a643f08ada94d9048274d8cd4e12
Reviewed-on: https://gerrit.instructure.com/17948
QA-Review: Marc LeGendre <marc@instructure.com>
Reviewed-by: Joel Hough <joel@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-02-22 17:15:05 -07:00
Jon Jensen db6e6c68b1 get rid of warning
the arity should be zero

test plan:
1. run specs

Change-Id: I27e1b629e7b63e4fc764ce12a7b28767b07d6c91
Reviewed-on: https://gerrit.instructure.com/18007
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2013-02-22 16:32:45 -07:00
Zach Pendleton 46e5b9027d remove body, sms_body columns from notifications.
fixes CNVS-3917

the notifications table had vestigial `body` and `sms_body`
columns that canvas no longer uses. this commit drops those
columns.

test plan:
  * back up your database (unless you want to keep this
    commit on your master branch forever);
  * run migrations;
  * verify that notifications still send as expected;
  * for extra credit, configure canvas with a new database
    and verify that db:initial_setup still works without
    any errors.

Change-Id: Icc7d8c4e926b5ea0ecb8c3814fdc95481037a0c9
Reviewed-on: https://gerrit.instructure.com/17892
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
Reviewed-by: Mark Ericksen <marke@instructure.com>
2013-02-22 16:07:21 -07:00
Zach Pendleton 55f1fa66ea add multiple reply-to support to outgoing mail.
fixes CNVS-2514

allow multiple reply-to addresses that will be rotated
across when sending mail. this commit, in conjunction with
CNVS-3781, allows canvas to receive mail from multiple
inboxes and distribute its incoming mail across them.

test plan:
  * configure config/outgoing_mail.yml with multiple
    reply_to_addresses as explained in
    config/outgoing_mail.yml.example;
  * trigger at least n notifications for a user in canvas,
    where n is the number of reply_to_addresses configured;
  * visit /user/:id/messages and verify that each message
    is sent from a different reply_to address.

Change-Id: I53c01c7c355dcbf7c16595070f41eee721814849
Reviewed-on: https://gerrit.instructure.com/17870
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
QA-Review: Zach Pendleton <zachp@instructure.com>
2013-02-22 14:02:27 -07:00