Commit Graph

377 Commits

Author SHA1 Message Date
James Williams 9ef3adb6b0 preserve course links in group html content
test plan:
* create a course with a group
* create a wiki page for the group
* inside the group, add a link to content for the course
(e.g. "/courses/:course_id/files")
* it should not translate the link to point to "/groups/:group_id"

fixes #CNVS-8313

Change-Id: Icd64cf11668481cee34d4bcddd1332431826959f
Reviewed-on: https://gerrit.instructure.com/24606
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-09-25 13:31:22 +00:00
James Williams 2326917a0a fix course copy and content migration date adjustment processing
test plan:
* import a content migration package through
"/courses/:course_id/content_migrations",
checking the field to "adjust events and due dates"
* manually type in dates of various formats
(e.g. "MM/DD/YYYY")
* should adjust the dates accordingly

* copy a course through the "copy this course" link
shown in "/courses/:course_id/settings"
* should adjust the dates here as well

fixes #CNVS-5771

Change-Id: Ib3c74f57ce3e351f6d3df88883b055bb8aa77101
Reviewed-on: https://gerrit.instructure.com/24246
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-09-25 13:31:19 +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
Landon Wilkins 72a51ce0b9 refactor notification exclusions for self enrollment
make it possible to have notifications that are sent during
self enrollment, rather than unilaterally skipping them all

test plan:
* self enroll in a course
* verify that you don't get any emails

relevant to CNVS-7624

Change-Id: I2b151dc004b2123eeaf44b6c12d93cc92d68cc63
Reviewed-on: https://gerrit.instructure.com/24242
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
2013-09-12 21:12:02 +00:00
Bracken Mosbacker 41a59e1ab5 add allow/enable draft account/course settings
Also update all flag checking to use context method
instead of doing settings[:enable_draft] checking

Test Plan:
 * "Allow Draft" on a root account. (make sure you don't have
   draft enabled for that account in the console)
  * All courses in that account should now have an
	  "Enable Draft" option in "more options"
	* If a course has draft enabled then it should be enabled for all sections
 * the help dialogs should work and make sense

closes CNVS-7695

Change-Id: Ia5eff0c4868b8be9e5c8417f904cea83e9313bb3
Reviewed-on: https://gerrit.instructure.com/24229
QA-Review: August Thornton <august@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-09-10 19:46:33 +00:00
Mark Severson 932bd3dc0e fix legacy wiki front page behavior
test plan:
 - in a course with no pages (new course is best)
 * manually update the course object:
   * set default_view to 'wiki'
 * manually update the course's wiki object:
   * set front_page_url to nil
   * set has_no_front_page to true
 * navigate to the course home page
 - there should not be an error on the page

fixes CNVS-7744

Change-Id: I047db32d2fa7a376be994a1314c0e55a0cadffde
Reviewed-on: https://gerrit.instructure.com/23751
QA-Review: Hannah Bottalla <hannah@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-09-03 19:27:02 +00:00
James Williams 93fb3b95d2 copy wiki front page setting
test plan:
- account-level draft state => disabled
  * create a course
  * set a custom wiki page as the home page
  * copy the course
  * the new course's home page should be the copied front page

  * copy the original course again
  * selectively omit copying the front page
  * the new course's home page should be an empty front page

- account-level draft state => enabled
  * create a course
  * set a custom wiki page as the home page
  * copy the course
  * the new course's home page should be the copied front page

  * copy the original course again
  * selectively omit copying the front page
  * the new course's home page should be the dashboard

fixes #CNVS-7774

Change-Id: If9987cad55f069a2803002de611ecb0d81b2ebc5
Reviewed-on: https://gerrit.instructure.com/23788
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-08-30 12:34:49 +00:00
Bracken Mosbacker 60650da3a0 correctly check for syllabus body flag on course copy
The import code was checking the wrong property

Test Plan:
 * do a selective course copy
 * the syllabus body should copy

closes CNVS-7410

Change-Id: I70f858383f635b8ebe46287f3c94153ebe7eb00f
Reviewed-on: https://gerrit.instructure.com/23852
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-08-29 17:50:21 +00:00
Jeremy Stanley 82e62e0d56 module sequence api
test plan:
 - consult the API documentation for the new Get Module Item Sequence
   endpoint, and also the Module Item Sequence return type
 - test retrieving the sequence information of a module item
   of each type
   - the ModuleItems for the prev, current, and next items
     in the sequence should be returned
   - any Modules referenced should also be returned
     (e.g., there should be three of them if you're testing
     on an item that is the only item in its module,
     and previous and next items in other modules exist)
 - verify that no more than 10 item sequences are returned
   when an item appears in modules more than 10 times
 - test as a student, ensuring that unpublished modules
   and unpublished module items are excluded from the results

fixes CNVS-7616

Change-Id: I75365dc3f169d35767525686815f9cd93e595bdb
Reviewed-on: https://gerrit.instructure.com/23578
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Hannah Bottalla <hannah@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-08-22 20:30:28 +00:00
Jeremy Stanley d27cf9f7d0 reuse Attachments' kaltura media objects on course copy
currently, when courses are copied, Attachments are resubmitted
to kaltura (replacing their media_ids).  however, links to
these videos in course content still refer to the original
course's media_id anyway... meaning the new course now refers
to _both_ copies.  let's just make the Attachments refer to
the originals.

test plan:
 - upload a video to the files page in a course
 - wait for kaltura to process it (so you can preview the
   video on the files page)
 - copy the course
 - make sure you can preview the video in the copied
   course's files page
 - make sure the media id of the video in the new course
   is the same as the one in the old course. probably
   the easiest way to do this is to use chrome's
   network watching tool; when you preview the video,
   the page will request something like
     /media_objects/0_abcd1234/info
   that middle part is the media id.

Change-Id: I39dfef2581ff4f918f691fa603ca0c87bdcd5196
Reviewed-on: https://gerrit.instructure.com/18163
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-21 15:01:07 +00:00
Zach Pendleton a7dd148274 create context-level enable_draft option.
test plan:
  * enable "enable_draft" on an account and verify that
    draft-state changes appear on its courses;
  * disable "enable_draft" on the account, enable
    "allow_draft" on the account, and enable "enable_draft"
    on a course and verify that draft-state changes appear
    for that course, but not for other courses in the
    account;
  * disable "allow_draft" on the account and verify that
    draft-state changes are disabled for all courses on the
    account, even if they have enable_draft set.
  * verify that draft_state changes are enabled/disabled on
    groups given the criteria above.

Change-Id: I6a28dea356c2c0af5bf04de2f20efaedfb17ab2c
Reviewed-on: https://gerrit.instructure.com/22136
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Hannah Bottalla <hannah@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Product-Review: Zach Pendleton <zachp@instructure.com>
2013-08-16 15:19:39 +00:00
Mark Ericksen 5a2d4464ed retain course profile through content_reset
fixes CNVS-4892

testing steps:
- create a course and enable "canvas network"
  and set some "canvas network" profile data
- optionally add other course content like
  an assignment.
- reset the course and verify the "canvas network"
  settings remain while other content is reset.

Change-Id: If26ab5086237a9363a41ad4b981d5437e923540e
Reviewed-on: https://gerrit.instructure.com/23018
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
2013-08-09 19:04:20 +00:00
Cameron Matheson 31e10b2f87 make update_student_submissions more efficient
closes CNVS-6926

Test plan:
  * change the # of points possible on an assignment with submissions
  * the students' grades should update correctly

Change-Id: Ie81ac87483bd351dec5d18b49031dd658b76a228
Reviewed-on: https://gerrit.instructure.com/22902
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
2013-08-09 01:24:34 +00:00
Cameron Matheson 15868bee11 Faster AssignmentGroupsController#index
refs CNVS-2500, closes CNVS-6577

Test plan:
  * make sure the assignment groups index api action still works
    - be sure to include assignments
      * test with and without overrides
  * make sure gradebook2 still works (focus on anything related to
    assignment due dates)

Change-Id: I440a8fdeffdb497884356f08c19b5b7792566a3a
Reviewed-on: https://gerrit.instructure.com/22102
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
2013-07-12 17:47:29 +00:00
James Williams 477f965cee copy attachments correctly between folders with identical names
fixes an error occuring during course copy under particular
conditions when folders are created with identical names

test plan:
* create a folder in a course
* add a subfolder to the previously created folder
 with the exact same name
* first, add a file to the subfolder
* second, add a file to the first folder
* copy the course
* confirm that the new files are organized correctly,
and not in the same folder

fixes #CNVS-2869

Change-Id: I5e4b5987226e451955292f7797817fa3a92a26a5
Reviewed-on: https://gerrit.instructure.com/21901
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-07-03 21:25:18 +00:00
Cody Cutrer 48156cdfca fix API seeing of test students for admins and test students
fixes CNVS-6569

test plan:
 * create a course with an assignment
 * go in to student view
 * submit that assignment
 * /api/v1/courses/<course_id>/assignments/<assignment_id>/submissions/self
   should return the data for the test student
 * leave student view, and log in as an account admin (that's *not* a
   teacher in the course)
 * the previous url, substituting the test student's actual id for "self",
   should work
 * /api/v1/courses/<course_id>/assignments/submissions?student_ids[]=<
   the test student's id> should also return the data for the test student

Change-Id: I3a1b8ceceb5eef914d4ec2e0f2f8c751a8fa9866
Reviewed-on: https://gerrit.instructure.com/21840
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-07-02 20:02:37 +00:00
Cameron Sutter b7da647e93 add apply_assignment_group_weights to course api
fixes CNVS-6515

test plan:
 - read, create, and update the apply_assignment_group_weights
   flag within a course with the api

Change-Id: I29b15ddafa9403a7434f8692b53ce31f1645626f
Reviewed-on: https://gerrit.instructure.com/21795
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2013-07-01 15:45:52 +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
James Williams 4a8328927b preserve account-level rubric associations on course copy
test plan:
* create an account level outcome
* create an account level rubric
* attach the outcome to the rubric

* in a course, attach the rubric to an assignment
* copy the course
* check the new assignment in which you linked the rubric to
  the outcome was carried over, and the association with
 the account-level rubric should be preserved,
 (and by extension the association with the learning
 outcome)

fixes #CNVS-4200

Change-Id: I0bfa11124d599ca1a96ed3b6e684b966974e397b
Reviewed-on: https://gerrit.instructure.com/21548
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
2013-06-19 19:23:48 +00:00
Cody Cutrer e852ebb6da delay creating jobs in other dbs until transaction completes
this prevents the job from accessing data that hasn't committed yet,
as well as many instances of it waiting for the first transaction to
release a lock cause the two transactions are referencing the same
data

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

Change-Id: I7b132b6119f60e38ae1ba4d17dea18ac49114960
Reviewed-on: https://gerrit.instructure.com/21168
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Cody Cutrer <cody@instructure.com>
2013-06-17 20:19:08 +00:00
Landon Wilkins 6441ef9d14 api functionality: unassigned group members, with search
adds list and search users functionality to group_category api,
  including the ability to filter to only list/search unassigned
  users.

depends on #CNVS-6152

test plan)

0) verify that the api doc is error free and makes sense
1) make the following requests for both a course and an acccount
     group category, then verify the results:
  a) list all the users (i.e. no search_term)
  b) list all the unassigned users (i.e. no search_term)
  c) search users (e.g. search_term=bob )
  d) search unassigned users (e.g. search_term=bob&unassigned=true)

fixes #CNVS-6151

Change-Id: I99b33f29531579478ccece595a20971a1f8ad914
Reviewed-on: https://gerrit.instructure.com/21292
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
Tested-by: Landon Wilkins <lwilkins@instructure.com>
2013-06-13 18:04:38 +00:00
Cody Cutrer 22c8c0ba1e optimize Account#/Course.update_account_associations a bit
* don't pull all courses in at once
 * only select necessary columns

also pick up some edge cases where we wouldn't catch courses

test plan:
 * do some sis imports
 * it shouldn't fail

Change-Id: I18d03f78e31c47de183e8a61ce7627ef1c3424ad
Reviewed-on: https://gerrit.instructure.com/21157
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-06-07 14:47:09 +00:00
Simon Williams d96ba9c601 finish removing course.publish_grades_immediately
this was removed from the UI in Mar 2011 but was never completely ripped out.
we'd like to remove it now since it was adding extra complexity for no benefit.

closes CNVS-5929
refs #3974

test plan:
- create/update/delete an assignment from the index page, and the show page
- grade an assignment (with and without muting)
- test assignment notifications (with and without muting)
  - creating an assignment
  - editing an assignment
  - changing a due date (after 3 hours of being edited)
  - grading an assignment

Change-Id: Ie455bed41154018b5bd2c9c0e69e1e3285a0ac09
Reviewed-on: https://gerrit.instructure.com/20778
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
2013-06-04 18:11:08 +00:00
Bracken Mosbacker 87eac4a7ae save selective import options for new migration api
The chosen options are now saved, and the import code was
updated to check for the new names and still work for the
old names.

Test Plan:
 * Selecting/deselecting specific areas in the new UI should work
 * Selecting/deselecting specific areas in the old UI should work

refs CNVS-4742

Change-Id: I2fd0bd9ffdb7d1d70ddb01a6b7be6f7ef708a5b5
Reviewed-on: https://gerrit.instructure.com/21043
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-05-31 22:49:50 +00:00
Cody Cutrer 002862f088 remove some egregious usages of Enumerable#select when a query will do
Change-Id: I06697cd82a984cd8a019ac44c4c257c15c963090
Reviewed-on: https://gerrit.instructure.com/18432
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-05-31 22:11:15 +00:00
Cody Cutrer c8464c5747 clean up tri-conditional syntax a bit
Change-Id: I899494c344f32c5161410d254d4e84fd7f6b7cc5
Reviewed-on: https://gerrit.instructure.com/21093
Reviewed-by: Duane Johnson <duane@instructure.com>
QA-Review: Duane Johnson <duane@instructure.com>
Product-Review: Duane Johnson <duane@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-05-31 16:23:05 +00:00
James Williams d71b258ed2 allow any wiki page to be set as front page
test plan:
* confirm that wiki pages can be created and updated
with the parameter wiki_page[front_page]
 * if true, this will set the wiki page as the
 front page for the context (assuming the page is
 not hidden to students)
 * if false, this will unset the page as the front page
 (assuming it was the front page to begin with)

* confirm that /courses/:course_id/front_page acts
as a proper endpoint for show/update/destroy and
acts just as /courses/:course_id/pages/:url
for whichever page is set as the front page

* confirm that none of the above page breaks
normal wiki functionality

closes #CNVS-5528

Change-Id: I3f51d740e90ff0a5a39f2aafc988a1a33947ca18
Reviewed-on: https://gerrit.instructure.com/20938
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
2013-05-30 02:51:35 +00:00
Landon Wilkins a18483e698 fixes course people observer logic such that students don't see observers
fixes #CNVS-5803

test plan:
1) create one student, two observers, and have only one of the two observers observe the student
2) masquerade as the student
3) navigate to the people page
4) you should not see either observer

Change-Id: I8e6426fca4a27d0d0b7f5d9586407753d630a477
Reviewed-on: https://gerrit.instructure.com/20845
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
Tested-by: Landon Wilkins <lwilkins@instructure.com>
2013-05-29 15:25:56 +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
Simon Williams fb5b10795d make some boolean logic clearer
test plan:
- specs pass

Change-Id: I52dfe80bfc5f526b5664d2facb52e27b1cc096a4
Reviewed-on: https://gerrit.instructure.com/20342
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
2013-05-07 15:16:16 +00:00
Cameron Matheson 63bde155b4 include points accumulated in gradebook csv
closes CNVS-2049

Test plan:
  * download the gradebook csv in a course with unweighted assignment
    groups. you should see "Current Points" and "Final Points" columns
  * download the gradebook csv in a course with weighted assignment
  * groups. there should not be any points columns

Change-Id: If795ab3dc0ae8a4fb84f29c9e759b463b7a14d04
Reviewed-on: https://gerrit.instructure.com/20189
Reviewed-by: Simon Williams <simon@instructure.com>
Reviewed-by: Stanley Stuart <stanley@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
2013-05-03 22:28:13 +00:00
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
Brad Humphrey 45f3bb468b lti configuration refactor
this commit is to help make canvas extensions more robust by
allowing tool level defaults and allowing both tool domains and launch
urls. Also added some helper methods for getting the correct properties,
and refactored to use the new helper methods.

Test Plan:
- Add a tool with both a domain and an launch url
- It should not give an error

- Add a tool configured with defaults for for canvas extensions
(such as icon_url, url, selection_height, selection_width, etc)
- Add a canvas launch (resource_selection, editor_button, course_navigation, etc)
with minimal configuration
- The canvas launch should inherit the properties from the extensions default
- Add an launch that has its own properties
- The launch should prefer its properties over the defaults

* should test that all launch types are accepting defaults

closes #CNVS-4498

Change-Id: I0dd4e78efb54db9c0cd1204383934db50f402674
Reviewed-on: https://gerrit.instructure.com/17715
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2013-04-29 21:05:58 +00:00
Cody Cutrer 4ffcfe0721 get assignments and submissions from all shards
fixes CNVS-4959

(note that this does not cover the cross-shard links
from these assignments working correctly; that is a
separate issue)

test plan:
 * enroll a user in courses in multiple shards
 * assignments from all courses should show up in
   /assignments regardless of current shard

Change-Id: Ic46711a31ddc573f124cad3ed2bc5abefd4646a9
Reviewed-on: https://gerrit.instructure.com/19234
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-04-29 16:00:31 +00:00
Bracken Mosbacker 83455f2252 wiki page draft state support
wiki pages can be unpublished but will still default to
active until the feature is enabled.

Test Plan:
 * make an unpublished course in the console
 * using the wiki api make sure students can't see it in
   the index or show actions

closes CNVS-5270

Change-Id: I48970ce9c6b86a3039432b6d7647810b434bfdfc
Reviewed-on: https://gerrit.instructure.com/20014
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-04-26 16:31:27 +00:00
Simon Williams b35b70580d fix performance regression in gradebook csv
fixes CNVS-5492

test plan (external):
- download the gradebook csv with and without sis ids
- it should still work

test plan (internal):
- run gradebook csv with sis ids from the console and watch the db queries
- it should not load quiz submissions
- it should not load the account once per student

Change-Id: I2665041d8733856d8b32547b49d5af5b69292076
Reviewed-on: https://gerrit.instructure.com/20007
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
Reviewed-by: Stanley Stuart <stanley@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2013-04-25 15:33:49 +00:00
Jeremy Stanley bd5c66011a use 'unpublished' (not 'created' or 'claimed') in courses api
test plan:
 - courses api should return 'unpublished' workflow_state for
   courses in 'created' or 'claimed' state

Change-Id: I927cd6d4b66556c1d0762ad16433f69764d6a050
Reviewed-on: https://gerrit.instructure.com/19574
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-04-20 01:36:23 +00:00
Cody Cutrer 6e9c843b3d switch to Shackles gem
extracted out of canvas-lms

refs CNVS-4713

test plan:
 * actions that use a slave should still work (dashboard render)
 * you should be able to switch envs and users in console

Change-Id: I07dda8057cf94383bc4579f1ef6b5a4b3ffc20b5
Reviewed-on: https://gerrit.instructure.com/19287
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-04-17 16:25:06 +00:00
Mark Severson 19757eebba allow public access to the syllabus page on a non-public course
also cleaned up the calendar events api specs to make them a
little less error prone

test plan:
 * syllabus page:
   note: please verify against published courses
   * standard access (calendar events, assignments, appointment groups)
   * public course (calendar events, assignments)
   * public syllabus (calendar events, assignments)
 * courses api:
   * create w/public_syllabus
   * update w/public_syllabus
   * get w/include[]=public_syllabus
 * calendar events api (for public courses/public syllabus courses):
   * calendar events and assignments

fixes #CNVS-4811

Change-Id: I17e9f260117c031af008592a470b6e17df93c1d5
Reviewed-on: https://gerrit.instructure.com/19376
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-04-15 15:42:33 +00:00
James Williams 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
James Williams 68ba7c7b46 don't import all files in migration if copy[:files] is missing
fixes a problem where having the copy[:files] value missing
(as opposed to an empty hash) in the migration settings
would cause every attachment to be imported in

test plan:
* import a migration
* on the "choose content" screen, make sure that
none of the boxes under "Files" are checked.
* confirm that the import did not copy every file
(files that are linked to in other imported content
will be implicitly imported)

fixes #CNVS-4817

Change-Id: I53c736bdc8cf6835e4460c0a43349be1c7b04959
Reviewed-on: https://gerrit.instructure.com/19161
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2013-04-01 19:27:44 +00:00
Cody Cutrer d9111f5414 arel-ify models
closes CNVS-4707

Change-Id: I32c8ec5a53525f89cf232890eaac790fbc2b4744
Reviewed-on: https://gerrit.instructure.com/18745
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-04-01 18:42:38 +00:00
James Williams 846df225be add account setting to allow/block future course view
adds a root account setting :restrict_student_future_view
that restricts students from viewing a course in which they
have a future enrollment

test plan:
* invite a student into a course that is unpublished
or is set to a future date (and restricted to those
dates)
* turn the restriction setting is on
* confirm that as that student, the course does not
appear in the list of future enrollments
on the courses index
* confirm that the student cannot visit the course
directly (i.e. through /courses/1)
* confirm the opposte if the restriction is unset

fixes #CNVS-4813

Change-Id: I4352a2919514a5c0da768a7f8aa79447dd3a948c
Reviewed-on: https://gerrit.instructure.com/18958
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-03-29 18:47:54 +00:00
Sterling Cobb 0f308db11d add admin tools for undeleting courses
You can now restore a course if you have its id from the admin tools
page.

Test Plan
1. Go to an accounts page.
2. Click on 'admin tools' in the left hand navigation.
3. Enter the ID of a deleted course into the field under 'Find a deleted
course'
4. Click 'Restore'
5. View the course and ensure its now in an Unpublished state.

Permissions Part
1. Go to the permissions page
2. In account permissions change the course restore permission to be an
X for all roles.
3. Log into an account that can see course settings for the account you
changed the permission on.
4. The "Account tools" should not show up.

fixes CNVS-3797
fixes CNVS-3692

Change-Id: I009fbdc8f1d5cf86a9ccd1b6652d0153cfb363c9
Reviewed-on: https://gerrit.instructure.com/18492
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2013-03-22 17:59:24 +00:00
Cody Cutrer a5ccb6bc2a fake arel!
closes CNVS-4705

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

test plan:
 * test all the things!

Change-Id: I4290d00db407f3250570df4e89c8c78283fe5f5f
Reviewed-on: https://gerrit.instructure.com/18427
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-03-19 11:10:22 -06:00
Cody Cutrer 469b6b674a resend course invitations async
fixes CNVS-4580

and don't load all the enrollments at once, either.

test plan:
 * (in production mode)
 * invite some people to a course
 * stop delayed jobs
 * click the re-send invitations link in the course settings
 * the users should not see the invitations again yet (in /messages)
 * start jobs
 * the invited users should see the invitations again now

Change-Id: Id2a7396df9cfe1a0f559a9780c5df0d8b7b0fcb2
Reviewed-on: https://gerrit.instructure.com/18509
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
2013-03-14 17:38:39 -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
Jon Jensen cd6d2de848 remove birthdate from UI, fixes CNVS-4191
test plan:
1. go to /register
2. you should not be prompted to enter a birthdate in any of the flows
3. the forms should work
4. go to your (user) settings
5. you should not see your birthdate nor be able to enter one
6. the form should work
7. go to the self enrollment page for a course as a new user
8. you should not be prompted to enter a birthdate
9. the form should work

Change-Id: I9bf92d27e208696b2aed74b4a6396d434494679c
Reviewed-on: https://gerrit.instructure.com/18143
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
QA-Review: Cam Theriault <cam@instructure.com>
2013-02-28 14:23:38 -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