Commit Graph

3138 Commits

Author SHA1 Message Date
Matthew Berns c6d3546002 correct i18n translation issue with DA
fixes CNVS-21995

Change-Id: I0e30cbf1508fdbe2a06e3b75f52146ea22c4234a
Reviewed-on: https://gerrit.instructure.com/61058
Tested-by: Jenkins
Reviewed-by: Ryan Taylor <rtaylor@instructure.com>
QA-Review: Adam Stone <astone@instructure.com>
Product-Review: Dana Danger <dana@instructure.com>
2015-08-20 22:38:59 +00:00
James Williams ddf6184a94 other misc performance improvements
- cache folder locked status
- don't load html content unnecessarily for
 index page api calls
- preload enrollment terms for menu

refs #CNVS-21317

Change-Id: I43f7915edc8cb33049723a80970f7cc23df679ef
Reviewed-on: https://gerrit.instructure.com/61198
Tested-by: Jenkins
Reviewed-by: Dan Minkevitch <dan@instructure.com>
Product-Review: Dan Minkevitch <dan@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2015-08-20 21:09:35 +00:00
James Williams 008cd38c32 fix activity_stream_summary for cross-shard users
test plan:
* create a user in a course on another shard
* activity_stream/summary should still include
 stream items from the other shard

closes #CNVS-22424

Change-Id: I37405a292ea28e76d9e559dd67fe82f8061e400f
Reviewed-on: https://gerrit.instructure.com/61300
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
QA-Review: August Thornton <august@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2015-08-20 18:59:52 +00:00
Nick Houle debb304d02 Set sis_app url as canvas account setting
Fixes: SIS-700
Change-Id: I95e475f00c1e00a00a4e04e099f7734c94604cad
Reviewed-on: https://gerrit.instructure.com/60592
Reviewed-by: Tyler Pickett <tpickett@instructure.com>
Product-Review: Tyler Pickett <tpickett@instructure.com>
Tested-by: Jenkins
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
2015-08-19 21:51:03 +00:00
Mark Severson 4b6418e4ae remove description from the sis assignments api
test plan:
 * query the sis assignments api for an account/course
   * /api/sis/accounts/:account_id/assignments
   * /api/sis/courses/:course_id/assignments
 * the description field should not be returned for any assignment

fixes CNVS-22513

Change-Id: I2d679a3b7eedf4f4892ef5e7d1b93007e7500c7a
Reviewed-on: https://gerrit.instructure.com/60861
Reviewed-by: Brad Humphrey <brad@instructure.com>
Tested-by: Jenkins
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Mark Severson <markse@instructure.com>
2015-08-19 16:59:27 +00:00
James Williams 86f7bddf5e don't load plugin settings for account services on every page load
loading AccountServies.allowable_services shouldn't calculate
 "expose_to_ui" when unnecessary

Change-Id: I86c6bebb88c372932283b063054a5f9e5fb947e1
Reviewed-on: https://gerrit.instructure.com/61186
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2015-08-19 14:46:51 +00:00
James Williams a60bd5ffe4 add more caching + performance improvements
refs #CNVS-21317

Change-Id: Id9bbb04a92abd835af69ba5ec0c21ef758a8a324
Reviewed-on: https://gerrit.instructure.com/61146
Reviewed-by: Dan Minkevitch <dan@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
Tested-by: Jenkins
2015-08-18 16:01:33 +00:00
Simon Williams 557567811a DRY up db_load_data task
test plan: N/A

Change-Id: I6b21021bc61cebc9d80990ee14b5c69cdc75164b
Reviewed-on: https://gerrit.instructure.com/59792
Tested-by: Jenkins
Reviewed-by: Christina Wuest <cwuest@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
2015-08-17 21:59:26 +00:00
Simon Williams 221c312631 fix confusing whitespace in lib/stats
test plan: N/A

Change-Id: I6baddd64b542fc4fb8c8388a718b9456db01e0a6
Reviewed-on: https://gerrit.instructure.com/59785
Tested-by: Jenkins
Reviewed-by: Strand McCutchen <smccutchen@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
2015-08-17 21:52:30 +00:00
Cody Cutrer a7fefca26a preload and/or avoid loading at all data used by stream items
Change-Id: Iab2605d77b7c546aacea2a0445f5582b40d0999c
Reviewed-on: https://gerrit.instructure.com/60621
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2015-08-17 21:43:55 +00:00
Cody Cutrer ee17716731 remove some kludge-caching of :nil
that was only needed in rails 2

Change-Id: I1e2a00f65237d45ac82daa19eaecf5c589171718
Reviewed-on: https://gerrit.instructure.com/61025
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2015-08-17 19:27:27 +00:00
James Williams 9a0a5fdb7c fix activity_stream_summary for announcements
apparently they are the exception to the asset_type
 is class name rule

test plan:
* create an announcement
* it should count as a separate type of stream item in the
 activity stream summary

refs #CNVS-22424

Change-Id: I4eefaab180e1dc8f441c9b23d0a2a237dac627c9
Reviewed-on: https://gerrit.instructure.com/61001
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2015-08-17 18:53:10 +00:00
Weston Dransfield c93dac757a read and write resource_placements to/from message_handler
fixes PLAT-1174

Test Plan
~ make sure resource_handler_id from the lti_resource_placements table
~ make sure installing a tool via lti tool registration URL works correctly as
  well as any other task that uses the Lti::ResourcePlacement model.

Change-Id: I058ae01cb43366342754e3fa9cdabf1c408cce0e
Reviewed-on: https://gerrit.instructure.com/60494
Reviewed-by: Nathan Mills <nathanm@instructure.com>
Tested-by: Jenkins
QA-Review: August Thornton <august@instructure.com>
Product-Review: August Thornton <august@instructure.com>
2015-08-17 16:47:43 +00:00
Jon Willesen 13d7c99e0c added anonymous grading feature flag
fixes CNVS-21535

For now this can just be a plain feature flag because feature
flags implement the "cascading state" functionality we want for
this setting. We can change the UI on this or convert it to a
new type of setting later if we think that's important enough.

test plan:
 - Anonymous grading feature flag exists as a feature currently
 under development (only visible to site admins until it is
 turned on). Nothing else should be affected by this
 flag's setting yet.

Change-Id: I5136265cd46af47ea48482b2ab5015112e079557
Reviewed-on: https://gerrit.instructure.com/60871
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: Dan Minkevitch <dan@instructure.com>
2015-08-14 21:54:28 +00:00
Jacob Fugal d79ccc78d9 localize values in datetime picker fields
fixes CNVS-21581, CNVS-21582

test-plan:
 - regression around all datepicker elements
 - for each, when it loads with prepopulated data, that data should be
   localized
 - the prepopulated localized data should be valid to the datepicker

Change-Id: I633034967c70066e337dc22d9b9ad0cd84793834
Reviewed-on: https://gerrit.instructure.com/60229
Tested-by: Jenkins
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
Product-Review: Mike Nomitch <mnomitch@instructure.com>
2015-08-14 20:25:02 +00:00
James Williams 9359807670 rewrite activity stream summary for performance
adds a notification_category column in order to move all
the calculation of stream item counts to the db instead
of loading all the instances and items

test plan:
* regression test activity stream summary api endpoint

closes #CNVS-22424

Change-Id: Ia0abf9d89e02d53800bcd5d62fdf1a36131bd6f8
Reviewed-on: https://gerrit.instructure.com/60578
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2015-08-13 19:43:34 +00:00
James Williams 6278d9e17a consolidate usages of TempCache into RequestCache
refs #CNVS-21317

Change-Id: I60016fd04109605d4324d5b184d5c0f7afa2515e
Reviewed-on: https://gerrit.instructure.com/60583
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2015-08-13 19:33:15 +00:00
James Williams 85afd15ec7 improve assignment api needs_grading_count performance
the course proxy caches values that would otherwise be
 re-calculated over and over again

refs #CNVS-21317

Change-Id: Iae0edc43b896b1029e869cf8c759aea7d7bcfd62
Reviewed-on: https://gerrit.instructure.com/60580
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2015-08-13 19:32:42 +00:00
Brian Palmer 6f99f0d3e0 send exception type as a tag
A tag makes it filterable, vs extra data which is just displayed on the samples
screen.

Change-Id: I9d01491c59a5ede9ffa12269d5a035a0e2d80793
Reviewed-on: https://gerrit.instructure.com/60488
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
QA-Review: August Thornton <august@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
2015-08-13 18:43:55 +00:00
Cody Cutrer 5202a59020 don't load the developer key just to log its ID
test plan:
 * use an access token to do an API request
 * the X-Canvas-Meta header should have a dk key, with a global id

Change-Id: I85139bffb16750a4bfffb241eaaf54de4d9601ae
Reviewed-on: https://gerrit.instructure.com/60597
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2015-08-12 18:30:40 +00:00
Cody Cutrer c215884ad8 fix typo
Change-Id: Id3189f4fe0243565da3dfd7b9e00e2fa3522f86f
Reviewed-on: https://gerrit.instructure.com/60589
Reviewed-by: August Thornton <august@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Tested-by: Jenkins
Product-Review: Cody Cutrer <cody@instructure.com>
2015-08-12 17:03:16 +00:00
Cody Cutrer d723bfcc75 avoid bothering the database with pointless queries
Change-Id: Ib207ec5fbea0eb4e5fb8c36791030c8bba0b7721
Reviewed-on: https://gerrit.instructure.com/60487
Tested-by: Jenkins
Reviewed-by: August Thornton <august@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2015-08-11 20:08:03 +00:00
James Williams 97f3bebe2b remove observer enrollments when removing a user observee
also added various user deleted state checks with
 user observers

test plan:
* enroll a student in a course
* add the student as an observee
* using the user observees api, remove an observee
* should no longer be enrolled in the student's courses

closes #CNVS-13669

Change-Id: I0cc9953fa9fab7039f2aa1887dfa25c40c553f08
Reviewed-on: https://gerrit.instructure.com/60482
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Dan Minkevitch <dan@instructure.com>
2015-08-11 19:05:31 +00:00
Jeremy Stanley 9501c59126 assignment moderated grading setting
test plan:
 - if the "moderated grading" feature flag is enabled,
   assignment settings should include a new checkbox for
   moderated grading.
   - this checkbox should not be available if the
     assignment's "Display Grade As" is "Not Graded"
   - the checkbox should be disabled, with a tooltip
     message given, if graded submissions already exist
     for the assignment.
  - if the destination course enables moderated grading,
    the moderated grading setting should persist across
    export/import and course copy
  - the create / edit assignment APIs should let you
    see and update the moderated grading setting
    via assignment[moderated_grading]
    - the API should ignore the setting if the feature
      flag is disabled
    - the API should give an error if you attempt to
      change the setting after submissions exist
    - the API should give an error if you attempt to
      enable moderated grading on an ungraded assignment

closes CNVS-22207

Change-Id: I33c1944792a47e51bff124d2cb9722e8d0edc93e
Reviewed-on: https://gerrit.instructure.com/59593
Reviewed-by: Dan Minkevitch <dan@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Tested-by: Jenkins
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2015-08-10 22:26:32 +00:00
James Williams 5df55f1344 preserve file student date restrictions on import/export
(also shift/remove file dates)

test plan:
* add date based restrictions for students to a file
* export the course
* import the file into a new course
* should retain the restrictions

* importing/copying with the shift dates/remove dates option
 should work as well

closes #CNVS-22352

Change-Id: Ie7510fc9b45664ce2dab49850dd09fce7023c306
Reviewed-on: https://gerrit.instructure.com/60040
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2015-08-10 15:46:22 +00:00
Mark Severson a1d111f0c4 only return active data from sis assignments api
test plan:
 * add an assignment to the course
 * add two sections to a course
 * add a due date override for each of the sections
 * delete one of the sections
 * delete the remaining override
 * query the sis assignments api for the course
   /api/sis/courses/:course_id/assignments
 * the deleted section and override should not be returned

fixes CNVS-22210

Change-Id: I259dec9448bc5c0880fd46171d1f6c09384ba08f
Reviewed-on: https://gerrit.instructure.com/60101
Tested-by: Jenkins
Reviewed-by: Andrew Butterfield <abutterfield@instructure.com>
QA-Review: Ben Bolton <bbolton@instructure.com>
Product-Review: Mark Severson <markse@instructure.com>
2015-08-07 23:19:22 +00:00
Jeremy Stanley ac7e8d3c52 add data-api-endpoint for module links in user content
test plan:
 - in a wiki page, use the wiki sidebar to create links to the
   Modules List and to a specific module
 - save the page
 - inspect the page source and you should find data-api-endpoint
   and data-api-returntype attributes on these links
   as documented at /doc/api/file.endpoint_attributes.html

fixes CNVS-22381

Change-Id: If805689a3974f6e101d5c640521da53b19db585d
Reviewed-on: https://gerrit.instructure.com/60235
Tested-by: Jenkins
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2015-08-07 20:46:09 +00:00
Cody Cutrer d32e72c569 allow setting auth providers on sis import
test plan:
 * create an auth provider
 * do an sis import without auth provider; it should still work
 * specify the auth provider by name in the import; it should work
 * specify the auth provider by id in the import; it should work

Change-Id: I71f381a1bc140c3992cac6eb45bb077e5bd26baa
Reviewed-on: https://gerrit.instructure.com/59558
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2015-08-07 20:23:45 +00:00
Derek Bender d6eaed579f create ProvisionalGrade table and model
- extracted some shared behavior between submissions and provisional grades
- improved organization in submissions

refs: CNVS-22006
Change-Id: I4207893362e4548d1d76d066322f3b333357807a
Reviewed-on: https://gerrit.instructure.com/59643
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: Derek Bender <dbender@instructure.com>
2015-08-07 17:12:37 +00:00
Keith Garner 3260f7f1ae gradebook importer considers variations of 'EX' as equivalent
gradebook importer now handles all case variations of 'EX' as excused.  Because
of this, case variations are not considered changes to grades on import.

fixes CNVS-21909

test plan:
- Go to Gradebook.
- Excuse a few assignments
- Export Grades.
- Change an 'EX' grade to a different case, i.e. 'ex', 'eX', 'Ex', then import
  the same CSV file.
- Note that 'no changes made' page is displayed

Change-Id: I97bf28d2c9a333cd38f9890b10df1d41a6db322e
Reviewed-on: https://gerrit.instructure.com/59920
Tested-by: Jenkins
Reviewed-by: Cameron Matheson <cameron@instructure.com>
QA-Review: Jason Carter <jcarter@instructure.com>
Product-Review: Josh Simpson <jsimpson@instructure.com>
2015-08-07 16:37:13 +00:00
Andraia Allsop 59bf3714a7 Allows teacher to clone a group set.
Option 'Clone Group Set' added in the group set cog wheel.
When modifying group membership on a group that has submitted an
assignment, teacher is alerted and given option of cloning group set
or changing groups.

fixes CNVS-19746

test plan:
- as a teacher
  - navigate to a course
  - select 'People' and go to 'Groups'
  - create a new group set with groups and memberships
  - create a group assignment for that group set
- as a student who is a member of a group of that group set
  - submit the assignment for their group
- as a teacher
  - modify the memberships for that group set
    - for groups that have submissions
      - drag and drop a student
        - out of group into another group
        - out of group into 'Unassigned Students'
        - into group from another group
        - into group from 'Unassigned Students'
      - remove student using 'Remove' option in cog wheel
      - move student using 'Move To...' option in cog wheel
      - add student from 'Unassigned Students' using '+' option
      - when 'Clone Group Set' modal is displayed
        - select 'New Group Set'
          - memberships in original group set should not change
          - within cloned group set
            - should contain all groups, group leader, memberships,
              and membership limits from original group set
            - group membership modification should function as normal
        - selecting 'Change Groups'
          - group membership changes
  - delete assignment created for group set
    - group membership modification should function as normal
  - select 'Clone Group Set' option from group set cog wheel
    - should follow same expectations when 'New Group Set' is
      selected from alert
- significant UI changes were made and should be tested
- accessibility has been considered and should be tested
- regression test on group

Change-Id: I59276eca93f86d370f8658f5bdd0e9464f3fa061
Reviewed-on: https://gerrit.instructure.com/58753
Tested-by: Jenkins
Reviewed-by: Andrew Butterfield <abutterfield@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Andraia Allsop <aallsop@instructure.com>
2015-08-07 16:31:52 +00:00
John Corrigan 3dcaea5a18 update CC::WebResources#add_course_files to filter files by permission
fixes CNVS-21391

The content export tool is being updated so that it consders the
provided user's rights, so that the CC export can be used for the new
epub generation tool.

This PS updates CC::WebResources#add_course_files to pass a user
instance to the ContentZipper instance it uses to zip up a course's
files, so that the ContentZipper can determine if the user has the
correct permissions to see the files.

Also, we update ContentZipper so that a user can be provided via
attr_writter.

test plan:
- Regression test for content export tool files functionality.

Change-Id: Ic5edecef28d60d9517ce3a67bc8aef5c5dade9cc
Reviewed-on: https://gerrit.instructure.com/59440
Tested-by: Jenkins
Reviewed-by: Brian Finney <bfinney@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Cameron Sutter <csutter@instructure.com>
2015-08-06 19:01:09 +00:00
John Corrigan 9a3a560539 use DisucssionTopic::ScopedToUser in CC::TopicResources#add_topics
fixes CNVS-21394

The content export tool is being updated so that it consders the
provided user's rights, so that the CC export can be used for the new
epub generation tool.

This PS employs DiscussionTopic::ScopedToUser to make sure that the user
only gets the discussion topics that they have the right to view.

test plan:
- Regression test for content export tool discussion topic functionality.

Change-Id: Id67bf1ed69c4b2066ff9d81678a5d61d52702978
Reviewed-on: https://gerrit.instructure.com/59365
Tested-by: Jenkins
Reviewed-by: Brian Finney <bfinney@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Cameron Sutter <csutter@instructure.com>
2015-08-06 19:00:54 +00:00
Weston Dransfield 2b0b7d26b0 Move placements to capabilities in the tool proxy. Placements are still written to both message_handler and resource_handler.
fixes PLAT-957

Test Plan:
     - Make sure a 'message_handler_id' column is added to the 'lti_resource_placements' table after migration
     - Use the master branch of https://github.com/westonkd/lti_tool_provider_example and make sure
       placements work as expected in Lti2Launch
     - use the 'placements_to_message' branch of https://github.com/westonkd/lti_tool_provider_example and
       make sure placements work as expected in Lti2Launch

Change-Id: I2d681eb8efb2a1c25e0250a89c09bb5d0c8ad797
Reviewed-on: https://gerrit.instructure.com/58654
Tested-by: Jenkins
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Reviewed-by: Nathan Mills <nathanm@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Weston Dransfield <wdransfield@instructure.com>
2015-08-06 15:48:13 +00:00
Strand McCutchen 5a2269ff8a GradebookImporter only allows editing current assignments
fixes CNVS-19924

When a teacher uploads a CSV with assignments in past
grading periods then they are not able to change grades.

Test plan

1. As an admin, create an account level grading period in
   the past.
2. Create assignments due during the past grading period.
3. Login as a teacher.
4. Navigate to the gradebook
5. Click export to download a CSV
6. Change the grade for the assignment in the past grading
   period.
7. Click the export button and use the wizard to upload
   your modified CSV.
8. You should receive a message telling you you are not
   allowed to edit the assignment in the past.

Change-Id: Ia8701c3504b03bd6ed35d0da1fe56cd8330ace79
Reviewed-on: https://gerrit.instructure.com/55297
Reviewed-by: Dylan Ross <dross@instructure.com>
Tested-by: Jenkins
QA-Review: Jason Carter <jcarter@instructure.com>
Product-Review: Strand McCutchen <smccutchen@instructure.com>
2015-08-05 23:30:54 +00:00
Weston Dransfield 284c502f6d Make membership.roles variable expansion available in the account context
Fixes PLAT-1184

Test Plan
 - Install the test tool at the account level with the account navigation and course navigation placements
 - Once installed edit the app and add the custom field 'role_test=$Canvas.membership.roles'
 - launch the app from the account navigation and make sure the variable was expanded
 - launch the app from the course navigation and make sure the variable was expanded

Change-Id: I840c537de5ec1fa8fc1f1f94d2b8beef1aed2abb
Reviewed-on: https://gerrit.instructure.com/59859
Tested-by: Jenkins
Reviewed-by: Nathan Mills <nathanm@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Weston Dransfield <wdransfield@instructure.com>
2015-08-05 23:07:32 +00:00
Ryan Shaw 27860d1b8f ThemeEditor: fix 404 to default preview images
fixes: CNVS-22258

test plan:
* open theme editor and open the "watermarks and 
  other images section. you should not see any
  404's in the browser console and you should
  see a default for each except for the 'watermark'

* in IE, make sure you don't see a "broken link"
  image for the watermark

Change-Id: Iea743e8efc5115e2f4dfae6b8d12f26d4f3f346f
Reviewed-on: https://gerrit.instructure.com/59793
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2015-08-05 22:52:58 +00:00
Addison Higham 665c7f2127 Add root_account.global_id and shard LTI expansions
For the Canvas Data product, we have an LTI app that we use to give customers access
to a flat file download or manage credentials for accessing a Redshift
database.

Since this is basically a huge amount of access, we want to be double
extra sure that we are properly linking up accounts with the canvas data
portal and only giving authorized users access.

For the LTI app, we are currently using per account oauth keys/secrets
and user whitelisting to ensure that only authorized users can access
the data. However, we currently have a gap where if a shard_id (which we
need for driving the ETL process) is not entered correctly, we would
process data for the wrong customer. With the shard_id being passed
by the LTI app, we can at least ensure that this data can't be accessed
by not allowing authentication if we are passed a shard_id we don't
expect.

This commit adds an expansion for the globalized account_id (which we
may use later) and the shard_id.

Test Plan:
  - Create an LTI app that expands $Canvas.root_account.global_id and $Canvas.shard
  - Ensure that the globalized root_account_id and shard_id are passed

Change-Id: I5315320c4920e258032a08f424b9a83a6f7a8744
Reviewed-on: https://gerrit.instructure.com/59895
Reviewed-by: Nathan Mills <nathanm@instructure.com>
Tested-by: Jenkins
QA-Review: August Thornton <august@instructure.com>
Product-Review: Addison Higham <ahigham@instructure.com>
2015-08-05 22:38:28 +00:00
Nick Houle c97147237f Add assignment overrides to the sis assignments API
Fixes: SIS-1291, CNVS-21824
Change-Id: If7e623004ab305d8edb5278f67e7c24a35133f99
Reviewed-on: https://gerrit.instructure.com/58909
Reviewed-by: Mark Severson <markse@instructure.com>
Tested-by: Jenkins
QA-Review: Kausty Saxena <kausty@instructure.com>
Product-Review: Tyler Pickett <tpickett@instructure.com>
2015-08-05 17:36:28 +00:00
Brad Horrocks 6ee329eebc The turnitin submission endpoint should save originality data
Fires off delayed job that hits the turnitin callback url,
creates a submission, and maps originality data into the turnitin_data
field.

Fixes PLAT-1167
Fixes PLAT-1169

Test Plan:
You'll need to have the TurnItIn LTI tool installed, and delayed_jobs
running

Create an assignment with the submission set to the External Tool for
turnitin.
As a student, submit the assignment.
wait for the delayed job to run. check out /jobs to see whats going on
After the job has ran you should see turnitin data, as you would
normally with the plugin

Change-Id: I5d60d250e91b422b5e77255d715abf2e4712f130
Reviewed-on: https://gerrit.instructure.com/59942
Tested-by: Jenkins
Reviewed-by: Nathan Mills <nathanm@instructure.com>
Product-Review: Nathan Mills <nathanm@instructure.com>
QA-Review: Nathan Mills <nathanm@instructure.com>
2015-08-05 15:43:30 +00:00
Weston Dransfield fdfadc6c7f Add ability ot view placements for Account Level tools at the course level
Fixes PLAT-1160

Test Plan:
 - Install a test tool at the account level and give it a variety placements.
 - Navigate to a course within the account you just installed the tool in.
 - go to settings -> apps and look at the app configurations.
 - make sure the account level tool has a button that allows a user to view placements.
 - make sure the list of placements given for the account level tool is correct.

Change-Id: I306290d593e59d80dcd34ff7550388508694c141
Reviewed-on: https://gerrit.instructure.com/59040
Tested-by: Jenkins
Reviewed-by: Nathan Mills <nathanm@instructure.com>
Reviewed-by: Brad Horrocks <bhorrocks@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Weston Dransfield <wdransfield@instructure.com>
2015-08-04 21:33:21 +00:00
Nathan Mills ac14a09bd1 submit orginal turnitin submission
Fixes Plat-1168

Test-plan:
Submit a turnitin assignment using the lti tool
it should create a submission with the submitted file as an attachment

Change-Id: I37b24f8d2cb5c78f1247a0096f1afe2f3528abcb
Reviewed-on: https://gerrit.instructure.com/59701
Reviewed-by: Brad Horrocks <bhorrocks@instructure.com>
Tested-by: Jenkins
Product-Review: Nathan Mills <nathanm@instructure.com>
QA-Review: Nathan Mills <nathanm@instructure.com>
2015-08-04 21:00:42 +00:00
Strand McCutchen 69ef11e91e Gradebook Exporter Extraction
refs CNVS-22054

Course had a large method `gradebook_to_csv` which was not a
clear responsibility of Course objects. This extraction creates
a GradebookExporter PORO which is responsible for exporting
gradebooks to CSV files.

Change-Id: I0a5c3099d21358ef0ee4c5cd03586760b971a9f5
Reviewed-on: https://gerrit.instructure.com/59708
Tested-by: Jenkins
Reviewed-by: Derek Bender <dbender@instructure.com>
QA-Review: Adrian Foong <afoong@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
2015-08-04 20:12:13 +00:00
Dan Minkevitch 6402a70f66 Fix migration issue with sharding
Change-Id: I1a756034d2296d222d14650339f32760e459183b
Reviewed-on: https://gerrit.instructure.com/59918
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Tested-by: Jenkins
Product-Review: Dan Minkevitch <dan@instructure.com>
2015-08-04 16:10:38 +00:00
John Corrigan c5269b8218 use WikiPages::ScopedToUser in CC::WikiResources#add_wiki_pages
fixes CNVS-21389

The content export tool is being updated so that it consders the
provided user's rights, so that the CC export can be used for the new
epub generation tool.

This PS employs WikiPages::ScopedToUser to make sure that the user
only gets the wiki pages that they have the right to view.

test plan:
- Regression test for content export tool wiki pages
  functionality.

Change-Id: Icd3cd11fb8008bbd7441854e51fd8f37bcfbb6b7
Reviewed-on: https://gerrit.instructure.com/59395
Tested-by: Jenkins
Reviewed-by: Brian Finney <bfinney@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Cameron Sutter <csutter@instructure.com>
2015-08-04 15:41:17 +00:00
John Corrigan c94b8bc73f use Assignments::ScopedToUser in CC::AssignmentResources#add_assignments
fixes CNVS-21390

The content export tool is being updated so that it consders the
provided user's rights, so that the CC export can be used for the new
epub generation tool.

This PS employs Assignments::ScopedToUser to make sure that the user
only gets the assignments that they have the right to view.

test plan:
- Regression test for content export tool assignment functionality.

Change-Id: Id0170806c10715130d34e8c7a190e4fcaeb22cd5
Reviewed-on: https://gerrit.instructure.com/59323
Tested-by: Jenkins
Reviewed-by: Brian Finney <bfinney@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Cameron Sutter <csutter@instructure.com>
2015-08-04 15:41:09 +00:00
Nick Houle b25ba4976c Add the assignments created date to the sis assignments api
Change-Id: I0a30e089d51014caaa67ba375c4c6338d9c77d53
Fixes: SIS-1306
Reviewed-on: https://gerrit.instructure.com/58984
Tested-by: Jenkins
Reviewed-by: Tyler Pickett <tpickett@instructure.com>
Reviewed-by: Mark Severson <markse@instructure.com>
QA-Review: Kausty Saxena <kausty@instructure.com>
Product-Review: Tyler Pickett <tpickett@instructure.com>
2015-08-04 15:35:48 +00:00
Ryan Taylor 1f8b10c357 Makes our API default to censoring question answers
Closes CNVS-22194

Test Plan:
  - No functional changes

Change-Id: I1969fcbec81e9519c7b48c79f79178fdee389923
Reviewed-on: https://gerrit.instructure.com/59413
Tested-by: Jenkins
Reviewed-by: John Corrigan <jcorrigan@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Ryan Taylor <rtaylor@instructure.com>
2015-07-30 21:33:55 +00:00
Brad Horrocks 7fa01132d0 Turnitin gem and delayed job skeleton
Fixes PLAT-1168

Test Plan:
run the tests :D

Change-Id: Ica5967b249c3b58b73070c75ac53f188e91fea7e
Reviewed-on: https://gerrit.instructure.com/59453
Tested-by: Jenkins
Reviewed-by: Nathan Mills <nathanm@instructure.com>
Product-Review: Nathan Mills <nathanm@instructure.com>
QA-Review: Nathan Mills <nathanm@instructure.com>
2015-07-30 14:02:15 +00:00
James Williams 8f7648060b give info on package_identifier errors
we're already raising an error later, hiding it just makes it more
difficult to fix if it's a real problem

Change-Id: I70f82cb96ffa1d0c0d56b5cd6dd91733851c7b05
Reviewed-on: https://gerrit.instructure.com/59536
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2015-07-30 03:42:38 +00:00
Brock Cooper f5c5f8de9d Student View for NC-Or Project
Addresses CNVS-20851

- Adds progress icons for each individual module item
- Adds progress icons for each module
- Ensures module progression works in accordance
  to the module requirement pills and prerequisites
  in the module header

Change-Id: I44811ce19db40e42fb35396070b679ba93609294
Reviewed-on: https://gerrit.instructure.com/58892
Tested-by: Jenkins
Reviewed-by: Sterling Cobb <sterling@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: Cosme Salazar <cosme@instructure.com>
2015-07-29 20:10:59 +00:00
Ryan Shaw b89a3eeb06 have s3Uploader upload svgs with correct content-type
fixes: CNVS-22212

test plan:
* delete stuff on your s3 bucket
* compile assets and upload to s3
* go to the files section, the icons for folders 
  and documents and stuff (the svgs) should show 
  up correctly

Change-Id: Ic3bf717ffa1b8e2d42b7b0e0d569dacbab90d41d
Reviewed-on: https://gerrit.instructure.com/59470
Tested-by: Jenkins
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2015-07-29 16:58:01 +00:00
Derek Bender 29fb3b91bf add feature flag for moderated grading
close CNVS-21955

Change-Id: I948446a0a9bf177dcd7fd4a2ce990a50955981de
Reviewed-on: https://gerrit.instructure.com/59396
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2015-07-29 03:16:42 +00:00
Ryan Shaw 52254ecc7b Theme Editor: Fix threading issues in preview progress updates
fixes: CNVS-22185

Because the the update_progress callback from the 
upload_to_s3 callback was happening inside a 
Parallel.each thread, we'd get random errors where 
it ran out of active record postgres connections. 
eg:
ActiveRecord::ConnectionTimeoutError
could not obtain a database connection within 5 
seconds (waited 5.000153379 seconds). The max pool 
size is currently 5; consider increasing it.

the fix is to call the callback on the main thread so 
any db queries are happening from the normal rails thread.

also, this adds a progress bar so if you run this from 
the command line, you'll get a nice progress bar like 
https://files.slack.com/files-pri/T028ZAGUD-F0896CFR9/screen_shot_2015-07-28_at_10.19.36_am.png 
so that when deployers run the:
`rake brand_configs:generate_and_upload_all` 
task, which takes a long time, they have an idea 
of how long it is going to take

test plan:

note:this is something that only broke on beta and 
not on local machines so to test that this fixes it,
you kinda need to just run it there:

* open theme editor
* make a change
* hit preview
* it should not say there was an error

Change-Id: Ife052ab9573aa677d49d8e5e6c637b0faa2b116e
Reviewed-on: https://gerrit.instructure.com/59407
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Tested-by: Jenkins
Product-Review: Ryan Shaw <ryan@instructure.com>
2015-07-28 20:25:21 +00:00
Brad Horrocks ad0275bf09 LTI grade passback correctly handles 0 point complete/incomplete assignments
when an assignment is worth 0 points. A score of 1.0 will be marked
as complete and anything less than 1.0 will be marked incomplete

Fixes PLAT-1095

Test Plan:
You'll need an LTI tool that uses grade passback
Use the external tool on an assignment with complete/incomplete as
the grading type.
Set the total points for the assignment to 0.
Make sure you can get a grade of "complete" after taking the assignment.

Change-Id: I911d22ec93ed223b79855ffe2c69fc0c94fa56f9
Reviewed-on: https://gerrit.instructure.com/59268
Tested-by: Jenkins
Reviewed-by: Nathan Mills <nathanm@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Brad Horrocks <bhorrocks@instructure.com>
2015-07-28 17:54:18 +00:00
James Williams 2818ecdb1a catch URI::Error instead of URI::InvalidURIError
test plan:
* using "mailto:example@example.com," in a link should
 not break course copies (or anything else) because it
 doesn't know how to rescue a URI::InvalidComponentError

closes #CNVS-22120

Change-Id: Iaac362a5bf33cd5fde05b01a578a1325f4126c6e
Reviewed-on: https://gerrit.instructure.com/59213
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2015-07-28 02:17:49 +00:00
Ryan Shaw 5d165fe8c8 rename "CDN" ruby module to "Cdn"
...because apparently "it's preloading. for
autoloading, CDN will look for cdn or c_d_n.

then in prod mode, it's somewhat different. like
autoloading is disabled? and it just pre-requires
everything in the autoload dirs"


test plan:

run `RAILS_ENV=production bundle exec rake canvas:cdn:upload_to_s3`

it should work

Change-Id: I5deed1cc2b9daa678465b174af320cf1724fea8c
Reviewed-on: https://gerrit.instructure.com/59341
Reviewed-by: James Williams  <jamesw@instructure.com>
Tested-by: Jenkins
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2015-07-27 21:55:37 +00:00
Ryan Shaw 5408a67c0d tell browsers they can cache can assets for a year
test plan:
* first, clear out all the cdn assets on your test
s3 bucket by running this in rails console:
Canvas::CDN::S3Uploader.new.bucket.objects.with_prefix('dist').delete_all
* compile_assets
* run bundle exec rake canvas:cdn:upload_to_s3
* access canvas in your browser
* on js/css/image assets (like common-xxxxx.js)
  you should see a "max age 1 year" header

Change-Id: I7847e614a0e3066686bda32f8854263f78cc168f
Reviewed-on: https://gerrit.instructure.com/59184
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2015-07-27 21:55:28 +00:00
Ryan Shaw 0531e3e4f4 remove old uploadify code
full_files.js was the last thing to use this.
since it is gone, this can go too. 


test plan:

* think of anywhere you might know of that might
use uploadify, try it, make sure it works

Change-Id: I41dd7b806bbcee881a9624dd93ffb385dd53a454
Reviewed-on: https://gerrit.instructure.com/59181
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2015-07-27 21:55:10 +00:00
James Williams 600165e7b2 rails4: deprecate Relation#all in favor of Relation#to_a
refs #CNVS-21596

Change-Id: I5dedaab90a2abe6bf288ff30401c9b31629b45b2
Reviewed-on: https://gerrit.instructure.com/59220
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2015-07-24 21:28:14 +00:00
Michael Nomitch 32935feb80 fix broken includes on account courses endpoint
fixes CNVS-21483

test plan:
  - get "api/v1/accounts/:id/courses" with
    an include[]=section param
  - it is a success BUT does not return section info
  - the endpoint properly responds without
    the sections as well

Change-Id: Ib5c9939e7417f9907cbff35fb0132bc71107a44b
Reviewed-on: https://gerrit.instructure.com/58940
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Tested-by: Jenkins
Product-Review: Cosme Salazar <cosme@instructure.com>
2015-07-24 20:16:08 +00:00
James Williams d2f69ac342 rails4: create log directory if it doesn't exist
refs #CNVS-21596

Change-Id: Iceb2109201a8cd98054a808439fa09983c462b36
Reviewed-on: https://gerrit.instructure.com/59146
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2015-07-24 12:56:03 +00:00
Ryan Shaw e1358c12db gzip assets before uploading to s3
closes: CNVS-22056

test plan

* compile assets
* run: bundle exec rake canvas:cdn:upload_to_s3
* go to canvas in the browser, look at the network
  panel, things like common.js and css files
  should be transferred as gzipped (so common.js
  should not be 1.4mb)

this is also a great time to test the s3/cloudfront
settings that ops set up for us in OPS-1047, instead
of using the instructure_uploads_engineering bucket
and my own cloudfront distribution that you may
have been using. go to that ticket and take note
of the settings to use for testing/dev
and put them in config/canvas_cdn.yml

Change-Id: I9c1f8d6d9128554a38cd424b6e24947d7cd92208
Reviewed-on: https://gerrit.instructure.com/58975
Tested-by: Jenkins
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2015-07-22 17:15:18 +00:00
Cody Cutrer d7444ed437 accept 1/0 as true/false in API calls
Change-Id: I5db3edca3182119e32b36064d1854a736b03b741
Reviewed-on: https://gerrit.instructure.com/56738
Tested-by: Jenkins
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2015-07-22 15:08:20 +00:00
James Williams 5f9304f3e0 rails4: various api spec fixes
refs #CNVS-21596

Change-Id: Ib41c03782b1667d3876283fd99d8ccf7585e1fd6
Reviewed-on: https://gerrit.instructure.com/58651
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2015-07-21 15:44:32 +00:00
Ryan Shaw 59744dbcee move 'parallel' gem to the everything group
before, we only used 'parallel' in asset generation
tasks, now we do it in prod too.

Change-Id: I107b339330173894942ba35f133d7e9602906b7c
Reviewed-on: https://gerrit.instructure.com/58839
Tested-by: Rob Orton <rob@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2015-07-20 22:03:21 +00:00
Ryan Shaw 1ef15493e5 Create predeploy rake task to handle Theme Editor
closes: CNVS-21990

This is the rake task we call from a job server
once that has new code before restarting all the
app servers.  It will make sure that our s3 bucket
has all static assets including the css for custom
themes people have created in the Theme Editor

test plan:

* make sure you have an config/canvas_cdn.yml file
* `rm -rf public/dist`
* run `bundle exec rake brand_configs:generate_and_upload_all`
* in log/development.log you should see it write
  a _variables.scss file for each brand_config
  in any shard to disk, compile the css for each
  of those brands and push all the js/css/images/etc to s3
* browse pages in canvas, the css/images/js
  should be served from your "host:" configured
  in canvas_cdn.yml and none should 404

this change also includes:

better error message when brandable_css manifest doesn't exist

if the manifest file can't be found, this will
tell you the full path to the file it was looking
for so that if it can't find the manifest file,it
will tell you the path to the file it was looking for.

test plan:

with RAILS_ENV=production:

* rm -rf public/dist
* try to access a page

the error that it give you should tell you the
full path to the json file it tried to read.

if we haven't loaded rails yet, we still want
to look at RAILS_ENV to get which style of css
to generate

Change-Id: I2dbb12541d6a28e90a326a51f0cddb90f313842f
Reviewed-on: https://gerrit.instructure.com/58809
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Tested-by: Jenkins
Product-Review: Ryan Shaw <ryan@instructure.com>
2015-07-20 21:19:53 +00:00
Weston Dransfield ea903c6b84 Update Content-Item LtiLink types to LtiLinkItem
Fixes PLAT-1125

Test Plan
 - Add the example test tool (https://github.com/rivernate/lti_tool_provider_example)
   to a course using Editor Button, Link Selection, and Module Menu placements.
 - Add the tool as a module item. While adding make sure to add a new content item by pressing the green '+' in the modal that pops up.
   This content-item should 'Lti Link' set as the type.
 - Click on the tool module item and make sure the link works.
 - Using similar steps add the tool in the RCE and make sure the link works as expected.

Change-Id: I91681d6b6937467ef1aadf3029ccbfd566ba3a71
Reviewed-on: https://gerrit.instructure.com/57296
Reviewed-by: Brad Horrocks <bhorrocks@instructure.com>
Tested-by: Jenkins
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Weston Dransfield <wdransfield@instructure.com>
2015-07-20 20:49:13 +00:00
Jeremy Stanley 56a3f80dd1 find or create a group category for imported discussions
test plan:
* create a group discussion topic
* copy the discussion topic
* it should still have "This is a Group Discussion" marked
* it should have created/found a default group called
 "Project Groups" (i.e. the default name populated in
 the dialog if there are no other group sets)

fixes CNVS-21926

Change-Id: If88b0f5e461ab4a769f911e9d5e359fa3bbdd685
Reviewed-on: https://gerrit.instructure.com/58725
Tested-by: Jenkins
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2015-07-20 17:25:45 +00:00
Jacob Fugal 7398702378 don't perform mute/unmute side effects w/o change
fixes CNVS-21979

particularly, if an assignment is already unmuted, don't trigger "just
unmuted" broadcast events when "unmute!" is called

test-plan:
 - have your account configured to receive unmute notification
 - edit an unmuted assignment in a published course you're enrolled in
 - save it with the "Mute" checkbox still off
 - don't receive an unmute notification

Change-Id: I948b5f1b2176e574ecf43fcde187019d7eadb50d
Reviewed-on: https://gerrit.instructure.com/58788
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins
QA-Review: Ben Bolton <bbolton@instructure.com>
Product-Review: Matt Fairbourn <mfairbourn@instructure.com>
2015-07-19 02:26:34 +00:00
Cody Cutrer c472370223 use qualified table names in EXISTS subqueries
refs CNVS-21900

Change-Id: Ic49c570888ad8712d7ba93de632d952ddf2b53e1
Reviewed-on: https://gerrit.instructure.com/58629
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Jenkins
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2015-07-19 00:09:24 +00:00
Ryan Shaw 1e2d787cf9 show progress of them editor preview
closes: CNVS-21013

when the user hits 'preview' in the theme editor,
it fires off a delayed job to create the css files
and push them to s3. we need to show the user the
the progress of that job as it is working and
then reload the page when it is done.

I made a screencast to show how it should work and
what to look for:
http://screencast.com/t/x6EeOBiQT6d

test plan:

* go to the theme editor,
* make some changes (be sure to test both colors
  and images)
* press 'preview'
* notice the ProgressBar that comes up in a modal
* try exiting the theme editor, it should warn
  you if you have unsaved changes

Change-Id: I3f14beefba227b5ba23b33acf84e04542f48954e
Reviewed-on: https://gerrit.instructure.com/57626
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Jenkins
QA-Review: Adrian Foong <afoong@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2015-07-18 20:08:53 +00:00
Jacob Fugal fee02186e7 gracefully handle latex parse errors
fixes CNVS-21975

test-plan:
 - put some invalid latex in an equation image
 - save and load
 - should not be a page error
 - equation image's alt attribute should still have the unprocessed
   latex

Change-Id: I635a042c11d9344d05f89c9ae5cdb9aff75eea13
Reviewed-on: https://gerrit.instructure.com/58783
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Ben Bolton <bbolton@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins
2015-07-18 18:47:34 +00:00
James Williams 94d48c3bf0 rails4: fix user_list_spec and user_merge_spec
refs #CNVS-21596

Change-Id: I1231665cc40c039bf036a853579cebdb34cb8617
Reviewed-on: https://gerrit.instructure.com/58691
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2015-07-17 17:29:09 +00:00
John Corrigan ce2434d264 decouple assignments scope permission logic from api index
fixes CNVS-21384

- Adds ScopeFilter to facilitate conditionally stringing scopes
  together.
- Adds Assignments::ScopedToUser to encapsulate Assignments API index
  scope permission logic.

test plan:
- Regression testing on Assignments API endpoint.

Change-Id: I61b91c324bedb0729b0d38859e85702792206e92
Reviewed-on: https://gerrit.instructure.com/57510
Tested-by: Jenkins
Reviewed-by: Matt Berns <mberns@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: John Corrigan <jcorrigan@instructure.com>
2015-07-17 17:01:36 +00:00
Andrew Butterfield e6368a1828 Adds a custom param with css info for lti launch
fixes CNVS-21837

Test plan:
* Set up sis_app
  * If you don't have it already, clone sis_app from gerrit
  * Then pull down g/58166
  * Run bundle, rake db:migrate, grunt webpack:build
  * Start the server with rails s -p 9292
  * Create a Skyward Agent if you haven't already (there are a lot of
    steps with this so just ping me if you have trouble)
* Canvas
  * Delete any existing Skyward GPB LTI tool you have installed
  * Reinstall the Skyward GPB tool
* Verifications
  * Go to post grades
  * Open up the javascript console in the browser
  * Monitor network traffic
  * Click the Skyward LTI tool in the Post Grades
    drop down menu
  * In the network traffic look for /post_grades
  * Click on that request and look through the form data sent with the
    post request
  * Ensure that there is a url to the common.css stylesheet under the
    key: custom_common_css_url
  * Verify that the url listed under that key matches the url for the
    common.css stylesheet in the Canvas grades page

Change-Id: I48e0aa74d498770513bcfa08f95537b922096b05
Reviewed-on: https://gerrit.instructure.com/58167
Tested-by: Jenkins
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Reviewed-by: Mark Severson <markse@instructure.com>
Reviewed-by: Brad Humphrey <brad@instructure.com>
Product-Review: Brad Humphrey <brad@instructure.com>
QA-Review: Ben Bolton <bbolton@instructure.com>
Product-Review: Matthew Wheeler <mwheeler@instructure.com>
2015-07-17 15:58:06 +00:00
James Williams 038cbb4585 rails4: remove Relation#with_each_shard
in rails 4, apparently relations no longer retain
 their proxy_association.owner when they're merged
 into another non-association relation

better to use Relation#shard explicitly

refs #CNVS-21596

Change-Id: Iad34bbf626c17a3f0b1fc57ac685506199cc5f3d
Reviewed-on: https://gerrit.instructure.com/58151
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2015-07-17 12:31:15 +00:00
Ryan Shaw 87eba38b3e don't blow away the brandConfig someone else is working on
closes: CNVS-21804

this will also do a better job of cleaning up
the app/stylesheets/brandable_css_brands dir
(so when you compile sass, it won't do stuff
for brandConfigs that aren't being used anymore)

test plan:
open theme editor, make some changes, hit preview.
as a different user in a different browser,
open theme editor, make changes, press save.
now in the first window, try to hit save.
before it would break, now it will work

Change-Id: I094f737d35c854764a7c361bec4798b8a2203410
Reviewed-on: https://gerrit.instructure.com/58102
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
Product-Review: Jennifer Stern <jstern@instructure.com>
Tested-by: Jenkins
QA-Review: Nathan Rogowski <nathan@instructure.com>
2015-07-16 21:59:10 +00:00
Weston Dransfield 25243983e8 Fix $Canvas.module.id and $Canvas.moduleItem.id not coming through on LTI launches from assignments
Fixes PLAT-1116

Test Plan
 - Add a tool to a course that has the 'Assignment Selection' placement enabled
 - Edit the tool and in the 'custom fields' area add 'module_id=$Canvas.module.id' and 'module_item_id=$Canvas.moduleItem.id'
 - Create a new assignment with 'Submission Type' set to 'External Tool' and select the tool you just installed.
 - Go to the course modules page and add the new assignment to a module.
 - note the id of the module and the moduleItem (The module item id is passed as a get param when you click on the link).
 - Make sure the custom fields (module_id and module_item_id) have the expected values

Change-Id: Ibc6c6342cf3493b8c81382f460c1af3a365130c0
Reviewed-on: https://gerrit.instructure.com/57235
Tested-by: Jenkins
Reviewed-by: Nathan Mills <nathanm@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Weston Dransfield <wdransfield@instructure.com>
2015-07-16 19:37:50 +00:00
Ryan Shaw ddc0955bdf ensure node_modules are up-to-date for guard & compile_assets
this will do a check to make sure all the node_modules
from our package.json are up-to-date before
running rake canvas:compile_assets or guard

there have been a lot of devs lately that have
been tripped up not knowing what to do because
they needed to `npm install`

Change-Id: I7c9d0896a6d7611bf9d89672a96cb9505099fa2c
Reviewed-on: https://gerrit.instructure.com/58580
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2015-07-16 19:17:54 +00:00
Cody Cutrer 9e353116ce quote table names in joins
refs CNVS-21900

Change-Id: I260c8dbae3c4abd7fe436f2051e1cc852ef1675f
Reviewed-on: https://gerrit.instructure.com/58554
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2015-07-16 16:35:31 +00:00
Andrew Huff faa2dfd775 remove duplicate score display on individual view grade summary
fixes CNVS-20215

This fixes a bug with the individual view grade summary page
(/courses/:course_id/grades/:student_id#tab-assignments)

Previously, when a grade was marked "Display grade as: Letter Grade" or
"Display grade as: GPA scale", and the score earned on the assignment
was equal to the grade earned on the assignment (according to the
assignment's grading scheme) the amount of points earned would be shown
twice on the grade summary page.

For example, if a student earned 2 out of 3 points on an assignment,
which translates to a grade of "2.0" on that assignment's grading scale,
the entry for that assignment would be displayed as "2 2 (2.0)" instead
of "2 (2.0)"

See JIRA ticket CNVS-20215 for pictures.

Also, changes blank grade display in the gradebook history from '--' to
'-' for consistency

Test Plan:
* Create different assignments with different "Display Grade as"
settings (e.g. "points", "percentage", "gpa scale") and different
grading schemes, including at least one grading scheme where the grades
are numbers (e.g. replace "A", "A-", etc. in the default grading scheme
with "4.0", "3.7", etc.)
* Grade a student on these assignments
* Make sure that the score and grade displayed in the student's
grade summary page is displayed as expected for each assignment

* Test this from both the student view (including "What-If"
calculations) and the teacher view

Change-Id: I4a76c721d0dbb7d71f3c3db25970ce9533f61707
Reviewed-on: https://gerrit.instructure.com/55116
Tested-by: Jenkins
Reviewed-by: Cody Poll <cpoll@instructure.com>
QA-Review: Jason Carter <jcarter@instructure.com>
Product-Review: Christi Wruck
2015-07-16 16:31:07 +00:00
Ryan Shaw 008ada0076 make it so anyone can turn "New UI" on
closes: CNVS-21908

Because of the workflow and tooling some QA people
use, they could not test the new UI because they
had to run in "production" but their portals couldn't.

This also means that it is now visible by non site admins.
So schools can see it and turn it on on their own

Change-Id: Ib3a7a5d00ba3bc6a1680a1528898add81dc165f0
Reviewed-on: https://gerrit.instructure.com/56850
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Matt Fairbourn <mfairbourn@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
2015-07-16 16:17:29 +00:00
James Williams 85dac3b3fb preload "can_unpublish" values for modules
should improve performance when viewing as a course admin

test plan:
* modules index should work as before

refs #CNVS-21476 #CNVS-21317

Change-Id: I00ee7602a48bc78538e8034d562781059f6fabb8
Reviewed-on: https://gerrit.instructure.com/57276
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2015-07-15 22:08:06 +00:00
Matthew Wheeler 5d3a611316 Revert "Recurring Calendar Events"
This reverts commit d4f4f1a395.

Change-Id: I5b46d244f9c6adffdcf9e62a283825c93344fec4
Reviewed-on: https://gerrit.instructure.com/58522
Tested-by: Jenkins
Reviewed-by: Matthew Wheeler <mwheeler@instructure.com>
Product-Review: Matthew Wheeler <mwheeler@instructure.com>
Reviewed-by: Dan Minkevitch <dan@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
2015-07-15 21:55:23 +00:00
Rob Orton 71e065a35a validate that pseudonyms belong to root_accounts
fixes CNVS-21700

test plan
 - in rails console run

a = Account.default
u1 = User.create(name: 'test user1')
p1 = Pseudonym.create!(account: a, user: u1,unique_id: 'so_unique')
a2 = Account.create!(name: 'sub_account1')
u2 = User.create!(name: 'test user2')
p2 = Pseudonym.create!(account: a2, user: u2,unique_id: 'so_unique')
u3 = User.create(name: 'test user3')
p3 = Pseudonym.create!(account: a2, user: u3,unique_id: 'more_unique')
a2.parent_account_id = a2.root_account_id = a.id
a2.save!

p1.workflow_state # should = 'active'
u1.reload.workflow_state # should be 'pre_registered' or 'registered'
p2.reload #should be ActiveRecord::RecordNotFound: Couldn't find Pseudonym with id=x
u2.reload.workflow_state # should be 'deleted'
p3.reload.account_id # should be Account.default.id
u3.reload.workflow_state # should be 'pre_registered' or 'registered'

Change-Id: I298fb662716fae7d0ba806db6878959e38cec322
Reviewed-on: https://gerrit.instructure.com/57677
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2015-07-15 20:22:48 +00:00
Cameron Matheson d5284d03b1 gradebook csv: support excused assignments
closes CNVS-21267

Test plan:
  * excuse some assignments in a course
  * download the gradebook
  * excuse/unexcuse students in the gradebook
  * upload the gradebook

Change-Id: I624f48415f0be524da70d0ea41ccd6216e06ed68
Reviewed-on: https://gerrit.instructure.com/57158
QA-Review: Adam Stone <astone@instructure.com>
Tested-by: Jenkins
Reviewed-by: Spencer Olson <solson@instructure.com>
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
Product-Review: Josh Simpson <jsimpson@instructure.com>
2015-07-15 03:41:23 +00:00
Brad Humphrey ee21fa3373 allow enrollment csv to accept user_integration_id as an optional key for users
test plan:
	import an enrollment csv with user_integration_id instead of user_id

fixes SIS-1214

Change-Id: I233b64b82223d614c9d3b05466ad0fa1f8289f6f
Reviewed-on: https://gerrit.instructure.com/56654
Tested-by: Jenkins
QA-Review: Clare Strong <clare@instructure.com>
Reviewed-by: Ken Romney <kromney@instructure.com>
Product-Review: Brad Humphrey <brad@instructure.com>
2015-07-14 16:51:55 +00:00
Josh Simpson 35cc61e40d add excused assignment support to grading history
closes CNVS-21065
This commit accounts for excused assignments in the grading history.
Now, if an assignment has been excused, the grading history will
report 'EX', as opposed to a blank value.

Test plan
- Check grading history for both graded assignments and
excused assignments.
- They should reflect prior behavior, except for excused assignments,
which should be shown as an "EX" value.

Change-Id: I8f8cc2f2f807414ae063e176fae301cb9a7ea19a
Reviewed-on: https://gerrit.instructure.com/58284
Tested-by: Jenkins
Reviewed-by: Derek Bender <dbender@instructure.com>
QA-Review: Adrian Foong <afoong@instructure.com>
Product-Review: Josh Simpson <jsimpson@instructure.com>
2015-07-14 15:14:53 +00:00
Cody Cutrer fcd944d600 explicitly reference functions from extensions in their correct schema
fixes CNVS-21362

test plan:
 * make sure you have pg_collkey installed
 * test user search
 * it shouldn't asplode

Change-Id: I911d57ea950679b3e26390c140149c528eae0a2d
Reviewed-on: https://gerrit.instructure.com/56969
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2015-07-13 23:02:57 +00:00
Alex Boyd b84677d3f0 Only consider active group memberships when searching users
Fixes CNVS-15692

Test plan:
 - Create a course with a section
 - Create 3 students and enroll them in the course under the
   section you created
 - Create a teacher and enroll them in the course under that
   same section
 - On the course's "People" page, click the teacher's name, then
   limit them to viewing only students in their same section
 - Create a group set with two groups
 - Add student #1 to group #1 and students #2 and #3 to group #2
 - As the teacher, open the inbox, create a new message, choose to
   add all users in group #1 as recipients, and verify that only
   student #1 shows up
 - Choose to add all users in group #2 as recipients and verify
   that only students #2 and #3 show up
 - As an admin, move student #1 to group #2 and students #2 and #3
   to group #1
 - As the teacher, open the inbox, create a new message, choose to
   add all users in group #1 as recipients, and verify that only
   students #1 and #2 show up
 - Choose to add all users in group #2 as recipients and verify
   that only student #1 shows up

Change-Id: If8016fef727415cc8f590017f84a07c09c78c0eb
Reviewed-on: https://gerrit.instructure.com/57269
Tested-by: Jenkins
Reviewed-by: Joel Hough <joel@instructure.com>
QA-Review: Adrian Russell <arussell@instructure.com>
Product-Review: Alex Boyd <aboyd@instructure.com>
2015-07-13 15:40:10 +00:00
Ryan Shaw 99f5d21cbb fix brandable_css so it works when rails is not loaded
this will fix our gulp guard


test plan:
check out code
run `bundle exec guard`
hit enter
it should not throw an error

Change-Id: I01e5c82783039e542dfdb6f76f70a5a3232ee793
Reviewed-on: https://gerrit.instructure.com/57897
Tested-by: Jenkins
Reviewed-by: Chris Hart <chart@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2015-07-13 15:34:43 +00:00
James Williams 7376ce89e5 rails4: fix lti specs missing ims/lti dependency
refs #CNVS-21596

Change-Id: I8c11fdfc52566e9a5286d4ac53c66a6ac4ced32c
Reviewed-on: https://gerrit.instructure.com/57950
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2015-07-13 15:22:30 +00:00
James Williams 02d141abd2 rails4: remove dynamic matching overrides from modelcache
they were broken in rails4 because the original non-cached
method (e.g. "find_by_id") would define itself the first
time it went through the method_missing mess, undoing
all the ModelCache overrides

turns out we weren't using them anyway

refs #CNVS-21596

Change-Id: Ibd4b9c14f1312d2218420fde107ce6278d45c465
Reviewed-on: https://gerrit.instructure.com/57933
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2015-07-13 15:22:15 +00:00
Brandon Broschinsky eb216c52c7 peer reviews api
refs: PFS-2071, PFS-2072, PFS-2073, PFS-2074

**Test Plan
PFS-2071
1. Create course with assignment, teacher and two students
2. setup peer reviews on assignment
3. As student 1 create a submission
4. As student 2 peer review submission, leave comments
5. execute the following api courses/:course_id/assignments/:assignment_id/peer_reviews
6. As account admin all information should be shown
7. As teacher all information should be shown
8. As student should see all information
9. Repeat above but set anonymous peer reviews on assignment
10. As account admin all information should be shown
11. As teacher all information should be shown
12. As student should see comments but all reviewer
information should not be shown
13. include the following include parameters, include[]=submission_comments,
include[]=user make sure additional information is shown according to parameter.

PFS-2072
1. Follow setup from PFS-2071
2. execute a get on the following api
   /api/v1/courses/:course_id/assignments/:assignment_id/submissions/:submission_id/peer_reviews
3. validate that only peer reviews for the given submission are shown

PFS-2073
1. Follow setup from PFS-2071
2. execute a post on the following api, including a user_id parameter
   /api/v1/courses/:course_id/assignments/:assignment1_id/submissions/:submission_id/peer_reviews
3. validate that user from user_id parameter is added as a reviwer on the submission

PFS-2074
1. follow setup from PFS-2071
2. execute a delete on the following api, including a user_id parameter
   /api/v1/courses/:course_id/assignments/:assignment1_id/submissions/:submission_id/peer_reviews
3. validate that user from user_id parameter is removed as a reviewer on the submission

(cherry picked from commit 91744bbcd5a81be968139b1f68b65c3e9eaa7b4a)

Change-Id: Ic09a16956cddb2f113625ff61bc733503d713abb
Reviewed-on: https://gerrit.instructure.com/56936
Tested-by: Jenkins
QA-Review: Adam Stone <astone@instructure.com>
Reviewed-by: John Corrigan <jcorrigan@instructure.com>
Product-Review: Brandon Broschinsky <brandonbr@instructure.com>
2015-07-08 21:18:59 +00:00
Cameron Sutter 3196af04e4 Turn on DA for all accounts
closes CNVS-21601

test plan:
- Differentiated Assignments should be on for all courses in all accounts

Change-Id: I24142a2e8e20186c62de5ef8db909e13b87f44e6
Reviewed-on: https://gerrit.instructure.com/57502
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
QA-Review: Jason Carter <jcarter@instructure.com>
Product-Review: Cameron Sutter <csutter@instructure.com>
2015-07-08 19:04:40 +00:00
Brandon Broschinsky fdd9ad3ca7 add grading_standard_id to course object for api call
fixes: PFS-2181, PFS-2182

**test plan
1. execute an api to request to retrieve a course
2. validate that grading_standard_id is part of the result object
3. do validation with/without standard set
4. update/create a course via api, validate that
   grading_standard_id is included in response

Change-Id: Ia0a9a4945035b0b1291883b4db10bef98413ee52
Reviewed-on: https://gerrit.instructure.com/57678
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Pedro Fajardo <pfajardo@instructure.com>
Product-Review: Cosme Salazar <cosme@instructure.com>
2015-07-08 15:42:31 +00:00
James Williams b8238e5e91 rails4: use preload instead of includes for context associations
also random spec file tweak

refs #CNVS-21596

Change-Id: Ia009265af517e7902cd915b48eb8d08d75ee1d74
Reviewed-on: https://gerrit.instructure.com/57828
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2015-07-08 13:03:29 +00:00
Ryan Shaw 6d55178bf7 raise if dress_code had errors
I was running rake canvas:compile_assets
and dress_code was failing but it just continued on as if it was successful

Change-Id: I20e56e5228421b1d01a92ffefd0c56146fb18b35
Reviewed-on: https://gerrit.instructure.com/57556
Tested-by: Jenkins
Reviewed-by: Colleen Palmer <colleen@instructure.com>
Product-Review: Colleen Palmer <colleen@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2015-07-07 00:04:22 +00:00
Simon Williams ad4938f565 catch more errors for external feed failure
when I ran through the loop against canvas production data, I ran into
a couple additional errors.

fixes CNVS-21542

test plan:
- try adding an external feed to a port that doesn't exist, like
  localhost:9999
- add valid external feeds before and after that invalid one
- the valid feeds should still import, even though the invalid one will
  fail

Change-Id: I4d0ef178ce18b9675d5138f3800dc9109fc97499
Reviewed-on: https://gerrit.instructure.com/57310
Tested-by: Jenkins
Reviewed-by: Benjamin Porter <bporter@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2015-07-06 14:10:14 +00:00
Ryan Shaw 84a7192a36 A new way of doing css/sass & New Canvas Theme Editor
what this does:
* Changes the way we generate css so we are able to generate custom
  css for people that use the theme editor.
* Sets everything up so we can push all of our static assets
  (js, fonts, css, images, etc) to s3 pre-deploy and serve them
  from cloudfront. Yay! faster canvas for everyone!
* as part of that, this enables the rails asset pipeline just so we
  can use it to put md5s in our urls.  we don't use it for any of the
  coffeescript/sass/sprockets transformer stuff.
* adds a new "Theme editor" functionality (only for people that have
  have the use-new-styles feature flag turned on) where an admin for
  an account can pick their own colors/images for all the users
  at their account/school.
* when the user is done saving things in theme editor, it will,
  in a delayed job, generate all the css with against the variables
  that user specified and push it to s3 so it will be available to
  anyone else that requests it.  (the delayed job will shell
  out to a node.js executable called `brandable_css`).
* ability to pick an existing shared theme and to reset to
  blank theme. closes: CNVS-19685
* gets rid of jammit.

test plan:
(this is exaustive, so not every person has to do every step
but we should make sure at least someone does each of these things.
maybe as part of the review add a comment if you have done one of these
bulletpoints)

* before you check this out, compile all css and copy the
  public/stylsheets_compiled directory somewhere. after you check out
  this code and regenerate all the css. make sure there are no
  significant changes to the css output. (we updated the versions of
  node-sass and autoprefixer that we use so we want to make sure they
  don't change things in a way we weren't expecting)

* make sure the way we load css for handlebars templates still works.
  eg: if there is a handlebars template at
  app/views/jst/some/template.handlebars
  if there is also a scss file at
  app/stylesheets/jst/some/template.scss
  then that stylesheet should get loaded when that template is rendered

* check out the code and run migrations. browse around canvas,
  make sure css and js files load correctly as before.

* cody, jacob, or someone on queso: look at the db migrations and
  make sure everything looks good and that I am handling sharding
  correctly.
* verify that both rake canvas:compile_assets and guard, works as well
  as `node_modules/.bin/brandable_css` (note: if you have
  "node_modules/.bin" in your PATH (which you should), it will also
  work with just `brandable_css`)

* verify that passing the --watch option to
  `.bin/node_modules/brandable_css` works and picks up changes to
  sass files, images, fonts, or any other resource that goes into
  a css file. and that it only recompiles the css files that actually
  depend on that file.

* go to https://github.com/ryankshaw/brandable_css and check out the
  code there. that is what is actually doing the sass compiling

* create a config/canvas_cdn.yml file and add aws access creds and
  an s3 bucket and cdn hostname (for testing, you can use the credentials
  for instructure_uploads_engineering from
  https://gollum.instructure.com/OtherServiceTestAccounts ). for a test
  cdn hostname you can use https://diu0rq5m1weh1.cloudfront.net. that
  is a cloudfront bucket I set up on my personal account that points to
  instructure_uploads_engineering

* run rake canvas:compile_assets again, this time, at the end, you
  should see it run the assets:precompile task that puts md5s in filenames
  and, gzipps them, and copys them to public/assets.
  then you should see it run canvas:cdn:upload_to_s3
  (look at log/development.log for progress),
  which pushes everything to s3.
  closes: CNVS-17333 CNVS-17430 CNVS-17337

* try out the theme editor: turn on new styles, go to accounts/x
  (where x is the @domain root acount you are testing from) and click
  the "theme editor" button on the right side of the page.
  that should take you to a page that has the ability to pick colors/images
  on the left side and preview your changes in an iframe on the right
  closes: CNVS-19360 CNVS-20551

* test the "preview", "save", "reset", and "choose existing" functionality
  closes: CNVS-17339 CNVS-17338 CNVS-19685

* make sure that the themeeditor works both if you have
  config/canvas_cdn.yml set up and enabled as well as if you don't.
  if it is enabled, you should see it push the css for just that new
  brand config to s3 when you hit preview, and the css
  should be accessible from the cdn you configured.

Change-Id: Ie0a812d04f5eeb40e7df7e71941ff63ea51a4d22
Reviewed-on: https://gerrit.instructure.com/53873
Tested-by: Jenkins
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2015-07-02 22:42:18 +00:00
Derek Bender bbbb9b1e54 use more robust require_dependency
per cody cutrer's request.

Change-Id: Ifb9b9a7ad6084fcc40b0f0bbfd0d99febc05ca9e
ref: CNVS-21552
Reviewed-on: https://gerrit.instructure.com/57607
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Derek Bender <dbender@instructure.com>
QA-Review: Adrian Foong <afoong@instructure.com>
2015-07-02 20:17:35 +00:00
James Williams 429108fb38 performance improvements for enrollments and state_based_on_date
test plan:
* regression test enrollment dates and
 the course/account settings to restrict students
 to from viewing past and future courses

closes #CNVS-21602

Change-Id: Ifc2fd8f6fd279839bd8ba520442e2c0b9cc91da6
Reviewed-on: https://gerrit.instructure.com/57535
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2015-07-02 15:51:16 +00:00
Derek Bender 1d732eb542 fix spring reloader on DraftStateValidations
previously, when using `bin/spring`, often the error
`Expected <snip>/lib/canvas/draft_state_validations.rb to define
Canvas::DraftStateValidations` would come up when modifying application
code (not spec code). The only away around this problem would be to issues
a `bin/spring stop` command. The problem appears to be a Rails loading
convention that canvas wasn't respecting so this commit attempts to
correct this issue so that spring no longer blows up on a regular basis.

Change-Id: Icd44f4dceb75dc965f0c9a50b500f505c82cd15b
Fixes: CNVS-21552
Reviewed-on: https://gerrit.instructure.com/57319
Tested-by: Jenkins
Reviewed-by: Dylan Ross <dross@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
Product-Review: Derek Bender <dbender@instructure.com>
QA-Review: Adrian Foong <afoong@instructure.com>
2015-07-02 15:27:37 +00:00
James Williams 8954acbd5a include course name in sis integration api
refs #SIS-1124

Change-Id: I82d37139c80115856c3f4511ab884aa8dda7d8cc
Reviewed-on: https://gerrit.instructure.com/57378
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2015-07-01 22:44:44 +00:00
James Williams 6a3c885d92 rails4: rename Notification.all to all_cached
'all' is a scope in rails 4 that 'where' and
 other methods delegate to

refs #CNVS-21596

Change-Id: I62bb115fa7158438937d1ee54c83b2e0fb17eba1
Reviewed-on: https://gerrit.instructure.com/57441
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2015-07-01 17:23:22 +00:00
Dan Minkevitch c8021284fb Hide "OR" module progression feature flag
Was hidden in prod, now hidden in beta.

Change-Id: Ie04bd5034faa1c7b37ce68f09d41d77d0870e7bf
Reviewed-on: https://gerrit.instructure.com/57448
Reviewed-by: James Williams  <jamesw@instructure.com>
Tested-by: Jenkins
Product-Review: Dan Minkevitch <dan@instructure.com>
QA-Review: Dan Minkevitch <dan@instructure.com>
2015-06-30 17:05:24 +00:00
James Williams eab9eea95f misc improvements for assignments, calendar events and modules
test plan:
* syllabus should work as before
* modules loading of assignment due dates should work
 as before
* assignments api should work as before

refs #CNVS-21476 #CNVS-21317

Change-Id: Iba183d6fda604acb29e9685f0f32be74ad27b898
Reviewed-on: https://gerrit.instructure.com/57215
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2015-06-29 15:45:27 +00:00
Mark Severson edbae2ad67 add sis assignments api with related details
test plan:
 * activate the api one of the following ways:
   * install a post_grades lti tool
   * enable the bulk_sis_grade_export feature
 * GET /api/sis/accounts/:account_id/assignments
   * published assignment details for the account should be returned
   * results should be paginated
 * GET /api/sis/courses/:course_id/assignments
   * published assignment details for the course should be returned
   * results should be paginated

closes CNVS-20944

Change-Id: Iab5d9ac03d9aa29cad3ebdf74e4f48eb14c4a709
Reviewed-on: https://gerrit.instructure.com/56653
Tested-by: Jenkins
Reviewed-by: Andrew Butterfield <abutterfield@instructure.com>
QA-Review: Derek Hansen <dhansen@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Mark Severson <markse@instructure.com>
2015-06-27 06:04:57 +00:00
Stephen Jensen d7c1191ba6 Changed "Use New Styles" label and corresponding description
closes CNVS-21036

Test Plan
- As admin go to Settings and find the new styles flag
- Instead of "Use New Styles" the label should now say "New UI"
- The dropdown description should say "This enables an updated
navigation, new dashboard and a simpler, more modern look and feel."

Change-Id: I92cc5a9a4f28bc23f638500cfbbc280550858b47
Reviewed-on: https://gerrit.instructure.com/57000
Tested-by: Jenkins
Reviewed-by: Chris Hart <chart@instructure.com>
Product-Review: Chris Hart <chart@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
2015-06-26 22:26:39 +00:00
James Williams 591d0c2551 improve context modules index performance
test plan:
* modules index should behave as before

refs #CNVS-20706 #CNVS-21317

Change-Id: Iaf51ec861adb0f0189d30aa0c29f3c2e94159d62
Reviewed-on: https://gerrit.instructure.com/57179
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2015-06-26 18:25:09 +00:00
Dan Minkevitch d4f4f1a395 Recurring Calendar Events
Adds recurring calendar events feature.

closes CNVS-19381

Test Plan:
* As a teacher, go to the Calendar
* Click the "+" (Create New Event) button
* Add some event details, then check the "Repeat"
  checkbox
* Additional fields should appear regarding repeat
  information
* Change the repeat fields, then save the event
* The event should create, then the calendar should
  reload and show the duplicated events

Change-Id: I2923721edb773bbe0c7b228554b21389ea0ea153
Reviewed-on: https://gerrit.instructure.com/51976
Tested-by: Jenkins
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Cosme Salazar <cosme@instructure.com>
2015-06-26 16:03:22 +00:00
Weston Dransfield e866f1b95b Add support for localized LTI tool labels
Fixes PLAT-1117

Test Plan:
  - Check https://instructure.atlassian.net/browse/PLAT-1117 for details on how this change should work
  - Check to make sure each of the following placements works like the description of PLAT-1117 outines
   - user_navigation
   - course_navigation
   - account_navigation
   - course_home_sub_navigation
   - course_settings_sub_navigation
   - global_navigation
   - assignment_menu
   - file_menu
   - discussion_topic_menu
   - module_menu
   - quiz_menu
   - wiki_page_menu
   - migration_selection
   - link_selection
   - assignment_selectino
   - editor_button

Change-Id: Ib56d4c8c386975dcb86d79267cf2e69949146066
Reviewed-on: https://gerrit.instructure.com/56467
Reviewed-by: Nathan Mills <nathanm@instructure.com>
Tested-by: Jenkins
QA-Review: August Thornton <august@instructure.com>
Product-Review: Weston Dransfield <wdransfield@instructure.com>
2015-06-26 14:00:20 +00:00
Ethan Vizitei e85ae442d2 pick sis pseudonym reliably
closes CNVS-15282

Previously for users that have multiple pseudonyms,
the "sis_pseudonym" might be selected differently depending
on whether the pseudonyms collection was already loaded or not
because no specific order clause was given.  This patchset
makes it so that all sis pseudonym selection strategies
order the data set the same way (by "unique id") so that
you can count on getting a deterministic result.

Also, user.rb is huge, so I took the opportunity to split out a
SisPsuedonym class.  There may be room to move more
functionality into it later liked deciding what pseudonym to
fall back to in cases where the current strategy finds
nothing, but this is a good first step.  I switched all the use
cases I could find of the old interface on user.rb, but left the
method in place for now in case other plugins or extensions make use of
it.  We can wait a while and let the deprecation warnings take effect
before removing it.

TEST PLAN:
 1) download a gradebook csv export for a course
 2) make sure the SIS Login ID is the same as the secondary
   ID for each user that you see in the gradebook view itself.

Change-Id: Ib18b40acbaf3a8f4352fd6ee8e0826897e3edf49
Reviewed-on: https://gerrit.instructure.com/57001
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: August Thornton <august@instructure.com>
2015-06-25 22:18:14 +00:00
Cody Poll 37d64e9822 Deleted upload submissions no longer download
When zipping assignment submissions for download, deleted files should not be
added to the zip.

fixes CNVS-12167

There is an edge case that is covered - that of a small course where maybe 1 or
2 submissions may exist, and the file for each has been deleted. By marking
success if the file is deleted, we keep it from erroring out, and will download
an empty zip. Jenkins shows no regressions for this, so we should be good.

Test Plan:
  A: As a teacher:
    1. Create a file-upload assignment as a teacher
  B: As a student:
    1. Submit a file upload for the assignment
    2. Delete the upload (/users/:user_id/files)
  C: As a teacher:
    1. View the students submission in speed-grader
    2. Click download icon
    3. Verify that a page not found error is displayed
    4. Return to assignment page
    5. Click "Download Submissions"
    6. Verify that the zip file downloaded
    7. Double-click on zip file
    8. Verify that the resulting file does not contain the deleted file
       The resulting file may simply be a .cfgz or similar file. This signifies
       an empty zip file in this case.

Change-Id: I6344cadb92d4e13bd23ade4c4e34111751bcecd1
Reviewed-on: https://gerrit.instructure.com/53574
Tested-by: Jenkins
Reviewed-by: Strand McCutchen <smccutchen@instructure.com>
QA-Review: Adrian Foong <afoong@instructure.com>
Product-Review: Cody Poll <cpoll@instructure.com>
2015-06-25 16:19:01 +00:00
Spencer Olson 0d0ca444f1 show green banner on successful gradebook upload
when a gradebook is successfully uploaded, a
green success banner will show.

closes CNVS-20359

test plan:
import a Gradebook CSV (with changes made to scores).
verify that after the gradebook is done uploading,
you are redirected to the Gradebook and there is a
green banner at the top of the page that says
'Upload successful'. refresh the page and verify that
a green banner does _not_ appear with the success
message.

Change-Id: I29346498a3c1ae7158e7ac2f11de3f7ca5b8d806
Reviewed-on: https://gerrit.instructure.com/57062
Tested-by: Jenkins
Reviewed-by: Cody Poll <cpoll@instructure.com>
QA-Review: Derek Hansen <dhansen@instructure.com>
Product-Review: Spencer Olson <solson@instructure.com>
2015-06-25 16:18:27 +00:00
Spencer Olson 19cfec5a3b unhide multiple grading periods feature flag in prod
closes CNVS-21424

Change-Id: I3fa65e3f74ba706f4b551ce7c2946e7657c3a299
Reviewed-on: https://gerrit.instructure.com/57079
Reviewed-by: Derek Bender <dbender@instructure.com>
Tested-by: Jenkins
Reviewed-by: Cameron Matheson <cameron@instructure.com>
QA-Review: Robert Lamb <rlamb@instructure.com>
Product-Review: Matt Fairbourn <mfairbourn@instructure.com>
2015-06-24 19:48:24 +00:00
Clay Diffrient e920f246ba Changes Course Catalog feature flag to Public Course Index
fixes CNVS-21139

Test Plan:
  - Go to the feature flags
  - Course Catalog should now be Public Course Index

Change-Id: Icdced7ef68a279f9d8e9fedd5ba3b9feb60f04ae
Reviewed-on: https://gerrit.instructure.com/57058
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: Cosme Salazar <cosme@instructure.com>
2015-06-24 17:14:39 +00:00
James Williams a291a5b560 fix sis csv utf-8 chunking errors
test plan:
* import a sis csv file longer than 4096 bytes with utf8 characters
 split at the 4096 byte point
* should not fail with "Invalid utf-8 error"

closes #CNVS-20678

Change-Id: I642f24391bfaed48e16130989710056664ab4fd5
Reviewed-on: https://gerrit.instructure.com/56918
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2015-06-24 12:45:48 +00:00
Ethan Vizitei 21a728f05c setup a generalized way to leave out errors from sentry reporting
refs CNVS-20836

Once this is merged, plugins or extensions can
register their own exceptions if they don't
want them broadcast to sentry for whatever reason
(there are some job failures that are a good candidate
for this)

Change-Id: Ic3bceb8185a92479166ec55c8c6c66dacf259f5a
Reviewed-on: https://gerrit.instructure.com/55678
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2015-06-23 22:41:26 +00:00
James Williams c63f0b946c improve module item file selector performance
test plan:
* selecting files as module items should still work
 as before (but loading from API should be more performant
on back-end)

refs #CNVS-20049

Change-Id: Icb4114651c1fc614192217aabcd699d20988f537
Reviewed-on: https://gerrit.instructure.com/56705
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Reviewed-by: Dan Minkevitch <dan@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2015-06-23 12:46:07 +00:00
Ethan Vizitei 00ab03214a don't die when trying to report exceptional exits for job queue
Change-Id: Ifd940fab1090ce71eb2bc6fcffe5a660fe60f054
Reviewed-on: https://gerrit.instructure.com/56740
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
2015-06-22 19:57:36 +00:00
Simon Williams 2acf92b81d don't send external feed fetch errors to sentry
we already handle external feed errors by incrementing a counter of
consecutive failures and only continuing to poll feeds with
< 5 consecutive errors.

fixes CNVS-20369

test plan:
- basic regression test of external feed functionality

Change-Id: I8d41729a4321bdacbb7ffa8a58495a1cafc0de48
Reviewed-on: https://gerrit.instructure.com/53833
Tested-by: Jenkins
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Adam Stone <astone@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2015-06-22 17:20:55 +00:00
Cody Poll 43dfc9c10a GradebookImporter ignores readonly stuff
fixes CNVS-18853

When a gradebook with a custom grading scheme was exported, some extra readonly
columns are inserted. When imported, the importer did not check for
readonly-ness, and so these columns that shouldn't have been looked at were
construed as extra assignments.

After this commit, those extra columns should no longer be considered
assignments, but should be left alone.

Test plan:
  1. In a course without a custom grading scheme, export grades.
  2. Without changing anything, import the exported CSV.
  3. Verify that nothing has changed.
  4. Enable a custom grading scheme.
  5. Export the gradebook again.
  6. Import the new gradebook CSV.
  7. Verify again that nothing has changed.

Change-Id: I4b43cfd8ef390a4dc6e5393f243f1b98e922cd4a
Reviewed-on: https://gerrit.instructure.com/54882
Tested-by: Jenkins
Reviewed-by: Cameron Matheson <cameron@instructure.com>
QA-Review: Adrian Foong <afoong@instructure.com>
Product-Review: Cody Poll <cpoll@instructure.com>
2015-06-18 21:52:03 +00:00
James Williams 5067afc590 improve performance of needs_grading_count in course_json
test plan:
* regression test 'needs_grading_count' includes in
 course index api calls

closes #CNVS-21156

Change-Id: Ic20704ec3704ed9e8230ad424cad2e5e92fccb68
Reviewed-on: https://gerrit.instructure.com/56465
Tested-by: Jenkins
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2015-06-17 19:38:43 +00:00
Clay Diffrient 22aa53007d Adds feature flag for new folder tree
Should I use BambooTree or not?

closes CNVS-21099

Test Plan:
  - Not much to QA here.

Change-Id: Ice5769c119b0f533a51cf2712acef34a2727c41a
Reviewed-on: https://gerrit.instructure.com/56456
Tested-by: Jenkins
Reviewed-by: Sterling Cobb <sterling@instructure.com>
QA-Review: Sterling Cobb <sterling@instructure.com>
Product-Review: Sterling Cobb <sterling@instructure.com>
2015-06-17 19:23:29 +00:00
James Williams 8436ddc8de ensure course_copy_worker runs on local shard
closes #CNVS-21273

Change-Id: I3513e08cd63647a402f54bb0c77f7e090d17e279
Reviewed-on: https://gerrit.instructure.com/56659
Tested-by: Jenkins
Reviewed-by: Dan Minkevitch <dan@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2015-06-17 17:21:07 +00:00
Clay Diffrient 7cbd0ff8dd Merge branch 'sfu-fix-inbox-display_name'
Change-Id: I47346088383f051ed023e29fc28484c85c67522f
2015-06-17 09:35:46 -06:00
James Williams 91646b65eb imported link refactoring
test plan:
* regression test links within copied content

* should also fix a pre-existing bug where
 links to content within assessment/quiz questions
 were not being copied

closes #CNVS-20890 #CNVS-20740

Change-Id: I1d1b89faba468690eaddaa1e29cd2936c807cc60
Reviewed-on: https://gerrit.instructure.com/55830
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Michael Hargiss <mhargiss@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2015-06-16 20:04:32 +00:00
Cody Cutrer 3c44f4f6e7 use prepend instead of alias_method_chain in SisStickiness
makes it play nicer with other modules that hook reload

Change-Id: Ic0905d419a10df29b13afb5e428b96ecd76379a3
Reviewed-on: https://gerrit.instructure.com/56519
Tested-by: Jenkins
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2015-06-16 19:54:30 +00:00
Dan Minkevitch 4048f15b52 Adds NC "OR" feature flag
closes CNVS-21208

Change-Id: I888a5f0cc3f6a8a4ba9e4e2eb82c3a9f724d74b3
Reviewed-on: https://gerrit.instructure.com/56484
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Dan Minkevitch <dan@instructure.com>
2015-06-16 19:54:10 +00:00
Andrew Leung 87ef5672ad Make Inbox/Conversations show display name
Inbox started showing full names since this commit:

  7137d14d21

Test plan:
  * Go to Inbox
  * Verify that display names are used in existing conversations
  * Open the recipient finder
  * Verify that search results are display names

Change-Id: I47346088383f051ed023e29fc28484c85c67522f
2015-06-16 11:46:57 -06:00
Clay Diffrient 336f5192d5 Adds is_favorite include option for course list
Makes it so that if you include 'favorites' as part of the include
query parameter, it will include a is_favorite option on each
course to let you know if the user has favorited that course.

closes CNVS-19479

Test Plan:
  - Make sure you have one or two courses favorited.
  - Go to /api/v1/courses?include[]=favorites
  - The JSON result that comes back should include 'is_favorite'
    for each course.
  - Courses that have been favorited should have this value set
    to true otherwise they should be false.

Change-Id: Iba49bbc66839a03e66fe26ce3d475678ff4c4232
Reviewed-on: https://gerrit.instructure.com/56375
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins
QA-Review: Michael Hargiss <mhargiss@instructure.com>
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
2015-06-16 17:09:25 +00:00
Ryan Shaw 1a58bc5a8d mark "use_new_styles" as in "development"
...so it is impossible to turn on in production.
With this set, you can only turn it on in
development / test / beta instances. Even though
it is already marked "beta", without this, a csm
could technically still turn it on for a customer
even though we clearly told them not to.

closes: CNVS-21233

Change-Id: Icb86594d052effde1abdc8d5e3732375b801cb27
Reviewed-on: https://gerrit.instructure.com/56433
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Tested-by: Jenkins
2015-06-16 17:02:19 +00:00
Cody Cutrer e5e6c8b2ee avoid raw sql updates in several places
refs CNVS-20933

Change-Id: I0e742eecf103ee0bb984fb74a7efe649c7e27df5
Reviewed-on: https://gerrit.instructure.com/56368
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
Tested-by: Jenkins
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2015-06-16 16:14:48 +00:00
Ethan Vizitei 93c612b822 fix auth selector for AACs
closes CNVS-21177

Turns the auth type selector into a react component
and makes sure it responds correctly in a couple
corner cases (with specs!)

TEST PLAN:

1) go to the authentication providers config page
2) add several authentication providers
3) you should always be scrolled down to your new
  form when you add a new one

Change-Id: Ia520ee358dbc8a469e29e13fcd653cf11f9259b3
Reviewed-on: https://gerrit.instructure.com/56377
Tested-by: Jenkins
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2015-06-16 15:49:24 +00:00
James Williams 1cab777234 add media_tracks.xml reference to exported imsmanifest
closes #CNVS-21152

Change-Id: If04697596a2e8fe3a05e26c16907b2c50149cd68
Reviewed-on: https://gerrit.instructure.com/56403
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2015-06-15 15:03:39 +00:00
Jonathan Featherstone 35688f6f2a Added Grade passback LTI UI
Added necessary UI code to allow LTI based grade passback.
UI allows for side-by-side launch of powerschool app
as well as LTI based. LTI based tools are launched within an iframe
in a new dialog.

Test Plan
  * configure powerschool grade posting by enabling sis feature flag
    * /accounts/:id/settings
      * "post grades to sis" -> on
    * /courses/:id/settings
      * SIS ID -> random number
  * add an assignment, make sure that "post grades to sis" is checked
  * navigate to gradebook, verify that "post grades" button is visible
  * verify that "post grades" button is not visible when no
    assignments are present
  * click on button and verify that current powerschool modal launches
  * add sisapp lti launch
    * get local sisapp running
    * /accounts/1/settings/configurations
    * add app, by url http://<local sisapp>/post_grades/config.xml
  * navigate to gradebook, verify that both powerschool post and new lti
    post are available in drop down menu
  * test for #successability

  Additional considerations:
  Drop down menu supports up to 10 post grades configurations. Add
  multiple sisapp endpoint to view ellipsis record indicating that no
  more configurations will be displayed

closes CNVS-20529

Change-Id: I988eb55555027903b6dab0692ce8514569a81345
Reviewed-on: https://gerrit.instructure.com/55384
Tested-by: Jenkins
Reviewed-by: Mark Severson <markse@instructure.com>
QA-Review: Derek Hansen <dhansen@instructure.com>
Product-Review: Jonathan Featherstone <jfeatherstone@instructure.com>
2015-06-12 19:07:37 +00:00
Andrew Huff 92986abd05 grade history tracks when the grade is changed to nil
fixes CNVS-8383

- wrote specs to demonstrate the correct behavior
- removed an unecessary `next`

test plan:
1) Create an assignment
2) Grade the assignment to anything, that is, "4"
3) Grade the assignment again, that is, "6"
4) Grade the assignment with blank, that is, " "
5) Go to the gradebook history (/courses/:id/gradebook/history)
6) Verify that the assignment submission's most recent change
	has the following values:
	Before: "6"
	After: "--"
	Current: "--"

Change-Id: Id357009ac7f6747f765e04c62fdf7fc0f5aad7f4
Reviewed-on: https://gerrit.instructure.com/55834
Tested-by: Jenkins
Reviewed-by: Cody Poll <cpoll@instructure.com>
QA-Review: Adrian Foong <afoong@instructure.com>
Product-Review: Josh Simpson <jsimpson@instructure.com>
2015-06-12 17:13:37 +00:00
James Williams 7fb0ccce3e allow course admins to view all files for soft-concluded courses
test plan:
* create a course with an unpublished folder and file
* add a teacher to the course
* in the term, set the concluded date for teachers
 to the past (putting the course in read-only mode)
* the teacher should still be able to see the
 unpublished folder and file

closes #CNVS-21008

Change-Id: Ia5f38d72869f152ceb0667d599ebb51db6c3b186
Reviewed-on: https://gerrit.instructure.com/56194
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2015-06-12 16:57:43 +00:00
Ethan Vizitei be832e9da1 make mathml work in all tinymce areas
closes CNVS-20200

first, takes the mathml translation we already know how to do
and stuffs that in a data element on equation images

second, extract mathml from data attribute and inject as a
screenreader span to make the mathml consumable.

I also reworked the "convertApiUserContent" coffee function to
be a little more broken up and individually testable (and
added specs for it), and made sure not to do this transformation
when editing (as that would start a content update loop where
we add content on every save/edit cycle)

TEST PLAN:
 For each of the following places, make sure you can save
  an equation image in the tinymce editor and get MATHML for
  screeenreaders in the output:

  Announcement reply
  Discussion reply
  Wiki Page body
  Outcome description
  Quiz essay answer text
  ePortfolio page edit

Regression test mathml generation in other tinymce areas (which were
already producing it)

Change-Id: Icc769dc92e799563133d47c8dda8ea84fde034eb
Reviewed-on: https://gerrit.instructure.com/56029
Tested-by: Jenkins
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2015-06-11 22:52:58 +00:00
Cody Cutrer 1a8bab0952 fix fragile gradebook history code
in specs, graded_at.to_i may be the same between versions; just rely on the sorting from the db

Change-Id: I8385ff3a6096415b26ecabc9ff879f290a97f234
Reviewed-on: https://gerrit.instructure.com/56237
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2015-06-11 22:51:44 +00:00
Mark Severson b4f4b67b92 allow the app display type to be overridden
test plan:
 * navigate to the /{context}s/:context_id/external_tools/:id endpoint
   * where context is an account or course
 * the app/tool should launch correctly
 * provide a ?display=borderless query parameter
 * the app/tool should launch correctly as a borderless launch

refs CNVS-20529

Change-Id: I0ed76a1952811c99a0452943339ffd2608b57027
Reviewed-on: https://gerrit.instructure.com/56177
Reviewed-by: Brad Humphrey <brad@instructure.com>
Tested-by: Jenkins
QA-Review: Derek Hansen <dhansen@instructure.com>
Product-Review: Mark Severson <markse@instructure.com>
2015-06-11 20:29:26 +00:00
Cody Cutrer d52669be47 use include so that a plugin can easily autoextend
Change-Id: I3f7856634cf95b928768bbb4d4be4e6837ecfd6d
Reviewed-on: https://gerrit.instructure.com/56043
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2015-06-11 15:52:21 +00:00
Tyson Brown d71945faad Register Parents and Add Observees when configured for SAML
authentication

Fixes PFS-1084

Parent Registration:
When a Saml config is designated for Parent Registration the parent
signing up will be redirected to a Saml login page where they will log
in with their child's credentials.  After login the child user's
Saml session will be ended and the parent registration process will complete.

Parent Adding Student:
When a Saml config is designated for Parent Registration the parent
adding another observee will be redirected to a Saml login page
where they will log in with their child's credentials.  After login the child user's
Saml session will be ended and the observee creation process
will complete.

---------------------------------------
TEST PLAN:
SETUP:
1) In your account settings check the box for 'Self Registration' (and
either of the sub-options)

2) Add the following users to your account (these will be the students):
billyjoel
eltonjohn

3) In Authentication Settings add a SAML authentication service
and enter the following fields (I've set up a remote SAML Idp):

IdP Entity ID:  http://107.170.212.143/saml2/idp/metadata.php
Log On URL:  http://107.170.212.143/simplesaml/saml2/idp/SSOService.php
Log Out URL:
http://107.170.212.143/simplesaml/saml2/idp/SingleLogoutService.php
Certificate Fingerprint:
9C:11:68:93:95:CD:18:01:EC:52:2B:9E:22:7F:73:55:ED:6D:82:D4
Parent Registration:  check

TEST:
Parent Registration:
* Go to '/login/canvas'
* Click on the signup banner
* sign up as a parent for billyjoel or eltonjohn
  (on SAML login page the password for either user is: tantrum)

Add Student:
* Log in as a parent user w/ a Canvas Auth login
* Go to '/profile/observees'
* Add Student 'billyjoel' or 'eltonjohn'

Authentication Settings (new parent reg checkbox):
* Go to Authentication Settings
* Add a second SAML config
* check the parent registration checkbox
  - it should warn that selection will deselect the other
    and in fact do so upon save.
  - the selected config is the one used for
    parent reg/add student
---------------------------------------

Change-Id: Ief83b604fc252c88dbb912c56de65d8620fe802f
Reviewed-on: https://gerrit.instructure.com/49691
Tested-by: Jenkins
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2015-06-11 15:25:19 +00:00
Cody Cutrer 5d7d31eebf fix some boot up issues when the db isn't set up yet
with spring and preloading, this code can be hit before the db exists

Change-Id: I0f0efbb96ba5cbc0c2461a84ab823a14dbb38f74
Reviewed-on: https://gerrit.instructure.com/55942
Tested-by: Jenkins
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2015-06-11 15:16:38 +00:00
Cody Cutrer 43ab37b7db remove some duplicate hash keys
Change-Id: I19a2afcfbbd40e5c3ab638384f84e4b9ad907f41
Reviewed-on: https://gerrit.instructure.com/56174
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2015-06-11 14:47:45 +00:00
Cameron Matheson 82a625684a assignments api: properly unmute assignments
fixes CNVS-20141

Test plan:
  * using the API:
    * mute an assignment
    * leave comments for a student
      - those comments should not be visible to the student
    * unmute the assignment
      - now the comments should be visible

Change-Id: Ieea8625c3e8456677e85ea71fd46380d71030f94
Reviewed-on: https://gerrit.instructure.com/55928
Tested-by: Jenkins
Reviewed-by: Cody Poll <cpoll@instructure.com>
QA-Review: Michael Hargiss <mhargiss@instructure.com>
Product-Review: Josh Simpson <jsimpson@instructure.com>
2015-06-10 22:18:59 +00:00
Brian Finney 8a2f143b4d Fix missed quiz_questions affected by CNVS-19292
If migration 20150506164227 was previously ran automatically it would
not have missed any records.
If migration 20150506164227 was previously skipped and
DataFixup::FixCorruptAssessmentQuestionsFromCnvs19292 was ran manually
as below, then it could have missed some records. Rerun to fix any missed
records.
If migration 20150506164227 has not previously been run, the below will
no longer miss any records.

rails console
  DataFixup::FixCorruptAssessmentQuestionsFromCnvs19292.run(
    [
      'calculated_question',
      'numerical_question',
      'matching_question',
      'multiple_dropdowns_question'
    ],
    Date.parse('2015/3/14').beginning_of_day, # Beginning of corruption
    Date.parse('2015/3/18').end_of_day        # End of corruption
  )

Fixes CNVS-20704
Change-Id: Idef1cc00c1713753563e63889b63241051b0d416
Reviewed-on: https://gerrit.instructure.com/55489
Tested-by: Jenkins
Reviewed-by: Ryan Taylor <rtaylor@instructure.com>
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Cameron Sutter <csutter@instructure.com>
Product-Review: Brian Finney <bfinney@instructure.com>
QA-Review: Brian Finney <bfinney@instructure.com>
2015-06-10 18:03:32 +00:00
Cody Cutrer a91fa7d440 handle UTF-16 error on ruby 2.2
Change-Id: I4fff1e2963d2a5eb3d544b546b2eada0f4b106b2
Reviewed-on: https://gerrit.instructure.com/56058
Tested-by: Jenkins
Reviewed-by: James Williams  <jamesw@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2015-06-10 14:34:42 +00:00