Commit Graph

603 Commits

Author SHA1 Message Date
Cody Cutrer 9bf7304917 use preload instead of include on associations
refs CNVS-21901

also got rid of some useless associations

Change-Id: I13e012e0ec755443fbed12ca0629c53a9c693f43
Reviewed-on: https://gerrit.instructure.com/62217
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-09-08 20:32:41 +00:00
Cody Cutrer 56ccea56d4 use preload/eager_load instead of includes
refs CNVS-21901

Change-Id: Ie9e1b2778b72f649392d8a1c47c0c86dae0ef19c
Reviewed-on: https://gerrit.instructure.com/58660
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-09-08 20:32:05 +00:00
James Williams d0e41711cb give full course visibility to users with :read_as_admin rights
closes #CNVS-22492

Change-Id: Ib4e1e1848fead8bcc2debf81756263ba9586b64d
Reviewed-on: https://gerrit.instructure.com/62601
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-09-08 17:19:42 +00:00
Cody Cutrer c443ef4b65 fix cross-shard UserObservers
fixes CNVS-22966

test plan:
 * in shard 1, create a user and a parent that perma-observes them
 * in shard 2, create a course, and enroll the student from shard 1
 * it should work

Change-Id: I95f8480c6b7d168cdd6fe8589f444bc2fb18a54e
Reviewed-on: https://gerrit.instructure.com/62579
Tested-by: Jenkins
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2015-09-04 17:18:18 +00:00
Michael Nomitch d0a42b3b1a deterministic ordering for quiz and enrollments scopes
fixes CNVS-19038

test plan:
  - make 10 quizzes in the same course with the same name
  - hit the quiz index api for this course with per_page=1
    ten times with the page number of 1 thru 10
  - there are no duplicate responses

  - make 10 users with the same name and enroll them
    all as students in the same section of a course
  - hit the enrollments index api for this course with
    per_page=1 ten times with the page number of 1 thru 10
  - there are no duplicate responses

Change-Id: I65adb60f8586d517bc5a3fd4c9138067f563a46f
Reviewed-on: https://gerrit.instructure.com/61847
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Michael Hargiss <mhargiss@instructure.com>
Product-Review: Jason Sparks <jsparks@instructure.com>
2015-09-02 19:24:09 +00:00
Cameron Matheson a3c1b75b7d pass user to gradebook.csv background job
fixes CNVS-22607

Test plan:
  * set up a section limited TA
  * download gradebook csv
  * ensure you can only see students in your section

Change-Id: I20c67d832f7cb234f7527d53747770c0092e9a0d
Reviewed-on: https://gerrit.instructure.com/61886
Reviewed-by: Dylan Ross <dross@instructure.com>
QA-Review: Derek Hansen <dhansen@instructure.com>
Tested-by: Jenkins
Product-Review: Cameron Matheson <cameron@instructure.com>
2015-08-29 03:33:45 +00:00
James Williams 3e9b184dd3 improve section_context_codes performance
don't initialize AR records just to get asset_strings

refs #CNVS-21317

Change-Id: If6afb664807926936d6957cac6aed24cfadc74b4
Reviewed-on: https://gerrit.instructure.com/61251
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-08-20 20:39:07 +00:00
James Williams 430d144b2a fix resetting courses with integration ids
test plan:
* create a course
* give it an integration id through the api
* reset the course content from the settings page
* should work

closes #CNVS-17370

Change-Id: I66d935e4688e9854a6f47604e33e358d7a0308fa
Reviewed-on: https://gerrit.instructure.com/61003
Tested-by: Jenkins
Reviewed-by: Dan Minkevitch <dan@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2015-08-20 17:43:56 +00:00
Cody Cutrer 219fe524bf avoid unnecessary permission check
Change-Id: Iccb0fd40a648a502613dfac89b331155afa103fb
Reviewed-on: https://gerrit.instructure.com/61099
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-19 17:22:30 +00:00
Cody Cutrer 0c4ad2eadd preload enrollment dates when selecting participating users in a course
refs CNVS-22546

Change-Id: Ia3fc3ecd7e4d8fe77c1203388554a25eed759fea
Reviewed-on: https://gerrit.instructure.com/61070
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-18 14:56:53 +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 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
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 726f8f10be Fixes issue with updating tab via api
fixes CNVS-22124

Test Plan:
* Add multiple tools to a course with "course_navigation[default]"
  set to "disabled" (using create external_tool api)
* Update one of the tools with "hidden=false" with tabs
* Go to the course's settings page -> navigation tab
* Only the tab you marked as "hidden=false" should be unhidden
  for the external tools you created

Change-Id: I106996778284a3b69d5f82f4c772497524681285
Reviewed-on: https://gerrit.instructure.com/59496
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Dan Minkevitch <dan@instructure.com>
2015-07-31 01:30:46 +00:00
Jennifer Stern fb371b6be7 Revert "Make it so students see "My Grades" and teachers see "Gradebook" in course menu"
fixes CNVS-22235

This reverts commit e413f8292d.

Change-Id: I49ada900ceef526f82ef37b6ff5febfe7298eda5
Reviewed-on: https://gerrit.instructure.com/59572
Tested-by: Jenkins
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Product-Review: Jennifer Stern <jstern@instructure.com>
QA-Review: Erin Hallmark <erin@instructure.com>
2015-07-30 22:34:04 +00:00
James Williams 10578f903f don't remove course dates with remove dates option
test plan:
* create a course with start and end dates
* import content into the course with the "remove dates" option
* should not remove the dates

closes #CNVS-22088

Change-Id: Ib2a680a85347d775aab95adab27faaa5ab3e75ce
Reviewed-on: https://gerrit.instructure.com/59206
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:53 +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
Jennifer Stern e413f8292d Make it so students see "My Grades" and teachers see "Gradebook" in course menu
refs CNVS-21636

Note: this change applies to both old and new ui

To test:

As a teacher:
1. Navigate to a course
2. Notice the 'Gradebook' link in the course nav
3. It should take you to the gradebook
4. You should NOT see a 'Grades' or 'My Grades' link in the course nav
5. On the gradebook page, the 'Gradebook' link in the course nav should be highlighted and the breadcrumb should say 'Gradebook'

As a student:
1. Navigate to a course
2. Notice the 'My Grades' link in the course nav
3. It should take you to your grades for the course
4. You should NOT see a 'Grades' or 'Gradebook' link in the course nav
5. On the grades page, the 'My Grades' link in the course nav should be highlighted and the breadcrumb should say 'My Grades'

Change-Id: I60574cd4408c2445c79f412873bd8d25d1cf7bbe
Reviewed-on: https://gerrit.instructure.com/57575
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Tested-by: Jenkins
QA-Review: Pedro Fajardo <pfajardo@instructure.com>
Product-Review: Jennifer Stern <jstern@instructure.com>
2015-07-20 16:12:55 +00:00
Jeremy Stanley bcd03e2445 add `allow_student_discussion_editing` to `clonable_attributes`
test plan: the setting in course settings / more options /
"Let students edit or delete their own discussion posts"
should be preserved across course copy / export+import

fixes CNVS-21789

Change-Id: Iab276a7cfebe47b47803205d4254e840e8882b56
Reviewed-on: https://gerrit.instructure.com/58342
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-07-17 15:31:04 +00:00
Cody Cutrer e34d7984a1 more use_qualified_names fixes
refs CNVS-21900, CNVS-21901

test plan:
 * got to an account, and click around

Change-Id: Ic9b7c03649009107c1e75fdb3e57a01a2a8028d9
Reviewed-on: https://gerrit.instructure.com/58531
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:37:35 +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
Jeremy Stanley a614b4f600 fix permissions around unpublished module items
use :view_unpublished_items rather than :manage_content or
:update, so teachers can still view unpublished content
(in a read-only state) after a course is concluded

test plan:
 - ensure unpublished modules and module items in
   a concluded course are visible to a teacher in that course
 - ensure the module items can be clicked on, and lead to
   the appropriate content (page, assignment, discussion)
   instead of an error message

fixes CNVS-21529

Change-Id: I01999a13d9d450b08ed8238608238de25a641d25
Reviewed-on: https://gerrit.instructure.com/57803
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-07-15 21:25:51 +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
James Williams 62851d8fe5 rails4: more misc model spec fixes
refs #CNVS-21596

Change-Id: I28cfeb917e29562734542d201148ad636d23cba1
Reviewed-on: https://gerrit.instructure.com/58170
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:24:49 +00:00
James Williams 417329b3b4 s/visibile/visible
lul

Change-Id: I303e168053ec058cdbf40acc6337b3d3404034ad
Reviewed-on: https://gerrit.instructure.com/58065
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-13 15:24:07 +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
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
Simon Williams 54f284bfb6 stop catching errors in broadcast policy state methods
we are swallowing a bunch of errors in broadcast policy methods that
check differences in workflow state between the old and new objects.
instead, let's let these fail and fix bugs that may come from using
these methods incorrectly.

fixes CNVS-21212

test plan:
- this would manifest itself as a error when trying to check the
  conditions for whether or not to send a notification on the following
  models:
  * announcement
  * assignment
  * calendar
  * content_export
  * course
  * discussion
  * enrollment
  * group_membership
  * quiz_submission
  * submission
  * wiki
- so the best way to test is to get notifications to send for these
  models under different conditions and make sure they work correctly

Change-Id: Ia9d6d0c37101b2d0859d5753835227d314955c3d
Reviewed-on: https://gerrit.instructure.com/54541
Tested-by: Jenkins
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2015-06-29 15:06:58 +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
Chris Hart 23e6b4eec2 Misc UI tweaks to Dashboard
Fixes: CNVS-21372, CNVS-21367, CNVS-21354

Small edits based on feedback from customers
at InstCon.

I also improved the dashboard card :hover and
:focus states. If the UI is not high contrast,
:hover/:focus is indicated by a subtle animation
of the course name, as well as a slight darkening
of the card background color. In high contrast,
the user still gets the underline.

I also reduced the padding/margin between the cards
and the padding of the main container slightly
so the cards don't look as scrunched up btw
~900-1100px, when there are three columns but the
middle container is pretty small.

Test Plan:
- Make sure the Use New Styles feature flag is ON.
- The entire dashboard card header (the colored part)
  should now be clickable as a link
- Long course names should wrap instead of becoming
  ellipses.
- In the dashboard card "actions" area (the links at
  the bottom), the icon for Files should be a
  folder icon, not a suitcase icon.

Change-Id: I8c5580fb27899bacfd16a5e3c4c1011b68f6ad06
Reviewed-on: https://gerrit.instructure.com/57025
Tested-by: Jenkins
Reviewed-by: Colleen Palmer <colleen@instructure.com>
Product-Review: Colleen Palmer <colleen@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
2015-06-26 22:26:28 +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
James Williams 518951b677 improve item_sequence endpoint
test plan:
* regression test module sequence footer

refs #CNVS-21317

Change-Id: I110fa2a5f00d4fe9f6be3c7b100cbf2b098b1358
Reviewed-on: https://gerrit.instructure.com/56986
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-24 20:23:33 +00:00
James Williams 58fdd31928 validate unique integration_id on course save
test plan:
* use the api to try to create a course with
 an integration id already in use by another
 course on the root account
* it should fail with a legible error (and
 not a database error)

closes #CNVS-21237

Change-Id: I69d352deb71168d93a621af9bbbba2d3706ac593
Reviewed-on: https://gerrit.instructure.com/56617
Tested-by: Jenkins
Reviewed-by: Dan Minkevitch <dan@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2015-06-17 19:38:40 +00: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
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
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 4fb4c84cdc don't let course notifications bomb with no prior_version
closes CNVS-21124

Course notifications for catalog were not getting sent out.
Upon sending them manually to debug, we found that courses with
no "prior_version" were throwing an exception from the predicate
block that evaluates whether to send the new_course notification.

This bombs the whole job (catalog sends notifications once an hour,
and a single exception stops the job from running).

This is not usually a problem when sending notifications in a save
cycle, but these records are being loaded and broacasted with no
save, which is why they break in this case.

TEST PLAN:
 1) load a course from the database but don't save it
 2) call "broadcast_notifications"
 3) it should not throw an exception

Change-Id: Ia9a07080b5b54e4f732fb51722a678650cce3b76
Reviewed-on: https://gerrit.instructure.com/56186
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins
Product-Review: Bryan Petty <bpetty@instructure.com>
QA-Review: August Thornton <august@instructure.com>
2015-06-11 20:00:46 +00:00
Colleen Palmer e8dd470a72 Dashboard Cards Dashboard
fixes CNVS-20119; fixes CNVS-20139; fixes CNVS-20140;
fixes CNVS-20424; fixes CNVS-20426

This adds a new Dashboard view when using New UI.

Note: This is for New UI only. Legacy UI should only show Recent Activity on
dashboard (as it always has).

Test Plan:

- Login and make sure new UI is on
- Go to / and see the new Dashcard view.
It should look similar to: http://cl.ly/image/2R2K28183h2G

- Switch to "Recent Activity" by using the toggle
It should look similar to: http://cl.ly/image/2l1V1h421b0d

- Dashboard Cards have quick links on the bottom to quickly let you
navigate to within a course. These include:

- Discussions (if available)
- Announcements (if available)
- Files (if available)
- Assignments (if available)

If activity has happened in Announcements, Assignments or Discussions, an
active state is given to the quick link that makes it look like this:

http://cl.ly/image/1d3Y0T3w1Q01

Change-Id: Ia07f7f2711d6e0625d26d7ea5d050ccb51dc0128
Reviewed-on: https://gerrit.instructure.com/53043
Reviewed-by: Jennifer Stern <jstern@instructure.com>
Product-Review: Colleen Palmer <colleen@instructure.com>
Tested-by: Jenkins
QA-Review: Adam Stone <astone@instructure.com>
2015-06-10 22:55:43 +00:00
Cameron Matheson ce51b1c9c2 make gb.csv names match web gradebook
closes CNVS-5620

Test plan:
  The display/sort order of gradebook.csv should match the web gradebook

Change-Id: I87fa21fd2e8c758dc74a1dab9e0f3208026fb0a3
Reviewed-on: https://gerrit.instructure.com/55325
Tested-by: Jenkins
Product-Review: Cameron Matheson <cameron@instructure.com>
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
QA-Review: Adrian Foong <afoong@instructure.com>
2015-06-08 23:25:38 +00:00
Dylan Ross 5a8eac9f11 remove attachment_id foreignkey from gradebook_csv
remove attachment_id foreign key constraint from
the gradebook_csvs table to prevent foreign key constraint
violation. also added `has_many :progresses` to the course
class to keep the progress_id foreign key on the gradebook_csv
table

closes CNVS-20549

test plan
  ensure a an admin user (a user on a different shard
  than the course shard) can export a gradebook csv
  successfully

Change-Id: Iae9d0201192320ed45d5e901867ae20a9eb7ab1d
Reviewed-on: https://gerrit.instructure.com/54494
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Robert Lamb <rlamb@instructure.com>
Product-Review: Dylan Ross <dross@instructure.com>
2015-06-02 18:49:53 +00:00
John Corrigan 5c3abaefe8 makes section tabs accessible outside of render logic
fixes CNVS-20120

- Updates UsersController#user_dashboard to add course favorite
  information to js_env.Add icon info to Course.default_tabs.Update
- I18nUtilities helper methods to use `I18n.t` instead of just `t`, so
  that the module can be included outside of a decendent of ActionView.Add
- SectionTabHelper. Includes method for rendering `section_tabs` to html,
  a separate method (`available_section_tab`) so section tabs can be
  accessed without rendering anything to the page, and a new class,
- SectionTabTag, which is responsible for constructing html to render a
  section tab.Add SectionTabPresenter, which takes a tab object (just a
  hash; accessed via a context class’s `.default_tabs` method) and
  translates it into an object for the view.
- Add `CourseForMenuPresenter`, which translates a course into a hash
  including only information necessary for construction of the section
  tab menu, or the new dashboard card.
- Add `AvailableSectionTabs` to encapsulate available_section_tabs
  logic. 

test plan:
- Validate that existing section menu navigation with a course context
  works.
- Validate that new dashboard cards show correct course information, as
  well as correct links.

Change-Id: Ief2cfc350991758e019a8a56ce23d29634470dd0
Reviewed-on: https://gerrit.instructure.com/54578
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Adam Stone <astone@instructure.com>
Tested-by: Jenkins
Product-Review: Simon Williams <simon@instructure.com>
2015-06-02 14:43:49 +00:00
Dylan Ross 349fb3e1ac set contenttype of gradebook_csv attachment to csv
when changing the uploaded_data attribute of an
attachment, the content_type must be set again.
without the content_type safari was downloading csvs
as a txt file.

closes CNVS-20553

Change-Id: I65186f2ea39fb752931913158fff92c2b60a2e25
Reviewed-on: https://gerrit.instructure.com/54465
Tested-by: Jenkins
Reviewed-by: Cody Poll <cpoll@instructure.com>
QA-Review: Michael Hargiss <mhargiss@instructure.com>
Product-Review: Dylan Ross <dross@instructure.com>
2015-05-19 01:03:19 +00:00
Cody Cutrer cf4cf37840 gradebook csvs belong on the course's shard, not the user's
Change-Id: I1599f5115fc3052d6356a2efc22bb0e97439c723
Reviewed-on: https://gerrit.instructure.com/54070
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-05-15 15:46:55 +00:00
Dylan Ross a76fe1355c pass include_sis_id param to gb csv generation
include the 'SIS User ID' and 'SIS Login ID' fields
in the exported gradebook csv if the user can read
and manage SIS

fixes CNVS-20403

test plan
  ensure a user who has read_sis and manage_sis
  rights has the SIS User ID and SIS Login ID
  columns in their exported gradebook

Change-Id: I55cfca9d7271e25745088ae4fd3d584d74299b81
Reviewed-on: https://gerrit.instructure.com/53960
Tested-by: Jenkins
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Josh Simpson <jsimpson@instructure.com>
2015-05-12 16:38:34 +00:00
Ethan Vizitei a98e2a497e abstract locks for postgres 9.3 specific exclusive locks
closes CNVS-20176

in several places we check the postgresql version to see
if we can use the NO KEY UPDATE lock style.  This abstracts
those checks into one place in our active record initializer.

TEST PLAN:
 1) make sure course enrollments still works, enrolling in a course
   makes use of this directly.
 2) make sure importing a CSV for SIS still works.

Change-Id: Ifc3fe364058e22c75b4fb035695da0a2e5cf066d
Reviewed-on: https://gerrit.instructure.com/53861
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-05-12 15:31:13 +00:00
Jeremy Stanley f4eadde577 count `creation_pending` enrollments as non-accepted
test plan:
 - create a new course and do not publish it
 - invite a student into the course
 - note the "1 invitation hasn't been accepted" message
 - invite a TA into the course
 - the message should change to "2 invitations haven't..."
 - reload the page
 - the count of non-accepted invitations should not change

fixes CNVS-20311

Change-Id: Idab3f4d5fa87b9f87513fc46b015fa6cf08cb7f2
Reviewed-on: https://gerrit.instructure.com/53652
Tested-by: Jenkins
Reviewed-by: Dan Minkevitch <dan@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2015-05-08 19:33:11 +00:00
James Williams 820bbf813c fix group file link handling in course html content
test plan:
* create a group in a course
* create a link to the group files page
from course html content (e.g. a wiki page)
* should not be pointing to the course
 after saving

closes #CNVS-19343

Change-Id: I34f45c7e50bdd505694092301b905db5ed4c40b9
Reviewed-on: https://gerrit.instructure.com/53501
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-05-06 16:32:17 +00:00
Dylan Ross 9ce06fb25e gradebook export process is now async
exporting the gradebook as a csv is now
done in a delayed job. when the user
clicks export, the export button will
be disabled. when the export has
completed, it will download the report
automatically. the csv generated previously
will be stored on the course, so it can
be downloaded again at a later time,
if a user leaves the page

fixes CNVS-17200

test plan
  ensure the data is consistent with the
  synchronously exported gradebook

  ensure the teacher can see the exported
  gradebook csv in the user's files page

Change-Id: I3d1e800326d82fe5cbca5a57ed7f60fad64daad5
Reviewed-on: https://gerrit.instructure.com/52689
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
QA-Review: Robert Lamb <rlamb@instructure.com>
Tested-by: Jenkins
Product-Review: Christi Wruck
2015-05-05 17:54:49 +00:00
Ethan Vizitei 5950b3bdff stop enrollment deadlocking on postgres >= 9.3
refs CNVS-20176

based on stream_item.rb:270, planning to abstract this strategy
in another commit, but this gets enrollments back to green

Change-Id: I983d33458e8777fecbda044cba91e6f755b29986
Reviewed-on: https://gerrit.instructure.com/53309
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
QA-Review: Hannah Bottalla <hannah@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2015-05-04 21:02:57 +00:00