Commit Graph

137 Commits

Author SHA1 Message Date
Brad Horrocks 3fee901ac0 Remove Google Docs plugin
Google drive relevant code has been moved to the gems/google_drive
Actually test google drive with mocked api responses
cleaned up lots of code

Fixes PLAT-1301

Test Plan:
*** You'll need to use 2 separate google accounts to fully test ***
** Its helpful to have multiple chrome profiles so you dont have to log in and
** out a bunch https://support.google.com/chrome/answer/2364824?hl=en

BEFORE SWITCHING TO THIS PATCH SET
  - Make sure you have some google doc collaborations
    - Directions for creating one are below
  - Disable your google docs plugin

Switch to the patch set
Enable google drive. (if not already)
  - You should be able to paste in a client_secrets.json
  - Update Redirect URI to point to your local instance (The URI should exist in the JSON)

As an admin/teacher
  - Goto `profile/settings` and add the google drive user service
    - Your email should be displayed with the service
  - Goto Collaborations
    - Make sure existing collaborations still work
    - Click "Start new collaboration"
    - give it a nice name (Created by admin)
    - select your student
    - click start collaborating
    - You should be redirected to the new doc in google
    - create another collaboration without the student (Created by admin, no users)
  - Create an assignment with
    Submission Type: Online
    Online Entry Options: File Uploads
  - Make sure your student has access to the course/assignment
  - Goto Account settings -> Users
    - Click View User Groups in the top right
    - create a new group set with a group in it
    - add yourself and your student to the group
  - Goto the Group's Collaborations (Courses & Groups -> [group name] -> Collaborations)
    - Click "Start new collaboration"
    - give it a nice name (Created by admin for group)
    - select your student
    - click start collaborating
    - You should be redirected to the new doc in google

As a student
  - Goto `profile/settings` and add the google drive user service
    - Your email should be displayed with the service
  - Goto the assignment
    - Submit the assignment
    - You should have a "Google Doc" tab
    - Choose a document and submit it
    - After it submitted, click download on the right side
      just to make sure its correct
  - Goto Collaborations
    - Make sure existing collaborations still work
    - make sure the "created by admin" collaboration works
    - make sure you can't see "Created by admin, no users"
    - Click "Start new collaboration"
    - give it a nice name (created by a student)
    - click start collaborating
    - You should be redirected to the new doc in google
    - Switch to your admin/teacher and make sure they can't access it
    - Edit the collaboration add the teacher, click Save
    - Switch to your admin/teacher and make sure they can access it
  - Goto `profile/settings` and REMOVE the google drive user service
  - Go back to collaborations
  - You should be forced to add the google service in order to use a collaboration
  - Goto the Group's Collaborations (Courses & Groups -> [group name] -> Collaborations)
    - Make sure you can access "Created by admin for group"
    - Click "Start new collaboration"
    - select your admin/teacher
    - click start collaborating
    - You should be redirected to the new doc in google
    - make sure your admin can access it to

As a site admin
  - Disable Google Drive
  - Then with your student
    - Make sure you can still do file upload submissions on the assignment
    - Collaborations should no longer show up (unless you have etherpad enabled)
  - Google drive should no longer show up in your profile settings as a registered service
Change-Id: I4dfaff6f5262743c044aadd12266fd0bd85a60e1
Reviewed-on: https://gerrit.instructure.com/69078
Reviewed-by: Andrew Butterfield <abutterfield@instructure.com>
Tested-by: Jenkins
QA-Review: August Thornton <august@instructure.com>
Product-Review: Brad Horrocks <bhorrocks@instructure.com>
2016-02-01 23:41:53 +00:00
Michael Brewer-Davis 154d34fa26 Allow outcome result details for Quiz alignments
Fixes CNVS-25911

Test plan:

Align an outcome to a question bank
Create a quiz
Import question bank into quiz
Have student take quiz
Go to outcome show page
Click on the quiz result within "Artifacts"
Should redirect to quiz submission, not show error

Change-Id: Ibb25d4fae21ccce29d49325bd593de3eafd866e3
Reviewed-on: https://gerrit.instructure.com/70093
Reviewed-by: John Corrigan <jcorrigan@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Tested-by: Jenkins
Product-Review: McCall Smith <mcsmith@instructure.com>
2016-01-27 23:48:03 +00:00
James Williams b1f3daf044 rails 4.2: misc spec fixes
refs #CNVS-26056

Change-Id: Ia94ee2fcfded1ec66cb77a19085b005c81304800
Reviewed-on: https://gerrit.instructure.com/70251
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2016-01-18 21:45:39 +00:00
Michael Hargiss ca8d6a62d8 spec: modify SpecComponents module and classes, prep for DA specs
Test Plan:
- pass Jenkins
- check for errors
- make sure DA (selective release) spec setup
  matches those specified in the DA Preconditions
  in TestRail (http://bit.ly/1mVXHOt)

Change-Id: I6b3d4a432c37b3bfb652a75d71bd78af1792afb8
Reviewed-on: https://gerrit.instructure.com/69920
Tested-by: Jenkins
Reviewed-by: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Caleb Guanzon <cguanzon@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
2016-01-16 02:31:18 +00:00
Michael Hargiss ae496391dd spec: add selective release module and context
Test Plan:
- pass Jenkins
- check for syntax errors

Change-Id: I7b2edb3201796efb8f5c4e5c7961c2ee506dc839
Reviewed-on: https://gerrit.instructure.com/66051
Tested-by: Jenkins
Reviewed-by: Robert Lamb <rlamb@instructure.com>
Product-Review: Robert Lamb <rlamb@instructure.com>
QA-Review: Robert Lamb <rlamb@instructure.com>
2015-10-30 21:44:18 +00:00
Joel Hough 0eda14710c set locale for summary message creation
fixes CNVS-21166

test plan
- see ticket for repro steps

Change-Id: I97d8a76918f597c2e2607eddb3ad4c84d4b17d9e
Reviewed-on: https://gerrit.instructure.com/64553
Reviewed-by: Matthew Wheeler <mwheeler@instructure.com>
Tested-by: Jenkins
QA-Review: Adrian Russell <arussell@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
2015-10-20 20:14:19 +00:00
Brian Finney 28c202db85 Add precision fields to numerical question ui
Adds edit ui for "Answer with Precision" as a "Numerical Answer" subtype.

Precision answers are rounded to a precision of 16 to handle floating
point errors and then truncated to the specified precision for grading
and comparison.

If any of the potential answers to a numerical question is a precision
answer then the student form will accept precision answers. If none of
the possible answers are precision answers then the student form will
continue to round to 4 decimal places.

Refs CNVS-10866

Test plan:
 - Create a new question
 - Select a question type of "Numerical Answer"
 - Select answer type of "Answer with Precision"
 - You should see an answer input field and a precision input field
 - The precision field should default to 10 and accept input between
 1 and 16, these are the limits of javascript floats
 - The answer input should accept numerical inputs with or without an `e`
 exponent and be formatted according to the configured precision
 - The quiz submission form should accept answers with a precision of up
 to 16 in normal or exponential format (#.##e##)

Change-Id: Idc117a61040a43b038272afec9319bada43e5f54
Reviewed-on: https://gerrit.instructure.com/64068
Reviewed-by: Matt Berns <mberns@instructure.com>
QA-Review: Michael Hargiss <mhargiss@instructure.com>
Tested-by: Jenkins
Product-Review: Jason Sparks <jsparks@instructure.com>
2015-10-08 22:48:10 +00:00
Ryan Shaw 6f4d7ba64a have spec factories use new UI if ENV['CANVAS_FORCE_USE_NEW_STYLES']
closes: CNVS-23137

We have a new jenkins build "canvas-sel-r21-hourly-p2-new-styles"
that will will test everything against new UI. It sets the
CANVAS_FORCE_USE_NEW_STYLES environment variable which, with
this commit will make it so account factories have new_ui
turned on by default. Tests can still explicitly turn off new UI
so they can test something with it turned on and then off if they want.

Change-Id: I8f7384064aa6674c09abc02d712a048a726f76d9
Reviewed-on: https://gerrit.instructure.com/61888
Tested-by: Jenkins
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Derek Hansen <dhansen@instructure.com>
2015-09-28 16:28:56 +00:00
Cody Cutrer fb08dd4499 convert Canvas login to a real authentication provider
test plan:
 * before applying this change
   * configure one account with canvas auth, one without (on account settings)
   * configure another account with canvas auth and 3rd party auth
 * check that /login still works on the above accounts, as well as
   /login?authentication_provider=canvas
 * run migration
 * Canvas auth should properly show up or not in authentication providers,
   and below any pre-existing providers
 * delete all auth providers; Canvas should automatically show up after you
   delete the last one
 * Canvas auth should be respected for logging in when it is enabled/not
   enabled (i.e. not enabled you can't login with a canvas password)

Change-Id: I873a4fe3e217f84384da6e5afbf5c280ae368c0b
Reviewed-on: https://gerrit.instructure.com/61814
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2015-09-14 21:13:38 +00:00
Dan Minkevitch 9aadc4c543 Stubbing out Crocodoc filter for moderated_grading
closes CNVS-22009
closes CNVS-22012

Test Plan:
* Enable "Moderated Grading" Feature
* Create an assignment that takes file uploads
  as submissions and has Moderated Grading
  checked
* Submit a PDF as a student
* As a teacher, open the assignment in speed grader
  and make comments on the document preview in the
  left pane  (not to be confused with comments
  on the submission)
* As a TA, open the assignment in speed grader
  and make comments on the document preview (as above)
* As the student that submitted the assignment,
  go to your submission and make comments on the document preview
* As a teacher, you should be able to view all the comments
  made on the assignment
* As a TA, you should see the annotations that TA
  has made
* As a student, you should see the annotations that
  student has made

Change-Id: I3bbbade5a8bdfa1d0a7d2d1e16e667e95d1a7a9a
Reviewed-on: https://gerrit.instructure.com/61396
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2015-09-04 02:15:00 +00:00
Deepeeca Soundarrajan 5c33b035ad Quizzes term-course-section hierarchy
Written a bunch of specs to regression test the quizzes functionality
for various hierarchy levels

dsoundarrajan, panda, 12

Change-Id: I6e95b0c1f262488d164101db42aaba4f958e2274
Reviewed-on: https://gerrit.instructure.com/61987
Reviewed-by: Derek Hansen <dhansen@instructure.com>
Tested-by: Jenkins
Product-Review: Derek Hansen <dhansen@instructure.com>
QA-Review: Derek Hansen <dhansen@instructure.com>
2015-08-28 18:59:29 +00:00
Derek Bender 570e6d3165 filter assignments by overrides when necessary
build query that search for overrides but delegates to assignment if none exist

fixes CNVS-20435

Change-Id: I0b88ccb78027e43a7d82c392a11b9980fff52174
Reviewed-on: https://gerrit.instructure.com/57176
Tested-by: Jenkins
Reviewed-by: Strand McCutchen <smccutchen@instructure.com>
QA-Review: Adrian Foong <afoong@instructure.com>
Product-Review: Matt Fairbourn <mfairbourn@instructure.com>
2015-08-20 15:37:12 +00:00
Deepeeca Soundarrajan a32e486735 Assignment_rubrics: Added and refactored specs for assignments_rubrics_spec.rb
dsoundarrajan, panda, 3

Change-Id: I5c148fc0f65a0cad2e4d8b6bd2ce3fc45a3e694b
Reviewed-on: https://gerrit.instructure.com/60508
Tested-by: Jenkins
Reviewed-by: Derek Hansen <dhansen@instructure.com>
Product-Review: Derek Hansen <dhansen@instructure.com>
QA-Review: Derek Hansen <dhansen@instructure.com>
2015-08-13 20:45:48 +00:00
John Corrigan fcb87dc336 move factories out of spec_helper
This is the first step to get us moved over to factory girl for test
factories. Gergich (rightly) has a lot to say on this, because I've
moved around a lot of scary looking code, but I am hesitant to spend
much time on fixing it here, since the end goal would be to rewrite most
all of the factory logic in factory girl anyway. Any feedback is good
feedback!

Change-Id: Id0da1099e98d4ac79c6bf1e1e8808d6e7ea43596
Reviewed-on: https://gerrit.instructure.com/57853
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: John Corrigan <jcorrigan@instructure.com>
Tested-by: John Corrigan <jcorrigan@instructure.com>
Product-Review: John Corrigan <jcorrigan@instructure.com>
2015-07-16 15:29:29 +00:00
James Williams 291d10c52f rails4: fix content_zipper_spec
refs #CNVS-21596

Change-Id: Ie6cdbd1c6d8ee8625f63fae60e141570c6ea0307
Reviewed-on: https://gerrit.instructure.com/57815
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2015-07-07 20:30:43 +00:00
Derek Bender 160c169944 one grading period save button
closes CNVS-20238

this removes individual save/update buttons on the
grading periods page in favor of a single save button.
a title validation is also added to grading periods.

Change-Id: Id6fa4de38f8d9243a21ce5011f090e8782c5aec0
Also-By: Spencer Olson <solson@instructure.com>
Also-By: Strand McCutchen <smccutchen@instructure.com>
Reviewed-on: https://gerrit.instructure.com/55688
Tested-by: Jenkins
Reviewed-by: Spencer Olson <solson@instructure.com>
Product-Review: Derek Bender <dbender@instructure.com>
QA-Review: Michael Hargiss <mhargiss@instructure.com>
2015-06-18 18:46:22 +00:00
Derek Bender 81feabdfbf validate grading period do not overlap dates
Grading Periods previously could overlap in arbitrary ways.
This adds a server side validation to ensure that when a Grading
Period is persisted it will not overlap with existing Grading
Periods in the same Grading Period Group. Grading Periods in
different groups are not validated in this way. The front end will
report errors if attempting to save a grading period that overlaps.

Our definition of overlapping is any two grading periods
intersecting each other except if the end date of an earlier
grading period is equal to the start date of a later grading period

These two grading periods would be considered overlapping
(when in the same group):

  GradingPeriod.new(
    start_date: 0.months.ago,      end_date: 2.months.from_now
  )
  GradingPeriod.new(
    start_date: 1.months.from_now, end_date: 3.months.from_now
  )

These two grading periods do *NOT* overlap, even thought the
end_date of the first is the same as the start date of the
second (again, these would need to be in the same group):

  GradingPeriod.new(
    start_date: 0.months.from_now, end_date: 2.months.from_now
  )
  GradingPeriod.new(
    start_date: 2.months.from_now, end_date: 3.months.from_now
  )

Fixes CNVS-19858

Change-Id: I0c901fa35f3225186948bbd8d61ef368cd15c939
Reviewed-on: https://gerrit.instructure.com/53953
Tested-by: Jenkins
Reviewed-by: Dylan Ross <dross@instructure.com>
QA-Review: Michael Hargiss <mhargiss@instructure.com>
Product-Review: Derek Bender <dbender@instructure.com>
2015-06-10 20:55:43 +00:00
Benjamin Porter 5c355ebe97 Course factory: remove unused code
Change-Id: Ic546c1851c2b4a2db664eacc439f7a63f4b73f33
Reviewed-on: https://gerrit.instructure.com/54709
Tested-by: Jenkins
Reviewed-by: John Corrigan <jcorrigan@instructure.com>
Product-Review: Benjamin Porter <bporter@instructure.com>
QA-Review: Benjamin Porter <bporter@instructure.com>
2015-05-26 18:56:37 +00:00
Cody Cutrer 9834937c8c don't autorequire a bunch of gems that are rarely used
Change-Id: I09ed3686629b62849d392684d587f30cb2047013
Reviewed-on: https://gerrit.instructure.com/51853
Tested-by: Jenkins
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2015-04-09 18:47:50 +00:00
John Corrigan 4658e125a4 allow anonymous peer reviews; respect anonymity for reviewers
Anonymous peer reviews will arrive in a couple of patches, but this
is the first, and 1) allows an assignment to require anonymous
peer reviews, and 2) respects anonymity from the perspective of
the student whose work has been reviewed.

A couple tangential changes:
- update styles / html of _submission_sidebar on assignments page.
- Update `submission_comment_model` factory to use `@submission`
  instance var if present.
- Update `Submission#add_comment` to allow setting of recipient.

fixes CNVS-5531

test plan:
- As a teacher of a course with at least two students, create or edit an
  assignment.
- Associate a rubric with the assignment.
- Click the `Require Peer Reviews` check box, and observe the checkbox
  under the headline, "Anonymity." Click the checkbox labeled: "Peer
  Reviews Appear Anonymously."
- As a student, we will call the reviewed, complete the assignment.
- As the teacher, go to the assignment peer reviews page locate a user
  different than the one that completed the assignment above, we will
  call the reviewer, and assign them a peer review of the reviewed's
  assignment.
- As the reviewer, log in and complete the peer review by leaving a
  coment, and by showing the rubric and adding number of points.
- Observe that you are able to see your own name below the comment you
  have left.
- Observe that, when you view the rubric, you can see your own name in
  the 'Show Assessment By' dropdown.
- As the teacher, observe that you are able to see the reviewer's name
  underneath the comment they have left, and when you view the rubric,
  you can see the reviewer's name in the 'Show Assignment By' dropdown.
- As the reviewed, observe that you are unable to see the review's name
  underneath the comment they have left, or in the 'Show Assignment By'
  drowndown when viewing the rubric.

Change-Id: I1cadc7ac65a32188095949dfd758d4cd0883ac3e
Reviewed-on: https://gerrit.instructure.com/47841
Tested-by: Jenkins
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
Reviewed-by: Matt Berns <mberns@instructure.com>
QA-Review: Adam Stone <astone@instructure.com>
Product-Review: Hilary Scharton <hilary@instructure.com>
2015-03-23 19:24:32 +00:00
Jeremy Stanley c2719cabe1 don't create thumbnails for very large images
test plan:
 1. enable new files
 2. upload a sane-sized image file (jpg/gif/png)
    with less than 100 million pixels
 3. within a minute or so, a thumbnail image should
    be generated for the image, and visible after the
    new files page refreshes
 4. upload an image with more than 100 million pixels
    (the size of the file in bytes isn't relevant;
     you can use 100mpx.png, attached to the ticket,
     which is a 12800x8000 image which compresses down
     to 13K because it's solid blackness).
    Canvas should not generate a thumbnail for it.
    A generic icon should be used (not a solid black
    square).

fixes CNVS-17995

Change-Id: Ie5ed1f57de65fa105cb3f23ceb0b895b676375fe
Reviewed-on: https://gerrit.instructure.com/48973
Tested-by: Jenkins
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2015-02-23 20:43:05 +00:00
Simon Williams 9ca3e49bf8 cleanup and prevent duplicate external feeds
this commit does three things:
* runs a data migration to delete duplicate external feeds.  duplicates
  are defined as having the same context, url, verbosity, and header match
* prevents duplicates from being created on course copy, by searching
  for and re-using an existing feed if it exists when importing
* validating uniqueness of newly created/saved external feeds, and
  exposing validation errors in the UI

fixes CNVS-17523

test plan:
- before downloading this commit, create two courses, go to the
  announcments pages, and create several different external feeds, some
  of which only duplicate the url (but have differences for other values)
  and some of which are exact duplicates
- checkout this patchset, run migrations
- those courses should now only have unique feeds (the full duplicates
  will be deleted)
- now try creating a new full duplicate
- you should get an error message that says "taken" on the url field
- try importing the feeds from a course with a feed into another course
  that has the exact same external feed
- it should succeed, but not create a duplicate feed in the second course

Change-Id: If1655283102a74626c4579c24382cde92115e776
Reviewed-on: https://gerrit.instructure.com/45991
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
Reviewed-by: Joel Hough <joel@instructure.com>
Reviewed-by: John Corrigan <jcorrigan@instructure.com>
QA-Review: Derek Hansen <dhansen@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2015-02-13 17:35:34 +00:00
Simon Williams b4a1230539 allow students who are also account admins to peer review
fixes CNVS-18317

test plan:
- create an account admin, and a course
- enroll the account admin as a student in the course, along with other
  normal students
- create a peer review assignment
- submit as the admin, student A and student B
- assign both the admin and student A to peer review student B
- complete the peer review as student A first
- then complete the peer review as the admin
- it should work

Change-Id: Id89ca9fd06e0e113156083d3bec031bd64fb394e
Reviewed-on: https://gerrit.instructure.com/48387
Tested-by: Jenkins
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
QA-Review: Derek Hansen <dhansen@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2015-02-13 17:32:50 +00:00
Simon Williams b10f626dde remove unused external feeds columns
external feeds have three columns that really aren't adding any value

* body_match: never used anywhere in the code, always nil in the
  database
* feed_type: always 'rss/atom' (built to handle ical, but never used)
* feed_purpose: always 'announcements' (build to handle calendar_events,
  but never used)

closes CNVS-17581

test plan:
- create an external feed on the announcements page
- wait for the rss feed to post a new story and the aggregator to run,
  OR, in a rails console:
  * set the created_at date on the external feed to before the last
    posted entry, something like
      ef = ExternalFeed.last
      ef.created_at = 5.days.ago
      ef.save!
  * run the external feed aggregator, like so:
      ExternalFeedAggregator.process
- it should create an announcement for the blog post from that feed

Change-Id: I74deffbdaaa1e217f8eefbdfd1000d50c2406cb1
Reviewed-on: https://gerrit.instructure.com/45990
Reviewed-by: Joel Hough <joel@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2015-01-07 23:36:18 +00:00
Sean Lewis 65f0f2080b spec: spec for differentiated assignments
here's a spec to test a bunch of stuff in selrel

Change-Id: I20fe292eca40599b7a5eb5657337e9d16789516a
Reviewed-on: https://gerrit.instructure.com/43898
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
2014-12-03 21:47:56 +00:00
Simon Williams 6c2f4c5766 Revert "added validation to prevent due dates before course start and after course end"
This reverts commit 8059663961.

Conflicts:
	spec/selenium/assignments_spec.rb

Change-Id: Iee57cb5dc2abfe79d71b36cd6020647dfebb9b74
Reviewed-on: https://gerrit.instructure.com/43942
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Matt Berns <mberns@instructure.com>
QA-Review: Adam Stone <astone@instructure.com>
Product-Review: Matt Fairbourn <mfairbourn@instructure.com>
2014-12-03 18:23:00 +00:00
Cameron Sutter 613e298271 DA - update gb cells on the fly
fixes CNVS-16565

test plan:
 * setup DA
 * setup an assignment that is only visible to two sections
 * grade all of a student's submissions so that he has a 100% in the class.
 - remove that student's section from the list of overrides on the assignment
 - navigate to gb
 - remove the student's grade for that assignment
 > the cell should be grayed out
 > the student's grade should still be a 100%
 - repeat the above with 'treat ungraded as 0' turned on

 * using all the api endpoints that return assignment submissions
   - including by not limited to:
     submit an assignment, index, show, grade a submission
 * include 'include[]=visibility' in the request
 > each submission object returned should have an 'assignment_visible' attribute
   which should match whether the submitter has visibility

Change-Id: I6eb5324ea5b96738cc40fb2446fc4bc96db094c5
Reviewed-on: https://gerrit.instructure.com/43618
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
QA-Review: Sean Lewis <slewis@instructure.com>
Product-Review: Hilary Scharton <hilary@instructure.com>
2014-11-20 22:01:19 +00:00
Cody Cutrer e719d737f4 more no more dynamic finders
Change-Id: Ibd26ab5b324efff3b9b1af52ac225198f440d8a7
Reviewed-on: https://gerrit.instructure.com/43599
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>
2014-11-04 18:57:05 +00:00
James Williams 81d4adc319 new roles
refactor everything that used to use strings for roles
to use actual role_ids

the apis should be backwards compatible so we don't need
to update (most of) the UI's right away in this commit

test plan:
* regression tests for permissions, role overrides,
 alerts (for account roles), enrolling users,
 adding account admins, etc.

refs #CNVS-15481

Change-Id: Id57fd3104c5c518b6fbf180609950dcddcdd474d
Reviewed-on: https://gerrit.instructure.com/41208
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2014-10-31 19:44:14 +00:00
Cody Cutrer 650820952f spec: slighty de-insanify assignment_model factory
refs CNVS-16239

Change-Id: If6f9cba61a01a1cc60f0b63b581a813a076b9b02
Reviewed-on: https://gerrit.instructure.com/42853
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-10-16 22:28:14 +00:00
Matthew Berns 8059663961 added validation to prevent due dates before course start and after course end
also added course start and end validations to lock and unlock dates

fixes CNVS-14195

test plan:
- set an end date for the course
- attempt to set a due date for an assignment that falls before course start
- should see error "Due date cannot be after before start date"
- attempt to set a due date for an assignment that falls after course end
- should see error "Due date cannot be after course end date"
- attempt to set an unlock date that falls before course start
- should see error "Unlock date cannot be before course start"
- attempt to set a lock date that falls after course end
- should see error "Lock date cannot be after course end"
- no errors should appear for blank date fields
- repeat above process with VDD and for quiz due dates and graded discussions

Change-Id: Ifc42d64ad51b98b03ccee6eccf8e08f4e5faf886
Reviewed-on: https://gerrit.instructure.com/40185
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-10-03 21:34:32 +00:00
Michael Nomitch 0a5e71d28e DA - quizzes
fixes CNVS-14094

test plan:
  - course with DA as students and teacher
    - api show & index
    - quizzes index page shows only assigned quizzes
    - quizzes show page url redirects to index if
      quiz isnt visible to user
    - grade calculation
    - gradebook/grades page
    - calendar events events
    - modules filter out quizzes correctly
    - observers see same things as their students
    - if a student takes a quiz and it is not graded and then
      loses visibility, make sure that the GB greys out the cell
      rather than showing a submission icon
  - same course with DA off works normally

Change-Id: I10b936f1516d6d24f11d74c0bb572051f0b1d1c4
Reviewed-on: https://gerrit.instructure.com/39897
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Mike Nomitch <mnomitch@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Product-Review: Mike Nomitch <mnomitch@instructure.com>
2014-10-01 20:58:54 +00:00
Cameron Matheson a1f400e754 remove scribd
closes CNVS-13380
closes CNVS-8057
closes CNVS-5156

Test plan:
  * scribd should no longer exist
  * document previews should work in canvadocs

Change-Id: I5ac60c3e986f030c3aea88e32d2992ec7b1c7a08
Reviewed-on: https://gerrit.instructure.com/37895
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Anna Koalenz <akoalenz@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-09-11 18:42:15 +00:00
Liz Abinante 6960995489 DA - notifications for assignments
fixes CNVS-13933

test plan (with a course setup for DA):

for the following tests:
* perform them on assignments that are only_visible_to_overrides
* _and_ again on assignments that should be visible to everyone (regression)

- mute an existing assignment that has a due date for one section only
- unmute it
- verify that the *unmuted* notification only go to the students & admins who can see the assignment

notes: must be an existing assignment that is more than 30 minutes old

Change-Id: Ic26fe29a8b1db06e376fdeae129636b0a097fab1
Reviewed-on: https://gerrit.instructure.com/37271
Reviewed-by: Cameron Sutter <csutter@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Liz Abinante <labinante@instructure.com>
2014-09-08 21:52:28 +00:00
Cody Cutrer b1dca446f1 fix duplicate notification policies
* use a join, not an include, when looking for channels by frequency
 * make the index more specific and unique

Change-Id: Ie8b83144e5155241ff22e40519584ffe5314541b
Reviewed-on: https://gerrit.instructure.com/39442
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>
2014-08-19 16:59:42 +00:00
James Williams 81558f728c remove rails 2 support
closes #CNVS-14261

Change-Id: I1b0e8a4438ab659ecd1ac8462bc3559d810989b3
Reviewed-on: https://gerrit.instructure.com/38744
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>
2014-08-06 18:16:19 +00:00
Jayce Higgins f3f8b0c428 Adds peer review notification for assigning peer reviewers
Fixes: CNVS-3771

Adds a peer review notification to go out after
a peer reviewer is added to the discussion. This
also resolves the issue with a notification not
being sent if a rubric is not attached.

Test-Plan:
1.) Run bundle exec rake db:migrate in the console
	before doing anything else -- (This sets up your
	db by using notification_types.yml to populate
	notification types in the DB.)
2.) Create a graded discussion with at least 2
     students
3.) Make sure both students have everything
     in their notifications set to ASAP.
4.) Edit the assignment settings and select the
     'Require Peer Reviews' - Choose to manually
     select peer reviewers.
5.) Navigate to discussions as an admin
6.) Select the cog and go to peer reviews.
7.) Assign a peer reviewer and verify that the
     notification was sent out.

Change-Id: I78212cb8043de0fcf809a9ffa56ffca327ffcacc
Reviewed-on: https://gerrit.instructure.com/36646
Reviewed-by: Matthew Wheeler <mwheeler@instructure.com>
Product-Review: Matthew Wheeler <mwheeler@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
2014-07-25 19:56:57 +00:00
Michael Nomitch a60802d00e DA - sql view and shared methods
fixes CNVS-13649

test plan:
  - go to a few pages and make sure no errors occur
    - GB2
    - assignment index
    - student grades page
  - do same with and without DA on

Change-Id: I72f303cf54c36420a57dfbd23635f319f9827bd0
Reviewed-on: https://gerrit.instructure.com/36675
Reviewed-by: Cameron Sutter <csutter@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
2014-07-15 18:03:57 +00:00
Braden Anderson c6014471f4 discussions: prevent creation of new group graded discussions
test plan:
  * create a graded discussion
  * using the Assignments API, try to set group_category_id
      on the discussion's linked assignment
  * verify that you get an error message
  * using the Discussion Topics API, set a group_category_id
      on the discussion
  * verify that the discussion becomes a group discussion

Change-Id: Ida1bae1f370a5d5f13a5002b9cdeb40c24dba0b2
Reviewed-on: https://gerrit.instructure.com/35084
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Willesen <jonw@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Braden Anderson <braden@instructure.com>
2014-07-14 19:30:13 +00:00
Jacob Fugal d9c6e2a0cd clarify Slug vs. UUID and fix event stream
refs CNVS-13987

what was called CanvasUuid was *not* generating UUIDs. it was generating
slugs. by default, its generate method only creates 4 character slugs.
these should obviously not be used as UUIDs. the misnomer already caused
a bug in EventStream where it used these slugs as UUIDs, causing
collisions. to fix:

 (1) rename canvas_uuid gem to canvas_slug, and rename it's primary
     class CanvasUuid to CanvasSlug
 (2) create new canvas_uuid gem, with class CanvasUUID, extracted from
     lib/uuid_singleton for actual UUID generation
 (3) fix event stream use CanvasUUID, rather than following the rename
     of CanvasUuid to CanvasSlug

test-plan:
 - have cassandra set up for audit logs
 - create an audit log entry (e.g. change a grade)
 - look at the generated audit log entry's id field; it should be a UUID
   value, not a 4 character slug

Change-Id: I19758fff4433cd6cb2e21219217dced19ee05c5a
Reviewed-on: https://gerrit.instructure.com/37506
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
2014-07-11 16:58:42 +00:00
Jon Jensen f42af73427 spec: basic once-ler integration, speed up some specs
see https://github.com/instructure/once-ler

in rails3, reduce spec/models/a* runtime by ~45% (15min -> 8.5min locally)

Change-Id: Ia7bbc36c3602c3c3742c1b894e539584323f3e14
Reviewed-on: https://gerrit.instructure.com/37043
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Dave Donahue <ddonahue@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2014-07-01 02:59:23 +00:00
Cameron Matheson 33b4eb55f9 canvadocs
This commit adds support for document previews from a Box View
compatible API.

closes CNVS-12416

Test plan:
* NOTE: check everywhere for previews (speedgrader, files list,
  individual files page, etc?)
* Enable Scribd and Crocodoc
  * attachments should be previewable in scribd or crocodoc (submission
    attachments should go to Crocodoc)
* Enable Canvadocs
  * Files that previously previewed in scribd should now go to
    Canvadocs.  Nothing should ever go to scribd.
  * New submission attachments should continue to use Crocodoc (for
    supported file types)
  * Other attachments should preview in Canvadocs

Change-Id: I173e4fabc0ae677cdddd4bd065777a90360c1f34
Reviewed-on: https://gerrit.instructure.com/34535
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Matt Fairbourn <mfairbourn@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
2014-05-09 22:38:57 +00:00
Joseph Rodriguez e0a5065086 replace usages of Quiz#find_or_create_submission with SubmissionManager#find_or_create_submission
fixes: CNVS-12598

  test plan:
    - create a quiz as an instructor
    - as a student
    - take quiz
    - exercise all paths by which a quiz submission is generated
    - verify that quiz submissions continue to work as before

Change-Id: I9fd71679e6c9a45686861609ff481f5f4250cca1
Reviewed-on: https://gerrit.instructure.com/33735
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Jason Madsen <jmadsen@instructure.com>
2014-04-24 19:33:08 +00:00
Cody Cutrer 045049036c add foreign keys part 16
fixes CNVS-6202

Change-Id: If5b037b65c49b4722616a80e6438d65cda3dbf3a
Reviewed-on: https://gerrit.instructure.com/32042
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-03-25 21:56:22 +00:00
Michael Ziwisky aa8b8c7ece add serializable hash of CustomData for User models
fixes CNVS-11424

test plan:
- rake db:migrate
- if you don't already have one, set yourself up with a developer token.
  (you can do so from <canvas>/developer_keys)

- $ curl -H "Authorization: Bearer <ACCESS-TOKEN>" \
         -X GET -F 'ns=test' \
         <canvas>/api/v1/users/self/custom_data
  #=> {"message":"no data for scope"}

- $ curl -H "Authorization: Bearer <ACCESS-TOKEN>" \
         -X PUT -F 'ns=test' \
         -F 'data[apple]=so tasty' \
         -F 'data[kiwi]=a bit sour' \
         <canvas>/api/v1/users/self/custom_data/fruit
  #=> {"data":{"apple":"so tasty","kiwi":"a bit sour"}}

- $ curl -H "Authorization: Bearer <ACCESS-TOKEN>" \
         -X GET -F 'ns=test' \
         <canvas>/api/v1/users/self/custom_data
  #=> {"data":{"fruit":{"apple":"so tasty","kiwi":"a bit sour"}}}

- $ curl -H "Authorization: Bearer <ACCESS-TOKEN>" \
         -X DELETE -F 'ns=test' \
         <canvas>/api/v1/users/self/custom_data/fruit/kiwi
  #=> {"data":"a bit sour"}

- $ curl -H "Authorization: Bearer <ACCESS-TOKEN>" \
         -X GET -F 'ns=test' \
         <canvas>/api/v1/users/self/custom_data
  #=> {"data":{"fruit":{"apple":"so tasty"}}}

- see new API doc for more info about how it should work, but
  basically, you should be able to GET, PUT, and DELETE at will
  for any given scope, and PUTting JSON hashes creates referenceable
  scopes. (e.g. the DELETE above has 'kiwi' in its scope)

Change-Id: If027ae4aeec14edf44275ba0372a68aef7e5600e
Reviewed-on: https://gerrit.instructure.com/31173
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
2014-03-24 21:52:43 +00:00
Cameron Matheson 3c434e8aff Remove unused collections stuff
This was a beta api that didn't work out.

Test plan:
  canvas should still work (sorry, this touches lots of stuff)

Change-Id: I31680b83f72f6d739ce74735ba40d7a760debb33
Reviewed-on: https://gerrit.instructure.com/29506
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
2014-02-07 19:32:46 +00:00
James Williams 0cedba19f8 replace association with association_object in models
having an "association" attribute causes problems in rails 3

Change-Id: I3249a25cd2a6162ff33f548a2e9f4f51a2940ece
Reviewed-on: https://gerrit.instructure.com/29058
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2014-01-24 16:35:40 +00:00
Ahmad Amireh 20a3562779 Quiz Submission Questions API - Update
This patch provides support for answering Quiz Questions via the API.

closes CNVS-9844, CNVS-10225

TEST PLAN
---- ----

Testing this will be a bit rough because there are many variations and
validations to cover. I'll spare the validations that are covered by
specs from the test plan.

Create a quiz with a question of *each* type except "Text" and "File
Upload". There's a script that creates a quiz with its questions
automatically for you if you don't want to keep doing this manually. See
references.

> Answering Questions

Now you need to answer each question via the API. Most of them vary in
formats, but they are fully specified in the API documentation page
(along with examples). See DOCUMENTATION for more info.

> Flagging Questions

Flagging, and unflagging, a question is the same regardless of its type,
see the "EXAMPLE REQUESTS" section.

> Access Validations

Here are some generic, non-question based validations to verify. You
should NOT be able to answer a question if:

  - the quiz submission has been turned in
  - the quiz submission is overdue
  - the Access Code for the quiz is invalid
  - the IP filter of the Quiz prohibits you from taking the quiz
  - the quiz submission :validation_token is incorrectly specified (ie,
    other students shouldn't be able to answer your questions)
  - you don't specify the latest :attempt, so if the Quiz has multiple
    attempts, and this is your 2nd take, you specify an :attempt of 1,
    3, or anything but 2 should fail
  - NEW: turn quiz into an OQAAT quiz with the "Can't go back" flag on;
    the API should not reject all requests to modify any of the
    questions with a 501 error saying that type of quizzes is not
    supported yet (support will come in CNVS-10224)

> Grading

Also, when you're done answering the questions, take a look at the
grades and make sure everything gets graded just like it does when using
the UI directly.

> Verifying results in the browser

While taking a quiz in the canvas UI, the scripts perform backups in the
background that would overwrite any changes you do via the API. If you
want to verify the changes you make via the API from the UI, you must
append "?backup=false" to the take quiz page URL, something like this:

http://localhost:3000/courses/1/quizzes/1/take?backup=false

Setting that flag will (for now) disable the backup behaviour and should
make things tick.

EXAMPLE REQUESTS
------- --------

Don't forget to set the 'Content-Type' header to 'application/json'!

> Answering a Multiple-Choice question

[PUT] /api/v1/quiz_submissions/:quiz_submission_id/questions/:id

{
  "attempt": 1,
  "validation_token": "1babd0...",
  "answer": 10
}

> Flagging a question

[PUT] /api/v1/quiz_submissions/:quiz_submission_id/questions/:id/flag

{
  "attempt": 1,
  "validation_token": "1babd0..."
}

> Unflagging a question

[PUT] /api/v1/quiz_submissions/:quiz_submission_id/questions/:id/unflag

{
  "attempt": 1,
  "validation_token": "1babd0..."
}

DOCUMENTATION
-------------

Run `bundle exec rake doc:api` and check out the Quiz Submission
Questions page. There's an Appendix that contains example requests for
each question type, as well as the errors produced by each handler.

LINKS
-----

  - bootstrap script:
    https://gist.github.com/amireh/e7e8f835ffbf1d053e4c
  - direct link to the API documentation page:
    http://canvas.docs.kodoware.com/quiz_submission_questions.html

Change-Id: I9a958323ece8854bc21a24c2affd8dc3972e46d5
Reviewed-on: https://gerrit.instructure.com/27206
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
2014-01-23 17:49:36 +00:00
Anthus Williams 40c5c1f5f7 fix for rails3 refactoring of TestUploadedFile
in rails 3, ActionController::TestUploadedFile has
been moved to Rack::Test::UploadedFile. This commit
simply updates uses of TestUploadedFile to work
with this new structure

Change-Id: Ib31159c635f033a13908608dffeea88c8f719086
Reviewed-on: https://gerrit.instructure.com/28234
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Anthus Williams <awilliams@instructure.com>
QA-Review: Anthus Williams <awilliams@instructure.com>
2014-01-17 17:53:18 +00:00
Anthus Williams 7f4d8fa39c fix spec failures for notifications
specs fail because evidently the notification model
expects to receive the :frequency parameter

Change-Id: I7ddd9e98a1c65ccf839256b460cc96af76afc849
Reviewed-on: https://gerrit.instructure.com/28365
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Anthus Williams <awilliams@instructure.com>
QA-Review: Anthus Williams <awilliams@instructure.com>
Product-Review: Anthus Williams <awilliams@instructure.com>
2014-01-15 18:33:26 +00:00