Commit Graph

590 Commits

Author SHA1 Message Date
Cody Cutrer 38bb3ca38a don't save a ContentMigration for AcademicBenchmark before all the fields have been set
Change-Id: I0f4bce0d47ac3e42e67976882b25771de64432de
Reviewed-on: https://gerrit.instructure.com/26518
Reviewed-by: Jake Sorce <jake@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2013-11-20 21:39:18 +00:00
Rob Orton 36f3f17d32 write zip reports to csv file then add file to zip
fixes CNVS-4418

test plan
 * run sis export report with multiple files
 * should return zip file
 * run other reports
 * they should still work

Change-Id: Ibfa598c12b730a54aee1c5af9fdb6c08d7e0cb36
Reviewed-on: https://gerrit.instructure.com/26197
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Adam Phillipps <adam@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2013-11-20 20:54:46 +00:00
James Williams ab8417528c import webct multiple short answer questions as fimb
test plan:
* import the course referenced in the ticket
* the question previous imported as short answer
should now be imported as a fill-in-multiple-
blanks question

fixes #CNVS-9355

Change-Id: Ia8f175249513bc4443a8ba339f867f3905f1d17d
Reviewed-on: https://gerrit.instructure.com/26447
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>
2013-11-20 18:06:36 +00:00
Rob Orton 627f858967 spec add new helper for running account reports
this helper takes an options hash and can return a
report object instead of the parsed file
this will also read from the zip file instead of
reading from the hash generated by the report

test plan
- specs should pass

Change-Id: I200aa9d29ba95d6468dca8b192e9d7c415584517
Reviewed-on: https://gerrit.instructure.com/26192
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2013-11-19 20:21:03 +00:00
Jacob Fugal 845b36d0ae fixup middleware for rails3
refs CNVS-4704

test-plan:
 - 2.3 rails still boots and works

Change-Id: I107637f3abf107ad652aec959567dd5d738229c0
Reviewed-on: https://gerrit.instructure.com/26335
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
QA-Review: Jacob Fugal <jacob@instructure.com>
2013-11-19 18:43:49 +00:00
James Williams 9568a68504 bring in webct question answer files
test plan:
* import the course referenced in the ticket
* quiz question answers should not have broken
image links

fixes #CNVS-1556

Change-Id: I8c99cc0c7c6940738e75a2b0d661880281411c91
Reviewed-on: https://gerrit.instructure.com/26417
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-19 16:35:10 +00:00
Jacob Fugal 52beb9a1c3 Revert "switch from rails_xss plugin to gem"
this reverts commit c8a4c453ff.

while the gem *appears* recent, it hasn't merged upstream changes from
http://github.com/rails/rails_xss since before we vendored it, so we
can't make the switch after all.

instead, I've just silenced the rails3 warning and left a TODO marker.

Change-Id: I8957e676c38ef7cdeac0e6266f2cac3288b1ec7d
Reviewed-on: https://gerrit.instructure.com/26374
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Bryan Madsen <bryan@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
QA-Review: Jacob Fugal <jacob@instructure.com>
2013-11-18 16:18:04 +00:00
Bracken Mosbacker 83334fb653 allow creating content migration with url to cartridge
Now a user can specify a url to the content to import instead
of having to upload the file directly to canvas.

Test Plan:
 * Using the content migration api, create a CC migration with
   a settings['file_url'] instead of doing an attachment
 * the file url must be publicly accessible from the canvas instance
 * it should happily import
 * Also do a zip file import

closes PLAT-206

Change-Id: Ide387b8e66625e5eb5c546054900a4a0fc50eb0c
Reviewed-on: https://gerrit.instructure.com/26287
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-11-15 20:14:04 +00:00
Jacob Fugal c8a4c453ff switch from rails_xss plugin to gem
fixes CNVS-9384

but maintain our patchup from 0fe0ba0

Change-Id: I828fdd8ef64ca04d10d2ef5b925d07243fb65be7
test-plan: specs
Reviewed-on: https://gerrit.instructure.com/26229
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-11-15 15:48:16 +00:00
Cody Cutrer 204e52a125 Merge branch 'fix-preview_reuploaded_files' of github.com:sfu/canvas-lms 2013-11-12 09:35:11 -07:00
Justin Ball 8ae4ba8ee8 Fixed style gauntlet regex to allow for negative values such as margin:-18px 2013-11-11 16:34:05 -07:00
Rob Orton 0f23818a30 spec don't use default account for report specs
fixes CNVS-9301

test plan
 * specs should pass

Change-Id: I66c9304f6d7ad8767840d5b1eba3ea1725486f13
Reviewed-on: https://gerrit.instructure.com/26015
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>
2013-11-06 20:40:24 +00:00
Rob Orton 71257d3942 spec fix fragile course report specs
refs PS-719

test plan
 * specs should pass

Change-Id: Ic4dfa202682166ea0ffd35ca4095123756d241dc
Reviewed-on: https://gerrit.instructure.com/26008
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>
2013-11-06 20:40:11 +00:00
Rob Orton c0a26cc4ae include state standards in learning outcome reports
fixes CNVS-9204
refs CNVS-8921

test plan
- import a state standard
- have an outcome result for the state standard (graded item tied to outcome)
- run learning_outcome_results report
- run student_competency_report
- reports should have result

Change-Id: I8c39f235022b8f4d0a642a9364b7082e313d9c4e
Reviewed-on: https://gerrit.instructure.com/25849
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2013-10-31 19:51:17 +00:00
Andrew Leung 8a5beb735f Fix inability to preview deleted/re-uploaded file
The problem affects an instance using local storage and Google Docs
Preview. When previewing a file that was previously deleted, an error
message saying "unable to find the document at the original source" will
be displayed in Google Docs Preview. This is because the preview URL is
no longer valid. In fact, it redirects to the login page.

Test Plan:
* Disable Scribd but enable Google Docs Preview
* Upload a brand new file to a course
* Preview the file
* Delete it, and re-upload the same file
* Confirm that the file can still be previewed
2013-10-30 09:46:59 -07:00
Rob Orton db130fd333 get rid of scribd_account
refs CNVS-8282

test plan
 - have scribd enabled
 - upload a scribdable document to a course
 - document should be rendered with scribd
 - previously created documents should still render

Change-Id: Id8d7ea962c7bbe16b0f124e23447c66a48dd4100
Reviewed-on: https://gerrit.instructure.com/25566
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2013-10-25 16:56:59 +00:00
Cody Cutrer c4130f340c get rid of jobs max run time
refs CNVS-86

orphan detection works good enough, and some jobs legitimately run that long

Change-Id: I0be6f4182c5f303b0c0b07888db98d2d0f5fd740
Reviewed-on: https://gerrit.instructure.com/25479
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2013-10-23 15:46:52 +00:00
James Williams 0fe0ba0180 change block helpers for rails 3.2 compatibility
closes #CNVS-5018

Change-Id: If1cef73759f090efe2a58dc97c351410a552ae1d
Reviewed-on: https://gerrit.instructure.com/25109
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2013-10-11 23:09:37 +00:00
James Williams 84a1d121ba fake rails3 generator for simply versioned
closes #CNVS-8668

Change-Id: I1c842ba228c6cba0d36ecfe5b9f545c714ccb1b6
Reviewed-on: https://gerrit.instructure.com/25148
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
QA-Review: Jacob Fugal <jacob@instructure.com>
2013-10-10 16:09:12 +00:00
Jacob Fugal dfab0425e3 use CANVAS_RAILS2 for conditionals
rather than CANVAS_RAILS3 or Rails.version

this is to be consistent, and to reinforce that any "special" branches
are for rails 2.3 backwards compatibility while trying to target rails
3, rather than rails 3 "forwards compatibility".

Change-Id: I4494b65e3f71108a43d09032c1569c478646a828
Reviewed-on: https://gerrit.instructure.com/24998
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
QA-Review: Jacob Fugal <jacob@instructure.com>
2013-10-10 15:58:43 +00:00
Cody Cutrer d935ab98b1 deprecate Setting.get_cached
now that we have SIGHUP, we were changing everything to it anyway,
so just let caching in-proc be the default

Change-Id: Id1b44722522ac9693b17695da7107c99a359d5ac
Reviewed-on: https://gerrit.instructure.com/25020
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-10-10 00:42:52 +00:00
James Williams 6f669330a8 update qti_exporter spec
Change-Id: Ib1d576ed98854fcbc9e2790687160bed4aed18ac
Reviewed-on: https://gerrit.instructure.com/25050
Product-Review: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
2013-10-05 21:53:50 +00:00
Cody Cutrer a19b3ef8dd spec: run transaction commit callbacks when down to 1 transaction
removes need for run_transaction_commit_callbacks all over the place

Change-Id: Id878276ed86bb37f625ef34412b16d1f75a63bca
Reviewed-on: https://gerrit.instructure.com/24758
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2013-10-01 23:51:04 +00:00
James Williams 66799050ba expand angel fill-in-multiple-blanks question answer importing
test plan:
* import the package referenced in the ticket
* check the quiz titled "Test 7"
* check the question titled
 "3.3 find p-value two-tailed mu with website"
* confirm that the question has answers

fixes #CNVS-5672

Change-Id: I8e2597475ead30a10e57b9a9edac18c0e10d6fe6
Reviewed-on: https://gerrit.instructure.com/24677
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Hannah Bottalla <hannah@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-10-01 18:43:44 +00:00
Brandon Broschinsky 11593a2b8c fixed report helper to account for user account timezone
fixed PS-534

Change-Id: I8b5233d80edf179337efdb23e33e959bfda1c72d
Reviewed-on: https://gerrit.instructure.com/24504
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Brandon Broschinsky <brandonbr@instructure.com>
QA-Review: Brandon Broschinsky <brandonbr@instructure.com>
2013-09-25 20:04:27 +00:00
James Williams 9d4660b641 fix respondus question bank and quiz importing
test plan:
* publishing through respondus should work for question banks
and for quizzes when settings are applied

fixes #CNVS-8276 #CNVS-4297

Change-Id: I3b254c6375aa5524f6ecf78c31e64d34a13ba4a7
Reviewed-on: https://gerrit.instructure.com/24566
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Hannah Bottalla <hannah@instructure.com>
2013-09-24 19:39:51 +00:00
Jacob Fugal 0f8b2775ab don't delete s3 objects on attachment destruction
refs CNVS-8056

we don't want to actually delete objects from s3 (at least not due to
the Attachment being destroyed). With our root attachment deduplication
scheme it just gets too messy and buggy.  We'll just GC them later.

test-plan:
 - be using s3
 - upload a file, call this a1
 - upload the same file again, call this a2. a2 should have a1 as its
   root attachment
 - in script/console, call a2.destroy!. a2 should be removed completely
   from the database
 - a1 should still work (its s3object should not be gone)

Change-Id: Ie1f488e28b44c983a0d8528d61ce8ae99b8c6736
Reviewed-on: https://gerrit.instructure.com/24280
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
2013-09-23 19:47:13 +00:00
Brian Palmer 49adf6050a search the right namespace for this constant
We're in the Delayed::Backend module here, and there's also a
Delayed::Backend::ActiveRecord class, so this call was ambiguous if
ActiveRecord wasn't already fully loaded.

Change-Id: I7071e2b1af454b2837e52204ef8282fb312002e1
Reviewed-on: https://gerrit.instructure.com/24424
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
Tested-by: Brian Palmer <brianp@instructure.com>
2013-09-18 16:50:50 +00:00
Brian Palmer 7928155ea9 extract delayed_job redis lua utilities into a gem
We'd like to re-use some of this code elsewhere, and there's nothing
canvas-specific about it.

refs CNVS-7008

test plan: redis delayed job specs still pass

Change-Id: Iaa19ee60419d01bb451cccf2861a1015a7ba087a
Reviewed-on: https://gerrit.instructure.com/24255
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
2013-09-17 15:09:38 +00:00
Jake Sorce b4264e7fa1 add ext param to generate file
default the param to csv
also support tab delimited parsing in report spec helper

refs PS-526

Change-Id: I962877d1937f1d88072861f456a29d2c31f2a3d4
Reviewed-on: https://gerrit.instructure.com/24330
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Jake Sorce <jake@instructure.com>
QA-Review: Jake Sorce <jake@instructure.com>
Reviewed-by: Jake Sorce <jake@instructure.com>
Tested-by: Jake Sorce <jake@instructure.com>
2013-09-16 23:47:12 +00:00
Rob Orton e0b5f33f90 limit students with no submissions report to two weeks
closes CNVS-8167

test plan
 - report should only report on a 2 weeks time range
 - if time range is over two weeks it will use the end date and 2 weeks before it for the start date
 - report should not time out

Change-Id: I2750d53f358a41b351e36e718bfbbb04e61aa198
Reviewed-on: https://gerrit.instructure.com/24382
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2013-09-16 21:49:03 +00:00
Cody Cutrer 025fbec05e clear active connections after each job
in a sharded environment, this helps to clear out idle connections

this is similar to what
ActiveRecord::ConnectionAdapters::ConnectionManagement middleware
does after each web request

test plan:
 * run some jobs
 * they should not fail

Change-Id: I431205ff1e9197940bddf4028d3c4c7662a74056
Reviewed-on: https://gerrit.instructure.com/24285
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-09-16 18:43:46 +00:00
Brandon Broschinsky 8fd37a4f88 added report helper method to format timezone string
fixes PS-534

Change-Id: I04329795ddd8eee2082b7e6523189d008013f342
Reviewed-on: https://gerrit.instructure.com/24356
Reviewed-by: Nathan Mills <nathanm@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Brandon Broschinsky <brandonbr@instructure.com>
QA-Review: Brandon Broschinsky <brandonbr@instructure.com>
2013-09-13 22:22:18 +00:00
Cody Cutrer d3f0b18684 validate nullness in the db on a bunch of columns
fixes CNVS-7414

Change-Id: I60978f66d88d916dc5736dbb975715172bd1e14b
Reviewed-on: https://gerrit.instructure.com/23141
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2013-09-12 22:20:39 +00:00
Brian Palmer 4d7ce65aa8 add strand to delayed job "Processing" log line
This would've helped some debugging I was doing today.

test plan: run delayed jobs, see that the "Processing <job tag> {job details}"
log line now includes the strand along with the other info

Change-Id: I569429d2f320486f161adbcab2985f93f9a68a99
Reviewed-on: https://gerrit.instructure.com/24169
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
2013-09-10 21:24:56 +00:00
Nathan Mills 0399b80ecc add report helper for extra text
Change-Id: I073bce65c59d68e89b714671ea81fe908879784b
Reviewed-on: https://gerrit.instructure.com/24091
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-09-07 16:25:11 +00:00
Rob Orton bc13f12a18 write report file object on master
fixes CNVS-7775

test plan
- run an account report 
- report should work

Change-Id: I96bcadd05b704247fb9b0b79ad30f8f36896d592
Reviewed-on: https://gerrit.instructure.com/23787
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2013-08-27 18:40:05 +00:00
Rob Orton 1d704e4893 spec change fragile spec in course report
fixes CNVS-7717

test plan
 - specs should pass

Change-Id: Icc47fdb60216095158142186ff10f53172bdf6fc
Reviewed-on: https://gerrit.instructure.com/23686
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bryan Madsen <bryan@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
2013-08-24 00:49:43 +00:00
Rob Orton ae0a3f5e1f implement protection against HTTPS BREACH attack
fixes CNVS-7383

test plan
 - take a quiz
 - it should not error
 - the token should change on each request
 - visit a page in canvas and open browser console(chrome, right click, inspect element) console is on the right side
 - run ENV.AUTHENTICITY_TOKEN
 - reload the page
 - run ENV.AUTHENTICITY_TOKEN
 - the tokens should not match

Change-Id: I405e749b37c7195af55b784d6b4f10346a15f377
Reviewed-on: https://gerrit.instructure.com/23506
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2013-08-23 19:48:20 +00:00
Nathan Mills 17a4a0b356 add a section helper for api find
refs PS-314

Change-Id: I2af0622de09a4eecf86d983a695457cf6b93717b
Reviewed-on: https://gerrit.instructure.com/23474
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-08-22 14:36:15 +00:00
Simon Williams 147d171aa1 correctly maintain assignment/rubric <-> outcome links
There are a few old LearningOutcomeResults that have a nil artifact, and
many that have a Submission as an artifact.  We want to get rid of these
because they come from bad data, and step 1 toward that goal is to stop
creating them and hide them in the UI.

The LORs with a nil artifact are very old and I believe came from a very
early incarnation of outcomes.  The LORs with a Submission as an artifact
came from a combination of two code problems.  The first was old code
that allowed an assignment that was aligned with an outcome but did not
have a rubric to create LORs directly based on it's submission.  The
second was a bug that prevented the assignment <-> outcome link from
being destroyed when a rubric with an outcome was removed from an
assignment.

fixes CNVS-7495
fixes CNVS-7498

test plan:
- try different combinations of adding a rubric with an outcome to an
  assignment.
- when you grade the assignment, the grade create a learning outcome result
  (which can be seen on the outcome show page, or in the account outcome
  report) if the rubric+outcome are currently attached to the assignment.
- so for example, add a rubric with an outcome, check, remove just the outcome
  row, check, add a new outcome row, check, remove the whole rubric, check.
- be sure to check both the show page and the outcome report

TODO:
- datafix migration

Change-Id: I37700e3e5c08fc6cfb8fcf1cac42ea6693fcaba3
Reviewed-on: https://gerrit.instructure.com/23303
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2013-08-20 22:40:01 +00:00
James Williams 64ccf532c1 fix moodle multiple_dropdowns importing
test plan:
* import the package referenced in the ticket
* importing should not fail

* however, it should give migration warnings explaining that
 the "Multiple dropdown" questions may be incorrect,
 including direct links to the questions

fixes #CNVS-7048

Change-Id: Iff001c0181086986be0b4ead38970df7abd9878a
Reviewed-on: https://gerrit.instructure.com/23165
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-08-20 20:08:06 +00:00
Brian Palmer fc22e21830 remove redis.pipelined usage
Unfortuanately the current ruby redis gem doesn't support pipelining
with a redis cluster, even if all the commands are acting on the same
key. Since we're working on turning the data redis into a cluster, these
have got to go.

test plan: specs should cover all this. could also do a quick regression
test on failed logouts (shouldn't error, should still limit failed login
attempts)

Change-Id: Ifa950268416e9086b72610914d7efc8a816d628b
Reviewed-on: https://gerrit.instructure.com/23457
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
2013-08-19 20:33:45 +00:00
Stanley Stuart 9b76539a3e add the ability to regrade a quiz
This commit gives teachers the ability to regrade quizzes by using
different options per quiz question:

* Current Correct Only
* Full Credit (regardless of answer choice)
* Previous and Current Correct
* No Point change (for updating the display of a question)

Test Plan:
  You'll want to run through each question regrade option making sure
  scores change appropriately.

"I seldom end up where I wanted to go, but almost always end up where I
need to be." - Douglas Adams

Change-Id: I9dbb88154cd3ac630bf59dbf3e997a87f75649dc
Reviewed-on: https://gerrit.instructure.com/22018
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
2013-08-19 17:29:26 +00:00
Nathan Mills 1a351ecf20 add header option to account report helper
Change-Id: I7b5f0bffe46ed2559af833121902af86bf79afa2
refs: PS-314
Reviewed-on: https://gerrit.instructure.com/23400
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brandon Broschinsky <brandonbr@instructure.com>
Product-Review: Nathan Mills <nathanm@instructure.com>
QA-Review: Nathan Mills <nathanm@instructure.com>
2013-08-19 17:20:38 +00:00
Cody Cutrer 4b6ee35a88 spec: fix respondus spec fragility
sometimes a Pathname object instead of a string gets added to $LOAD_PATH.
just .to_s it so that regex will work

Change-Id: If3279881edc302b27941bb2ac91a61c0bbf5759b
Reviewed-on: https://gerrit.instructure.com/23422
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2013-08-19 14:55:07 +00:00
Brian Palmer e5db3b351b raise a NameError when a periodic job is no longer scheduled
This way the job deserialization code will properly handle the error and
delete the job. The ArgumentError was causing the worker to blow up and
leave the job in the queue, causing a neverending cycle of worker
failure.

fixes CNVS-7578

test plan: specs

Change-Id: If79fa107c0d7942416971d90cfbc1a01feb0d54a
Reviewed-on: https://gerrit.instructure.com/23390
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
2013-08-16 14:31:31 +00:00
Rob Orton b3d9e566ce fix unused courses reports to ignore deleted files
test plan
 - create a file in a course 
 - course should not show up in unused courses report
 - delete the file
 - course should show up in unused courses report

Change-Id: I0075fa039493192746d1201fa5e872a8b19861b4
Reviewed-on: https://gerrit.instructure.com/23273
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2013-08-14 22:32:00 +00:00
Cody Cutrer c36b0231dd don't let jobs master die when unlocking jobs
the db might go away, so fork and then we don't care about errors

Change-Id: I29e8487a1c1b7f5e6b4e0b74b306625dbcbfab56
Reviewed-on: https://gerrit.instructure.com/23312
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2013-08-14 22:26:18 +00:00
Rob Orton 294be5d3f5 create outcome results report
closes CNVS-7299

test plan
- create an account level outcome
- create a quiz bank and tie to outcome
- create a quiz
- as a student take the quiz
- the result should be in the outcome report

Change-Id: Ie5c9ad25266e32a204cb6f44cebbc8d46a39a032
Reviewed-on: https://gerrit.instructure.com/23243
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2013-08-14 20:58:47 +00:00
Mark Severson e595ebe375 only create page versions on content change
test plan:
 * editing a page (through the UI or API)
   - saving changes to a page should only create revisions when body or title are changed
 * editing a page as a different user
   - saving non-content changes as a different user should not create a new revision

fixes CNVS-7247

Change-Id: Icbcafc8ce70f82908b3b517a9eb5ce09bd0bae09
Reviewed-on: https://gerrit.instructure.com/23178
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Matt Goodwin <mattg@instructure.com>
2013-08-12 21:31:32 +00:00
Rob Orton 3dec746126 fix course api helper for account reports
test plan
- make a course in a sub_account
- use a report that has a course filter on a root_account
- report should work

Change-Id: I17e4f62d2049ab2f73b6baee37b0f85e578e6c7d
Reviewed-on: https://gerrit.instructure.com/23057
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Nathan Mills <nathanm@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2013-08-06 20:04:39 +00:00
Rob Orton fc0b9dbdc8 update account report progress on master
test plan
- run Student Competency report
- progress should work(this may take thousands of outcomes to see progress in api)
- report should not fail
- run recently deleted courses report
- run unpublished courses report
- reports should not fail

Change-Id: I0020af16a73c0aec5d017ab048b926e3e7e93279
Reviewed-on: https://gerrit.instructure.com/22936
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2013-08-06 18:54:32 +00:00
Nathan Mills 9e134d97a5 add helper for writing csv files
refs PS-451

Change-Id: I9efdfc2ac218642321cff152e905f8544e8ff2ad
Reviewed-on: https://gerrit.instructure.com/22995
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2013-08-05 21:06:30 +00:00
Jake Sorce b117b3957e add status column to grade export report
closes PS-516

test plan:
  1. run grade export report
  2. verify extra status column is included in report
  3. the status column is the users workflow state

Change-Id: I17b5d8562a92ae94b0d211da6b9d7315fc94d303
Reviewed-on: https://gerrit.instructure.com/22833
QA-Review: Adam Phillipps <adam@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2013-08-02 15:29:34 +00:00
Bracken Mosbacker d1651922c4 add link to source course in new migration ui
adds a column to the new migration UI that has a link to
either the uploaded file or to the source course.

also sorted the content type box and put course copy and
canvas packages first.

Test Plan:
 * run a file upload migration and a course copy one
   (or just go to a page with existing ones)
 * There should be a link to the uploaded file and the source course
 * The type column should also make more sense, for example,
   it'll say 'Course Copy' instead of 'Copy Canvas Course'
 * The content type box should be in the order of: course copy,
   canvas cartridge, .zip file, then alphabetical

closes CNVS-7178

Change-Id: I639e00db0188ce5119daac792119abd1da546908
Reviewed-on: https://gerrit.instructure.com/22742
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-07-30 19:31:17 +00:00
Rob Orton d5eff95ba0 create unused courses report
closes PS-442

test plan
 - create an empty course shell
 - courses should show on report
 - add something to the courses
 - courses should not show on the report

Change-Id: If2f47cbb343eee64ad9b485b635f7bf7e8d6f42a
Reviewed-on: https://gerrit.instructure.com/21691
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Nathan Mills <nathanm@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2013-07-24 21:23:17 +00:00
Duane Johnson 1c297e632b add an on_load callback to simply_versioned
refs CNVS-6869

When a version is loaded from the database, the on_load callback
gives the model an opportunity to process or modify the data if
necessary. For example, if current information on the model should
override a cached attribute, this would be the place to do it.

Test Plan:
- in the console, create a submission, e.g.
  >> s = Submission.create :assignment => a1, :user => u1
- add an on_load callback, e.g.
  >> submission.simply_versioned_options[:on_load] =
     lambda{ |model, version| model.grade = 'A' }
- now, no matter what grade you set (and save) in a versioned copy of
  the submission, you should get 'A' back

Change-Id: I9dde0118e2833c72e6209f3d632d9503db1e1eb3
Reviewed-on: https://gerrit.instructure.com/22472
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Duane Johnson <duane@instructure.com>
2013-07-24 16:14:39 +00:00
Rob Orton 95662eb9a4 create zero activity and last user access reports
also change enrollment_term to enrollment_term_id
and course to course_id for api parameters but make
it backwards compatible

closes PS-440
closes PS-441
refs CNVS-6265

test plan
- run zero activity report
  report should return users that have not participated
  since the given date in the course
- run las user access report
  report should return all users in an account and 
  the last time they accessed canvas
- verify that parameters[enrollment_term] works in 
  addition to parameters[enrollment_term_id] when
  using the api to post new reports
- verify that parameters[course] works in 
  addition to parameters[course_id] when
  using the api to post new reports

Change-Id: I6d65bdf21c270f9c227ebeb1b044397fc1d5807d
Reviewed-on: https://gerrit.instructure.com/22539
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brandon Broschinsky <brandonbr@instructure.com>
QA-Review: Tyler Belnap <tyler@instructure.com>
Reviewed-by: Nathan Mills <nathanm@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2013-07-23 19:43:44 +00:00
Cody Cutrer b27e4dcf99 move a bunch of SIS export reports to the slave
Change-Id: Iddb53e417c2b42e9b282e419719386afe1e86051
Reviewed-on: https://gerrit.instructure.com/22368
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>
2013-07-18 22:27:03 +00:00
Cody Cutrer 2deb504378 useful find_each
* automatically does with_exclusive_scope
 * if the scope has an order or group by, use an alternate
   implementation so it's not broken
 * alternate methods are cursors (postresql only) or temporary
   tables. if a transaction is already open, or we're on a slave,
   prefer a cursor (even over the normal method, since the query
   might be slow even without an order or group by)

test plan:
 * migrations should still work (especially data fixups)
 * lots of account reports use find_each; make sure they still run

Change-Id: If876b7b3401e6cda1d41f1c94b93af4810b78cf4
Reviewed-on: https://gerrit.instructure.com/22364
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-07-18 22:26:46 +00:00
Brian Palmer bfb4285864 extend n_strand jobs to support the per-root-account use case
refs CNVS-6970

This allows passing two params for the :n_strand parameter, and looking
up the Setting based on just the first param. For example
["course_copy", root_account.global_id] will create an n_strand per root
account, but allow the "course_copy_n_strands" to control the # of
strands for every root account. You can also override for a specific
account with a "course_copy/<global_id>_n_strands" setting.

test plan: specs

Change-Id: Ie72468588fa1172ea967e1f0a072c9d565bae62f
Reviewed-on: https://gerrit.instructure.com/22461
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-07-18 19:41:33 +00:00
Rob Orton 50f8160861 create students with no submissions report
closes PS-439

test plan
 - report should return students that have no submissions in date range

Change-Id: I412791e9631f54cb2050ae2ac180872a2f170a2e
Reviewed-on: https://gerrit.instructure.com/21688
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Nathan Mills <nathanm@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2013-07-18 17:14:30 +00:00
Brian Palmer b5c1506e94 reconnect to redis when forking for unlock_orphaned_jobs
test plan:
* run jobs (script/delayed_job run), verify that jobs are still
  processed without error.
* create a long-running job (you can just Kernel.send_later(:sleep,
  300)), then while the job is running, kill -9 the delayed_job
  processes. When you next start jobs, the sleep job should get
  unlocked and re-queued to run again.

Change-Id: Ic3efba2537b29dabd2adad63699ac768512dbbe6
Reviewed-on: https://gerrit.instructure.com/22302
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
2013-07-18 15:59:56 +00:00
Cody Cutrer 685096c442 fix sis courses export report on a sub account
fixes CNVS-4439 FRD

test plan:
 * in a sub account, run the sis export report, selecting the courses
   option
 * it should work

Change-Id: I1fe42aa4ceeb59742376dfdbeeb7481152cf7286
Reviewed-on: https://gerrit.instructure.com/21598
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-07-16 16:35:03 +00:00
Jake Sorce 6e99c9db46 grab all AB Standards not just grade types
closes PS-488

test plan:
  1. run academic benchmark import with state guid
  2. once that is imported verify all standards are imported

Change-Id: I82455878ea947e33a0c8b5974582106b0633c86e
Reviewed-on: https://gerrit.instructure.com/22183
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Jake Sorce <jake@instructure.com>
QA-Review: Jake Sorce <jake@instructure.com>
2013-07-10 17:24:46 +00:00
James Williams 6855e451fe qti exporter angel import substring fill-in-the-blank answers
test plan:
* import the package referenced in the ticket
* in the quiz titled 'Exam II', last question,
the 5th answer field should have an expected answer

refs #CNVS-5757

Change-Id: Ie412626d53a52f464f4d488a2b991898d455e349
Reviewed-on: https://gerrit.instructure.com/22088
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: August Thornton <august@instructure.com>
2013-07-09 16:09:28 +00:00
Bracken Mosbacker 89508bf997 make new migration UI the default
removed old migration UI.

Test Plan:
 * rejoice
 * zip file uploads in files UI for courses, groups, and users should work
 * the links /courses/:id/imports and /courses/:id/imports/list should redirect to new UI
 * the course copy api should work
 * doing a course copy in the UI should work
 * rejoice

closes CNVS-6499

Change-Id: Icd71c5f7bf8a97570f6572938b01504589a6a718
Reviewed-on: https://gerrit.instructure.com/21943
Reviewed-by: James Williams  <jamesw@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
2013-07-08 17:19:06 +00:00
James Williams ffa674f18d update moodle2cc gem
fixes two separate issues

CNVS-4048 - test plan:
* import the moodle package referenced in the ticket
* should include discussion topics

CNVS-6081 - test plan:
* import the moodle package referenced in the ticket
* the first questions in the question bank 'Test 2'
should include images

fixes #CNVS-6081 #CNVS-4048

Change-Id: I386cdc3c7380580758a8924c75801d3fb721d3bd
Reviewed-on: https://gerrit.instructure.com/21798
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
2013-07-02 19:17:04 +00:00
Brian Palmer 89ec89930c rails3 fixes
* disable i18nema until we're on rails 3.2
* fix how we access session_options
* fix how we access the basic auth header
* fix attachment_fu callbacks

test plan: none of these fixes should affect rails 2

Change-Id: I7f9b6f18c04d51284ec3e5e9fdd39fb93539c91b
Reviewed-on: https://gerrit.instructure.com/21728
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
2013-06-26 20:22:26 +00:00
James Williams 7d79140483 fully remove style tags in html sanitizer
test plan:
* test the sanitizer through the api by
creating or updating an object with html content
(such as a wiki page body attribute)

* the following html:
  <p><style>should ignore this text</style></p>

* should be sanitized to:
  <p></p>

fixes #CNVS-5828

Change-Id: I735f031eafdeeb8d7ae05fd977327fb3cc7e9251
Reviewed-on: https://gerrit.instructure.com/21689
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
2013-06-25 19:13:20 +00:00
James Williams e370322471 prevent incompatible character encodings errors
refs #CNVS-5828

Change-Id: Id0a165363de05f000eee956bf976ffcff70adfc7
Reviewed-on: https://gerrit.instructure.com/21674
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
2013-06-25 19:13:13 +00:00
James Williams ef90ab60e2 preserve links to other content in quizzes on course copy
test plan:
* create a quiz that includes a link to other content
in the course, such as an assignment or a wiki page
* copy the course
* the links should be copied correctly

fixes #CNVS-2303

Change-Id: Ie5eb41c9193bad4d3786d2cd312b31a3be6c4ddf
Reviewed-on: https://gerrit.instructure.com/21600
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
2013-06-24 18:54:31 +00:00
Cody Cutrer 5d16bd674b minor optimizations around simply_versioned
refs CNVS-5805

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

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

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

Change-Id: I9d29eacbaa67dbc267ee09400d62651ef6ccdc0a
Reviewed-on: https://gerrit.instructure.com/20901
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-06-18 21:05:27 +00:00
Cody Cutrer e852ebb6da delay creating jobs in other dbs until transaction completes
this prevents the job from accessing data that hasn't committed yet,
as well as many instances of it waiting for the first transaction to
release a lock cause the two transactions are referencing the same
data

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

Change-Id: I7b132b6119f60e38ae1ba4d17dea18ac49114960
Reviewed-on: https://gerrit.instructure.com/21168
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Cody Cutrer <cody@instructure.com>
2013-06-17 20:19:08 +00:00
James Williams 9a718e36f6 delay migration job_progress creation for academic benchmarks
Change-Id: Ia07bf2e963d48605b388a1ca16de26825558aebb
Reviewed-on: https://gerrit.instructure.com/21410
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2013-06-12 20:18:10 +00:00
Rob Orton b2e9773832 create account level course reports
closes PS-326

test plan
- unpublished courses report should run
- recently deleted courses report should run
- specs should pass

Change-Id: I3de16037b3b6b010610309628b698e3ef3247d3f
Reviewed-on: https://gerrit.instructure.com/20744
Tested-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Tyler Belnap <tyler@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2013-06-10 20:52:06 +00:00
Rob Orton fd12cc5630 add course sections to student competency report
closes CNVS-5923

test plan
- student competency report should run and include sections name, id, sis_id
- specs should pass

Change-Id: I4543dbc80bada79ab54b206ed4f39cf8d6ff2588
Reviewed-on: https://gerrit.instructure.com/20745
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2013-05-31 23:19:59 +00:00
Jon Willesen 5a4a84a487 add back-end recording to big blue button conferences
fixes CNVS-5660

test plan:
 - setup the BBB conferences plugin.
 - create a new BBB conference, and click the checkbox to record
   the conference.
 - start the conference, do some stuff, logout, and then wait a
   few minutes.
 - start script/console and find the conference you just
   created: `wc = WebConference.find(1234)`
 - in the console, type `pp wc.recordings; nil`
 - you should see a recording_id, a duration_minutes, and a
   playback_url.
 - copy-and-paste the playback_url into your browser. you
   should go to the BBB playback page and be able to view the
   recorded conference.

Change-Id: I326ac25ef0280350a85a37215a5659fc6a827151
Reviewed-on: https://gerrit.instructure.com/20783
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Product-Review: Jon Willesen <jonw@instructure.com>
QA-Review: Jon Willesen <jonw@instructure.com>
2013-05-28 16:20:30 +00:00
Brian Palmer 02e8efdcd7 skip checking override versions when not needed
if we're dealing with the actual assignment/quiz instead of the model
from one of its versions, we don't need to align the history of the
overrides with the history of the assignment/quiz. we can just use the
most recent version of each override.

refs CNVS-5805

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

Change-Id: I52d55da0619688744d63d6523e1bc055ecdaa667
Reviewed-on: https://gerrit.instructure.com/20813
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
2013-05-23 20:46:49 +00:00
Jon Jensen 53dc3ad6a6 fix various i18n issues
fix all the places we incorrectly translate during rails initialization
rather than at runtime

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

Change-Id: I1c0e3b9513103cfddfd4ad94dde4b3a0dd49203e
Reviewed-on: https://gerrit.instructure.com/20468
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2013-05-23 18:54:55 +00:00
Rob Orton 1cc013d539 removes a race condition for report file downloads
spec plan
-specs should pass

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

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

fixes: CNVS-4732

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

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

refs #CNVS-4228

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

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

closes CNVS-4228

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

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

refs CNVS-4228

Change-Id: Iab1082ca68b61d1b0493c191b48169a164444d06
Reviewed-on: https://gerrit.instructure.com/19108
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
2013-05-17 22:34:09 +00:00
Rob Orton 51cca64e77 fixes ambiguous query in sis_export
fixes CNVS-4439

test plan
- specs should pass

Change-Id: Iede9966c6979cc7682096e14d1651dcb84a5396b
Reviewed-on: https://gerrit.instructure.com/20636
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Nathan Mills <nathanm@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2013-05-15 14:20:51 +00:00
Rob Orton 60b101d86d exclude student view student from reports
also removes a race condition for report file downloads

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

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

Change-Id: I03544c7a38d91bd7d356c4ae73ea8857f948da7e
Reviewed-on: https://gerrit.instructure.com/20517
QA-Review: Clare Strong <clare@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2013-05-10 21:00:12 +00:00
Cody Cutrer 6a08e9058b use the birth shard so that the default shard can be changed
Change-Id: Ia7684c0b50df9d5fae4608b7e8e3d8d6dea291cc
Reviewed-on: https://gerrit.instructure.com/19748
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2013-05-07 15:44:17 +00:00
Brian Palmer 37e7f7f141 upload attachments to s3 outside of the AR#save db transaction
fixes CNVS-5505

This utilizes our after_transaction_commit callback mechanism to delay
uploading the file until the database trasaction is committed, so that
we aren't holding the transaction open for the entire upload to S3. At
best this causes <IDLE> transactions, and at worst it keeps other rows
locked for the duration of the upload.

It also introduces a new callback on AttachmentFu models,
after_save_and_attachment_processing, which is called like a normal
after_save when the attachment is uploaded immediately, and after the
attachment is uploaded (so after the transaction) when the upload is
delayed.

test plan: most attachment upload paths are covered by selenium tests.
for manual testing, we'll want to check each location in the application
where files can be uploaded for regressions. this includes anywhere that
a zip file is uploaded or generated and downloaded.

Change-Id: I033bd19d63a6becc421143c929dfe7c19c7f4e51
Reviewed-on: https://gerrit.instructure.com/20210
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Reviewed-by: Duane Johnson <duane@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
2013-05-06 19:28:37 +00:00
Brian Palmer 31f33164b5 remove 1.8 compatibility shims
- update the Gemfile to be 1.9 only, and raise an exception on wrong
  ruby version
- remove RUBY_VERSION checks, replacing with the applicable code
- remove the FasterCSV compatibility shim, just use CSV now

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

Change-Id: I49088e9d227c59c6d5d5acb417c2df971129474a
Reviewed-on: https://gerrit.instructure.com/19806
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
2013-05-03 01:43:52 +00:00
James Williams b993954788 enable import/export with file_upload_question types
test plan:
* Enable the file_upload_question type for
 the root account in the console:
 > a = LoadAccount.default_domain_root_account
 > a.settings[:file_upload_quiz_questions] = true
 > a.save!

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

closes #CNVS-1158

Change-Id: I99d872ee8557a83647fb2fa1425050c20a4ba518
Reviewed-on: https://gerrit.instructure.com/20013
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2013-04-29 15:57:44 +00:00
Duane Johnson 9c55ed33f9 simplify SimplyVersioned option storage and add callbacks
SimplyVersioned plugin needs callbacks for the addition of the
submission_versions index table. Whenever a submission version is
saved, we will want to add an entry to the submission_versions table
in addition to the versions table. This patch provides hooks for
those callbacks.

Test Plan:
- Versioned anything should still work

Refs CNVS-2802

Change-Id: I02a862c5894a98ece8a586330f264680751ab52f
Reviewed-on: https://gerrit.instructure.com/19520
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jacob Fugal <jacob@instructure.com>
Reviewed-by: Duane Johnson <duane@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
2013-04-20 13:20:29 +00:00
Jeremy Stanley 9938feab15 whitelist <font> tags in sanitizer
fixes CNVS-4957

test plan:
 - import content containing <font> tags
   (such as the course attached to CNVS-4957)
 - these should survive the import process

note: the text in the course above won't actually appear in
hebrew unless you have the bwhebb.ttf font installed
but you can inspect the element and see that the <font> tags
are still there

Change-Id: Ifd219097b6a92813892669cb908d2e7c2d9dd4ca
Reviewed-on: https://gerrit.instructure.com/19712
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2013-04-19 18:21:54 +00:00
Mark Severson 26a4204b87 fix failing specs (caused by libxml2 upgrade)
test plan:
 * specs pass

Change-Id: I2041fa39cbabfd11a51de5aae28d611cacb280e5
refs: #CNVS-5269
Reviewed-on: https://gerrit.instructure.com/19687
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
2013-04-18 16:29:44 +00:00
Bracken Mosbacker 7c4a35b80d allow content migrations to be hidden in the ui
There are some migration systems that aren't for course
content but they still show up in the course content
migration drop-down. So with this you can flag a system
to not show up for users

Test Plan:
 * On the "Import Content from Another System" page there
   shouldn't be a blank option.

closes CNVS-5327

Change-Id: Icb6e7b6e84b80613bc231488cc9f6b16b6ebfe24
Reviewed-on: https://gerrit.instructure.com/19608
QA-Review: Adam Phillipps <adam@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2013-04-16 21:48:31 +00:00
Brian Palmer 08714d9a69 include information about current request in SQL queries
This will help immensely when debugging slow or misbehaving queries.
Thanks to 37signals: https://github.com/37signals/marginalia

closes CNVS-5108

test plan:

cp config/marginalia.yml.example config/marginalia.yml
then edit config/marginalia.yml to uncomment the production block and
change "production" to "development".

run Canvas, and see in your log file how SQL statements have some extra,
useful information in a comment at the end. Run delayed jobs, and you'll
also see useful info on SQL statements in the log -- including job tag,
and context_id in this case will be job id.

Change-Id: I7988a9afaf674bd00c3edc6adafccaf51e7ff60f
Reviewed-on: https://gerrit.instructure.com/16008
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
2013-04-15 15:43:05 +00:00
James Williams 21d1788f22 add migration warnings for missing references in html content
adds migration warnings when links and other references point
to missing or unknown internal content

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

closes #CNVS-134

Change-Id: I1d0a9217fe0c1678968410be8b2eba5b990b8305
Reviewed-on: https://gerrit.instructure.com/19367
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-04-11 18:28:59 +00:00
Cody Cutrer 8c94e53dc7 arel-ify scopes
s/named_scope/scope/g

refs CNVS-4707

Change-Id: I930d229fc9985c7c0096a0f4888933addd4f3aee
Reviewed-on: https://gerrit.instructure.com/18834
Reviewed-by: Duane Johnson <duane@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-04-01 21:57:16 +00:00
Brian Palmer ee2faf03e1 change class_inheritable_accessor and write_inheritable_hash to class_attribute
for rails 3.1+ compatibility

Change-Id: If86dbf1c3fe9d2f42aac16726c02af1eb5a7b86c
Reviewed-on: https://gerrit.instructure.com/19095
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
2013-04-01 18:41:30 +00:00
Jeremy Stanley 0bb7b9d92a fix importing bb9 out-of-order matching questions with distractions
fixes CNVS-4927

test plan:
 - import a blackboard .zip containing a quiz with a matching question
   where the answers are out of order and there are additional
   right-side options (distractions) present
   (such as "test test" attached to CNVS-4927)
 - the questions should be imported correctly

Change-Id: I77ef0019c2d430ee28cdbc79006a2a7971baafc6
Reviewed-on: https://gerrit.instructure.com/19093
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2013-04-01 17:06:03 +00:00
Brian Palmer f5b017a259 spec: fix sharding it_should_behave_like for rspec 2
Apparently the fact that a shared example group added its before/after
filters to the outer context was a bug, and it's been fixed in rspec 2.
So we can't use a shared example group to setup or mark pending sharding
specs anymore.

test plan: specs

Change-Id: I92b022e2e7125214e6bad38bf0a23da547fca984
Reviewed-on: https://gerrit.instructure.com/19182
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Duane Johnson <duane@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
2013-04-01 15:26:44 +00:00
Cody Cutrer 3c53640e36 arel-ify plugins
refs CNVS-4706

Change-Id: I09728ac6d436273fd55a33da91e1abe14ae4da69
Reviewed-on: https://gerrit.instructure.com/18941
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-03-29 14:53:33 +00:00
Cody Cutrer 332e6c7c30 update thumbnail attachment options like Attachment's
basically, s3 needs path_prefix, and refactor authenticated_s3_url for
local storage so that dynamic attachment fu backend switching works
for thumbnail as well

Change-Id: I321560f4d01099000997cd5af379b87aaea75d86
Reviewed-on: https://gerrit.instructure.com/18604
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Duane Johnson <duane@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-03-26 18:46:14 +00:00
Brian Palmer cb5e957965 start adding rails 3.0 support
This can successfully load rails console and rails server. There are
many, many problems still. The idea is this won't change anything under
rails 2.3, it's all backwards compatible.

closes CNVS-4711

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

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

Change-Id: Idd6f35de88adde84cd2db3a650f44b71bd6e9684
Reviewed-on: https://gerrit.instructure.com/18453
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-03-22 19:08:40 +00:00
James Williams 5f470c69ac add File.expand_path for ruby version compatibility
code fix, no test plan

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

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

closes CNVS-4230

Change-Id: I4577f811dd3b16aa200d381f039632b7cc2cd184
Reviewed-on: https://gerrit.instructure.com/18639
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2013-03-18 12:21:58 -06:00
Mark Severson 6a27a192b1 update delayed_jobs to notify job workers of failures
test plan:
 * specs pass

fixes #CNVS-4548

Change-Id: I8db00fef38e7b988d2ea2be4205b8c01af2a2931
Reviewed-on: https://gerrit.instructure.com/18487
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2013-03-15 14:57:21 -06:00
Cody Cutrer 97d5926a0b only remove the tempfile we intended to, not everyone's
test plan:
 * have multiple rails procesess
 * upload lots of image files in parallel
 * it should not fail because a temp file doesn't exist

Change-Id: Ib15c28c3d18af6fd6764f8413ce17e0c7fe193ff
Reviewed-on: https://gerrit.instructure.com/18603
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2013-03-14 15:52:55 -06:00
Simon Williams 716768ec38 fix notifications for quizzes + vdd
fixes CNVS-4510

test plan:
- set students to get due date and course content notifications immediately
- make sure they are active and they're email address is confirmed
- find an old published quiz with overrides (at least a few hours old)
- change the due dates, check 'notify of updates', and hit save
- the student should get a notification that contains the due date that applies
  to them.

Change-Id: I3a43bb2d6673625a4181f1ae5880f354652b93fa
Reviewed-on: https://gerrit.instructure.com/18457
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
2013-03-14 10:06:49 -06:00
Jeremy Stanley dd385f0230 fix problem with unicode characters in wiki page titles
test plan:
* make a wiki page with a title that includes a unicode
  character, such as an accented "a" or "e"
* save the page
* accented characters should be replaced by plain-ascii
  equivalents in the url (e.g., "é" -> "e")
  * but not in the title, of course!
* also test weird stuff like fraction characters ('¼')
  and interrobangs ('‽') to make sure question marks
  and slashes don't end up in the url
* it can also transliterate katakana and stuff, but I
  don't know how smart the rules are for that

fixes #CNVS-4540

Change-Id: I6a6076af1bed138599592430adc69c3b92d65d89
Reviewed-on: https://gerrit.instructure.com/18507
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2013-03-14 09:02:48 -06:00
Rob Orton f4fe87b548 spec add spec for report helper
also fix minor bug where enrollments could return
a deleted pseudonym

-test plan
 run a report with no parameters
 report should still run

Change-Id: I08da8b19fffd130764685c6688fd422602458ca0
Reviewed-on: https://gerrit.instructure.com/18433
Reviewed-by: Nathan Mills <nathanm@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2013-03-13 15:29:38 -06:00
Brian Palmer 5347ef0fad remove the has_custom_fields plugin from vendor/
This was written 2 years ago and never used, I've verified the DB tables
are empty.

Change-Id: I405e009be2eb657c4ebfb63da21dbcfee92efc0d
Reviewed-on: https://gerrit.instructure.com/18564
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
2013-03-13 13:33:38 -06:00
Cody Cutrer 40309819b7 upgrade mocha
Change-Id: I2209531a3bfaf68932455dc9a1eb2471067b754f
Reviewed-on: https://gerrit.instructure.com/18550
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2013-03-12 17:55:53 -06:00
Cody Cutrer b843f68a38 upgrade attachment_fu to use aws-sdk gem instead of aws-s3
closes CNVS-4248

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

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

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

Change-Id: If32fa5f381f5a4ac493948fa32230175a695f51e
Reviewed-on: https://gerrit.instructure.com/18282
QA-Review: Clare Hetherington <clare@instructure.com>
Tested-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2013-03-11 15:55:58 -06:00
Cody Cutrer 22d0c053af change attachment backends dynamically for specs
removes the need to fork/exec (and reboot rails) for specs;
also simplifies forcing a specific backend for specs

note that path_prefix in file_store.yml is now respected for
S3 as well (so that parallel spec runs that use the same bucket
don't conflict with each other), with the caveat that 'tmp/files'
is special cased to be backwards compatible for S3, and change
to 'attachments'

test plan:
 * specs pass (especially selenium specs involving files)

Change-Id: I9673d454291062c958c2989788d36339ce60dfc4
Reviewed-on: https://gerrit.instructure.com/18292
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
Tested-by: Cody Cutrer <cody@instructure.com>
2013-03-11 15:55:49 -06:00
Brian Palmer 77ca8ac013 remove deprecated rails constant usage
basically convert RAILS_ROOT -> Rails.root , RAILS_ENV -> Rails.env ,
RAILS_DEFAULT_LOGGER -> Rails.logger

This is necessary for rails 3

Change-Id: I138e1aa217fa8fb186d23ac09b04031c1e2b665e
Reviewed-on: https://gerrit.instructure.com/18412
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Eric Berry <ericb@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
2013-03-11 12:14:08 -06:00
Rob Orton 7f39f14fea use temp table on grade reports
also adds scope helpers and other report helpers
added extra text to reports to give more detail 
about the last run report

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

Change-Id: I9c635790ea46482e0941a134282c8182f9ea8677
Reviewed-on: https://gerrit.instructure.com/18377
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brad Humphrey <brad@instructure.com>
QA-Review: Tyler Belnap <tyler@instructure.com>
2013-03-07 15:35:31 -07:00
Brian Palmer 6871d97b9e open the XML file and look at the namespaces for is_qti_2 query
Before we were just running a regex against the raw file text, but the
XML isn't necessarily UTF-8 encoded so that could blow up. This now runs
it through an actual XML parser, which takes encodings into account.

fixes CNVS-4422

test plan: i've verified that there are specs testing this method. you
should be able to still import QTI packages into quizzes and question
banks, including through the respondus tool. the packages attached to
CNVS-4340 should import correctly in spite of their non-UTF8-ness.

Change-Id: Ibac9c4fbe4b2bc7625d16e636b90db23c7e4e704
Reviewed-on: https://gerrit.instructure.com/18314
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
2013-03-06 14:12:59 -07:00
Rob Orton aef2563ca7 rename report helpers
test plan
- specs should pass

Change-Id: I5a29f7feca75bc791d0c8d7b76629771cad44a6a
Reviewed-on: https://gerrit.instructure.com/18236
Reviewed-by: Nathan Mills <nathanm@instructure.com>
Tested-by: Cody Cutrer <cody@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2013-03-04 11:02:34 -07:00
Cody Cutrer 56e317e4ab use mysql2 gem for mysql
closes CNVS-4199

Change-Id: I81a14efca365a61ff9e5d29892ec95ace64aabb3
Reviewed-on: https://gerrit.instructure.com/18089
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2013-02-27 14:10:37 -07:00
Nathan Mills 2e0613d34b write reports to file
fixes PS-120

test plan

*reports should all still generate

Change-Id: I0a0dc8fdf298a6bd803bb52a4562a548ef727c6b
Reviewed-on: https://gerrit.instructure.com/17242
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Tyler Belnap <tyler@instructure.com>
2013-02-25 12:20:05 -07:00
Mark Ericksen 91f957bba0 clean up Notification creation in 'rake db:initial_setup'
identify "Reminder" category notifications as deprecated

fixes CNVS-3918, CNVS-3824

Explicitly run through 'rake db:load_notifications'

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

Change-Id: Ib5dc69c7adc7a643f08ada94d9048274d8cd4e12
Reviewed-on: https://gerrit.instructure.com/17948
QA-Review: Marc LeGendre <marc@instructure.com>
Reviewed-by: Joel Hough <joel@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-02-22 17:15:05 -07:00
Rob Orton f288b4a2b6 fixes grade export report to students only
fixes CNVS-4083

test plan
- run report
- only students should be included

Change-Id: Ibf6feae1e2a0aee5f969b6322400fe598d539eae
Reviewed-on: https://gerrit.instructure.com/17957
Reviewed-by: Nathan Mills <nathanm@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Tyler Belnap <tyler@instructure.com>
2013-02-21 16:20:46 -07:00
Zach Wily 259d122371 use safe_yaml
Includes the safe_yaml gem, which replaces YAML.load and friends with a "safe"
version by default, that does not create arbitrary objects.

DelayedJobs was modified to use unsafe_load, as it relies on deserializing
ruby objects.

The biggest impact is with serialized columns - many of those store
non-simple data types. Most commonly HashWithIndifferentAccess, but
there are a few others as well. Our version of the safe_yaml gem allows
for whitelisting certain classes.

The I18nExtraction::SafeYAML class was also removed, as it's no longer
needed. The extraction task was updated to call YAML.safe_load to be
explicit.

Currently, Gemfile is pointing to the Instructure fork of the safe_yaml
gem on github. This needs to be released as a gem.

Closes CNVS-3784

test plan: If any serialized YAML columns contain a class that we missed
in our whitelist, then that column will fail to deserialize and the
model will behave incorrectly. It's difficult to say what exactly should
be tested, as all the classes should be whitelisted. A general
regression test on migrations, course copy, scribd, and quizzes would
cover most of it.

Change-Id: I3e1a95e101ada3a1b2366ff1ca70db6d17742cce
Reviewed-on: https://gerrit.instructure.com/17404
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
2013-02-20 12:24:41 -07:00
Jeremy Stanley 76b4da53bf fix copying calculated questions that are missing formulas
test plan:
 - import a blackboard quiz containing formula questions
   (a suitable one is attached to CNVS-3468)
 - take the quiz and ensure it is graded properly
 - using Settings / Copy This Course, copy the imported Canvas
   course to a new Canvas course
 - take the quiz in the new course and ensure it is graded
   properly

fixes #CNVS-3468

Change-Id: Iedfbc4e9a2440a5f88208a10150195050ddfd3c6
Reviewed-on: https://gerrit.instructure.com/17416
Reviewed-by: Mark Severson <markse@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2013-02-19 14:28:44 -07:00
rob orton 0b6ea1443a fix provisioning report for x_listed sections
fixes CNVS-3937

test plan
-sections report should still work if it has been
 x_listed 

Change-Id: I6440442c09be666d69e20a901cd440a23af3b684
Reviewed-on: https://gerrit.instructure.com/17806
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
2013-02-16 14:56:01 -07:00
Mark Severson 6501fe7bd9 fix incorrect translations showing up randomly in breadcrumbs
test plan:
 * start/restart canvas server
 * navigate to an assignment
   (not just the assignments list)
 * note the "Assignments" breadcrumb
 * change language (or to a user with a different language)
 * navigate to the same assignment
 * verify that the "Assignments" breadcrumb changed languages

closes #CNVS-1449

Change-Id: I7539c56ad6fe1307f251689840883391e67d5bed
Reviewed-on: https://gerrit.instructure.com/17732
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2013-02-15 17:01:21 -07:00
Jeremy Stanley 2929aa1e8e fix importing bb fimb questions with illegal chars
older versions of blackboard let you put crazy
characters like spaces and apostrophes in blank
IDs.  these break imports, so replace them with
dashes.

test plan:
 - import a blackboard course containing fill-in-
   multiple-blank questions with variable names/
   blank ids containing spaces or apostrophes
 - edit the quiz, and notice the variable names
   should use '-' in place of these
 - but the answer text should not be affected
   (e.g., they might have a blank named
   "[what's this]", expecting the text
   "what's this"; with this fix, the variable is
   now named "[what-s-this]", but the accepted
   text is still "what's this"
 - take the quiz, and make sure it's graded
   properly

fixes #CNVS-3430

Change-Id: I01abcf290b9233bba7897d9a23f3e3af5cd5896c
Reviewed-on: https://gerrit.instructure.com/17275
Reviewed-by: James Williams  <jamesw@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2013-02-08 16:37:15 -07:00
Jeremy Stanley 0450fce3b5 fix issues with fill-in-multiple-blank imports
two problems:
 1. blanks identified with a number (e.g., "I'm just a poor [1]
    from a poor [2]") were not recognized
 2. multiple blanks accepting the same text were not recognized
    (only the last blank accepted the answer)

fixes #CNVS-3339

test plan:
 - import the course in #CNVS-3339
 - edit the first quiz "2005 Do Yo Remember-E"
 - make sure the "Show possible answers" dropdown box shows
   a possible answer for every blank

Change-Id: Ib2030eb0217be540efe0c87eb3baf13a08953eb2
Reviewed-on: https://gerrit.instructure.com/17218
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
2013-02-08 16:36:48 -07:00
Cody Cutrer db0bf46471 clean up course account associations
closes CNVS-3417

test plan:
 * after the migrations are run, ensure that every section has at
   least one entry in CourseAccountAssociations in the database
 * smoke test SIS imports

Change-Id: I261cad633788efbf4b0c64db34436ef695856fee
Reviewed-on: https://gerrit.instructure.com/17256
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
2013-02-08 16:33:25 -07:00
rob orton faa91a7cdb more explicit select for sis exporter users.csv
refs CNVS-3607

test plan
- report should still work

Change-Id: Ic0ff43b551aeb6937da7d3fab8576017ba3e4a7b
Reviewed-on: https://gerrit.instructure.com/17451
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Tyler Belnap <tyler@instructure.com>
2013-02-05 12:38:24 -07:00
Brian Palmer ca5c8a8776 reconnect to redis in the job worker after forking
If the parent pool process uses redis, then the child after forking will
end up sharing the connection, so a reconnect is necessary.

Change-Id: I29f3fd3adafca504cf0805548bca9ba6b30d5318
Reviewed-on: https://gerrit.instructure.com/17456
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
2013-02-05 09:51:45 -07:00
rob orton 617c30e321 allow reports on sub accounts and return deleted objects
closes PS-60

test plan
* provisioning report should now include deleted items
* sis report should now include deleted items
* grade export report should now include deleted users
* outcome report should now include deleted users
* these reports should work at the sub account level

Change-Id: Ifa8bb3edd2dbe1fcda9645091fd55bfd13781405
Reviewed-on: https://gerrit.instructure.com/16939
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Tyler Belnap <tyler@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2013-01-31 10:55:04 -07:00
Bracken Mosbacker 4d1e54f33f allow loading wiki page in edit mode
Some iFramed pages can force the browser to forward to a new
page. If you had one of those on a wiki page you couldn't
get to the page to edit it because it forwarded too quickly.
Now you can add ?edit=1 on the wiki page url and it won't
render the wiki's content when the page loads, allowing you
to edit it.

This also white-listed the 'sandbox' attribute for iframe
nodes. Sandbox isn't supported by all browsers, but adding
it to the iframe would prevent it from forwarding if you
don't want it to.

Test Plan
 * embed an iframe in a page that tries to forward the page
 * add ?edit=1 to the wiki page and notice that it doesn't forward you
 * add the 'sandbox' attribute to the iframe and save the wiki page
 * the sandbox attribute should not have been scrubbed when saving

closes #CNVS-1288

Change-Id: I5f257e88c81db93ff19d09798ad46a77abfd69bd
Reviewed-on: https://gerrit.instructure.com/17250
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2013-01-30 15:15:16 -07:00
rob orton bdfadf3cb4 add date parser helper for account reports
refs PS-29

test plan
 * pass this helper a date
 * the date should be formatted to pass into a query

Change-Id: Ib1183d268973f0830e4eeb5c2bf7ea714d4fa49a
Reviewed-on: https://gerrit.instructure.com/17192
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brad Humphrey <brad@instructure.com>
QA-Review: Brad Humphrey <brad@instructure.com>
2013-01-28 12:43:36 -07:00
Jeremy Stanley 55a794c9c5 fix importing blackboard out-of-order matching questions
test plan:
 * import the quiz in CNVS-1352
 * edit the quiz
 * make sure the answers are correctly matched (referring to the
   answer key in that ticket)

fixes #CNVS-1352

Change-Id: Ia95d4dcf90ca86b25baa8001f112961a928df857
Reviewed-on: https://gerrit.instructure.com/16957
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2013-01-23 14:16:17 -07:00
Zach Pendleton 5ccb69325f add destructive set_broadcast_policy! to BroadcastPolicy.
fixes #CNVS-2732

current implementation of set_broadcast_policy shares
notifications across parent and child classes; this method
provides a way for child classes to choose not to share
their notifications with the parent.

test plan:
  * create a user and set her notification policies for
    announcements and discussions to ASAP;
  * create a new discussion;
  * verify that the user receives a single message about
    the new discussion;
  * repeat the same process with an announcement.

Change-Id: Iaafa97f550f804d8bac4fb95552a6a4eeb2626dd
Reviewed-on: https://gerrit.instructure.com/16935
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mark Ericksen <marke@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
2013-01-22 11:18:14 -07:00
Brian Palmer 10c949a2b9 pass the worker to unlock_orphaned_jobs as well
This can be useful for code hooks

test plan: no behavior change. jobs should still run as before.

Change-Id: I5016a8111ab2382811adb273148f2c72e9f50b24
Reviewed-on: https://gerrit.instructure.com/16884
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
2013-01-16 16:24:10 -07:00
Brian Palmer d2e735bb39 change how we build this error string
It's possible for an exception to have a nil message, in which case this
job worker process would die trying to do nil + "\n".

Change-Id: I7d6b4cb58fb47711e77ffc877b17f9248c401238
Reviewed-on: https://gerrit.instructure.com/16830
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ethan Vizitei <ethan@12spokes.com>
QA-Review: Brian Palmer <brianp@instructure.com>
2013-01-16 09:38:00 -07:00
rob orton 490b6d8c08 simplify date time parse and formatting
test plan
 * reports should not change
 * future reports with date strings should work

Change-Id: Ie4843fd39faf2ce8a1b2e68f80a447313fa83d6b
Reviewed-on: https://gerrit.instructure.com/16758
Reviewed-by: Brad Humphrey <brad@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2013-01-14 11:39:40 -07:00
Jon Jensen 0222cbeb6b allow multiple broadcast policy blocks
allow plugins to add additional policies without having to worry about
stomping on existing ones

test plan:
1. run specs
2. install a plugin that defines additional notifications in a model
3. ensure that all notifications for the model work

Change-Id: Ia6f382f085f5b599209fde5ac3224f08eaa52631
Reviewed-on: https://gerrit.instructure.com/16567
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
2013-01-05 13:08:18 -07:00
rob orton da8d373100 add id to query results on outcome report
test plan
 * run report where there are over 1000 results
 * report should run and generate without error

Change-Id: I61e32f31f9719a577b3ffc0497da815ecf6f0f27
Reviewed-on: https://gerrit.instructure.com/16507
Reviewed-by: Duane Johnson <duane@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
2013-01-04 12:34:19 -07:00
Devlin Daley 6bf8172cb2 Permit new HTML5 elements figure and figcaption
Allows the new HTML5 elements figure and figcaption to bypass scrubbing by the user input sanitizer.

The HTML5lib sanitizer allows these elements
http://code.google.com/p/html5lib/source/browse/python3/html5lib/sanitizer.py

Specification for figure
http://dev.w3.org/html5/markup/figure.html

Specification for figcaption
http://dev.w3.org/html5/markup/figcaption.html
2012-12-28 23:12:13 -07:00
rob orton 50abd7f1ec fix term dates in specs so enrollments work
test plan
 spec should be able to enroll users in valid term

Change-Id: I0be35a673b0534abfdcc50c1d2a2b14d96726542
Reviewed-on: https://gerrit.instructure.com/16260
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
Tested-by: Brian Palmer <brianp@instructure.com>
2012-12-20 10:37:50 -07:00
Mark Severson e6f6c9e705 fix import of quiz durations with time units specified
durations may be specified with a single digit unit prefix
e.g. M# (minutes), H# (hours), D# (days)

if no unit is specified, seconds is assumed

fixes #CNVS-1283

test plan:
 * perform a Blackboard Vista/CE/WebCT course migration
   - the course should include an assessment with a time limit
 * verify that the imported quiz has the correct time limit

Change-Id: I02c9144540eadf5a43c623a4ffeb78e22c3786e5
Reviewed-on: https://gerrit.instructure.com/15944
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2012-12-17 14:04:01 -07:00
James Williams f3a9c9968d fix error on moodle import with missing question references
upgrades moodle2cc gem version to fix problem with missing
question references

test plan:
 * try to import the moodle .zip file in  ticket
 * confirm that it imports successfully

fixes #CNVS-1960

Change-Id: I0496cee6efa2dc6091282dfdbcd57db725d2d476
Reviewed-on: https://gerrit.instructure.com/15918
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2012-12-13 12:07:07 -07:00
Jeremy Stanley b87eeb0149 course role support in sis import/export
closes #CNVS-1078
test plan:
 - create custom roles in an account
 - sis import:
   - put the custom role name in the 'role' column in a SIS
     enrollment import, and ensure the role_name is assigned
     in the Enrollment
   - ensure only valid roles can be assigned this way
     (must be defined in the course's account or parent
      account, and must not be inactive)
  - sis export:
   - ensure custom role names are exported in the 'role' column
     of the SIS enrollment export and provisioning reports

Change-Id: Ib8b4c129d451023fa51c73747baadd42cb305338
Reviewed-on: https://gerrit.instructure.com/15868
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-12-10 08:41:20 -07:00
Simon Williams dcd49f08a8 fix character encoding issues in academic benchmark import
cropped versions of the description are used in some titles for outcomes, and
that cropping needed to be made utf-8 aware.

fixes #CNVS-1206

test plan:
- in ruby 1.8.7
- import a state like utah from academic benchmark
- it should import without errors
- specifically, an outcome group which has a description with a utf-8 character
  which crosses the 50-51 byte boundry in the string should import without an
  error.

Change-Id: I80fd2a38c8baec50aed2ff28deb76f2485b54241
Reviewed-on: https://gerrit.instructure.com/15830
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Stanley Stuart <stanley+gerrit@instructure.com>
2012-12-06 09:29:36 -07:00
Jeremy Stanley ba42f334e5 use label as d2l quiz question migration id instead of ident
because in some quizzes, every question has the same ident,
and d2l assesments refer to questions by label anyway.

fixes #CNVS-1346

test plan:
 - import the course attached to the ticket
 - the 'Correlation Quiz' should have unique questions, not
   45 copies of the same question

Change-Id: Ife122f691c083600428b893ba2e52042f5fc0ae6
Reviewed-on: https://gerrit.instructure.com/15827
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
2012-12-05 08:35:14 -07:00
Duane Johnson c65f3e4c1d add cross-shard capability to student competency report
relies on "improves speed of student competency report"

If a user with the ability to make API calls on several domains
(such as a site admin) tries to access the student competency report
via an API call, but does so on a domain that is not the default
domain for the account, then the "improves speed of student
competency report" patch will fail.

test plan:
  * Test that the student competency report will work for API calls
    not on the default account domain.

    e.g. curl -H 'Authorization: Bearer <token>' \
    https://canvas.instructure.com/api/v1/accounts/<account_id>/reports/student_assignment_outcome_map_csv

    (this attempts to access this report on the "canvas" domain)

refs #11138

Change-Id: Ie7773b0cc403c0d1e372e44095faa87c07156c85
Reviewed-on: https://gerrit.instructure.com/15692
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2012-11-29 15:42:16 -07:00
Duane Johnson b2fd481570 improves speed of student competency report (account_reports)
refactor the student_assignment_outcome_map report in GradeReports
to directly query the database via a SQL query. this should significantly
speed up the entire report.

test plan:
  * given the same large set of data (e.g. beta vs production),
    the Student Competency report should be much faster.
  * some students may be missing from the new report, if
    they have no pseudonym associated with the account.
    The new way (removing students without pseudonyms)
    is the Right Way.
  * Also note that we added an sis_user_id column to the
    new version of the report. This is to aid schools who
    need to line up the report with their internal records
    (Thanks Rob Orton)

fixes #11138

Change-Id: I3db33971a8d81565e718d886a0e2a428dba2272e
Reviewed-on: https://gerrit.instructure.com/15472
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-11-29 09:38:45 -07:00
Brian Palmer 7bda6283ff drop the unencrypted token column on access_tokens
closes #8943

now that all access tokens have the crypted_token field filled in, we
can drop the unencrypted column.

test plan: both before and after running the migration, you should be
able to use existing access tokens to make api calls, and create new
access tokens.

Change-Id: I83cfb2342ad2302bb7b43aabc528341d1d265920
Reviewed-on: https://gerrit.instructure.com/15601
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
2012-11-28 14:19:22 -07:00
Simon Williams 4308022050 move 'all models' code from spec_helper to ar initializer
refs #11982

test plan:
- no visible changes
- specs should still work (tables should still be truncated)

Change-Id: I426bd81cbfd1147f156600bd09e94066710cd876
Reviewed-on: https://gerrit.instructure.com/15627
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2012-11-27 15:44:12 -07:00
Brian Palmer e6ee92f743 fix displaying job handler/last_error details for failed jobs
The change to load these details on demand didn't know how to properly
handle failed jobs.

test plan: go to /jobs as a site admin, filter by failed jobs, select
one, you should be able to view the handler and last error details.

Change-Id: Ibb7cdd768726a4952d29d3185f8e4524eae3f064
Reviewed-on: https://gerrit.instructure.com/15595
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2012-11-27 10:31:09 -07:00
Bracken Mosbacker d0f3c6ff00 don't send notifications for outcome account migrations
because they're not needed

Test Plan: n/a

refs bracken's inbox

Change-Id: I0c8001c0efbabc03f531d7fa752d08624fc0fa00
Reviewed-on: https://gerrit.instructure.com/15599
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-11-27 07:44:56 -07:00
Bracken Mosbacker 83765cb137 update outcome importer to incrementally access api
Use multiple api calls to get all the necessary data
instead of one call. this reduces the risk of the 3rd
party timing out when pulling the data.

Test Plan:
 * Run an import in the console like AcademicBenchmark.queue_migration_for_guid(authority_guid, permissionful_user)
 * The outcomes for that authority should be imported

Change-Id: I37be9f96e13415b8f6573dd6e03282d2d6ad7bd7
Reviewed-on: https://gerrit.instructure.com/15562
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-11-22 22:20:43 -07:00
Bracken Mosbacker cfa7d99bca refactor outcome importing service
clean up the AB outcome importer to make it easier to
change how canvas uses their api.

Test Plan:
 * No functionality changed. AB imports should run as before.

Change-Id: I52298700838888ebf514ba5a1bcf673efa0ae1dd
Reviewed-on: https://gerrit.instructure.com/15561
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2012-11-22 22:20:25 -07:00
James Williams c44dfb8206 qti quiz import should create a question bank for quiz
fixes a problem where quiz questions imported from a qti
file would always be added to the "Imported Questions"
bank, rather than a quiz specific bank.

test plan:

* import the qti quiz file from redmine
* go to quizzes -> question banks
* confirm that the questions were added to a question bank
 with the same title as the imported quiz

closes #11689

Change-Id: Id97ceef6f3db6c835ec8897ed94e6516e5b5b7c1
Reviewed-on: https://gerrit.instructure.com/15266
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Sterling Cobb <sterling@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
2012-11-14 10:11:09 -07:00
Jeremy Stanley 6edaff4a7d VDD: notifications; closes #10896
The following changes have been made:
 - Assignment Created
  - students see the due date that applies to them
  - admins see "Multiple Dates"
 - Assignment Due Date Changed
  - students see the due date that applies to them;
    they receive no notification if their date doesn't change
  - admins receive a separate notification for each due
    date that changes, that they have access to;
    the message indicates which section or group applies
    (section-limited TAs will not get messages about due dates
    in sections they can't see)
 - Assignment Submitted Late
  - the message text does not change, but the student's overridden
    due date is checked
 - Group Assignment Submitted Late
  - same as previous

There were some bugs fixed along the way:
 - no longer send duplicate Assignment Submitted and
   Assignment Resubmitted notifications when an assignment
   is resubmitted
 - Group Assignment Submitted Late actually goes out
   (there was a typo in the whenever clause)

Test plan:
 - Create a course with two sections and a teacher
 - Enroll a student in each section
 - Enroll a section-limited TA in each section
 - Make sure everybody involved is signed up for "Due Date"
   notifications, ASAP
 - Using the API, Create an assignment with a default due date
   (in the past) and an overridden due date for section 2
   (in the future).  the assignment and override must be
   created in the same request (use the "Create an assignment"
   API and supply assignment[assignment_overrides]; it may
   be easier to use a JSON request body)
 - Verify that everybody got an "Assignment Created"
   message (use /users/X/messages)
   - the teacher should see "Multiple Dates",
     as should the TA in section 2 (because the default date
     is still visible to him)
   - the student and the TA in section 1 should see
     the default due date
   - the student in section 2 should see the overridden
     due date
 - "Due Date Changed" messages will not go out for assignments
   that were created less than 3 hours ago (by design, and not
   new with this changeset), so for the remaining items, you
   either need to wait 3 hours, or falsify created_at for the
   assignment you just made...
 - Change the default due date for the assignment, leaving it
   in the past
  - Everybody except the student in section 2 should get a
    notification with the new date
 - Change the overridden due date for section 2, leaving it
   in the future
  - everybody except the teacher and TA in section 1 should get
    a notification about the new date
  - the teacher and section-2 TA's notifications should indicate
    that they apply to section 2 (the student's should not)
 - submit the assignment as each student
  - the teacher should get one notification about each submission:
    the one about the student in section 1 should say it's late;
    the one about the student in section 2 should not
 - submit again
  - the teacher should get one notification about each submission:
    the one about the student in section 1 should say it's late;
    the one about the student in section 2 should not, and should
     be identified as a resubmission
     (there is no late-re-submission notification)

Change-Id: I26e57807ea0c83b69e2b532ec8822f6570ba1701
Reviewed-on: https://gerrit.instructure.com/14662
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
2012-11-14 09:04:07 -07:00
rob orton 7e2ad3caf0 fix reports running for all_terms
test plan
 * run report through ui or 
     run report with api passing empty string for term
 * report should work

Change-Id: Ib3a325209bc003c91e86d402f154232c8d62de5b
Reviewed-on: https://gerrit.instructure.com/15258
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
2012-11-13 16:31:11 -07:00
Cody Cutrer e3a869b71e close db connections after unlocking orphaned jobs
to fix problems with connection sharing across fork boundaries

test plan:
 * set worker_max_job_count: 2 in config/delayed_jobs.yml
 * queue up a ton of jobs
 * start a delayed jobs pool
 * it should not die off

Change-Id: I248743a401a8f434270b64da43f1da85d67cd8f1
Reviewed-on: https://gerrit.instructure.com/15312
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-11-13 15:20:40 -07:00
Jacob Fugal d121ee9737 tweak to go along with outcomes refactor
the recent outcomes refactor included temporary shims to let old code in
plugins work. this code used to be in a plugin, but is now that on
master, so we can fix it to move off the shims. once this and like
commits in other plugins have been submitted, the shims included with
the refactor can be removed.

test-plan:
 - specs pass

Change-Id: I8e5d903af8de01d12166b2f6ce861aec28720203
Reviewed-on: https://gerrit.instructure.com/15106
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
2012-11-08 10:29:41 -07:00
James Williams ec5cdff8bc sanitize html out of quiz matches on import
test plan:

* import the QTI zip file (from the redmine)
* edit the imported quiz
* check whether the matches contain <span> tags

fixes #10452

Change-Id: Ib40a6b09b540e0293f2ed11b58e8df0063acd3a4
Reviewed-on: https://gerrit.instructure.com/15078
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
2012-11-08 09:59:23 -07:00
Brian Palmer 0a1d780259 spec: fix qti_exporter specs for ruby 1.9
Change-Id: Ic6cdb5a587c9a081957f48d9b770a75620e7dcea
Reviewed-on: https://gerrit.instructure.com/15112
Reviewed-by: Ethan Vizitei <ethan@12spokes.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-11-07 16:25:42 -07:00
Cody Cutrer f644680cb2 untaint DJ handlers
because it comes from the database, it's marked as tainted, but when
it's deserialized, it taints actual classes that are used. This is
bad for specs, cause when you stub or unstub something, new methods
are defined, and the tainting spreads to them, and the original
method is called via a call(), which if tainted, raises a security
exception regardless of $SAFE level.

this isn't a *huge* deal, cause canvas runs at $SAFE=0, so we're
not relying on tainting anyway.

Change-Id: Ic7ed5642de7ebfba7d4930bb6bca428e24f621ff
Reviewed-on: https://gerrit.instructure.com/15065
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-11-06 13:10:39 -07:00
rob orton 88cbee0bb2 add parent_account_id and a date helper
test plan
 * provisioning report should have canvas parent account id
 * all dates should be displayed in the account's time zone

Change-Id: I895b928e0cd217606b20d114b9f14681130167f7
Reviewed-on: https://gerrit.instructure.com/14917
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
2012-11-05 10:14:02 -07:00
Cody Cutrer fa2cff2d08 use PluginSetting to configure account reports
note that by default all reports are enabled now

test plan:
 * disable a few reports in plugin settings
 * wait 5 minutes
 * they should be gone in the account settings | reports tab

Change-Id: Ib7fb9cbe8d72ec22830fb1d08ba1cfb1c1f909b3
Reviewed-on: https://gerrit.instructure.com/14793
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
2012-11-02 12:55:14 -06:00
Brian Palmer 249b85acfe spec: a couple ruby 1.9 spec fixes
Remove a stray scope argument, since # of args is more strict in 1.9
lambdas.

Switch to respond_to since methods returns strings in 1.8 and symbols in
1.9

Change-Id: I59b12009682fa22b6d42ae722cbf98d50ee96ef2
Reviewed-on: https://gerrit.instructure.com/14957
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ethan Vizitei <ethan@12spokes.com>
2012-11-02 09:32:04 -06:00
Brian Palmer c359888be3 update the respondus_soap_endpoint plugin for ruby 1.9
A fix had to be made to soap4r-middleware, and it also now uses the
soap4r-ruby1.9 gem instead of the old soap4r gem. Despite the name, this
new gem also works in ruby 1.8.7.

test plan: the existing specs cover the api endpoint well. manual
testing will require installing the respondus 4.0 desktop client and
making calls to upload quizzes to your test canvas instance.

Change-Id: I14b3c61753f67a00da755cec9cb9603bc41922b3
Reviewed-on: https://gerrit.instructure.com/14876
Reviewed-by: Zach Wily <zach@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
2012-10-31 14:28:51 -06:00
Bracken Mosbacker d4b19b0a76 increase timeout for outcome import
These requests take a while to load sometimes

Test Plan:
 * Importing should work for all states

refs #11541

Change-Id: Ied27d543b4009d3e9a0f018854b1902ae8afb84c
Reviewed-on: https://gerrit.instructure.com/14846
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
2012-10-31 13:12:53 -06:00
Bracken Mosbacker 76857fda0f fix url fetching for academic benchmark library
Test Plan:
 * Running an AB import should work

closes #11541

Change-Id: I1725b1b71435e0d9deb53a8fc7cac376c79040c7
Reviewed-on: https://gerrit.instructure.com/14840
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
2012-10-30 09:54:12 -06:00
Jacob Fugal 52cd995f1b Merge branch 'dev/learning_outcome_refactor'
simple keep-both merge in config/routes.rb

Conflicts:
	config/routes.rb

Change-Id: If4180b9c360f32786acce2a8ad6251437318db21
2012-10-25 15:12:10 -06:00
Cody Cutrer 04fb5be075 automatically unlock orphaned jobs when re-spawning a child
test plan:
 * start jobs
 * kill -9 a long-running job while it is in progress
 * it should immediately unlock, and retry if it has more attempts
   (check future jobs if it doesn't retry immediately),
   or go to fail if it is out of attempts

Change-Id: I3fb3961235c80de23d0bd33e2b63cb743009342a
Reviewed-on: https://gerrit.instructure.com/14622
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2012-10-25 09:33:53 -06:00
Cody Cutrer 7044108757 automatically unlock orphaned jobs when starting a pool
won't work if workers are explicitly named. if you have
multiple nodes with the same hostname, you should explicitly
disable this, otherwise they'll unlock jobs that are running
on the other node

test plan:
 * don't have a name: key in delayed_jobs.yml
 * start two long running delayed jobs
 * stop (nicely) the pool
 * kill -9 one of the remaining jobs
 * start the pool again
 * the job that was killed should restart
 * add disable_automatic_orphan_unlocking: true to
   delayed_jobs.yml
 * repeat killing a job and starting a pool
 * this time, the job shouldn't auto-restart

Change-Id: Iffeca73950745ab90580a4e22058af653af9ec53
Reviewed-on: https://gerrit.instructure.com/14454
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-10-24 20:35:58 -06:00
Jacob Fugal 2fc15ae69c Merge branch 'master' into dev/learning_outcome_refactor
simple keep-both resolutions for app/models/submission.rb and
config/routes.rb. spec/integration/learning_outcome_group_spec.rb stays
removed.

fixed path->url in outcome group api pagination to match master's new
rules.

Conflicts:
	app/models/submission.rb
	config/routes.rb
	spec/integration/learning_outcome_group_spec.rb

Change-Id: I8dd31e1d3764970a8f683aef362f0cca06abe90e
2012-10-24 13:56:33 -06:00
Brian Palmer a4317b20db store and query hashed access tokens
refs #8943

This is phase 1. Once this is rolled out and the migrations have
finished, we can implement phase 2, which is dropping the token field so
that plaintext tokens are no longer stored in the database.

There should no longer be any code that reads the token attribute, it's
kept in the database purely to help with the transition.

test plan: before the postdeploy migration runs, access tokens should
still work. after it runs, access tokens should still work.
newly-created access tokens should work as expected. expired access
tokens should still error. For now, the plain-text token field should
still be populated for new tokens.

Change-Id: Icb1b4fdc8e2627ba6540d96d23eb28d874020acb
Reviewed-on: https://gerrit.instructure.com/14491
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-10-18 13:03:53 -06:00
Cody Cutrer dc76a1980c improve delayed_jobs process management
use process groups to be able to differentiate between running and
draining, and to easily stop workers without draining.

 * added --with-prejudice to stop (or restart) without draining first
 * added --with-extreme-prejudice to kill -9 running jobs
 * don't remove the pid file when stopping, so that you can call stop
   again with one of the above
 * improve status to detect the difference between stopped and
   draining
 * don't start a daemon if one is already running

test plan;
 * ensuring you have some long running jobs that would need to be
   drained, use ps to verify that all of the following work correctly:
   * start with no pool running
   * start with a pool running (doesn't allow it)
   * start with a pool draining (allows it)
   * stop (allows jobs to drain)
   * stop --with-prejudice (doesn't allow jobs to drain)
   * status (differentiates between stopped, running, and draining)
   * stop --with-extreme-prejudice (doesn't allow jobs to drain, and
     even kills jobs stuck in IO)
   * restart (drains currently running jobs, but starts the new pool
     immediately)
   * restart --with-prejudice (stops currently running jobs
     immediately, and starts a new pool immediately)

Change-Id: If7aa05f6a81c1cbd27df95777097834095fb406b
Reviewed-on: https://gerrit.instructure.com/14441
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2012-10-18 09:06:00 -06:00
rob orton dbc1d7f59b allow sis term parameters fixes #11070
Change-Id: I1b224f99a437b0dec076921cfa78469b18455224
Reviewed-on: https://gerrit.instructure.com/14397
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Cody Cutrer <cody@instructure.com>
2012-10-17 12:40:42 -06:00
Bracken Mosbacker 030effd7b6 update delayed job spec to not fail if redis isn't configured
Change-Id: I2ed7a65f8146bea7ec9bd9903dd78f8580e4da9f
Reviewed-on: https://gerrit.instructure.com/14352
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2012-10-12 09:19:09 -06:00
Cody Cutrer 89155684a0 spec: be more tolerant of plugins using cache
Change-Id: I24fa386546791b34d790034517118cbdde3e60e2
Reviewed-on: https://gerrit.instructure.com/14058
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2012-10-01 20:01:22 -06:00
Simon Williams e465cf7eb4 render correct page after joining self-signup group
fixes #10880

when joining a self-signup group, permissions were being incorrectly cached
causing a 'membership pending' page to be shown.

test plan:
- as a teacher, create a set of course groups, and allow self-signup
- as a student, join one of these groups
- it should not say 'membership pending'
- it should say 'you joined the group'

Change-Id: Ic11cdeead8db23293e64faa0dc3c803310e426cc
Reviewed-on: https://gerrit.instructure.com/13959
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2012-09-27 14:42:46 -06:00
Brian Palmer a193f8c4d9 batch up delayed jobs in some controller actions
fixes #10889

Also some new functionality in Delayed::Batch -- you can now give it a
priority, and it'll create all jobs in one batch at that priority rather than a
separate batch for each priority seen. Also, if the batch only contains
one job, it'll just enqueue that job.

test plan: No user-visible changes. The following actions
where changed and should be checked for breakage:
 - changing a grade in gradebook1/speedgrader
 - changing a grade in gradebook2
 - starting a quiz
 - submitting a quiz
 - sending a conversation message

Change-Id: I2f68eec7de1b1c4fc1ec417b8e89d69ec1c0e8ae
Reviewed-on: https://gerrit.instructure.com/13930
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2012-09-26 12:42:50 -06:00
Brian Palmer f426b505e5 optionally shuffle the candidate jobs returned before locking
This will cut down on lock contention if many jobs workers are trying to
pop at once.

Change-Id: I1cce8ef5cceb35de2b5f2e274d59b199fc68018f
Reviewed-on: https://gerrit.instructure.com/13953
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-09-26 11:40:09 -06:00
rob orton 1687c490a9 sis export report scope changes
test plan
 * existing specs should pass

Change-Id: Ia3d8869996575b3453203aa7bd4dc2ef6e3694b5
Reviewed-on: https://gerrit.instructure.com/13828
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2012-09-24 16:16:36 -06:00
Brian Palmer a8a2be6848 spec: fix jobs spec that didn't have deterministic ordering
Change-Id: Id45a3a548729690a8bc8f2f22b5b451a08014652
Reviewed-on: https://gerrit.instructure.com/13906
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-09-24 14:48:57 -06:00
Brian Palmer c25465506a redis jobs backend
This supports all the features of our current delayed jobs backend,
including priorities, queues, jobs scheduled for the future, strands,
periodic jobs, etc.

Atomicity is guaranteed by using the new Lua scripting features of Redis
2.6, so this requires 2.6 (which is still only a release candidate as of this
time).

It's not yet production ready (see the TODO at the top of the
redis/job.rb file), so trying to start canvas in prod with redis jobs
configured will raise an error as a safeguard.

The tests have been modified to all pass with redis configured as the
jobs backend. Some selenium specs were removed because the jobs UI lost
some functionality that I didn't think was important enough to port to
redis (listing the most popular tags for future and failed jobs, for
example).

Change-Id: Ie57b15bae1d4ba7b2b2344c872411165551d1ac8
Reviewed-on: https://gerrit.instructure.com/12120
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-09-19 08:50:11 -06:00
Bracken Mosbacker 990d1f6457 create framework for importing standards from a vendor
This adds a migration tool that can import standards from
academic benchmarks, either by giving it a file, or by
using their API.

Test Plan:
 * Run a migration for a specific authority
 * It should import into the global group happily

refs #9866

Change-Id: If654681d60848e1233475f737dc2fadecacdbd98
Reviewed-on: https://gerrit.instructure.com/13421
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-09-17 15:22:36 -06:00
rob orton a352fc1edd fix concluded course status for provisioning report
test plan
 * create a course
 * conclude the course
 * the course should be in the provisioning report with
   status 'concluded'

Change-Id: I111fd9f05fd8c7f460e2241ec3338bec5cbe3ea9
Reviewed-on: https://gerrit.instructure.com/13664
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2012-09-13 14:43:54 -06:00
Zach Pendleton ae79f23bda add aria labels to navigation regions.
we have as many as three aria navigation regions on any
given page; this commit labels them as "main," "breadcrumbs,"
and "context" to make navigation easier.

this commit also gives the "complementary" region a label of
"sidebar."

test plan:
  * using voiceover or another screen reader, open the list of
    landmarks (ctrl-option-u in voiceover) and verify that
    the navigation landmarks are properly labeled.

Change-Id: Id175ca2e2dda540cb096e43dc5ad5242b85e97e1
Reviewed-on: https://gerrit.instructure.com/13450
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
2012-09-11 15:48:51 -06:00
rob orton cb3257afa9 remove password column from provisioning report
test plan
 * run report
 * report should not have password column in users.csv

Change-Id: Id3da2580dcddead6412c3b4a577e559791c10b03
Reviewed-on: https://gerrit.instructure.com/13489
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2012-09-07 09:42:57 -06:00
rob orton 657bdc3d29 fixes intermittent spec failures
Change-Id: Ieed9eebbc7bf0b705d8d9bd1a054611014c4521b
Reviewed-on: https://gerrit.instructure.com/13481
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-09-06 08:27:35 -06:00
rob orton 3369c4e2b3 add provisioning report and fix security issue
closes #10201

test plan
* run report
* report should contain all active accounts, users, course ...

Change-Id: I591300670fb5fea0ca01b74c5fe90f0610997d24
Reviewed-on: https://gerrit.instructure.com/13260
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-09-05 13:35:08 -06:00
Brian Palmer d13d50c798 cache context_permissions for 1h, not 1d
there are some situations where the permissions can change without the
user or course being touched (e.g., course start date or end date
passes), so for now we need this to be a shorter cache.

Change-Id: Ie267e8251913d584ca858b25ed2d54655e5a200c
Reviewed-on: https://gerrit.instructure.com/13311
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
2012-08-30 09:54:52 -06:00
rob orton 6152357972 open source account reports plugin refs #10119
Change-Id: If427b75b9eb3ab7a2a7fa9322d8873455cc03cfa
Reviewed-on: https://gerrit.instructure.com/13120
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2012-08-29 11:14:36 -06:00
Brian Palmer f70fe86fed cache plugin_settings for 5 minutes
Ideally these would expire if changed, but this is a quick
optimization because of other current limitations.

Change-Id: I8ef54a0161a754f407a5b939c576b6bbdfa485de
Reviewed-on: https://gerrit.instructure.com/13236
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2012-08-28 16:50:34 -06:00
Zach Pendleton 30cb2b1e14 handle qti questions with a leading, empty <div />.
fixes #10060

when importing a qti answer with a leading <div /> that's empty,
ignore it and look instead for a direct child with a "text" class.

test plan:
  * run specs

Change-Id: I10467eb1bdf0ad8508a4d11c59239d6e751b1958
Reviewed-on: https://gerrit.instructure.com/13112
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
2012-08-23 09:19:49 -06:00
Brian Palmer 0d4e118bda optimize query for root attachment to filter db-side
test plan: no visible change in behavior, attachments should still get
root attachments assigned when appropriate.

Change-Id: I866a81b6da81a744483fcadb2bff5b74d229619b
Reviewed-on: https://gerrit.instructure.com/13041
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Brian Palmer <brianp@instructure.com>
2012-08-20 22:14:24 -06:00
Jon Jensen d10d5c5b8b cache permission lookups for additional context types, refs #9957
now cache permission lookups for anything that is_a_context?, except for
the User model (since that might result in a lot of writes to the cache
that seldom get read). this expands the cacheable list to [Course, Group,
Account]

test plan:
1. use course, group and account-related functionality in canvas
2. confirm that the those permissions are cached (rails log) and used
3. do something that sets :session_affects_permissions (e.g. get a
   course invitation and go look at the course)
4. confirm that course, group and account permissions are no longer
   cached, but work correctly
5. confirm that non-context permission checks work correctly and are not
   cached (rails log)

Change-Id: I2aab74e225bb4da1a7f486512575c702415eb6fc
Reviewed-on: https://gerrit.instructure.com/12971
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-08-16 16:33:00 -06:00
Jon Jensen 41f6d8225f refactor grants_rights?, add cache expiration, refs #6058, #9957
clean up grants_right? and grants_rights?, and add cache expiration so
that stale data eventually clears. the cache-related changed are:

1. we now cache "nobody" lookups for course permissions
2. course permission lookups are cached for no more than a day

additionally, there is a slight behavior fix for non-course grants_rights?
calls that care about the session. previously, the session argument to a
"given" block would be set to nil unless the :session_affects_permissions
flag was set. this was *not* the case for grants_right?. so that means
that grants_rights? calls for a non-context could be more restrictive than
the equivalent grants_right? one(s).

a code audit reveals there should be no places where this was actually
happenening today, so the fix shouldn't affect any current permissions
checks in canvas. rubric_assessment.rb would be susceptible, but the
corresponding controller code is unused. eportfolio.rb has some session-
based policy checks, but it was setting :session_affects_permissions.

test plan:
1. use course-related functionality in canvas
2. confirm that the course permissions are cached (rails log) and used
3. do something that sets :session_affects_permissions (e.g. get a
   course invitation and go look at the course)
4. confirm that course permissions are no longer cached, but work
   correctly
5. confirm that non-course permission checks work correctly and are not
   cached (rails log)

Change-Id: Ie7f79054f48f6a9f168510349c3d1f1ef453deb4
Reviewed-on: https://gerrit.instructure.com/12933
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-08-16 16:32:27 -06:00