Commit Graph

444 Commits

Author SHA1 Message Date
Rob Orton e2117f2713 retry enrollment unique constraints
fixes CNVS-12761

test plan
 - specs should pass

Change-Id: Icfd276e85c359b7d5625f0d187eaf142fe00601c
Reviewed-on: https://gerrit.instructure.com/34051
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2014-04-30 20:43:56 +00:00
Kenneth Romney 31361b5255 extract lib/text_helper to gems/canvas_text_helper
fixes: CNVS-12305

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

Change-Id: I912a63b03c6c14de0c1d678063bb8fa33504d843
Reviewed-on: https://gerrit.instructure.com/33171
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-04-30 15:18:40 +00:00
Eric Adams 933bff25d3 Add integration Ids to API
fixes SIS-135
fixes SIS-136

Change-Id: Ide2f51765c76a50f09d54d2865357b5ff38bc360
Reviewed-on: https://gerrit.instructure.com/28587
Reviewed-by: Duane Johnson <duane@instructure.com>
Tested-by: Duane Johnson <duane@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Eric Adams <eadams@instructure.com>
2014-04-24 20:43:45 +00:00
Michael Nomitch 0c3e7fcd7a warn teachers when changing grade display
fixes CNVS-11250

test plan:
  - as a teacher with unweighted assignment groups
  go to GB2 and toggle between points/percent
  - a modal should appear that warns you about this action
    - the text should make sense
    - it should say "a percent" or "points" depending on
      your current settings
    - clicking cancel or the x should close the dialog
    - clicking continue should close the dialog and change the totals
      - when you reload the page, totals should remain changed
    - clicking the checkbox and then continue should do the same
      - however the next time you click the dropdown, the modal should
        not appear, even after reload
        (other courses/browsers will still show this user the modal)
    - as a TA or another teacher in the same class, the modal should
      still appear (until you click the checkbox)

Change-Id: I465bd7b9d770077931a769efb7904c1349920a3c
Reviewed-on: https://gerrit.instructure.com/33356
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Hilary Scharton <hilary@instructure.com>
2014-04-23 02:07:44 +00:00
Braden Anderson 251fe0a7b7 dashboard: hide stream items from concluded courses
fixes CNVS-1485

test plan:
  * verify that stream items show up on the dashboard
  * create a term with an end date in the past
  * assign a course to that term
  * verify that items from that course are no longer on the dashboard

Change-Id: I9851997c9672f73335f54bdba78bdb71ee24d029
Reviewed-on: https://gerrit.instructure.com/33264
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Joel Hough <joel@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Braden Anderson <banderson@instructure.com>
2014-04-22 22:42:53 +00:00
Jason Madsen ec7751f341 move migration importers to app/models/importers
closes CNVS-12404

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

Change-Id: Ia5c88cc179e3cc8075270d0d423e618f80d61234
Reviewed-on: https://gerrit.instructure.com/33314
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
2014-04-22 15:35:09 +00:00
Nathan Mills 32b2ce407f extract attachment importer
fixes CNVS-12245

test plan:
*run a course migration on a course that has attachments
the attachments should come across

Change-Id: I897ec39bfa393835ee20cb8ff83918dcdddf57ff
Reviewed-on: https://gerrit.instructure.com/32965
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2014-04-18 16:37:00 +00:00
James Williams 1ae166f3ff export/import/copy course tab configuration with external tools
test plan:
* create a course with an external tool (either configured
for the course or on an account-level) that adds a course
 navigation tab
* arrange the tabs in the course settings
* copy the course, or export the course and then import
 into a new course
* should retain the same tab configuration as the original course

fixes #CNVS-8866

Change-Id: I8ee7cb5bd2e098829994e63f4fbd1ca4d0afd701
Reviewed-on: https://gerrit.instructure.com/32906
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mark Severson <markse@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2014-04-17 17:45:46 +00:00
Jason Madsen 6dd6129c96 move quiz importing to individual class
closes CNVS-12397

test plan:
  - verify that existing specs pass
  - import a quiz with various question types
    - verify import works as previously defined

Change-Id: I25b778aea06ffbd1ad23a7076cd597e9123c32bf
Reviewed-on: https://gerrit.instructure.com/33294
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Jason Madsen <jmadsen@instructure.com>
2014-04-16 21:32:22 +00:00
Michael Nomitch 2cb906d9b5 gpa scale grading standard
fixes CNVS-8931

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

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

Change-Id: Ide1ea5ca13a70116ae3535b2c8e105ece79a34c8
Reviewed-on: https://gerrit.instructure.com/29742
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Hilary Scharton <hilary@instructure.com>
Product-Review: Mike Nomitch <mnomitch@instructure.com>
2014-04-10 16:00:28 +00:00
Jeremy Stanley 6170b20b13 export/import media file captions
test plan:
 - have a course with a video file embedded in content somewhere
   (such as a wiki page)
 - create captions for the video and verify that they play back
 - export this course to an .imscc
 - import it to a new course
 - ensure the captions play back in the copied course

fixes CNVS-10228

Change-Id: Ie15076bc31ad36efabf7a718d12bd8a9b12e45e1
Reviewed-on: https://gerrit.instructure.com/32680
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2014-04-08 20:03:45 +00:00
Jacob Fugal f36bfb546d default to root account's time zone
if performing a course copy/import and options[:time_zone] isn't
provided, use the default_time_zone on the root account (not the sub
account). sub accounts aren't currently expected to have their own
default time zones (but the database allowed it, and the code didn't
automatically look to the root account)

refs CNVS-9312

test-plan:
 - give a root account a non-Mountain Time default time zone (e.g.
   Arizona)
 - create a sub account of that root account
 - perform a course copy across DST boundaries into that sub account
   with date shifting
 - the date shifting should follow the tz rules of the root account's
   default time zone (i.e. time of day on due dates, etc., should not
   change between the source and target)

Change-Id: I6096490b7d125263421a48c552c32ed0b215f31d
Reviewed-on: https://gerrit.instructure.com/32788
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
2014-04-07 17:33:50 +00:00
Cody Cutrer 7d16d22369 fix unique constraint violation when re-enrolling user in a section
Change-Id: I3fa5924672c035c068b053d2d00fe24fa3818db4
Reviewed-on: https://gerrit.instructure.com/32707
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-04-03 13:25:26 +00:00
Raphael Weiner 5704e9247d Remove duplicate code for finding uniq array elements.
Change-Id: Ib574f903a52b27d0075029f2afb7845c58d61dba
fixes: CNVS-11932
Reviewed-on: https://gerrit.instructure.com/32153
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
2014-03-31 16:21:35 +00:00
Jeremy Stanley 8e433b1731 log kaltura bulk API error instead of failing import
refs CNVS-11602

Change-Id: I0a5a26a455d08361b69e12f6e6bd552b9a149dfe
Reviewed-on: https://gerrit.instructure.com/31352
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Bracken Mosbacker <bracken@instructure.com>
2014-03-17 21:45:46 +00:00
Cody Cutrer 5631eb41ec cache account_users by id, not object
the object is likely @current_user, which probably has lots of stuff
preloaded on it, and if the course gets cached out-of-process, it
will be lots more than we want serialized (and could cause weird
deserialization loops)

Change-Id: I815791ccc194ce285fd6573e4c97bfe7608048a8
Reviewed-on: https://gerrit.instructure.com/31433
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Anthus Williams <awilliams@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-03-07 21:13:47 +00:00
Rob Orton 1be0a2db95 add unique index to enrollments users per section
index should be unique per user, section, role,
type, and associated_user_id

fixes CNVS-7698
fixes CNVS-7700

test plan
 - add duplicate enrollment in script console
   - run migrations
   - duplicates should be removed
   - attempt to add duplicate enrollment in console
   - duplicate enrollment should fail
 - test user merge with conflicting enrollments
 - test creating, deleting, and restoring enrollments
 - enrollment regression testing

Change-Id: I0fb600ba6ff98054f71dc41a8519680413507494
Reviewed-on: https://gerrit.instructure.com/30986
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2014-03-06 22:20:30 +00:00
Cameron Sutter 78a7d26d91 remove :includes => :quiz_submission
fixes CNVS-9933

test plan:
 - basic regression on the following:
   - teacher activity pages
   - gradebook pages
   - grades page
   - gradebook upload
   - changing due dates on assignments
   - submissions api
   - assignments api
 - sorry

Change-Id: I7bb4c32a74b159565772da8ee1d5a43e27369ca0
Reviewed-on: https://gerrit.instructure.com/30367
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-03-01 01:46:22 +00:00
Raphael Weiner 644b29d12f extract auto_handle to new canvas_uuid gem
Change-Id: Ic226e61e900532cc3acf08444b316b6e2bb6b368
Reviewed-on: https://gerrit.instructure.com/30049
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-02-25 19:30:59 +00:00
Eric Adams afe2e87acb allow setting start_at, end_at for enrollments api
fixes SIS-160

Test Plan
---------
  - Create an enrollment via the api with start_at and end_at parameters
  - verify start_at and end_at are poplutated for resulting record in enrollments table
  - verify user can only access course during start_at and end_at times

Change-Id: Icfeaded1f43c6b0309d41280d7caa17482b9182e
Reviewed-on: https://gerrit.instructure.com/30136
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ken Romney <kromney@instructure.com>
Reviewed-by: Duane Johnson <duane@instructure.com>
Product-Review: Duane Johnson <duane@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
2014-02-14 23:37:29 +00:00
Michael Nomitch 36de188de0 remove test student scores from assignment data
fixes CNVS-10570
fixes CNVS-11104

test plan:
  - as a teacher enter in scores for students and a test student
  - make test student grade the hightest (not tied)
    - on the grades page, in assingment stats, the test student score shouldnt show up
  - make test student grade the lowest (not tied)
    - on the grades page, in assingment stats, the test student score shouldnt show up
  - on the grades page, test student score shouldnt change the average

Change-Id: I9916a999cf7db4872b09d03e8e14883503025d96
Reviewed-on: https://gerrit.instructure.com/29091
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Matthew Irish <mirish@instructure.com>
Reviewed-by: Cameron Sutter <csutter@instructure.com>
Product-Review: Mike Nomitch <mnomitch@instructure.com>
2014-02-14 18:09:27 +00:00
Cody Cutrer a389fd18c1 rails 3 doesn't auto-require csv, so require it where necessary
Change-Id: Id76980c82024a082855f5b7b5b60cd7e760730a9
Reviewed-on: https://gerrit.instructure.com/30132
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-02-14 16:04:34 +00:00
Jacob Fugal a2c3dc44fc rename skip_callback->suspend_callbacks
refs CNVS-9522

in rails3 ActiveRecord::Base.skip_callback is a real thing that doesn't
do what this does. because of load order, ours happens, but it would be
nice to leave the other available.

to simplify the switch, both suspend_callback and suspend_callbacks are
kept as renames, but suspend_callback should not be used, preferring
suspend_callbacks. suspend_callback will go away in the near future.

skip_callback is temporarily added back in as an alias to
suspend_callback to allow time for fixing a plugin that uses
skip_callback. it will be removed as soon as that plugin is updated.

Change-Id: Iaefd16dde3b6ce575780cb8f721dc826258eef4e
Reviewed-on: https://gerrit.instructure.com/29808
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Nick Cloward <ncloward@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
QA-Review: Jacob Fugal <jacob@instructure.com>
2014-02-11 23:14:41 +00:00
Cody Cutrer de9bd8b898 fix files controller for rails 3 specs
* don't use respond_to if json is the only possible format
 * when filtering scribd_doc, rails 3 serializes as a hash with
   string keys, as opposed to a HashWithIndifferentAccess, so
   delete with string key
 * don't use StringIO as an uploaded file; Rails 3 TestCase will
   call to_param on it
 * don't require the .:format part of the public_url route

Change-Id: I282f529f1ee0941b52a996eefa01647a018f70d3
Reviewed-on: https://gerrit.instructure.com/29930
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-02-11 16:04:43 +00:00
Raphael Weiner 6ae716da73 extracted html text helper methods into gem
test plan:
  * run specs

Change-Id: I8bd463396aee14853bdcf552eef144a509ffb62a
Reviewed-on: https://gerrit.instructure.com/29613
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Product-Review: Zach Pendleton <zachp@instructure.com>
QA-Review: Zach Pendleton <zachp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2014-02-07 20:11:19 +00:00
Michael Nomitch d4e95394ce allow displaing total grade as points for students
fixes CNVS-9874

when teacher choses to show total grade as points in GB2, a setting is saved
student grade summary page shows the total grade in same format
if assignment groups are weighted, grade is displayed as a percentage again

test plan:

  - new addition:
    - go to a course where GB2 is displaying totals as points BUT has no DB setting about show_point_totals
      (ask mike if you need help getting to this state)
    - as a student look at the grade summary page, total should be a percent
    - as a teacher in that class, go to GB2 and wait for 5 seconds
    - as that same student, go back to grade summary, total should be points now

  - as a teacher, change total grade to show as points in GB2
    - when you return to the GB, even from a new browser, this should be the same
    - in GB, tooltip should show points if cell shows percent, and visa vera
    - as a student in that class, you should see your total grade as points
      - grade tooltip should show points if cell shows percent, and visa vera
  - switch to weighted assignment groups
    - total grade as a teacher and student should switch back to percent
  - switch back to non-weighted
    - total grade should stay a percent until explicitly changed back to points

  - GB2 weighting and points/percent switching should have no unintended effects on the GB
  - student grade summary page should display everything in a consistent manner

Change-Id: Id0c4f496576c226eb7000d6684a37faf0b439359
Reviewed-on: https://gerrit.instructure.com/28780
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Mike Nomitch <mnomitch@instructure.com>
2014-02-04 15:54:58 +00:00
Raphael Weiner 91944495c2 convert sanitize field plugin into proper gem: CanvasSanitize
Change-Id: I5562a318bb3f52c1374a3a69f288bfb2381f8ee7
Reviewed-on: https://gerrit.instructure.com/29405
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Stephan Hagemann <stephan@pivotallabs.com>
Product-Review: Stephan Hagemann <stephan@pivotallabs.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
2014-01-28 22:36:18 +00:00
Nathan Mills b9ddd5d5d1 enhance tabs get api, and add put api
fixes PS-969

test plan:
*the posistion should reflect the posistion displayed in the UI
*the visibility should reflect the visibility in the UI
*hidden should be set if the nav tab is hidden
*unused should be set if the nav item has no content
*you should be able to update a tabs position
*you should be able to set a tab to hidden
*you shouldn't be able to modify home, or settings tabs

Change-Id: I96beba411551ea0709ecf0e876c61d90b35b8482
Reviewed-on: https://gerrit.instructure.com/28093
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Adam Phillipps <adam@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Reviewed-by: Brandon Broschinsky <brandonbr@instructure.com>
2014-01-28 21:18:28 +00:00
Joshua Simpson 1e81ea7caa move quiz into quizzes namespace as a precursor to enginifying
fixes CNVS-10679
this commit refactors quiz into a quizzes namespace. it contains various
shims to facilitate the data migration of polymorphic relationships
('Quiz' -> 'Quizzes::Quiz').  JIRA contains several tickets linked to
the above tickets in regards to removing these shims after the data
migration, as well as the strategies on reverting the shims once the
data migration is complete.
Change-Id: I30c566d60a87af6ee83e9d0041fdcb909ead6a89
Reviewed-on: https://gerrit.instructure.com/28573
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Josh Simpson <jsimpson@instructure.com>
2014-01-24 00:08:46 +00:00
Jeremy Stanley 4cb084d4b7 don't create the default section in search_helper
test plan:
 - Create a course via SIS import or Accounts page
   (not via front page, since this will enroll you as a teacher)
 - Go to the settings page for the created course and verify
   no sections were created

fixes CNVS-10683

Change-Id: I4ee7296cf45b44335a5fc49d701951e079800b20
Reviewed-on: https://gerrit.instructure.com/29189
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
2014-01-23 21:21:57 +00:00
James Williams 8a7d9d790a explicitly save course after migration for rails 3 compatibility
Change-Id: I3b2337e88c0b4717d76cd6735a82be0ededa0950
Reviewed-on: https://gerrit.instructure.com/29041
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2014-01-22 19:56:05 +00:00
Cameron Matheson b862ea30b6 add assignment group information to gradebook.csv
closes CNVS-9968

Test plan:
  Download gradebook.csv, it should include grades for each assignment
  group.  Points will be included for courses with  unweighted
  assignment groups (just like for current/final grades)

Change-Id: Ic47a4cd6cfb62726d3ec6e015b1d3ecfd71f79cc
Reviewed-on: https://gerrit.instructure.com/28579
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
2014-01-21 21:14:37 +00:00
Cody Cutrer e535791b05 order instructor by id before touching
reduces deadlock situations

Change-Id: I46fae6a68de680b501739526304145a2d8445f08
Reviewed-on: https://gerrit.instructure.com/28862
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2014-01-20 17:08:17 +00:00
Mark Severson 0152fa52fa deprecate hide_from_students on wiki pages
hide_from_students is being deprecated in lieu of the workflow states
'active' (published) and 'unpublished'

test plan: (draft state and legacy)
  special attention should be given to areas related to hiding wiki
  pages from students (legacy: hide from students checkbox;
  draft state: published/unpublished items)

  items that are hidden from students or unpublished should show for
  teachers, but should not show for students

 - areas to test:
   - pages api and ui (regression)
     - validate hide_from_students and published values in all api calls
   - course migrations (specifically course copy)
   - wiki sidebar in other parts of canvas

fixes CNVS-10354, CNVS-10366

Change-Id: I70f4d8c07c2be4150163279f0673377bad6e9c48
Reviewed-on: https://gerrit.instructure.com/28375
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2014-01-15 21:29:06 +00:00
Cody Cutrer d5bb142adc fix deadlock on postgres < 9.3 enrolling users
Change-Id: I681b7c897b1118f6575e747328ab3930874f6558
Reviewed-on: https://gerrit.instructure.com/28292
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-01-14 22:42:45 +00:00
James Williams c86ea36c28 fix course appointment_participants association for rails 3
activerecord 3 tries to call course[:asset_string] which
returns nil because asset_string is not an attribute

Change-Id: Idb4c5da5ebf4fe2eec4946e991aa091d4bc01ce5
Reviewed-on: https://gerrit.instructure.com/28477
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2014-01-14 13:25:08 +00:00
Cody Cutrer b6338bb051 create default sections on master
Change-Id: I481ac52ac9367a1ab6d9a159c5d64d088e31d1cf
Reviewed-on: https://gerrit.instructure.com/28220
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2014-01-10 17:28:43 +00:00
Anthus Williams 08f41af26d cross-shard support for student interactions report
Activate the course's shard to retrieve teacher
enrollments, not necessarily the current shard

fixes CNVS-4450

Test plan:
- On shard A, create user A
- On shard B, create a course with one or more 
students and enroll user A as a teacher
- Log in as user A on shard A; navigate to /grades
- When you click "Student Interactions Report" you
should see the report (instead of a "this user is
not a teacher in this course" error)

Change-Id: I767c88ca1ebb27a33060dd1ba62aa2ffdd646da1
Reviewed-on: https://gerrit.instructure.com/28182
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Anthus Williams <awilliams@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Anthus Williams <awilliams@instructure.com>
2014-01-08 23:21:56 +00:00
Rob Orton ed12014bdb validate sis_id, section name and drop section_code
fixes CNVS-10147

test plan
 - set sis id, section name to longer than 255 chars
 - should throw rails error
 - should not throw database error

Change-Id: I05ebdf3ae89ace4f737ae6c124f015efceafec1d
Reviewed-on: https://gerrit.instructure.com/27835
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2014-01-02 20:43:52 +00:00
Cameron Matheson b088c6beda custom gradebook columns api
closes CNVS-6906, CNVS-6475

Test plan:
  Use the new custom gradebook column apis to create/edit/delete custom
  gradebook columns, and set data for users in a course on those
  columns.

  only teachers/TAs should have permission to use these apis.

Change-Id: I658b8dc02d6104559c98a6b7e1be5c72e775d664
Reviewed-on: https://gerrit.instructure.com/27615
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
2013-12-26 17:45:40 +00:00
Zach Pendleton f5ee7dbfc3 remove tinychat code
fixes CNVS-10058

canvas no longer integrates with tinychat; this commit
removes legacy references to it.

test plan:
  * run specs

Change-Id: I4887e901d57ff39f8554af3e4eacd52ec4edd6e5
Reviewed-on: https://gerrit.instructure.com/27621
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
Reviewed-by: Braden Anderson <banderson@instructure.com>
Product-Review: Zach Pendleton <zachp@instructure.com>
2013-12-18 22:51:45 +00:00
Rob Orton 22a699e885 validate the length of sis ids on the rails side
fixes CNVS-9902

test plan
 - set sis id to longer than 255 char
 - should not throw database error

Change-Id: If72466dc91c1ef48ac91b5e9d7a92bea62c88c50
Reviewed-on: https://gerrit.instructure.com/27164
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2013-12-10 18:20:50 +00:00
Jeremy Stanley 59a05a5bb9 don't create a section for student view unless no sections exist
fixes CNVS-6031

test plan:
 - create a course via the Account Settings page
   (not via the dashboard)
 - create a section in the course
 - go to student view in the course
 - leave student view
 - return to the course sections page. only the section you
   created should be there.

Change-Id: I7e86de6f27172454d3176c46f2cc986cade85a8b
Reviewed-on: https://gerrit.instructure.com/27059
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Jeff Fox
2013-12-06 23:39:07 +00:00
Jacob Fugal 34893f80bd remove uses of memoize
fixes CNVS-9331

instead, as appropriate, use one of (or a combination of, if necessary):

 * instance variable caching
 * Rails.cache
 * query caching (implicit)

also:

 * remove the buggy cc.active_pseudonyms (didn't account for
   sharding) in favor of cc.user.all_active_pseudonyms
 * streamline assignments in the menu to not need to construct method
   names

test-plan: N/A

Change-Id: Id0dec60464a283985e39493b90711b32cb5cca82
Reviewed-on: https://gerrit.instructure.com/26936
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
QA-Review: Jacob Fugal <jacob@instructure.com>
2013-12-06 22:03:24 +00:00
Michael Nomitch ad24eb77a9 moves test student to end of csv gradebook file
fixes CNVS-9268

added enrollments_for_csv method to course with test
moves test student enrollment to the end for enrollments array

test plan
- add multiple students to class
- add test_student to class
- download gradebook csv file
- ensure Test Student is the last student in the csv (and others are alphabetized)

Change-Id: Ic3dc92cf0a3e1da01e90fc270cb391bfa19c7fcd
Reviewed-on: https://gerrit.instructure.com/26745
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
2013-12-02 23:53:27 +00:00
Jeremy Stanley dcf3df456b move draft state under feature flag umbrella
fixes CNVS-9496

test plan:
 - draft state feature should show up in site admin feature
   flags, or root account feature flags when called as site
   admin
 - when site admin hits "allow" for the feature, it should
   appear in the root account administrator's settings
   in "Off" state
 - the root account admin should be able to "Allow" the setting
   which allows a sub-account or course to turn it on
 - when the feature is turned on via the Feature Settings tab
   or features API, draft state functionality should appear
   in the course wiki pages and elsewhere

Change-Id: Id7403f2a8371b0a7bfebffbb8f29330fff5c94c5
Reviewed-on: https://gerrit.instructure.com/26308
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
2013-11-26 20:43:49 +00:00
Jacob Fugal cd892fe723 clean up context.users_not_in_group
for rails3 and folio

fixes CNVS-8790

test-plan:
 - validate pagination of unassigned group members both for course
   groups and account groups

Change-Id: Ic9e842abdbfba714829a123ca0dee4f93e5a1fdc
Reviewed-on: https://gerrit.instructure.com/26534
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
2013-11-25 16:37:50 +00:00
Liz Abinante ae4c9def12 VDD rendering on assignments index
fixes CNVS-5860

test plan
* with draft state OFF
* in a course with 1 section
* create an assignment
* under advanced options, select the single section (usually course name)
* set the due date and save assignment
* verify that assignments index shows single date for students, teachers
* create a quiz
* under advanced options, select the single section
* set due date and save
* verify that quiz index shows single date for students, teachers
* verify that modules page shows single date for students, teachers

* with draft state OFF
* in a course with 2+ sections
* create a quiz and assignment with VDD
* verify that assignments and quiz index show 1 date for students
* verify that assignments and quiz index show multiple due dates for teachers
* verify that modules page shows "Multiple Due Dates" for observers with multiple students

Change-Id: Ie6b2f571eb7b344d40ca4ffda26e27d43778d17d
Reviewed-on: https://gerrit.instructure.com/26449
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cameron Sutter <csutter@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Liz Abinante <labinante@instructure.com>
2013-11-22 21:09:11 +00:00
Ahmad Amireh 6b8d55a77b Controlling visibility of student quiz scores
Teachers can now control when, and for how long, students get to see the
correct answers to their quiz submissions.

The patchset introduces two new columns to Quiz and a CSS rework of the
quiz options form. See linked references for more info.

Quiz#show_correct_answers should no longer be directly accessed, use
Quiz#show_correct_answers? instead.

== Test plan

CAs stands for Correct Answers.

  - Create a quiz with 3 questions
  - Take the quiz as a student, and:
    - get 2/3 of the questions answered correctly
    - submit it

Case A - Showing CAs the moment the submission goes in:

  - Edit the quiz, and:
    - Tick the 'Let Students See Their Score Points' checkbox
    - Leave both date fields empty
    - Save quiz
  - Refresh student view
    - You should see the CAs

Case B - Showing CAs after some date:

  - Edit the quiz, and:
    - Tick the 'Let Students See Their Score Points' checkbox
    - Set the "Show Correct Answers At" to 3-days from now
  - Refresh student view:
    - You should not see the CAs
  - Edit the quiz, and:
    - Set the date to 3-days back
  - Refresh student view:
    - You should see the CAs

Case C - Hiding CAs after some date:

  - Edit the quiz, and:
    - Tick the 'Let Students See Their Score Points' checkbox
    - Set the "Hide Correct Answers At" to 3-days from now
  - Refresh student view:
    - You should see the CAs
    - You should see an alert that tells you the CAs will be hidden at
      the date you chose earlier
  - Edit the quiz, and:
    - Set the date to 3-days-back
  - Refresh student view:
    - You should no longer see the CAs
    - Alert should read that the answers stopped being visible as of the
      date you chose earlier

Case D - Creating a time-frame for showing CAs:

  - Edit the quiz, and:
    - Tick the 'Let Students See Their Score Points' checkbox
    - Set the "Show Correct Answers At" to yesterday
    - Set the "Hide Correct Answers At" to 3-days from now
  - Refresh student view:
    - You should see the CAs
    - You should see an alert that tells you the CAs will be visible
      between yesterday and 3 days from now
  - Edit the quiz, and:
    - Set the "Show At" date to tomorrow
  - Refresh student view:
    - You should no longer see the CAs
    - Alert should still tell you that the CAs will be visible starting
      tomorrow until 3 days from now

Case E - Choosing a bad range

  - Edit the quiz and:
    - Tick the 'Let Students See Their Score Points' checkbox
    - Set the "Show at" to tomorrow
    - Set the "Hide at" to today, or tomorrow
    - You should see an error-box

== Notes and really wild things

- http://docs.kodoware.com/canvas/cnvs-8103-take2
- http://docs.kodoware.com/canvas/cnvs-8103 (legacy changes)

refs CNVS-8103, CNVS-9386

Change-Id: Ib241ee5f143b87164105b7541aadac00f38f79ad
Reviewed-on: https://gerrit.instructure.com/25505
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
2013-11-20 22:08:21 +00:00
Jeremy Stanley 0e075a24b4 feature flags infrastructure and API
test plan:
 - install the test_features plugin (since no real features exist yet)
 - render and consult the feature flags documentation
 - have a test environment with a root account,
   sub-account, course in sub-account, and user

 - Use the "list features" endpoint as a root account admin
   (with no site admin privileges), on the root account context, and
   confirm that hidden features do not show up
 - Use the "list features" endpoint as a site admin user,
   on the root account context, and confirm that hidden features
   show up
 - Use the "list features" endpoint on the site admin account
   and confirm the hidden features show up

 - Use the "set feature flag" endpoint on a hidden feature on site
   admin and ensure the feature becomes visible in all root accounts
 - Use the "set feature flag endpoint" on a hidden feature on a
   single root account, and ensure the feature becomes visible to
   that root account and not others

 - Confirm that root_opt_in features appear "Off" by default
   in root accounts, after being "Allowed" in code or site admin

 - Confirm a feature flag that is set to "on" or "off" (vs. "allowed")
   cannot be overridden in a lower context (and the API returns
   locked=true for them)

 - Confirm that setting locking_account_id requires admin rights
   in the locking account
 - Confirm that a feature flag with locking_account_id cannot be
   changed without admin rights in the locking account (e.g.,
   set a feature flag on a course, locked with the root account's id,
   and make sure a teacher who is not an account admin can't change it)

 - Confirm feature flags can be deleted with the "remove feature flag"
   endpoint (and they are only deleted where they are defined, not
   when called on an object that inherits a flag)

Change-Id: I3e12e23b4454889b6e8b263f1315e82d8f2ada52
Reviewed-on: https://gerrit.instructure.com/25502
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
Product-Review: Matt Goodwin <mattg@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
2013-11-19 20:50:03 +00:00