Commit Graph

2419 Commits

Author SHA1 Message Date
Brian Palmer 207efe7698 only include unpublishable in the json response when applicable
In other words, when the API caller can publish/unpublish the quiz

Also change the semantics of Quiz#has_student_submissions slightly, so
that we can do a simple count > 0 query, rather than loading all the
submissions just to determine it. The only difference in behavior is if
a user took the quiz and then their enrollment was dropped.

Change-Id: I2aa779d247b87a5f1775fc93baa74b6920045569
Reviewed-on: https://gerrit.instructure.com/26892
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
2013-12-03 05:20:41 +00:00
Cameron Matheson b4f7bb0daa don't include assignment version_number in cache key
fixes CNVS-9776

The version number isn't necessary since we still have updated_at
(having the version number requires a query for every assignment).

Test plan:
  * make sure assignment overrides still work (sorry)

Change-Id: I909494d1b7bde237a3b66db8ae987f61cdd6c024
Reviewed-on: https://gerrit.instructure.com/26793
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-12-03 00:53:37 +00:00
Michael Nomitch ad24eb77a9 moves test student to end of csv gradebook file
fixes CNVS-9268

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

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

Change-Id: Ic3dc92cf0a3e1da01e90fc270cb391bfa19c7fcd
Reviewed-on: https://gerrit.instructure.com/26745
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
2013-12-02 23:53:27 +00:00
Michael Nomitch de759895db added 255 character max title length to rubric in model
fixes CNVS-7136

Change-Id: I021afc50ba7c1d16e2d4c45276c3503b3c1e6a71
Reviewed-on: https://gerrit.instructure.com/26814
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Liz Abinante <labinante@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Mike Nomitch <mnomitch@instructure.com>
2013-12-02 23:52:22 +00:00
Rob Orton 600adefeab show when an account report fails in the ui and api
test plan
 * manually break a report so it will generate an error
 * ui should show that the report failed and give an error_report id
 * api extra text will also display the error

Change-Id: I20d08a01542154933752660a86a0570491ac7945
Reviewed-on: https://gerrit.instructure.com/26539
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jake Sorce <jake@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2013-12-02 22:57:25 +00:00
Sterling Cobb 2d40ce4e43 sync quizzes content_tag when publishing/unpublishing
When you publish or unpublish a quiz in a module it should also sync
the workflow state for its content_tag in that module so that the
sequence api doesn't think quizzes are published and show them to
students for parts of the code that use the sequence api ie: the
modules sequence footer.

fixes  CNVS-9118

Test Plan
With Draft State Enabled
1. Create three modules. Module A, Module B andModule C. Put a quiz in
each module.
2. In module A, unpublish the quiz in that module.
3. Navigate to module B and go to the quiz in the module. At the bottom
of the quiz there should now be a module sequence footer. That
footer should have a next button but not a previous button since the
quiz in the previous module isn't published.

Test Plan 2
1. Create a module.
2. Add a quiz to that module
3. Publish that quiz
4. Unpublish that quiz
5. Log in as a student and make sure you can see the quiz in the module
as a student but you can see it as a teacher.

Change-Id: Ibb4be0492aae33be9202f95e64cfbc3e09dc86b4
Reviewed-on: https://gerrit.instructure.com/26697
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-12-02 16:58:12 +00:00
Zach Pendleton 32b4ef475a move google docs domain restriction to feature flag
fixes CNVS-9686

test plan:
  * as a site admin, navigate to a root account's settings
    page, select the feature flags tab, and verify that the
    google docs domain restriction is there;
  * enable the feature;
  * reload the settings page and verify that there is a
    domain text input in the settings form;
  * verify that if set, the google docs restriction
    prevents users with invalid google docs domains from
    submitting assignments;
  * verify that when turned off, users can submit
    assignments on any domain.

Change-Id: I1078c4d0d6d56e04ee882e1d58e6e1c302cf4caa
Reviewed-on: https://gerrit.instructure.com/26657
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Product-Review: Zach Pendleton <zachp@instructure.com>
2013-11-27 15:37:01 +00:00
Ahmad Amireh 6fafe23b61 More accurate Access Report scores for Quizzes
This patch makes it that when viewing the Access Report for a course
student, their "Times Viewed" column will reflect the number of times
the student has browsed the quiz or any of its related resources
(like History, or attempt views), but not taken it.

While the "Times Participated" column will reflect the number of times
the student really took the quiz (1:1 mapping with the number of
submissions.)

TEST PLAN
---- ----

In both test cases, you'll need:
  - a course with a student enrolled
  - one browser session with a teacher logged in viewing the Access
    Report of the student
  - one browser session with the student logged

CASE: Normal quizzes

  - Create a quiz with a few questions and unlimited attempts.
  - Refresh the teacher tab, keep an eye on Times "Viewed" and
    "Participated" columns
  - As the student:
    - Go to the quizzes page
    - Go to the quiz page
  - Refresh the teacher tab, and:
    - ONLY the "Times Viewed" score should be incremented by 1
  - As the student:
    - Push the Take the Quiz
  - Refresh the teacher tab, and:
    - ONLY the "Times Participated" score should be incremented by 1
  - As the student:
    - Refresh the quiz page (while taking it)
  - Refresh the teacher tab, and:
    - NEITHER score should be incremented

CASE: OQAAT quizzes

The expected behaviour for OQAAT quizzes is that the entire attempt
counts as 1 participation, just like the normal quizzes.

Follow the same steps as above, but:

  - While taking the quiz, and for every question page:
    - Refresh the teacher tab and make sure that neither score is
      incremented

OBLIGATORY REFERENCES
---------- ----------

  - Acceptance criteria @ http://docs.kodoware.com/canvas/cnvs-5294

refs CNVS-5294

Change-Id: I55883b8edbf417edb42b9fd103e08369e0e9e63c
Reviewed-on: https://gerrit.instructure.com/26543
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
2013-11-26 23:05:01 +00:00
Jon Jensen 3d2b6d07d1 don't create 2 jobs for auto-locked delayed announcements
also make update_based_on_date more defensive (i.e. lock the row) for any
double jobs out in the wild. we don't delete jobs, so you could have dups
even without this bug, e.g. you set it for 1pm, then 2pm, then back to
1pm, et voilà, you now have 2 jobs at 1pm

fixes CNVS-9561

test plan:
1. under course settings, disable comments on announcements
2. create a new announcement w/ a delayed posting date
3. confirm that only one delayed job is created (you should not get
   double-emailed)
4. create another announcement w/ a delayed posting date
5. change the posting date
6. revert to the original date
7. while there will be multiple jobs, you should still not get double-
   emailed for the announcements

Change-Id: I86de7fc418599de86d9ef300ea7b3c2bf9f924b3
Reviewed-on: https://gerrit.instructure.com/26652
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeff Belser <jbelser@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
2013-11-26 20:58:10 +00:00
Jeremy Stanley dcf3df456b move draft state under feature flag umbrella
fixes CNVS-9496

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

Change-Id: Id7403f2a8371b0a7bfebffbb8f29330fff5c94c5
Reviewed-on: https://gerrit.instructure.com/26308
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
2013-11-26 20:43:49 +00:00
Josh Simpson 30b640ba96 add input validation for quiz groups
fixes CNVS-9282
this commit adds input validation to quiz groups for pick_count and
question_points, requiring the data given by the user to be numerical.

Test Plan
1. Create a Question Group with non-numerical values for pick count and
question points.
- Validation should fail and alert the user.

Change-Id: I13b1c95763504afd13f2f16e1a2de190e836c085
Reviewed-on: https://gerrit.instructure.com/26656
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Josh Simpson <jsimpson@instructure.com>
2013-11-26 18:45:45 +00:00
Paul Hinze ecbf218f10 remove legacy comment; add explicative comment
Change-Id: I7a70ec391d1c17e070b8d0e8714dddfc22a45bd3
Reviewed-on: https://gerrit.instructure.com/26714
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Paul Hinze <paulh@instructure.com>
Product-Review: Paul Hinze <paulh@instructure.com>
2013-11-26 16:57:09 +00:00
Cody Cutrer 7f463161ec only do scribd docs on root attachments
fixes CNVS-9603

also, migration to move scribd_docs up to root attachments

test plan:
 * BEFORE checking this out:
   * configure and enable scribd
   * upload the same (scribdable) file to two courses in the same
     root account
   * inspect the database, and confirm that both files have a
     scribd_doc for them
   * confirm both files render in the UI (you'll need to have
     jobs running)
   * upload another (scribdable) file to two courses
   * directly set scribd_doc=NULL on the root_attachment of this
     second pair; do *not* view it in the UI
 * check out this change
 * run migrations
 * inspect the database, and confirm that only the root attachment
   of for both pairs of previous files has a scribd_doc now
 * in the UI, confirm that all 4 render correctly
 * double check the DB, and ensure that only the two root attachments
   have scribd_docs
 * stop jobs
 * upload *another* (scribdable) file to two courses
 * start jobs; confirm that both copies render with scribd, and only
   the root has a scribd_doc. also confirm that the last_inline_view
   for the non-root one is still NULL (and that the last_inline_view
   on the root is updated when you view the non-root one in the UI)
 * repeat the last two stops, with jobs running the whole time this
   time (i.e. make sure that the first copy of the new file renders
   in scribd before uploading the second copy)

Change-Id: I3053e23a592e3a0c0713880f20fc543eb2c726d4
Reviewed-on: https://gerrit.instructure.com/26503
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-11-26 15:51:18 +00:00
Ahmad Amireh 0dff562ba8 Quiz IP Filters API controller - #index
This patch moves rendering of IP filters from the QuizzesController into
a separate, specialized API controller - QuizzesIpFilters.

The rendered IP filter object is backwards-compatible, as in it provides
the same three attributes: name, account, and filter. However, the endpoint
output has been modified to scope the array of filters under "quiz_ip_filters".
The front-end/JS part has been adjusted to accommodate this change.

REFACTORING
-----------

In an effort to reduce complexity, I've also taken to refactor all the
:before_filters that were looking up Quiz in the current context across
all Quiz controllers (where it was applicable), and that was done by
introducing a new component set: API Helpers.

API Helpers are modules that can be mixed-in, just like the API Modules,
that are really just a place to hold routines common between the API
and the regular controllers. I've put the first one in
lib/api/v1/helpers, namespaced under Api::V1::Helpers...

TEST PLAN
---- ----

  - Create a Quiz. No questions.
  - Set an IP filter of 192.168.1.1 on the Quiz
    - the restriction should still hold like it usually does
  - Perform a GET request to this endpoint:
    /courses/:course_id/quizzes/:quiz_id/ip_filters
    - A list of filters should be returned in JSON-API format containing
      the filter you set for the Quiz
  - Add one or more IP Filters on the account-level, and:
    - Re-perform the GET query:
      - The list should contain both the Quiz and the Account filters
    - Using the IP Filter search box from the Quiz settings page:
      - It should still properly list the available filters

refs CNVS-8988, CNVS-9586

Change-Id: I75c1b85024a58e6accd1627b7bee3da1185d2658
Reviewed-on: https://gerrit.instructure.com/26440
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>
2013-11-26 10:26:21 +00:00
Rob Orton 4c960ef934 set scribd user different per context
closes CNVS-9691

test plan
 - scribd user should be canvas-context-global_id

Change-Id: I2374aa656134b7ad80986be758e9cab3401bceec
Reviewed-on: https://gerrit.instructure.com/26663
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-11-25 22:04:22 +00:00
Brian Palmer c5114c418a rails3: errors_add_to_base was removed
The errors.add_to_base(...) method was removed in rails3, so this replaces
all instances of that with errors.add(:base, ...) which also works in
rails2 and is forward compatible with rails3, semantically as well as
syntactically.

test plan: specs cover some of these error responses, generally you'll
want to make sure that validation errors still get displayed correctly.
for instance when accessing /plugins/etherpad and saving the settings
without filling in all the fields, should display an appropriate error

Change-Id: Icab1592470bf5bd86912655d5b847cfe413bd003
Reviewed-on: https://gerrit.instructure.com/26180
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
2013-11-25 16:57:42 +00:00
Jacob Fugal cd892fe723 clean up context.users_not_in_group
for rails3 and folio

fixes CNVS-8790

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

Change-Id: Ic9e842abdbfba714829a123ca0dee4f93e5a1fdc
Reviewed-on: https://gerrit.instructure.com/26534
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
2013-11-25 16:37:50 +00:00
Zach Pendleton 557a3dae9e restrict google doc submissions by domain
fixes CNVS-8949

test plan:
  * from a rails console, run the following:

    account = Account.default
    account.settings[:google_docs_domain] = 'example.com'
    account.save!

  * as a student, configure your google docs integration
    from your profile page;
  * attempt to submit an assignment that allows file
    uploads using the "google docs" tab of the submissions
    box;
  * verify that a message is displayed informing you that
    cannot use a google doc because your domain is
    incorrect;
  * as another user who shares a course with the first
    student, create a google doc collaboration and add
    the first student to it;
  * verify that the first student cannot join the
    collaboration;
  * change the account :gmail_domain setting to 'gmail.com'
    and verify that both assignment submissions and
    collaborations work as expected;
  * verify that if you delete the gmail domain account
    setting, both google doc submissions and collaborations
    work as expected for users with google docs integration
    configured.

note: users added to a collaboration without a valid google
docs address will receive a notification about the
collaboration, but will not be able to join it. this is
pre-existing behavior.

Change-Id: I26f164f253710819214ccf5f2250b74b91a6774b
Reviewed-on: https://gerrit.instructure.com/26436
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Product-Review: Zach Pendleton <zachp@instructure.com>
QA-Review: Zach Pendleton <zachp@instructure.com>
2013-11-23 17:10:31 +00:00
Zach Pendleton af22c7faca exclude submission comments from new conversation badge
fixes CNVS-9141

if a user has opted into new conversations, he/she should
not have their new conversation badge updated when a
submission comment is made on one of their submissions.

test plan:
  * as a teacher, enable new conversations;
  * as a student in old conversations, submit an assignment
    and leave a submission comment on it;
  * as the teacher, verify that your inbox unread badge has
    not incremented;
  * as the teacher, respond to the submission comment;
  * as the student, verify that your inbox unread badge has
    incremented.

Change-Id: I672ed98b86e4f4c5bdcb5ea7b7b6db60c6c0d4d1
Reviewed-on: https://gerrit.instructure.com/26547
Reviewed-by: Braden Anderson <banderson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Zach Pendleton <zachp@instructure.com>
2013-11-23 00:22:33 +00:00
Stanley Stuart 63000d4944 stop students from viewing unpublished quizzes when viewing by URL
test plan:

  - With Draft State Enabled
    - Call the api as a student for an unpublished quiz. You should get
      a 401 response.
    - Try to view the quiz show page for an unpublished quiz by
      visiting its url. You should get an "Unauthorized" warning
      message.
  - With Draft State Disabled
    It should work exactly as before...:
    - Call the api as a student for a quiz that has not been
      "published." You should not get a 401 error.
    - Visit the page of the unpublished quiz. You should see quiz
      details, but you should not be able to take the quiz. Also the
      yellow "This quiz is unpublished. Students will not be able to.."
      banner should also not appear for the student.

fixes CNVS-9122

Change-Id: I2bd8893ce8f28f919eac0d6b4b8b0f929b818ee3
Reviewed-on: https://gerrit.instructure.com/26294
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
2013-11-22 22:11:08 +00:00
Liz Abinante ae4c9def12 VDD rendering on assignments index
fixes CNVS-5860

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

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

Change-Id: Ie6b2f571eb7b344d40ca4ffda26e27d43778d17d
Reviewed-on: https://gerrit.instructure.com/26449
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cameron Sutter <csutter@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Liz Abinante <labinante@instructure.com>
2013-11-22 21:09:11 +00:00
Jeremy Stanley 1e29a97ee0 rubyzip 1.0.0 upgrade
test plan: zip functionality should continue to work, including:
 * course exports and imports
 * zip file uploads
 * zip submissions

also, the selenium dependency on rubyzip 1.0.0 is resolved
and we're making progress toward > 4GB exports

Change-Id: I58c5b0644b1e7fbb289821c9c0901f00750988de
Reviewed-on: https://gerrit.instructure.com/25474
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bryan Madsen <bryan@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
2013-11-22 19:23:34 +00:00
Josh Simpson b5b627efa6 Quiz question refactor / api implementation
fixes CNVS-7982
Changes parsing mechanisms for question data, and adds
API for quiz questions.

Change-Id: I483fc9c4718af50e1bed2ee3547905f857de6285
Reviewed-on: https://gerrit.instructure.com/25346
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Josh Simpson <jsimpson@instructure.com>
2013-11-22 17:03:45 +00:00
Cody Cutrer 4e7e22b852 add push communication channel type
fixes CNVS-5794

links to an access token to get the proper ARN

test plan:
 * set up an SNS app in AWS
 * configure your credentials in sns.yml
 * set sns_arn on a developer key to be the ARN of the app in SNS
 * using an access token created from that developer key,
   you should be able to create a push channel
 * you should see that channel in your profile (named after your developer
   key)

Change-Id: I183241d02715252bf558c495d72d4995cea4232d
Reviewed-on: https://gerrit.instructure.com/25281
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-11-21 21:38:45 +00:00
Brad Humphrey 5bbcbe8103 fixed a bug in the sessionless launch api
It would cause an internal server error when looking
up a tool by id without specifying the launch type

Test Plan:

 * Create a sessionless launch by id without any optional params
 * It should launch

Change-Id: I5ca3aa3db7d988413968422ee8acc1d3c63d3d76
Reviewed-on: https://gerrit.instructure.com/26527
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-21 21:07:55 +00:00
Nick Cloward 711f33c07e add option for course grade change (log auditing)
fixes: CNVS-348

This adds grade change auditing functionality.  It uses cassandra and is built
after the authenication auditing.  A new API endpoint was created to query these
logs.  Permissions for this is a domain account.  The logs can be quiried by
assignment, course, student, and grader.

Refer to: https://gollum.instructure.com/grade-auditor-implementation

Test Case:

  Setup:
    - Create a course with a student and an assignment.

  1. Grade an assignment for a student.
  2. The auditor should create a record in cassandra.
  3. Query the endpoint should return the audit event.
      - Query by Assignment
      - Query by Course
      - Query by Student
      - Query by Grader
  4. Ensure permissions are valid by querying with a non root account admin.
  5. Permissions should be changable by site_admin under account permissions.

Change-Id: I0a1cf867d5d1b5bfbdeacc7eac81747f8732025a
Reviewed-on: https://gerrit.instructure.com/25961
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Nick Cloward <ncloward@instructure.com>
2013-11-21 20:53:27 +00:00
Derek DeVries 80a7ee67a6 refactor and add api to quiz group reorder
fixes CNVS-8815

test plan:
- reordering of questions within a group should continue to work
- try dragging questions out of a quiz group
- try dragging questions into a quiz group
- Try out the API for reordering questions within a group

Change-Id: Ic2ebac87f7e2f5d9612b25cd9b80227cfa533b45
Reviewed-on: https://gerrit.instructure.com/26267
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ahmad Amireh <ahmad@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
2013-11-21 18:17:48 +00:00
Stanley Stuart 38f6fdb9de don't send "needs grading" notification for graded surveys
test plan:
  - As a teacher, create a graded survey with an essay question.
  - As a student, take the graded survey.
  - As the teacher:
    -  You should not receive a notification that the submission needs
       grading
    - You should not see the survey in your todos list on the course
      home page.
    - When you view the quiz submission in speedgrader, you should see
      the full points possible for that question in the input on
      the question header box, instead of '--'.

fixes CNVS-1786

Change-Id: I658c0bc94d54be8449830412fd2da28884e98b4c
Reviewed-on: https://gerrit.instructure.com/25593
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ahmad Amireh <ahmad@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
2013-11-21 18:14:44 +00:00
Derek DeVries 2552517b14 disable auto-submissions of quizzes in background until we figure out why answers are being lost
fixes CNVS-9605

test plan:
  - Create a quiz with a time-limit (1 minute will do)
  - As a student, start taking the quiz
  - only answer a few questions and then close the window
  - the quiz should not be auto-submitted in the background anymore

Change-Id: I572e8434cb188b0d23c8bac65d5be7c79790f99c
Reviewed-on: https://gerrit.instructure.com/26491
Reviewed-by: Ahmad Amireh <ahmad@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
2013-11-21 17:18:01 +00:00
Ahmad Amireh 6b8d55a77b Controlling visibility of student quiz scores
Teachers can now control when, and for how long, students get to see the
correct answers to their quiz submissions.

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

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

== Test plan

CAs stands for Correct Answers.

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

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

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

Case B - Showing CAs after some date:

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

Case C - Hiding CAs after some date:

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

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

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

Case E - Choosing a bad range

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

== Notes and really wild things

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

refs CNVS-8103, CNVS-9386

Change-Id: Ib241ee5f143b87164105b7541aadac00f38f79ad
Reviewed-on: https://gerrit.instructure.com/25505
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
2013-11-20 22:08:21 +00:00
Ahmad Amireh 8609c2a8f3 Quiz Submissions API - Index
Endpoints introduced:

  - GET /api/v1/courses/<course_id>/quizzes/<quiz_id>/submissions

Refactoring/changes:

  - Creating a ZIP archive has been moved, and refactored, to the
    Submission API model because it was used by both QuizSubmission
    and Submission controllers
  - time_spent is a property now exposed for QuizSubmission objects
  - new API spec shared example group 'API tests':
    - new API spec helper 'assert_jsonapi_compliance!' that tests a
      given API response for compliance with the JSON-API format
      specification

fixes CNVS-8978, CNVS-8923

Change-Id: I6a18e35a2bcd0ebe357faff46c18f1bce54ddac0
Reviewed-on: https://gerrit.instructure.com/26073
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
2013-11-20 21:57:19 +00:00
Joel Hough 1941d97d90 discussions: add publish icon to index and show pages
fixes CNVS-9265

test plan
- ensure that the publish icon is not visible when the account
 level draft state variable is unset
- ensure that the publish icon is visible when the account level
 draft state setting is set
- ensure that ungraded topics with no replies can be published/unpublished

Change-Id: Ia93b91aa54812610e5c07e063f512e605d6235f2
Reviewed-on: https://gerrit.instructure.com/23470
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Braden Anderson <banderson@instructure.com>
2013-11-20 21:33:25 +00:00
Ryan Florence adbd7b8c0b updates to draft state modules page
- don't publish/unpublish files yet
- change meaning of published on attachments from
  'hidden' to 'locked' because 'locked' determines
  visibility, not hidden.

Change-Id: Iac6c32dc02f68e39ff4a968f072d14c9424be5a5
Reviewed-on: https://gerrit.instructure.com/26241
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-11-20 21:05:10 +00:00
Braden Anderson efe2e14dba lti: use asset_strings relative to tools in opaque identifiers
fixes CNVS-9030

test plan:
  * use an LTI tool as users on two different shards with the same IDs
  * verify that the two users get separate accounts in the LTI tool

Change-Id: I977cc13c11d6e0e39a2c184d350d52f25fe94d06
Reviewed-on: https://gerrit.instructure.com/26234
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
2013-11-19 23:50:32 +00:00
Jeremy Stanley 0e075a24b4 feature flags infrastructure and API
test plan:
 - install the test_features plugin (since no real features exist yet)
 - render and consult the feature flags documentation
 - have a test environment with a root account,
   sub-account, course in sub-account, and user

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

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

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

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

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

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

Change-Id: I3e12e23b4454889b6e8b263f1315e82d8f2ada52
Reviewed-on: https://gerrit.instructure.com/25502
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
Product-Review: Matt Goodwin <mattg@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
2013-11-19 20:50:03 +00:00
Nick Cloward 3ca2c595e5 analytics showing submissions were submitted if teacher give a 0
fixes: CNVS-1601

Since submissions were not created for students who did not submit an
assignment the analytics were showing them as missing even if they were not due
yet. Regardless what the score was.  The fix changed the DueDateCacher to create
submissions for students with overridden due dates.  This will cache the due date
so analyitics can correctly calculate the graph data.  The analytics will search
for a submission,  if it finds one it will use the cached due date for
calculations,  if not it uses the assignments date due assuming there are not any
dates that are overridden.

Also reference g/23800.

Test Case:
  Setup: Create a Course with an assignment and an enrollment.

  - Without the student submitting the assignment. Grade the assignment for the
    student.
  - Open analytics for the course and the Assignments graph should not show any
    submissions for that assignment.
  - Create a due date override.
  - A submission should be created to cache the due date and the graph should
    not show any submissions for that assignment.

Change-Id: Icdae246d9c9913c8a163505d14b86f1300c809de
Reviewed-on: https://gerrit.instructure.com/25352
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Nick Cloward <ncloward@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Nick Cloward <ncloward@instructure.com>
2013-11-19 20:36:33 +00:00
Jacob Fugal a5d8bb8041 limit fake_arel caveats to rails2
refs CNVS-4704

fake_arel gets us most of the way to rails3's arel, but with some
caveats. the workarounds (mostly) work in both, but it'll be nice to not
have them crufting around when we're on rails3. so only use the
workarounds in CANVAS_RAILS2 branches.

Change-Id: Ia1f5cfa6b10f83cdb8d9a6e397b12401d180118d
Reviewed-on: https://gerrit.instructure.com/26331
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
QA-Review: Jacob Fugal <jacob@instructure.com>
2013-11-19 19:46:30 +00:00
Jon Jensen 28bc876088 spec: speed up some submission-related specs
refs CNVS-9183

submit_homework is expensive, so just create the bare objects in specs
that do it a lot ... egregious example is 34sec -> 5.5sec, for all these
specs it's 546sec -> 449sec

Change-Id: I08e68dcfead83361601dd2b9cb00fcdf0400005e
Reviewed-on: https://gerrit.instructure.com/26389
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2013-11-19 19:17:56 +00:00
Cody Cutrer 219c4aab7e fix cross-shard json generation of wiki pages
fixes MBL-956

test plan:
 * access a wiki page from a shard it's not on (via the API)
 * it should work

Change-Id: Ia47966c359b1e33d38729ba0db9f108768ea3d57
Reviewed-on: https://gerrit.instructure.com/26323
QA-Review: August Thornton <august@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-11-16 19:07:56 +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
Landon Wilkins b232dcf448 adds high-contrast theme user preference
test plan:
* log in as user1
* go to user1's user settings
* click "Edit Settings"
* change "Enabled Theme" to "High Contrast"
* navigate to /styleguide
* verify that main header is darker (higher contrast)
* verify that the buttons at /styleguide#buttons have
** higher contrast
* log in as user2
* go to user2's user settings
* verify that the "Enabled Theme" is "Default"
* verify that the header is grayish (not as high contrast)
**********************************************************
* add a global css that changes something easily testable
** such as the header
* verify that the global css takes precedence

Change-Id: I7ce520be63ad639a77c603d7b3177df334750b15
Reviewed-on: https://gerrit.instructure.com/24787
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
2013-11-14 17:20:04 +00:00
Jacob Fugal b0e3177647 better handle varying number of parts for mailer
in the rails2 shim. refs CNVS-9184

test-plan:
 - configure canvas to send outgoing email
 - configure a user with a real eamil address and set notifications for
   this user to asap
 - have a different user initiate a conversation with the first user
 - check for a notification email from the conversation
   - entire email should have content-type multipart/alternative with
     both text and html parts
   - text part should have content-type text/plain
   - html part should have content-type text/html
   - both parts should have charset=utf-8 in their content-type
   - html format should still be displayed by default

Change-Id: I0dd1cf7aad6d51e808438946bce172d256ffceb7
Reviewed-on: https://gerrit.instructure.com/26295
Reviewed-by: Jon Willesen <jonw@instructure.com>
QA-Review: Jon Willesen <jonw@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
2013-11-14 03:27:57 +00:00
Cody Cutrer bb0061832c fix cross-shard permissions checks on wikis
fixes MBL-956

test plan:
 * access a wiki page from a shard it's not on (via the API)
 * it should work

Change-Id: I19a6cc1a87b302ad408a12f97d20d773ec198b51
Reviewed-on: https://gerrit.instructure.com/26252
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-11-13 20:19:40 +00:00
Jon Willesen 0a8389e86d fix order of parts in outgoing multi-part emails
the order of the parts in a multi-part email matters. The last
displayable format is the format email clients will display by
default.

fixes CNVS-9184

test plan:
 - configure canvas to actually send outgoing email.
 - configure a user with a real email address that you can
   access. set notifications for this user to asap.
 - have a different user initiate a conversation with the user
   that has the real email address.
 - check for the notification email from the conversation and
   make sure html format is displayed by default.

Change-Id: I4263bb914ad25d305a0578dc7401d795b2664f80
Reviewed-on: https://gerrit.instructure.com/26215
Reviewed-by: Zach Pendleton <zachp@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Jon Willesen <jonw@instructure.com>
2013-11-13 17:35:46 +00:00
Ryan Florence 7c5d5da632 draft state modules
Change-Id: I7f1117d4a18652624ea6dcf9aae4740740796b90
Reviewed-on: https://gerrit.instructure.com/25420
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
Reviewed-by: Aaron Shafovaloff <ashafovaloff@instructure.com>
Product-Review: Ryan Florence <ryanf@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
2013-11-12 16:31:46 +00:00
Simon Williams d337334979 make data fixup resilient to missing submission rows
fixes CNVS-9349

test plan:
- no visible changes to submission version api
- the data fixup does not fail when version rows exist for non-existant
  submissions

Change-Id: I579808d94b1b32b1e87faaab1efb53f51ea82d7c
Reviewed-on: https://gerrit.instructure.com/26103
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
2013-11-11 23:31:36 +00:00
Jason Madsen bb2b9a3c72 unpublished quiz to show in assignment list
fixes CNVS-9181

test plan:
  - create a quiz, but do not publish
  - un published quiz should display in assignment index as unpublished
  - publish the quiz
  - assignment list should be updated to reflect published quiz

Change-Id: I8d365121454203ca4913bba16551e8f220aa1ea3
Reviewed-on: https://gerrit.instructure.com/26060
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Stanley Stuart <stanley@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Jason Madsen <jmadsen@instructure.com>
2013-11-11 16:44:04 +00:00
Jon Jensen 1cc0846b04 support for student organized groups in new ui, fixes CNVS-8210
test plan:
1. under course settings, let students organize their own groups
2. as a student, create a group
3. as a teacher, go to the groups UI
4. the Student Groups category
   1. it should be present (first tab) w/ a big notice about how it's
      special
   2. you should see the student's group in it
   3. the student should be a member
   4. you should *not* be able to edit or delete the category
   5. you should be able to add/edit/delete groups in the category
5. instead of "Unassigned Users", you should see "Everyone"
   1. assigning a user to a group should not remove it from "Everyone"
   2. removing a user from a group should not double-add it to "Everyone"
6. in large_roster view, you should be able add anyone to a group (even if
   already in another group)
7. you should be able to move students from group to another

Change-Id: I7d4255610f353a8911c0c4f591780ff009a12998
Reviewed-on: https://gerrit.instructure.com/25911
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
2013-11-08 23:32:47 +00:00
Cameron Matheson 4c6aca97e5 speedgrader: prefer group members with submissions
fixes CNVS-9337

Test plan:
  * set up a group assignment
  * submit homework as someone in the group
  * add a new user to the group
  * go to the speedgrader for the assignment
  * you should see the submitted homework for the group

Change-Id: Iac3b7b49e64017e5081acdb93418cb33688fa2d2
Reviewed-on: https://gerrit.instructure.com/26143
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
2013-11-08 22:24:23 +00:00
Brian Palmer b112fed315 don't re-calculate the etherpad url when a new user joins
This matches the behavior of other Collaboration sub-classes like google
docs

closes CNVS-9237

test plan:
* set up /plugins/etherpad using one provider, like titanpad.com
* create a collaboration and launch it
* change the plugin settings to another provider, like etherpad.instructure.com/p
* log in as a second user and load the existing document, it should
  still send you to the original doc at titanpad or whatever you
  first configured

Change-Id: I5fbacaae3a9290c6263ef52545d4e9d1a01724ac
Reviewed-on: https://gerrit.instructure.com/26159
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
2013-11-08 21:45:44 +00:00