Commit Graph

3058 Commits

Author SHA1 Message Date
James Williams 3181ac8b11 improve cc 1.3 support
test plan:
* import the test assignment fixtures as a common cartridge file
* there should be an assignment in the course

* also test import of flat manifest xml files

closes #CNVS-5906 #CNVS-13219

Change-Id: I0b765ed0d140516f78a5f4fb5dbe9b81ac77ecd4
Reviewed-on: https://gerrit.instructure.com/35394
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
2014-05-23 21:11:59 +00:00
Ethan Vizitei 3c19c96287 apply dual timezone filters
closes: CNVS-9814

add support throughout our formatting layer
to give us a way to convert values
to the wall clock time of the timezone for
a course (or really any other way we choose),
and then apply that to several selected
date/time displays.

TEST PLAN:

- Login as a user who's part of a course
with at least some data in each tab
- Check the following areas to ensure that
the correct timezone-differentiated hover
text is showing up:
  * Announcements -> Date Sent column
  * Announcement Detail -> Date Sent (top right)
  * Assignments -> Due Date column
  * Assignment Detail -> Due Date (bottom table)
  * Collaborations -> Start Date
  * Discussions -> Last Post Date
  * Discussions -> Due Date
  * Discussion Detail -> Post date of each reply
  * Modules -> (if locked) shows date to unlock
  * Quizzes -> Due Date
  * Syllabus -> Dates on the left
  * Syllabus -> Due dates on the right
  * Settings -> Course Details -> start/end date
  * Settings -> Sections -> start/end date
  * Recent activity page -> Everything

Change-Id: I048c2de85d9f9b196d35c6c65ae104dab7441eee
Reviewed-on: https://gerrit.instructure.com/34861
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Drew Bowman <dbowman@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2014-05-23 19:01:34 +00:00
Jon Jensen e95b14f196 API tweaks to support querying upcoming enrollments/courses
fixes CAT-147

add support for a user_id param when querying course/section enrollments

ensure course and enrollment endpoints allow users to see their own
*active* enrollments in unpublished course (i.e. self-enrollments), even
if they are not admins.

slightly tighten up User#current_and_future_enrollments (only return non-
admin enrollments in unpublished courses if they are active). this method
is only used currently around self-enrollment functionality, and that sets
the enrollment state to :active, so there should be no changes in
functionality

test plan:
1. set up self-enrollment in an unpublished course
2. self-enroll as a student (via link from course settings page)
3. it should work (though you can't get into the course yet)
4. as the student, hit /api/v1/courses
   1. with no params, you shouldn't see the course
   2. with state[]=unpublished you should see the course
5. as the student, hit /api/v1/courses/:id/enrollments?user_id=self&state[]=current_and_future
   1. you should get back your enrollment
6. as a teacher, publish the course
7. as the student, hit /api/v1/courses
   1. you should get back the course
8. as the student, hit /api/v1/courses/:id/enrollments?user_id=self
   1. you should get back your enrollment

Change-Id: I75a4f77b0298729088c7f8e3dbc46d551f36f241
Reviewed-on: https://gerrit.instructure.com/35085
Reviewed-by: Jeff Belser <jbelser@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
2014-05-23 18:50:25 +00:00
Cameron Matheson 78b414f328 fix gb2 set default grade functionalty
fixes CNVS-8211

Test plan:
  In a large course:
    * load gradebook2
    * try setting the default grade for an assignment (with and without
      overwriting grades)
    * do the same but only for a section

Change-Id: Ide6ba77b11df482a34fb7206a6e42dd19eda7bc0
Reviewed-on: https://gerrit.instructure.com/29121
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-05-23 18:22:54 +00:00
Ethan Vizitei b68c8fc772 Automatically Assign group leaders
closes: CNVS-11834

This creates a way for an instructor to
assign a random student as the group leader.
It only applies when an instructor is having groups
created automatically at the time of defining
a group category.

This also take an opportunity to refactor out
some bloated code from the group_categories_controller
and move it into some separate objects
that can be more easily understood and rapidly
unit tested through all the necessary permutations
(allowing higher level integration tests to just
cover a case or two)

It ALSO removes group leadership knowledge into
it's own object so that the callbacks in other
objects are simple and the logic regarding
how to do group leadership management is in
one place.

TEST PLAN:

AUTO_DISTRIBUTION:
1) login as an instructor
2) go to the "people" tab and try to create a group
set.
3) click on the "Create [0] groups for me" radio
button; verify you now have controls for assigning
a group leader automatically and that the strategy
radio buttons are greyed out.
4) check the "Assign a group leader automatically"
checkbox; verify the 2 nested radio buttons for
"random" and "first" strategies become enabled
5) select a strategy and fill out the rest of the
form, then submit (make sure your background job
is running)
6) verify after groups are created that each group
has a leader, and that the leader is in fact a member
of the group.

SelfSignup:
1) login as an instructor
2) go to the "people" tab and try to create a group
set.
3) enable self-signup.
4) check the "Assign a group leader automatically"
checkbox; verify the 2 nested radio buttons for
"random" and "first" strategies become enabled
5) select a strategy and fill out the rest of the
form, then submit.
6) Login as a student for the same course and join
the group.
7) verify that the student has been made the group
leader.

Change-Id: I2cdd9f5ed2fd577469beec4ab7369c69ecf7eaa6
Reviewed-on: https://gerrit.instructure.com/35130
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Braden Anderson <banderson@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2014-05-23 17:23:53 +00:00
Josh Simpson 0b7d6d1f5f fix poll session visibility after it's closed
fixes CNVS-13261
poll sessions are not visible to their creators via the #show action
after they've been closed. This commit fixes that issue.

Test plan
1. Create a poll with poll choices via the API
2. Create a poll session via the API
3. Publish then close the poll session via the API
- the session should be viewable by its creator
- the session should not be viewable by students

Change-Id: I5b03241b539d8abe32d48907c260a01c53fb6b01
Reviewed-on: https://gerrit.instructure.com/35366
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
Reviewed-by: Stanley Stuart <stanley@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Josh Simpson <jsimpson@instructure.com>
2014-05-23 14:49:16 +00:00
Jon Jensen 0a9a954a5d extract User.enrollment_conditions from user.rb, refs CAT-147
they're not relevant to *a* User, and they're needed by things other than
User.reflections.

test plan:
n/a, just refactoring to a (hopefully) better spot. existing and new specs
should cover all of this

Change-Id: I66ab5314582113ac549af5662bcf08a8ca5df580
Reviewed-on: https://gerrit.instructure.com/35082
Reviewed-by: Dave Donahue <ddonahue@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
2014-05-22 20:54:03 +00:00
Josh Simpson 5fb5464891 add polling session and submission apis
fixes CNVS-12474, CNVS-12477, CNVS-12478
this commit fleshes out the API endpoints for polling sessions and
submissions, and solidifies the other polling endpoints.

Test plan
- Full tests on the following endpoints:
  - Polls are the basic data model of the polling app.  They can take a
    question attribute and a description attribute. They are only
    creatable and modifiable by teachers.

    - GET /api/v1/polls (index action)
    - POST /api/v1/polls (create action)
    - GET /api/v1/polls/:id (show action)
    - PUT /api/v1/polls/:id (update action)
    - DELETE /api/v1/polls/:id (destroy action)

  - Poll choices belong to polls. They consist of the particular answers
    a submitter can choose when participating in a poll session.  They
    have attributes of text (the answer text), their associated poll,
    and an 'is_correct' boolean attribute.  The 'is_correct' attribute
    show not be accessible by students.  Poll choices are only creatable
    and modifiable by the creator of the poll.

    - GET /api/v1/polls/:poll_id/poll_choices (index action)
    - POST /api/v1/polls/:poll_id/poll_choices (create action)
    - GET /api/v1/polls/:poll_id/poll_choices/:id (show action)
    - PUT /api/v1/polls/:poll_id/poll_choices/:id (update action)
    - DELETE /api/v1/polls/:poll_id/poll_choices/:id (destroy action)

  - Poll sessions are for publishing a poll so that it can accept
    submissions.  They should only be createable / modifiable by
    teachers. Only students that are enrolled in the associated course
    of the poll session should be allowed to view them.
    The show action of a poll session acts differently for a teacher.
    They are able to see the results of the voting that has taken place
    by students since the session was published.

    - GET /api/v1/polls/:poll_id/poll_sessions (index action)
    - POST /api/v1/polls/:poll_id/poll_sessions (create action)
    - GET /api/v1/polls/:poll_id/poll_sessions/:id (show action)
    - PUT /api/v1/polls/:poll_id/poll_sessions/:id (update action)
    - DELETE /api/v1/polls/:poll_id/poll_sessions/:id (destroy action)
    - GET /api/v1/polls/:poll_id/poll_sessions/:id/publish (publish action)
    - GET /api/v1/polls/:poll_id/poll_sessions/:id/close (close action)

  - Poll submissions are for submitting an answer for a particular poll
    session.  A student should only be allowed to submit a poll choice
    for a session they're able to view, and they can only submit one
    poll choice per poll session.

    - GET /api/v1/polls/:poll_id/poll_sessions/:poll_session_id/poll_submissions/:id (show action)
    - POST /api/v1/polls/:poll_id/poll_sessions/:poll_session_id/poll_submissions (create action)

Change-Id: Ifcfd72ec30597e37fc54c687fb7d61a644d7348c
Reviewed-on: https://gerrit.instructure.com/34605
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Josh Simpson <jsimpson@instructure.com>
2014-05-22 20:49:40 +00:00
Derek DeVries efa361db59 add student extension dialogs on new ember quiz moderate page
fixes CNVS-12449

test plan:
  - as a teacher
  - enable fabulous quizzes
  - enroll a few students in the course

  - there is a new quizzes api attribute called 'quiz_extensions_url'
  - check out the jsonapi quizzes api to make sure this attribute only shows
    up for teachers (and not students)

  - create a quiz with no time limit and unlimited attempts
    - visit the quiz moderate page
    - click the "edit" icon for a student
    - the modal dialog should only allow you to "manually unlock"

  - create a quiz with a time limit
    - visit the quiz moderate page
    - click the "edit" icon for a student
    - the modal dialog should only allow you to "manually unlock"
    - the modal dialog should only allow you to add "extra time"

  - create a quiz with a limited number of attempts (1 or more)
    - visit the quiz moderate page
    - click the "edit" icon for a student
    - the modal dialog should only allow you to "manually unlock"
    - the modal dialog should only allow you to add "extra attempts"

  - create a quiz with both a time limit and a limited number of attempts
    - visit the quiz moderate page
    - click the "edit" icon for a student
    - the modal dialog should only allow you to "manually unlock"
    - the modal dialog should only allow you to add "extra attempts"
    - the modal dialog should only allow you to add "extra time"
    - change the settings for extra attempts, extra time, and manually unlock
    - hit submit
    - it should save these new settings if you reopen the dialog
    - it should show the extra minutes allowed on the attempt under the username
    - it should add the extra attempts to the 'attempts left' column value

Change-Id: I0e10942ff7a3a80cec200468216ba0641decee2c
Reviewed-on: https://gerrit.instructure.com/35089
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Ahmad Amireh <ahmad@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
2014-05-22 19:45:34 +00:00
Ahmad Amireh ddcffe00ef Quiz Stats - File Upload & Formula
Add support for generating stats for File Upload and Formula questions.
Similar to Essay metrics but adjusted to calculate properly.

Closes CNVS-13169

TEST PLAN
---- ----

  - create a quiz with those question types
  - take the quiz:
    - answer both question types by at least one student, but leave it
      unanswered by another so we can test the "responses" metric
  - test the stats:
    GET /api/v1/courses/:course_id/quizzes/:quiz_id/statistics
    - the "responses" metric should count the number of students who
      provided an answer
    - the "graded" metric should read the number of students whose
      answers you've graded so far
    - the "full_credit" one should read 0 until you grade it and give
      them a score higher than, or equal to, the maximum points possible
    - "point_distribution" is similar to that of Essays; it is an array
      of objects that track every score you gave the students and the
      number of students who received those scores
  - grade the scores and re-test to verify the metrics update correctly
  - verify that the API documentation is updated to include those
    question types

PS: the "responses" field will read "the number of students who uploaded
a file" for File Upload, and "the number of students who wrote any
answer" for Formula.

Change-Id: I890eafe018e000eef88de782bd7e86b5259df5d5
Reviewed-on: https://gerrit.instructure.com/35112
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
2014-05-22 15:56:29 +00:00
Nick Cloward 3958a5cf44 add reset content event
fixes: CNVS-12590

Adds a course content event type to the course audit logs.

Test Case:

  - Create a course.
  - Reset its content.
  - The event and its data should be reflected for both
    the source course and new course from resetting the
    course data.

Change-Id: I473d2e237491d890c20aace57f9c7675d70d22c7
Reviewed-on: https://gerrit.instructure.com/33726
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Nick Cloward <ncloward@instructure.com>
2014-05-22 14:53:34 +00:00
Simon Williams dd30e31a6f remove outcome alignment shim
test plan:
- tests pass

Change-Id: I56c1c7dfa3703d4f04c0b758d7723e85dbf9ad7e
Reviewed-on: https://gerrit.instructure.com/34910
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-05-22 14:53:03 +00:00
Derek DeVries 093b6c76f4 fix documentation issues for quiz extensions api
fixes CNVS-13237

test plan:
  - generate the documentation for the api
    - the description for the endpoint to set extensions has been corrected
    - the copyright block is no longer in the docs
    - user_id is now correctly described as 'Required' instead of 'Optional'
    - The attributes of the QuizExtension object description have been changed
      to not show the extend_from_now and extend_from_end_at, and instead
      reflect the actual object returned when you make updates - which instead
      includes the end_at date
    - fixed description of extra_attempts to be more clear
    - The example response should now correctly show quiz_extensions and not
      quiz_submissions
    - updated the description of extra_time in quiz submissions api to correctly
      describe it in 'minutes' instead of 'seconds'

  - I have updated the behavior of the manually_locked attribute.
    - Sending 1, '1', true, or 'true' will result in the attribute being
      set to true. Every other value will set the value to false.

Change-Id: Id6071632a8eb9d01d61cf21287955fb5e44c2f3f
Reviewed-on: https://gerrit.instructure.com/35305
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
2014-05-22 00:53:43 +00:00
Derek DeVries 1343e2379c add api for quiz submission extensions
quiz submissions can have their time limit or number of attempts extended.
we can extend both existing quiz submissions, and also those that don't exist
yet. adding this functionality to the existing quiz submissions api would
muddle up responsibilities. So instead we post all extensions to a the
quiz extensions api which is specifically meant for adding extensions to a
submission whether it has been started yet or not.

Also add 'manually_unlocked' to the quiz submissions api. this field lets us
know if a student can take a quiz after it has been locked for everyone else.

fixes CNVS-13165

test plan
  - There is a new attribute added to quiz_submissions objects in the api
    called 'manually_unlocked'. This attribute will now show up when returning
    results back from
    - GET /api/v1/courses/:course_id/quizzes/:quiz_id/submissions (index)
    - GET /api/v1/courses/:course_id/quizzes/:quiz_id/submissions/:id (show)

  - There is a new endpoint to create quiz extensions. This should work to
    create quiz extensions for users that both have existing quiz submissions
    started, and users who have not yet started a quiz:
    - POST /api/v1/courses/:course_id/quizzes/:quiz_id/extensions (create)
  - Check Permissions on the new quiz extension endpoint. Only teachers should
    be able to extend the quizzes.
  - Check that all the documentation looks okay for quiz extensions.

Change-Id: Ie23113c1f30e139a1e376475fb35a2cf3ce0212c
Reviewed-on: https://gerrit.instructure.com/35111
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ahmad Amireh <ahmad@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
2014-05-21 21:30:15 +00:00
James Williams e2fe9ab601 retain attachment content_type on cross shard user merge
test plan:
* create a user
* create another user on another shard
* upload a previewable file (such as an image) for a user
* merge the user with the file into the other user
* after jobs have run, the file should show up in the
 final user's folder, and should still be previewable

fixes #CNVS-13059

Change-Id: I20eec5d8b9dac06a72dd3f7a7018cb5034426080
Reviewed-on: https://gerrit.instructure.com/35230
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
2014-05-21 19:29:35 +00:00
Cody Cutrer 8178266194 split yaml file loading out of Setting
refs CNVS-13024

Setting wasn't properly being initialized as unsharded because
it was loading before Switchman. The reason we need Setting before
switchman is just for yaml loading, so split that into its own
class.

Change-Id: I5456e103cb216dba2d5af4e9c20a697b468c923b
Reviewed-on: https://gerrit.instructure.com/35043
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-05-21 18:27:06 +00:00
Ahmad Amireh 82b1e74f16 Quiz Stats - Maintain ERB compatibility
This patch makes it so that if you want to get the new stats from the
back-end, you'll have to explicitly pass a "legacy=false" parameter to
the report generator routine. Old code will use the old output, new code
will use the CanvasQuizStatistics gem for stats.

Closes CNVS-13198

TEST PLAN
---- ----

  - create a quiz with a bunch of questions and take it by multiple
    students
  - visit the ERB stats page at
    /courses/:course_id/quizzes/:quiz_id/statistics
    - verify that the page renders and looks just like how it was before
      the work on its ember counterpart
  - visit the ember stats page at
    /courses/:course_id/quizzes/fabulous_quizzes#:quiz_id/statistics
    - verify the ember page is still functional

Change-Id: I0a9e8d69eacc64a8727f238fc0c2e2acd44c0451
Reviewed-on: https://gerrit.instructure.com/35167
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
2014-05-21 16:36:30 +00:00
Bracken Mosbacker 12ec269bba qti 2 conformance
test plan:
* qti migration regressions

Change-Id: I53587880a591d9ea70e7039d4216770cb1772880
Reviewed-on: https://gerrit.instructure.com/34407
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2014-05-21 15:57:02 +00:00
Nathan Mills 5010cdef69 refactor variable substitution out of the models
also adds some new substitutions

fixes PLAT-497 PLAT-496

test-plan:
all current variable substitutions should work
new substitition: '$Canvas.account.name'  should work as well

Change-Id: I9b4e71f816d777e17d3369bb907c7b72209da770
Reviewed-on: https://gerrit.instructure.com/34546
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brad Humphrey <brad@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Product-Review: Nathan Mills <nathanm@instructure.com>
2014-05-21 14:58:01 +00:00
Ahmad Amireh d7a23ea23d Quiz Stats - Normalize input
Ensure all input hashes are using symbol keys.

Closes CNVS-13158

TEST PLAN
---- ----

Code changes. Test plan is similar to
https://gerrit.instructure.com/#/c/35096/

Change-Id: Ie1db45e2a5875e410a758c0b2f14594345212b5d
Reviewed-on: https://gerrit.instructure.com/35098
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
2014-05-21 13:03:55 +00:00
Ahmad Amireh 457e55d6a2 Quiz Stats - Refactor/get rid of QuestionAnalyzer
- removed the question analyzer
  - each answer analyzer is now expected to calculate its own
    "responses" field as opposed to doing it in a generic manner
  - made the Essay analyzer generate its "responses" field
  - a self-documenting DSL for defining analyzer output metrics

Closes CNVS-13157

TEST PLAN
---- ----

It's all code movement/refactor so nothing new to test. The plan is to
verify the Essay question stats are unaffected (which is basically all
the gem supports at this point:)

  - create a quiz with an essay question
  - take the quiz by a few students
  - grade a submission
  - retrieve the stats via the API:
    GET /api/v1/courses/:course_id/quizzes/:quiz_id/statistics
    - verify the essay stats in the API are still functional, the
      "responses" field in particular

Change-Id: I42b9552c60ccb56f7c6912fed7cc1173da71852d
Reviewed-on: https://gerrit.instructure.com/35096
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
2014-05-21 13:03:40 +00:00
James Williams dea0db86d4 add option to open external url module items in new tab
test plan:
* should be able to create and edit external url module items
 with an option to require the urls to be opened in a new tab

* on the modules index page, clicking on these items should
 directly link to the url in a new window, but also redirect
 the open canvas page to the module item page (so to register
 progression, and show the sequence footer)

* navigation through the sequence footer should be unaffected

* should work with draft state enabled and disabled

fixes #CNVS-12579

Change-Id: Ic0b33014acd43f72b05258705a87221c4b8d61c3
Reviewed-on: https://gerrit.instructure.com/35123
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Product-Review: Hilary Scharton <hilary@instructure.com>
2014-05-21 11:55:54 +00:00
Joel Hough 0d186e3c1a group leaders
fixes CNVS-11833

test plan
- regression test teacher view of groups page

a group can only have one group leader, and that user must be in
the group. anything that can be done to remove a user from a
group should revoke their leadership if they have it. a user's
leadership should not be revoked unless the teacher revokes it,
a different leader is chosen, or that user leaves the group. a
leader's user should have a user icon on it and their name should
appear next to the group's name

a few test cases:
- set group leader using gear menu on user in group
- revoke the leadership of the user using the gear menu
- ensure that the group is now leaderless

- set a group leader
- set a different user as leader
- ensure that a screenreader identifies the group leader link as "Group
  Leader"
- ensure that the first user is no longer the leader

- set a group leader
- remove that user from the group by dragging and dropping
- ensure that the user is no longer the group leader

- set a group leader
- move the user to another group using the option on the gear
 menu
- ensure that the user is not the leader of their original or new
 group

- in a large-roster course, add users to a group user the plus
 button next to the gear menu
- set a group leader using the gear menu next to a user
- fill a group up to it's maximum limit of students
- ensure that the "full" label shows up for that group
- ensure that when you narrow the browser size, you can
still tell that the group is full

Change-Id: I8bb1b62e0f36a37a24e050878c945f822fe9f66c
Reviewed-on: https://gerrit.instructure.com/34360
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2014-05-20 22:22:12 +00:00
Cody Cutrer a99e904d11 fix cassandra page view sharding issue
fixes CNVS-13024

test plan:
 * configure cassandra page views
 * as a user from shard 1, visit a course on shard 2
 * go to /users/self on shard 2, and watch the network requests for
   page views. in the response, the context should be a local id, and
   the user should be a global id

Change-Id: I6bbc54d9b055aff74b81441b2449c4548fd96816
Reviewed-on: https://gerrit.instructure.com/35056
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Nick Cloward <ncloward@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2014-05-20 21:55:09 +00:00
Cody Cutrer 6329af6525 fix deadlock between stream items and conversations touching users
fixes CNVS-12621

test plan:
 * start a conversation between two users
 * reply to the conversation as one user
 * as the other user, refresh the dashboard; confirm the unread messages
   count went up

Change-Id: Ia9c58b9ce03b3a1befd5cfdb64774c4a73bedce9
Reviewed-on: https://gerrit.instructure.com/34734
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2014-05-20 20:10:56 +00:00
Jeremy Stanley 257330c4c2 always send content-type to uploadify.swf
because otherwise it will remember the previous file's content_type
and break the upload signature, resulting in a 403 from S3

test plan:
 - upload a .txt file via the files page
 - without reloading the page, upload a file with an unknown type
   (such as .blargh)
 - the second upload should succeed

fixes CNVS-13058

Change-Id: I6909b61c89d78e1d0fb8fa75e126e94ea088ba4d
Reviewed-on: https://gerrit.instructure.com/35011
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mark Severson <markse@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2014-05-20 14:58:20 +00:00
Jeremy Stanley 72ca7fa124 fix renaming quiz module items
the 'Quizzes::' prefix broke the CSS selectors. this commit
removes namespaces from the item class

test plan:
 - have a quiz in multiple modules
 - edit the module item to rename the quiz
 - the name should update in both modules without reloading the page
 - also do a sanity check on adding and renaming other item types

fixes CNVS-13083

Change-Id: I7e32c3b90c6e516770a7307090448d621823af17
Reviewed-on: https://gerrit.instructure.com/35022
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mark Severson <markse@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2014-05-19 23:54:22 +00:00
Anthus Williams 62ec134c92 active_polymorph
fixes CNVS-12143

allow polymorphic names in ActiveRecord has_many
associations; when retrieving association, use these
names to retrieve records with different (but synonymous)
foreign_types

currently this gem only addresses has_many relationships
to achieve feature-parity with the existing Quizzes
monkeypatching. A future commit will address adding
similar functionality to other types of associations

test plan:
1) Create a quiz with id Q
2) Attempt the quiz twice, so you can see
both attempts on submission_history/ gradebook
3) In the rails console, get the set of attempts:

versions = Quizzes::QuizSubmission.where(quiz_id: Q).first.versions

4) Change the versionable_type of one of the attempts, but not the other:  

versions.where(id: versions.first.id).update_all(versionable_type: 
"Quiz")

5) Check the submission_history/gradebook to verify
that you still see both attempts

Change-Id: Ia9611a35705ba2929a92757f586a916dce90a4ee
Reviewed-on: https://gerrit.instructure.com/33505
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Anthus Williams <awilliams@instructure.com>
2014-05-19 22:05:09 +00:00
James Williams 9c5852bf5d exclude future enrollment scope to students of unpublished courses
test plan:
* create an unpublished course
* add a student
* as that student, visit the "/courses" index
* should not see the unpublished course listed in
 "Future Enrollments"

fixes #CNVS-5198

Change-Id: I93a69205f7bde958519c9567a1f4a547112cd9a7
Reviewed-on: https://gerrit.instructure.com/35041
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
2014-05-19 19:51:39 +00:00
James Williams 8ca1b231d6 restrict enrollments on users show page based on permissions
test plan:
* create two separate sub-accounts, each with a course
* add a user to both courses
* as an subaccount admin, visit the user's account details page
* confirm that you are not able to see the enrollment listed
 for the course in the other subaccount

refs #CNVS-13034

Change-Id: I8d5ac25474e5417814660e9292fe792368118d7a
Reviewed-on: https://gerrit.instructure.com/34895
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2014-05-19 17:07:43 +00:00
James Williams 7f6fbcbf62 don't escape message subjects
test plan:
* create an asset (such as an assignment) that includes
characters such as quotes, ampersands and brackets.
(e.g. "<stuff> &that's html escaped")
* create a notification for the asset (such as an
"Assignment Created" message)
* confirm that the message subject is not escaped
(e.g. "&lt;stuff&gt; &amp;that&#x27;s html escaped")

fixes #CNVS-11652

Change-Id: I23a4529b7e582a8a5f725f965d96c79748e762b7
Reviewed-on: https://gerrit.instructure.com/34796
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2014-05-19 16:51:49 +00:00
Ethan Vizitei c404a73236 Add time_zone to courses
closes CNVS-10395

This provides the ability to set the timezone
at the course level in the Course Details
area of the Settings tab.  If there
is no time_zone set, it defaults to the
default_time_zone of the root account. For
this ticket, this value is used nowhere, it just
allows it to happen (and tests are added to
verify that it does happen).  Permissions
are currently granted in tandem with
the ability to rename a course.  If you can rename
it, you can set the timezone. Making
use of this new value throughout the rest of
the application is taken care of in: CNVS-9814

TEST PLAN

1) Log into a course as an instructor.
2) Click on the settings tab.  You should see
the timezone for the associated root account
(if the course timezone won't be set yet).
3) Edit the course to change the timezone and save.
4) the timezone should now be the one selected.

Change-Id: I50e1ed1da283689511795bf018adaa021f42d6f5
Reviewed-on: https://gerrit.instructure.com/34779
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Drew Bowman <dbowman@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2014-05-19 16:49:38 +00:00
Liz Abinante e04a49235e AssignmentOverrides refactor
fixes CNVS-10793
fixes CNVS-12360

test plan
=========
- assignment overrides should still work
- general regression of assignment#new, #edit, quizzes#new, #edit, discussions#new, #edit
- check API end points for above overrides

Change-Id: I211ad888ac14d7e863ab67bfcb27d56a85e62aac
Reviewed-on: https://gerrit.instructure.com/29980
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Liz Abinante <labinante@instructure.com>
2014-05-16 21:12:45 +00:00
Joel Hough d9318b8e42 fix notification policy lookup in find_all_for
fixes CNVS-12319

Change-Id: Ib51e9b76cd0b054026553ea1e86bb276506cb926
Reviewed-on: https://gerrit.instructure.com/34707
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Reviewed-by: Drew Bowman <dbowman@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
2014-05-16 16:40:50 +00:00
Cody Cutrer 154e1909c9 include hostname and pid in error reports
to make it easier to go from error reports to logs

Change-Id: I38015db9dd616460f84d9792db6c2bbbfbbde330
Reviewed-on: https://gerrit.instructure.com/34965
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-05-15 19:20:43 +00:00
James Williams cbddb39443 optimize User#find_pseudonym_for_account
refs #CNVS-12929

Change-Id: Id3528896d9e8a6a0e098478dc30742a9b0a43c05
Reviewed-on: https://gerrit.instructure.com/34692
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2014-05-15 18:47:58 +00:00
Liz Abinante 9df3965ee8 adds screenreader label for sidebar menu
fixes CNVS-11002

test plan
- inside of a course
- using a screenreader
- for the "Assignments", "Grades" and "Settings" left sidebar items
- verify they are each preceded with "Course" (ex: "Course Assignments")
- verify that menu does't change for sighted users

Change-Id: I727576bd70c49a3b0bff96bf40fcf5b6a40f95ba
Reviewed-on: https://gerrit.instructure.com/34907
Reviewed-by: Cameron Sutter <csutter@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Liz Abinante <labinante@instructure.com>
2014-05-15 18:02:45 +00:00
Cody Cutrer c5176a47bb fix deadlock between stream items (touching) and stream items (fk checks)
fixes CNVS-12621

bulk inserts do fk checks, so be sure to do them in user id order

Change-Id: I83a1fee981c6b597a1ee80e44ce5d77309e1389f
Reviewed-on: https://gerrit.instructure.com/34736
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-05-15 05:30:36 +00:00
Nick Cloward 19ea2789dd canvas event stream
fixes: CNVS-10477

Test Plan:

Make sure auditing still works.

Change-Id: I021c0772ad0cf337d452b55bf690d15ce1a61a09
Reviewed-on: https://gerrit.instructure.com/31494
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>
2014-05-14 19:09:24 +00:00
Derek DeVries e1381ae75c publish and unpublish with the api instead of changing workflow state directly
fixes CNVS-12975

test plan:
  - create a quiz with two questions (save but don't publish)
  - turn on fabulous quizzes
  - view the number of questions for the quiz on the ember quiz index page
  - it should show you the correct number
  - publish the quiz
  - refresh the page
  - it should continue to show you the correct number of questions

Change-Id: If9cd041f47b339771f8ffa3e9e3953195efc540d
Reviewed-on: https://gerrit.instructure.com/34835
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
2014-05-14 16:54:50 +00:00
James Williams 413e30a4de only try to import active outcomes and groups
test plan:
* create an account-level outcome group
* create an outcome in that group, but then delete it
* in a course, find and import the account-level group
* should not import a broken outcome link to the deleted outcome

fixes #CNVS-2015

Change-Id: I59d3404038960e156cd7b3e8540df286f27d1569
Reviewed-on: https://gerrit.instructure.com/34797
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
2014-05-14 12:31:29 +00:00
James Williams 5f927946c5 import/export learning outcome alignments
test plan:
* create a course with a question bank and
questions
* create learning outcomes (either on the course
or account level)
* align outcome(s) to the question bank(s)
* copy the course, or import/export it
* confirm that the question banks in the new course
retain their alignments

fixes #CNVS-5917

Change-Id: I16a80371af4433a4debdcc29d09d7fa1f43bc41e
Reviewed-on: https://gerrit.instructure.com/34572
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
2014-05-14 12:31:11 +00:00
Cody Cutrer 3e38c56d60 fix deadlock with concurrent module touches
Change-Id: I1ea3123857a68b7cbdd923b7966cd06814e95d35
Reviewed-on: https://gerrit.instructure.com/34799
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-05-13 22:41:33 +00:00
James Williams 8fd8304974 re-enable deleted rubrics on import
test plan:
* create a course with a rubric
* copy the course into another course
* delete the copied rubric
* recopy the original course into the copied course
* the rubric should be available again

fixes #CNVS-12958

Change-Id: Ic8ddb8b9c629d8d27baea9f1a08db60c7d8317d0
Reviewed-on: https://gerrit.instructure.com/34728
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
2014-05-13 19:35:02 +00:00
Cameron Matheson 4932e6d450 canvadocs: configurable mime types
closes CNVS-12992

Test plan:
  * configure canvadocs with more mime  types (e.g.
      Setting.set('canvadoc_mime_types',
        (Canvadoc.mime_types + %w[application/rtf text/rtf text/plain]).to_json)
  * restart your server
  * upload some documents of the newly added types (rtf or txt)
  * they should now preview in canvadocs

Change-Id: Ic3a1cb907f4da39cc8510221caa8b794b9d7f9f1
Reviewed-on: https://gerrit.instructure.com/34697
QA-Review: Amber Taniuchi <amber@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
2014-05-13 18:48:07 +00:00
Cody Cutrer 66715b770f more optimization for scheduler
closes CNVS-12936

test plan:
 * basic regression test of scheduler functionality

Change-Id: I7cd7de55e36a66e18fdf01de85d0240bee69c437
Reviewed-on: https://gerrit.instructure.com/34555
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2014-05-13 17:02:50 +00:00
Joel Hough 38c0bfd032 remove old conversations and conversation submission comments
fixes CNVS-12330, CNVS-9234, CNVS-8099

before you check out
- configure a user to use old conversations

test plan
- ensure that everyone get new conversations, always, even if
 they explicitly told us that they really like old conversations
 better

- as a student with an existing conversation with a teacher,
 make an assignment submission and a submission comment
- as the teacher, ensure that your unread message count did not
 increase because of the submission comment

Change-Id: If5ae7143abbc5cf5e035f5ed9ea2e5728f70cd45
Reviewed-on: https://gerrit.instructure.com/34343
Reviewed-by: Braden Anderson <banderson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
2014-05-12 23:38:34 +00:00
Mark Severson 797538d34d fix mysql build regarding module progression
test plan:
 - automated regressions pass (postgres & mysql)

fixes CNVS-12965

Change-Id: Id91325c97a0a88257d1b030f9f2aee481854328a
Reviewed-on: https://gerrit.instructure.com/34709
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Reviewed-by: Bryan Madsen <bryan@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Mark Severson <markse@instructure.com>
2014-05-12 18:52:36 +00:00
James Williams 2ba4531f73 migration refactor: account question banks import
test plan:
* course migration regressions (canvas cc, course copy)

* in addition:
 use the content migrations api to queue a content migration
 for an account ("/accounts/:account_id/content_migrations")
 to import a qti/cc package.
* confirm that the question banks from the package
 that would have been normally imported into a course are now
 imported into the account

closes #CNVS-12529

Change-Id: I2ef306341d2f7defe03c63a981679a3987f1aaa0
Reviewed-on: https://gerrit.instructure.com/34303
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2014-05-12 16:30:10 +00:00
Ahmad Amireh 555e7b0e18 Quiz Stats [Backend] - Gem & Essays
Refactoring the generation of quiz question statistics into its own gem.
This patch adds support for Essay question statistics.

Closes CNVS-12725

TEST PLAN
---- ----

  - create a quiz with an essay question
  - perform an API request to retrieve the quiz statistics
  - ensure that the following metrics are generated and correct:
    - "graded": number of students whose answers have been graded by the
      teacher
    - "full_credit": number of students who received a full score
    - "point_distribution": a list of scores and the number of students
      who received them (so if 2 students got graded for 3 points, it
      should have a key of 2 and a value of 3), un-graded submissions
      should be keyed under null
    - "responses": number of students who answered the question
      (wrote anything)
    - "user_ids": IDs of those students
  - documentation for QuizStatistics -> Essay should be updated with the
    new stats

> Other things to test

  - verify that the old statistics page still renders:
    /courses/:course_id/quizzes/:quiz_id/statistics
  - verify that you can still generate both student and item analysis
    CSV reports

API endpoint for quiz stats:

  /api/v1/courses/:courseid/quizzes/:quiz_id/statistics [GET]

Change-Id: Ib15434ff4cef89ac211c1f4602d1ee609ef48ec4
Reviewed-on: https://gerrit.instructure.com/33990
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
2014-05-12 15:02:45 +00:00
Cody Cutrer 7af788b612 ensure course's account and root account are in associated_courses
fixes CNVS-3273

test plan:
 * create a course in a sub account
 * delete all course_account_associations for that course
 * clear your cache, and restart your server
 * as an admin in only that account, you should be able to
   edit the course (even though you won't see it in the course
   list for the account)

Change-Id: I26120fedbd9556c18e08cecf5ff4f14a960d334c
Reviewed-on: https://gerrit.instructure.com/34486
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2014-05-10 01:08:04 +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
Cody Cutrer d1d4878404 return sis pseudonyms from trusted accounts
fixes CNVS-11814

and be sure to identify the account somehow

test plan:
 * set up a trust between account A to account B
 * add a user to account B with an SIS pseudonym
 * enroll the user in a course in account A
 * course gradebook csv and quiz statistics csv should show the
   pseudonym from account B, and account B's domain
 * an API call to list students in the course shoud show the
   pseudonym from account B, and account B's domain

Change-Id: Id656d06b8119bdcb31cc3e567d49cd6ce7c8428f
Reviewed-on: https://gerrit.instructure.com/31812
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2014-05-09 20:20:42 +00:00
Drew Bowman 0d42fd2204 allow users to manage group membership limits
fixes CNVS-11830
fixes CNVS-11831

test plan

 - add a course group
 - set the max members in the group creation dialog
 - verify that the limit is enforced

 - enforced it a course group
 - change the max members in the group edit dialog
 - verify that the new limit is enforced

 - edit the group set
 - change the max members limit for the group set
 - verify that the limit is changed for all of the groups in the set

Change-Id: I6f112d29d6c5ca662da1598e29db2f3081f30148
Reviewed-on: https://gerrit.instructure.com/33722
Reviewed-by: Joel Hough <joel@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Drew Bowman <dbowman@instructure.com>
2014-05-09 16:49:47 +00:00
Joel Hough d824ea6665 force calendar2_only account setting to true
fixes CNVS-12331

before you check out
- configure some accounts to not use calendar2
- configure some users to prefer calendar1

test plan
- ensure that everyone gets calendar2, all the time, even if they
 specifically checked a box saying they don't want to use it

Change-Id: Ibe1eb6b86ccc1c9489b166c138c87a288eb91ac1
Reviewed-on: https://gerrit.instructure.com/34339
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Reviewed-by: Braden Anderson <banderson@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
2014-05-09 16:33:08 +00:00
Nick Cloward 5d4dda1c68 add option for course state changes (log auditing)
fixes: CNVS-347

Adds state change logging activity for courses.  This change also adds an event
source field to all the course activity events.  The options for this is api,
manual, and sis.

Note: This also adds a fix for the event stream record object to force request_id to
be a string.  Event stream will try to insert an integer into a text column which
Cassandra will complain about and throw an error.

Test Plan:
  - Test for each type of Event:
    * Concluded
    * Unconcluded
    * Published
    * Deleted
    * Restored
    * Updated
    * Created
    * Copied To
    * Copied From

  - Test each type of event and each source.  Note that some events can only
    have certain sources.  Also make sure SIS migrations show that the source
    is type SIS.

Change-Id: Ic2308e1d10e6fc1cc6437221d7842eaf1a596f46
Reviewed-on: https://gerrit.instructure.com/30343
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Nick Cloward <ncloward@instructure.com>
2014-05-09 16:09:20 +00:00
Cody Cutrer ad9820a505 create media objects on the account's shard
fixes CNVS-9711

Change-Id: If6f49101350e8adca55254906f45f5c3381af74b
Reviewed-on: https://gerrit.instructure.com/34509
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-05-09 14:57:43 +00:00
Braden Anderson 4fafdda484 discussions: separate group discussions from group assignments
fixes CNVS-4475

pre-checkout plan:
  * create a course
  * open people->groups
  * create a student group with multiple students
  * open discussions
  * create two topics
  * make one topic a group assignment

test plan:
  * open the topics you created
  * verify that a "group discussion" option replaced "group assignment"
  * verify that your group assignment is a group discussion
  * verify that your group discussion uses the same group set
  * verify that the old behavior of presenting child topics is retained
  * verify that your non-group topic is not a group discussion
  * verify that the "group discussion" flag cannot be changed for topics
      with replies

  * create a new discussion topic
  * verify that "group discussion" is available for ungraded topics
  * verify that changes to the field persist

  * create a new graded group discussion topic
  * post to one of the subtopics as a student in its group
  * open the gradebook as the teacher
  * verify that the student who posted has a submission but the other
      group members do not
  * verify that group members can be graded individually

Change-Id: Iada30628f0abdb7d7df4267d695553baf8b952d3
Reviewed-on: https://gerrit.instructure.com/33253
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Reviewed-by: Jon Willesen <jonw@instructure.com>
Product-Review: Braden Anderson <banderson@instructure.com>
2014-05-08 21:18:40 +00:00
Rob Orton b096aabcbc validate length of eportfolio_entries.name and slug
fixes CNVS-1006

test plan
 - eportfolio_entries name and slug should not
   throw database error when over 255 characters

Change-Id: I393cb04f6f4bf7516262cc5996c27fdf330e5d32
Reviewed-on: https://gerrit.instructure.com/34496
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>
2014-05-07 23:23:31 +00:00
Rob Orton d1a60d2cea validate length of user_notes.title
fixes CNVS-7111

test plan
 - UserNote title should not
   throw database error when over 255 characters

Change-Id: I18366c1ec5a9e2434d2c6cc6638ea74803e05970
Reviewed-on: https://gerrit.instructure.com/34494
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>
2014-05-07 22:24:28 +00:00
Cody Cutrer a9db5cbee2 protect against race conditions creating course account associations
fixes CNVS-7108

Change-Id: I68a4cdc105300f274f84ee61b2e195ba94f92284
Reviewed-on: https://gerrit.instructure.com/34507
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-05-07 22:09:12 +00:00
Jeremy Stanley 4548797744 clean up question import SQL parameter binding
test plan:
 - import the evil_angel.zip Angel package into Canvas
 - you should not have a migration issue referring to
   a SQL syntax error encountered when importing a
   quiz question
 - test quiz and question bank imports and re-imports

fixes CNVS-12899
fixes CNVS-12901

Change-Id: I26dcf5ffd4c6b6320232a7603ae2688f7c860fac
Reviewed-on: https://gerrit.instructure.com/34434
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2014-05-07 20:15:11 +00:00
James Williams 50bead3e73 don't unset front page settings on course copy/import
test plan:
* create a course with wiki pages
* set one of them as the front page

* create another course and copy it into the first course,
* the front page in the original course should stay the same
 as before

* unset the front page
* now copy or import a course package that has a front page
* the new page should become a front page

fixes #CNVS-12137

Change-Id: I91b70ce32cb3bacd5e42d161019b304eca3586bd
Reviewed-on: https://gerrit.instructure.com/34328
QA-Review: Clare Strong <clare@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2014-05-07 17:12:09 +00:00
James Williams 68fb8d952c fix importing of unpublished quiz assignments
test plan:
* import the package referenced in the ticket
* there should be a "Quiz Assignment"
* the link on the wiki front page to the "Quiz Assignment"
 should work

fixes #CNVS-12815

Change-Id: Id4c779da199610783bfd339468532853ebd948bf
Reviewed-on: https://gerrit.instructure.com/34197
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2014-05-07 17:11:59 +00:00
Anthus Williams 828981e72c define exportable attributes/associations on models
instead of passing an :exportable option to
ActiveRecord::Associations, simply define a constant
on the class containing exportable associations and
attributes. This is due to :exportable breaking
ActiveRecord, and we can't simply monkey-patch in
config/initializers because models are included in
migrations before the initializers are run

Change-Id: I11f1a6b4570c397d8e01010c517bc6efdac7afca
Reviewed-on: https://gerrit.instructure.com/33235
Reviewed-by: Braden Anderson <banderson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Anthus Williams <awilliams@instructure.com>
QA-Review: Anthus Williams <awilliams@instructure.com>
2014-05-06 23:54:24 +00:00
Cody Cutrer af2af3a3f1 Merge pull request #443 from redconfetti/CLC-3511-gradebook-sections-export-canvas
Updated Gradebook to CSV export to include all section names
2014-05-06 09:39:10 -06:00
Joseph Rodriguez 2d9cfc5ac4 moved Facebook code into gem
fixes: CNVS-12120

test plan:
- regression test facebook functionality

Change-Id: I041e726ee12f9eca8fc27ccdd049422073d1af15
Reviewed-on: https://gerrit.instructure.com/33595
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-05-05 22:32:15 +00:00
Joseph Rodriguez 02761bce6f pull canvas specific code out of Facebook class
fixes: CNVS-12520

test plan:
- regression test facebook functionality

Change-Id: I0016edccd3186e7d55146bf216ec2b07a369c801
Reviewed-on: https://gerrit.instructure.com/33531
Reviewed-by: Joel Hough <joel@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-05-05 22:32:07 +00:00
Josh Simpson 4e903f5fd1 add basic polling api
refs CNVS-12469
closes CNVS-12471,CNVS-12472,CNVS-12473
This commit adds basic CRUD API operations for polling.

Test plan
- Check the create/show/update/deletion API endpoints for both polls
and poll_choices

- Check access controls (students shouldn't be allowed to
  create/delete/update polls or poll choices, nor see the 'is_correct'
  attribute on poll_choices)

Change-Id: I05504bac9cce30382311b3beb6df826e6a30b77f
Reviewed-on: https://gerrit.instructure.com/33956
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Josh Simpson <jsimpson@instructure.com>
2014-05-05 20:30:43 +00:00
Raphael Weiner a13f85e0ed move twitter to gem
fixes: CNVS-12492

test-plan:
* Test that all things Twitter related still work

Change-Id: Ib656c5bfcb2dc8490a6fa6f214b0f6dce25ad181
Reviewed-on: https://gerrit.instructure.com/33193
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
Reviewed-by: Liz Abinante <labinante@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-05-05 20:08:27 +00:00
Nathan Mills 8eeb4f5bf0 refactor twitter to not be a mixin
fixes: CNVS-12118

test-plan:
*twitter integration should work

Change-Id: I44a9011eb451aaa8eb196264bb4b65d1635da083
Reviewed-on: https://gerrit.instructure.com/33065
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
Reviewed-by: Liz Abinante <labinante@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-05-05 20:08:17 +00:00
Dave Donahue 19c973ef4c course progress API fix for deleted/unpublished module items
fixes CNVS-12769
fixes CAT-157

Test plan:
  1. Create a module with a few module items and set up
     completion requirements for them. Also be sure to require
     sequential progress.
  2. Hit the course progress API for that course and verify
     that the next_requirement_url points to the first module
     item.
  3. Delete the first module item.
  4. Hit the API again and verify that the next_requirement_url
     points to the next module item, not the one that was deleted.

Change-Id: If77ed034f897507f45b15e623fdbe2c1c8ab9208
Reviewed-on: https://gerrit.instructure.com/34082
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>
2014-05-03 04:39:44 +00:00
Nathan Mills bb244d1f86 move all DelayedJob Alert code into separate class
fixes CNVS-12411

test-plan:
regression test all alerts

Change-Id: Ie954c3c6c3f034fce130774c5c6e4e1515b02049
Reviewed-on: https://gerrit.instructure.com/33339
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-05-02 21:48:55 +00:00
Joseph Rodriguez 339dc7a41f Refactor alert creation to remove unnecessary code
fixes CNVS-12410

test plan:
regression test alert notifications

Change-Id: I3f20a532b0ee39ce2b9e136145f8c7f5f0bc0ba6
Reviewed-on: https://gerrit.instructure.com/33313
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-05-02 21:48:42 +00:00
Joseph Rodriguez 40dcaa4681 refactor Alert::UserNote to check enable_user_notes on account
fixes CNVS-12406

test plan
regression test alerts sent based on user notes and the enable user
notes accout setting

Change-Id: I9627c7db5381be282f6ed9134aee2f44fef76720
Reviewed-on: https://gerrit.instructure.com/33306
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-05-02 21:48:33 +00:00
Joseph Rodriguez 2533ddc54c extract interaction alert check to it's own class
fixes CNVS-12405

test plan:
regression test alerts sent out based on Submission Comments and
Conversation Messages

Change-Id: Ibd145fe07b7c23180bf855afa96c1d4e47459409
Reviewed-on: https://gerrit.instructure.com/33300
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-05-02 21:48:23 +00:00
Nathan Mills 99ef8ef712 extract user note alert check to it's own class
fixes CNVS-12402

    test-plan:
    regression check user note alerts for timespan threshold

Change-Id: I33abc799d7c34185aba15e62387eedee9b1acaf6
Reviewed-on: https://gerrit.instructure.com/33295
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-05-02 21:48:13 +00:00
Nathan Mills 1088ca732b extract ungraded timespan alert check to it's own class
fixes CNVS-12393

test-plan:
regression check ungraded submission alerts for timespan threshold

Change-Id: I228c2e152d20a61871a483974e5a418a9b61e56d
Reviewed-on: https://gerrit.instructure.com/33287
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-05-02 21:48:01 +00:00
Nathan Mills f3e4a898ba move ungraded count checking to it's own class
fixes CNVS-12392

test plan:
regression test on alerts for ungraded assignments

Change-Id: I0ee553666706e91a96b953b1796578b834fd88b7
Reviewed-on: https://gerrit.instructure.com/33284
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-05-02 21:47:41 +00:00
Nathan Mills 8002734889 extract student to teacher mapping
fixes CNVS-12370

test plan:
course alerts should still work

Change-Id: I877f27506e1c8f5c89de77c266018824b7f5045e
Reviewed-on: https://gerrit.instructure.com/33252
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-05-02 21:47:31 +00:00
Nathan Mills a891bdeca5 make evaluate_for_course arguments required
fixes CNVS-12343

test plan:
alerts for a course should still get sent

Change-Id: I149f72e5604c3d83a6a4aa63f2adcea5325ae9f5
Reviewed-on: https://gerrit.instructure.com/33220
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-05-02 21:47:22 +00:00
James Williams 7692af009a move all importing methods into models/importers
test plan:
* migration regressions

Change-Id: Ibed8d4820c05b9c69101b215932af32055c3e006
Reviewed-on: https://gerrit.instructure.com/33728
QA-Review: Clare Strong <clare@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2014-05-02 17:31:15 +00:00
Nathan Mills 079f2d60cc force navigation tabs cache to invalidate when changing external tools
fixes:PLAT-277

test plan:
1. Go to https://www.eduappcenter.com/apps/redirect
2. Enter criteria for a redirect link configuration URL
3. Access an account in Canvas
4. Add the Redirect External Tool with your configuration URL
5. Observe link is added to your Navigation per your settings
6. Attempt to edit the External Tool in Canvas with a new configuration URL you get from https://www.eduappcenter.com/apps/redirect after putting in new data
7. Observe that changes are reflected in the External Tools tab but the actual link in Navigation menus is changed

Change-Id: I2b233cb89e4b446cd66b6e826ec8de894a02bfdd
Reviewed-on: https://gerrit.instructure.com/33757
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Reviewed-by: Eric Berry <ericb@instructure.com>
Product-Review: Nathan Mills <nathanm@instructure.com>
2014-05-02 16:49:14 +00:00
Nathan Mills 50aaedf38e make the resource_link_title for content_tag launched lti tools correct
fixes PLAT-324

test-plan:
  steps:
    *setup an lti tool as a module item changing the name to be different than the lti tools name
    *launch the lti tool
  result:
    *the resource_link_title value should match the name of the module item

Change-Id: Ifcfa695dd09f693cf4449869052349402168470b
Reviewed-on: https://gerrit.instructure.com/34030
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Eric Berry <ericb@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Product-Review: Nathan Mills <nathanm@instructure.com>
2014-05-01 21:29:42 +00:00
Ahmad Amireh e471722b26 Ember Quiz Statistics - Base/Skeleton
A starting point for the implementation of Ember quiz statistics that
includes a route with the required data properly loaded, the necessary
serializers and adapters, and base stylesheet/template to start from.

This patch also adds a new submission statistic called
"submission_scores" that's basically a map between a score percentile
and the count of students who received it.

Closes CNVS-12171

TEST PLAN
---- ----

  - with fabulous quizzes on, go to a quiz show page
  - click the Statistics tab
    - verify that you see the blank page, and the tab is activated
    - verify that no errors are thrown in the console

Testing the new metric:

  - create a quiz with a certain number of points possible
  - take it by a number of students and score diversely
    - also let more than one student have the same score
  - perform an API request to retrieve the statistics and:
    - verify you get the new score distribution statistic and that it is
      correct
    - the metric should contain an entry for each distinct percentile
    - the metric entry should really reflect how many students got that
      score
  - check out the Quiz Statistics API docs and:
    - verify the new "scores" statistic under SubmissionStatistics is
      documented
    - verify that the documentation is clear enough

Change-Id: I1f00bd4c18a0767d6a50767c5d8868f1d6e561ac
Reviewed-on: https://gerrit.instructure.com/32732
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
2014-05-01 21:06:57 +00:00
Jason Miller a3915253ec Updated Gradebook to CSV export to include all section names 2014-05-01 14:04:54 -07:00
James Williams 7d05ef0994 fix problems with importing invalid wiki page urls
test plan:
* import the package referenced in the ticket
* should still be able to visit and edit the page with
the title 'BIO 095'

fixes #CNVS-12696

Change-Id: Iff793642697576dc8df887a9084c8fc0fdf2eaa8
Reviewed-on: https://gerrit.instructure.com/34042
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
2014-05-01 17:19:15 +00:00
Mark Severson c0480a4dc5 rework module progressions evaluation
test plan:
 * regress module progression workflow for students
   - student progress should always be up-to-date

fixes CNVS-11818

Change-Id: Ib6b4ccf7b93bc490726fe2bf75333d75f1572ee0
Reviewed-on: https://gerrit.instructure.com/31575
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
2014-05-01 16:42:07 +00:00
Jeremy Stanley f84003358f allow zip file import migrations on users and groups
test plan:
 - use the List Migration Systems endpoint on
   a group and a user, and confirm only the
   zip_file_importer is returned
 - use the Content Migrations API to import a zip file
   into folders belonging to Users and Groups
   - try both the POST and the URL workflows
   - ensure migration types other than zip_file_importer
     are rejected in User and Group context

fixes CNVS-11218

Change-Id: I4b407ce76f0b5df60cc9f99795a6d9d3ddf81ae2
Reviewed-on: https://gerrit.instructure.com/33723
QA-Review: Clare Strong <clare@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2014-05-01 15:18:42 +00:00
Jacob Fugal ec8dc289f9 default subaccount time zone to root account tz
refs CNVS-9312

we don't ever look at the default time zone on a subaccount (or
at least shouldn't). but if we happen to, default to the root account's
default time zone, rather than going straight to Mountain. but if we
happen to look at this field for a subaccount that has set it (rare, can
only be achieved through API, UI disallows it, and it's probably wrong
to do), go ahead and honor it. we may remove that in the future

test-plan:
 - have a root account with Eastern as default time zone
 - create a sub account under that root account
 - in script/console, check value of subaccount.default_time_zone; it
   should match be Eastern
 - set subaccount.default_time_zone to 'America/New_York'
 - reload and check value; should still be 'America/New_York'
 - clear default_time_zone on both subaccount and root account (e.g.
   assign nil to the field)
 - check subaccount.default_time_zone; should be Mountain

Change-Id: Ib32932159db926a9a92dd889ae60c9c12e0a94d9
Reviewed-on: https://gerrit.instructure.com/32789
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
2014-05-01 14:09:58 +00:00
Derek DeVries d7228c4edf force draft state enabled to see fabulous quizzes
the new ember quizzes ui isn't going to work pre draft state, but will be
released before draft state is the default interface for everyone. This change
is to make sure that enabling the new quiz interface forces draft state to
be enabled. It also adds logic so that when we remove the enable fabulous
quizzes flag that we still ensure that draft state is enabled to see it.

fixes CNVS-12614

test plan:
  - disable draft state
  - enable fabulous quizzes
  - draft state should be enabled automatically

Change-Id: If2d2f3fecad1f72746cc17350abf018de5a9c79d
Reviewed-on: https://gerrit.instructure.com/34066
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
2014-04-30 22:28:00 +00:00
Rob Orton e2117f2713 retry enrollment unique constraints
fixes CNVS-12761

test plan
 - specs should pass

Change-Id: Icfd276e85c359b7d5625f0d187eaf142fe00601c
Reviewed-on: https://gerrit.instructure.com/34051
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2014-04-30 20:43:56 +00:00
David Julia 12949cb829 Prefer mp3 for audio comments in api_user_content
When preparing user content for public consumption via the API, we were
hardcoding a media_type of mp4, which prevented clients using API
endpoints (specifically the mobile client) from playing audio comments
which only had mp3 sources.

This adds a new path through media_download that prefers mp3 for audio
media but falls back to the old mp4 behavior. We also maintain backwards
compatibility with other callers using the file_extension based
filtering.

NTRS-43

Test Plan:
 - With both a 'wav' and an 'mp3' sample file:
   - Create an announcement and upload an audio file via the RTE
   - Wait for transcoding to complete in Kaltura
   - The file should play properly in the web browser
   - Open the same announcement in the iOS mobile app
   - The audio file should play properly on the phone

Change-Id: I26735096ea4336cf1acc04eb9649d322f68fa515
Signed-off-by: Paul Hinze <paulh@instructure.com>
Reviewed-on: https://gerrit.instructure.com/33318
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2014-04-30 20:00:13 +00:00
Kenneth Romney 31361b5255 extract lib/text_helper to gems/canvas_text_helper
fixes: CNVS-12305

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

Change-Id: I912a63b03c6c14de0c1d678063bb8fa33504d843
Reviewed-on: https://gerrit.instructure.com/33171
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-04-30 15:18:40 +00:00
Jeremy Stanley 7fc35e3145 add "Resolve path" to Folders API
fixes CNVS-11494

test plan:
 0. on both rails2 and rails3...
 1. find the "Resolve path" endpoint in the API docs
 2. in Course, Group, and User contexts:
   a. create some folders and subfolders
   b. use the new endpoint and confirm that
      (1) a full path such as "course files/folder/subfolder"
          returns an array containing each Folder in order;
      (2) status 404 is returned if the path doesn't exist
          (even if a partial match exists);
      (3) status 404 is returned if the requested folder or
          a parent folder is locked, the caller is a student,
          in Course context
      (4) users not authorized to access files receive a 401

Change-Id: I6438317fc8c847fa0a5c140bc9e91890d727514c
Reviewed-on: https://gerrit.instructure.com/33447
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2014-04-28 20:05:52 +00:00
James Williams 1aa4f25a65 move user attachments on user merge
test plan:
* create two users
* upload files as both users
* merge one user into the other user
* confirm that the final user has the attachments
 from the merged user (after jobs have run) and that
 files with duplicate filenames are renamed
 (however, note that files that have identical content
 and names will not be duplicated)

fixes #CNVS-12264

Change-Id: Id699c24c804808737b763ec37316e03bd1f3c59f
Reviewed-on: https://gerrit.instructure.com/33769
QA-Review: Clare Strong <clare@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2014-04-28 16:47:55 +00:00
Josh Simpson cd67c0e684 add models for polling
fixes CNVS-12467
This commit adds the models for the new polling feature: Poll,
PollSubmission, and PollChoice.

Change-Id: If8adb91073d8173b14206f442fadbee4a9e3b4c9
Reviewed-on: https://gerrit.instructure.com/33566
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Product-Review: Josh Simpson <jsimpson@instructure.com>
2014-04-28 15:15:29 +00:00
Raphael Weiner 5553f62357 extract incoming mail into gem
fixes CNVS-12182

test plan
- regression test on incoming mail
- use script/process_incoming_emails to manually trigger the processing
  of incoming mail

Change-Id: Iccd74d8fe2b5af3d5eefe25a2736273e3bf559b0
Reviewed-on: https://gerrit.instructure.com/32794
Reviewed-by: Simon Williams <simon@instructure.com>
Reviewed-by: Braden Anderson <banderson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
2014-04-25 23:06:02 +00:00
Joseph Rodriguez 8554d5c894 moving mail processor to module
fixes CNVS-12174

Test Plan:
Regression test on incoming mail.

Change-Id: I3f5d131ce4a1f4408bf95a5455ffc4baa6bdc85c
Reviewed-on: https://gerrit.instructure.com/32716
Reviewed-by: Braden Anderson <banderson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
2014-04-25 23:05:39 +00:00
Joel Hough 53db21e37b extract secure-id handling from incoming message processor
fixes CNVS-12147

test plan
- regression test incoming mail

Change-Id: Id3d8a95dda3566bae8d395d1b759c7897ab3c1ee
Reviewed-on: https://gerrit.instructure.com/32671
Reviewed-by: Braden Anderson <banderson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
2014-04-25 23:04:53 +00:00
Joseph Rodriguez a8c90d61df Extract and inject incoming message handler
fixes CNVS-12145

QA Test Plan:
- regression test incoming mail
- ensure that reply to discussion topic works

Change-Id: Iae88aa6da5cfe79e51609e233c05e356feacc198
Reviewed-on: https://gerrit.instructure.com/32610
Reviewed-by: Braden Anderson <banderson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
2014-04-25 23:04:42 +00:00
Raphael Weiner 8be0ae37d7 Move google_docs code into a gem
fixes: CNVS-12329

Change-Id: I044725c93582cbca39a61e036bb5f0385e069c1e
Reviewed-on: https://gerrit.instructure.com/32990
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-04-25 21:50:43 +00:00
Raphael Weiner c8d7b9f915 Further decoupling of google_docs from models and controllers.
fixes: CNVS-12328

test plan:
  - as admin enable the google_doc plugin
  - as student visit `/profile/settings`
  - click 'Google Docs' under the 'Other Services' section
  - click 'Authorize Google Doc Access' in modal
  - when redirect to google, click 'Allow access'
  - verify success banner displays

Change-Id: I2b45ffa38ac0d1d810fb988335f4cd39154ae2a6
Reviewed-on: https://gerrit.instructure.com/32949
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-04-25 21:50:34 +00:00
Jon Jensen d4b4129950 customize "Canvas" in registration confirmation email, fixes CAT-128
add a product_name account setting to allow schools to customize the
registration confirmation email. ostensibly this setting could be used
throughout canvas to allow greater customization, but let's not get ahead
of ourselves

test plan:
1. on your root account, set settings[:product_name] to something
2. /register as a new user
3. confirm that the "set a password" email uses that product name in the
   header and body

Change-Id: I6e0d5aa8ad80c4cda40e2aac1367364293843627
Reviewed-on: https://gerrit.instructure.com/33846
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Dave Donahue <ddonahue@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
2014-04-25 18:51:23 +00:00
Eric Adams be040d6713 Added Post Assignment to SIS
fixes SIS-214
fixes SIS-229
fixes SIS-230

TestPlan:
 - go to account settings and verify post grades feature is enabled
 - go to course settings and verify post grades feature is off
 - create a new assignment, verify "Post Assignment to SIS" checkbox is not present in the view
 - go to course settings and enable Post Grades
 - create a new assignment and verify Post Assignment to SIS is present in the view and checked. NOTE: it should be checked by default if this is a NEW assignment
 - save the assignment
 - edit the assignment again and the post grades checkbox should be true
 - uncheck the post assignment to sis checkbox, save
 - re-edit the assignment, the post grades checkbox should be unchecked

Conflicts:
	app/coffeescripts/models/Assignment.coffee

Change-Id: I34cba5add03b3cb935b502e47b4537bf93c5b7c1
Reviewed-on: https://gerrit.instructure.com/33411
Reviewed-by: Eric Adams <eadams@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Reviewed-by: Duane Johnson <duane@instructure.com>
Product-Review: Eric Adams <eadams@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2014-04-25 18:23:04 +00:00
Braden Anderson f4057e4796 calendar: support dragging to undated events
fixes CNVS-10796

test plan:
  * open calendar2
  * open the undated events section
  * drag a dated event to the undated section
  * verify that the event becomes undated
  * verify that this functionality works with variable due date
      assignments, scheduler items, and per-section events

Change-Id: Ifd5b46d2c6480b66ac4e1268ae7694c77dc17717
Reviewed-on: https://gerrit.instructure.com/33272
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Joel Hough <joel@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Braden Anderson <banderson@instructure.com>
2014-04-25 16:28:56 +00:00
Derek DeVries e576477d70 make quiz assignment creation appear in main stream items in the dashboard
fixes CNVS-11209

test plan:
  - turn on draft state
  - create and publish a quiz
  - go to the main dashboard and courses dashboard
  - the quiz that was created shoulda ppear on the mains stream items list

Change-Id: Iadc3f41f2baa6b35114e267fbea6fd4e5e7feff6
Reviewed-on: https://gerrit.instructure.com/33805
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
2014-04-24 21:18:14 +00:00
Eric Adams 933bff25d3 Add integration Ids to API
fixes SIS-135
fixes SIS-136

Change-Id: Ide2f51765c76a50f09d54d2865357b5ff38bc360
Reviewed-on: https://gerrit.instructure.com/28587
Reviewed-by: Duane Johnson <duane@instructure.com>
Tested-by: Duane Johnson <duane@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Eric Adams <eadams@instructure.com>
2014-04-24 20:43:45 +00:00
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
Joseph Rodriguez 1cd4974638 refactor SubmissionManager#create_or_update_submission
fixes: CNVS-12587

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: Ia768a54bcca19750b0e8c701368099cdeb055664
Reviewed-on: https://gerrit.instructure.com/33724
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
Product-Review: Jason Madsen <jmadsen@instructure.com>
2014-04-23 21:31:09 +00:00
Raphael Weiner 732d4991e5 extract linkedin into a gem and add tests
fixes: CNVS-12119

test plan:
regression test linkedin functionality

Change-Id: I9cec121d641db37d4c8f6a04966e766e9f8b293e
Reviewed-on: https://gerrit.instructure.com/33473
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Jason Madsen <jmadsen@instructure.com>
2014-04-23 20:23:55 +00:00
Michael Nomitch 0a8fa96417 gradebook url changes
fixes CNVS-11966

test plan:
  - with srgb feature flag enabled
    - cant get to gb1
    - /gradebook takes you to your preference
    - switching saves the preference
    - student behavior is normal

  - with srgb feature flag disabled
    - cant get to srgb
    - /gradebook goes to gb1
    - /gradebook2 goes to gb2
    - student behavior is normal

  - make sure all links to the GBs work
  - student grade summary should work as usual
  - with both FF settings, as a teacher checking a
    single student's grade should work as usual
  - courses with 'large rosters' get GB2 not GB1

Change-Id: I2a488fdfb5b3667c1d6cd21dc250ef3c50df101c
Reviewed-on: https://gerrit.instructure.com/33178
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Anna Koalenz <akoalenz@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-04-23 19:39:21 +00:00
Joseph Rodriguez 32f45d6956 remove #grade_submission from QuizSubmission
fixes: CNVS-12565

test plan:
- as a student take a quiz
- verify that:
  - background submissions are working
  - end of time / date submissions are working
  - manual submsissons are working
- verify various question types are graded correctly
- verify outcomes work as previously defined

Change-Id: Ia85141559e8026993c0e270267947128a5a0466b
Reviewed-on: https://gerrit.instructure.com/33669
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Jason Madsen <jmadsen@instructure.com>
2014-04-23 19:28:03 +00:00
Jason Madsen d777955bf3 move quiz submission grading to individiual object
closes CNVS-12538

test plan:
  - as a student take a quiz
  - verify that:
    - background submissions are working
    - end of time / date submissions are working
    - manual submsissons are working
  - verify various question types are graded correctly
  - verify outcomes work as previously defined

Change-Id: Ibdab88a4bf57f953330f576cb9b73c0ddb795d55
Reviewed-on: https://gerrit.instructure.com/33618
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Jason Madsen <jmadsen@instructure.com>
2014-04-23 19:27:44 +00:00
Jon Willesen 1f4737ed05 add migration_selection lti extension
this commit lets canvas remember that an LTI has this extension.
launching and using LTI for content migrations will happen
separately.

refs LOR-20

test plan:
 - configure an LTI tool with XML that includes the
   migration_selection extension
 - the tool should show up in the tool list with the "Migration
   Selection" tag.

Change-Id: I880125515a32af1b9a39fbd1787617bceae74f50
Reviewed-on: https://gerrit.instructure.com/21442
Reviewed-by: Jake Trent <jaketrent@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Reviewed-by: Brad Humphrey <brad@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Jon Willesen <jonw@instructure.com>
2014-04-23 17:05:41 +00:00
Jon Willesen 5804d857d9 add migration external tool extension ui
An external tool configured for the migration extension will
show up on a course's content import page and allow you to
select a file to migrate from the LTI launch.

fixes LOR-20

Test Plan:
 * Configure an external tool that has the migration_selection
   extension
 * The new tool should show in the dropdown on the content
   import page.
 * Run some migrations through the external tool.

Change-Id: Iea16a7e32145e6799c551816e6f70a73f2a8c3d0
Reviewed-on: https://gerrit.instructure.com/21443
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jake Trent <jaketrent@instructure.com>
Reviewed-by: Brad Humphrey <brad@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Jon Willesen <jonw@instructure.com>
2014-04-23 17:03:15 +00:00
Jason Madsen 9c74ee4702 move find_or_create_submission to own object
closes CNVS-12576

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: I4c97162589b5fb9cceb0c6cbe9e4fb68dd1f8093
Reviewed-on: https://gerrit.instructure.com/33691
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Jason Madsen <jmadsen@instructure.com>
2014-04-23 16:36:52 +00:00
Michael Nomitch 0c3e7fcd7a warn teachers when changing grade display
fixes CNVS-11250

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

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

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

Change-Id: I9851997c9672f73335f54bdba78bdb71ee24d029
Reviewed-on: https://gerrit.instructure.com/33264
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Joel Hough <joel@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Braden Anderson <banderson@instructure.com>
2014-04-22 22:42:53 +00:00
James Williams af9e8d900b fix importers/calendar_event_spec
Change-Id: Ie64bf50f780d20ca0e09e0aeb8d709fc6d9f2859
Reviewed-on: https://gerrit.instructure.com/33716
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
Tested-by: Brian Palmer <brianp@instructure.com>
2014-04-22 22:24:02 +00:00
Sterling Cobb 01fbc15817 add translations to account settings
The account settings were not being translated. It should now be
translated.

Test Plan
1. Go to the account settings page.
2. Ensure that the account settings page is translated properly.

fixes CNVS-9804

Change-Id: Ib2768302fb9745b59be311244ed4f080bb6448ee
Reviewed-on: https://gerrit.instructure.com/28404
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
2014-04-22 16:27:24 +00:00
Jason Madsen ec7751f341 move migration importers to app/models/importers
closes CNVS-12404

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

Change-Id: Ia5c88cc179e3cc8075270d0d423e618f80d61234
Reviewed-on: https://gerrit.instructure.com/33314
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
2014-04-22 15:35:09 +00:00
Cody Cutrer c2c12ce84f some optimisations for scheduler api json
refs CNVS-5647

test plan:
 * simple regression test of creating, editing, and signing up
   for appointments

Change-Id: Iee2b30ff2ffcd15e4e0664177052eec0f3e5e22b
Reviewed-on: https://gerrit.instructure.com/33402
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2014-04-21 21:30:05 +00:00
Stanley Stuart 94f3b1bd15 add submitted/unsubmitted quiz users endpoint to quizzes api
Test plan:
  - As a teacher, create a quiz.
  - Visit the quizzes API using JSONAPI headers. For that quiz,
    "submitted_students" should be null. You should get a URL back to
    the "unsubmitted_students" endpoint, which you can query and find
    the unsubmitted students.
  - As a student submit the quiz. As a different student, don't submit
    the quiz.
  - As a teacher, visit the quiz show endpoint for that quiz again. You
    should have "submitted_students" and "unsubmitted_students" under
    the "links" hash. Query these APIs using those URLs. The students
    returned from the link that looks like "?submitted=true"
  - As a student, you should not see "submitted_students" or
   "unsubmitted_students" under the "links" hash when querying
   the show API in JSONAPI format
  - In non-jsonapi format as any user, you should not see
   "unsubmitted_students" or "submitted_students"

closes CNVS-11687

Change-Id: I7094dfc37b0dde501e5a2c1f12ade983cd2a150a
Reviewed-on: https://gerrit.instructure.com/31223
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2014-04-18 21:04:23 +00:00
James Williams 68094f6217 fix and simplify learning outcomes in selective content import
the current learning outcome selection only occurs during course copy,
and will not bring in any outcomes that are in a group

in the future, we would like to add detailed item selection to the
dialog, but for now, make a simple solution that at least works

test plan:
* for both course copy, and course export/import, confirm that
 the 'select content' option gives you a checkbox to either bring
 in all the learning outcomes (and their groups) or none of them

fixes #CNVS-7464

Change-Id: I06a423ea949442cbba1459e04154681b6b2859bc
Reviewed-on: https://gerrit.instructure.com/33031
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Product-Review: Hilary Scharton <hilary@instructure.com>
2014-04-18 17:29:13 +00:00
Nathan Mills 32b2ce407f extract attachment importer
fixes CNVS-12245

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

Change-Id: I897ec39bfa393835ee20cb8ff83918dcdddf57ff
Reviewed-on: https://gerrit.instructure.com/32965
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2014-04-18 16:37:00 +00:00
Cameron Matheson 5b9b9cc24c speedgrader: link to quiz history page
closes CNVS-12250

Test plan:
  * Make a quiz
  * Make 151 quiz submissions
    (or go to the rails console and run
       Setting.set("too_many_quiz_submission_versions", 1)
    and then make 2 quiz submissions)
  * you should get a link to "See all submissions" in the sidebar where
    the quiz version selector would normally go

Change-Id: Ica1e19eb6f16ef16ea6b86fec1975509a09f3326
Reviewed-on: https://gerrit.instructure.com/33309
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
2014-04-18 00:13:37 +00:00
Cameron Matheson 168b0b7b64 crocodoc: retry more frequently
closes CNVS-7104, closes CNVS-12396

Test plan:
  Developers could test this but it would be hard for QA to do anything
  on this one.

Change-Id: Ieab9326a4e2a45264894e201e839568d813cbe57
Reviewed-on: https://gerrit.instructure.com/33319
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>
2014-04-17 20:20:23 +00:00
Ryan Shaw 95faa5fb36 Convert 'high-contrast' from user pref to feature flag
fixes: CNVS-11426

a few months ago we started trying to enable users to turn
on some "high contrast" css changes. The way we did that was
with a override css file that would go and override existing
style rules to set them to new values.  the main difference
here is that it is done at the *source of where the variable
is declared* instead of *after the fact, overriding what was there*
this will make things a lot easier to maintain.  for example, see
the part where instead of having a huge selector to override a bunch
of things that look like links to be darker, we just go and set the
$linkColor sass variable to be a little bit darker.

test plan:
* before you check out this code, go to /settings and turn on the
  'high_contrast' user theme.
* run the db migration in this commit
* now go to /settings and make sure that the 'high contrast' feature
  is enabled.
* verify that with that feature enabled, when you go to /styleguide
  you should see higher contrast buttons, link text, and backgrounds
* it wont be exactly the same as when you had the 'high contrast' theme
  enabled because some of the high contrast things weren't super important
  (specifically, the darker grey borders on some elements). but the most
  important changes, making the contrast between text and the background
  around it, should be there.

this essentially reverts:
"adds high-contrast theme user preference"
b232dcf448.

this also makes jmadsen's change to make the green
alert bar a little darker (to comply with contrast)
in g/31881 apply across the board to all of our
green things so they are all compliant. (in addition,
now if they have high contrast enabled, it will be
even darker green)

Change-Id: Iee7d81bb5160e86f1900dbf4a249364b1ddfa7f1
Reviewed-on: https://gerrit.instructure.com/32863
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2014-04-17 19:47:38 +00:00
Ryan Shaw ca503542e2 a way for accounts to opt-in to new styles and users to high-contrast
fixes CNVS-11426

The UI/UX team *really* wants to start doing some major style changes
to the canvas interface. Because it is a very visual change and especially
because we've let people hack the crap out of canvas styles with
their own css override file, any changes we do need to be behind a
feature flag so an institution can opt-in when they are ready.

This commit does some trickery so we actually create 4 different versions
of every stylesheet. one for each variant in:
legacy_normal_contrast legacy_high_contrast
new_styles_normal_contrast new_styles_high_contrast
and then sets the $use_new_styles and $use_high_contrast sass variables
accordingly in each.

now, in any sass file, you can do things like:
  @if $use_new_styles {
    background-color: red;
  } @else {
    background-color: blue;
  }

  @if not $use_high_contrast{
    font-size: 12px;
  }

test plan:

* in a production (minified assets) environment, ensure you see:
  <link href="/assets/common_legacy_normal_contrast.css... in the <head> of the page
* go to the account settings page for the domain_root_account you are on
* turn on the "Use New Styles" feature
* now verify that <link href="/assets/common_new_styles_normal_contrast.css...
  is in the <head>. There should not be any visible differences because we do
  not have any styles that target specifically $use_new_styles yet.
* now, go to /settings and turn on the user feature for "Use High Contrast Styles"
* verify that <link href="/assets/common_new_styles_high_contrast.css..
  is in the <head>
* again, turning that on will not actually change the way anything looks,
  the next commit (g/32863) will take care of that

Change-Id: I45ba4ddfe780c5c819fb995b61ebfc0a5325d418
Reviewed-on: https://gerrit.instructure.com/31881
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
2014-04-17 19:47:05 +00:00
Joseph Rodriguez c6fce9e781 extract bookmarked_collection gem
fixes: CNVS-11645

Test Plan:

Test the groups api endpoint at

api/v1/users/self/groups?context_type=Account

Make sure its not broken.

Change-Id: I2a17672f0e81530aa8623c5ed16b9cb0bb6b3ce5
Reviewed-on: https://gerrit.instructure.com/31417
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
2014-04-17 18:16:13 +00:00
James Williams 1ae166f3ff export/import/copy course tab configuration with external tools
test plan:
* create a course with an external tool (either configured
for the course or on an account-level) that adds a course
 navigation tab
* arrange the tabs in the course settings
* copy the course, or export the course and then import
 into a new course
* should retain the same tab configuration as the original course

fixes #CNVS-8866

Change-Id: I8ee7cb5bd2e098829994e63f4fbd1ca4d0afd701
Reviewed-on: https://gerrit.instructure.com/32906
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mark Severson <markse@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2014-04-17 17:45:46 +00:00
James Williams fbb05045c1 enable domain substitutions in imported urls
test plan:
* create a course with html content, with links pointing to a given
domain (e.g. "http://www.example.com/somewhere")

* in the rails console, manually configure the account settings
as follows, (replacing -COURSEID- with the id of the course):

 a = Course.find(-COURSEID-).root_account
 h1 = {"http://www.example.com" => "https://www.not-example.com"}
 h2 = {:domain_substitution_map => h1}
 a.settings[:default_migration_settings] = h2
 a.save!

* copy the course

* the links should all be translated to the new domain
 (e.g. "https://www.not-example.com")

fixes #CNVS-12325

Change-Id: I0ac2ddf628303ae760995e44c72e2c90a836f966
Reviewed-on: https://gerrit.instructure.com/33472
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2014-04-17 17:24:45 +00:00
Derek DeVries d17adf014f fix issue where matching results blanked out repeated answers
fixes CNVS-10613

test plan:
 - create a quiz with a matching question
 - have one answer on the right side be a duplicate
 - take the quiz and answer correctly
 - when viewing the results the answers should all show up correctly
 - try this same with multiple duplicates
 - do general regression testing around matching questions

Change-Id: I711c9df59c17f99e2d4ddb25b79b9e9679e1be8c
Reviewed-on: https://gerrit.instructure.com/33467
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
2014-04-17 16:25:24 +00:00
James Williams bfbfdf41ee retain assignment muted status on course copy/import/export
test plan:
* create a muted assignment
* copy the course, or use import/export
* the migrated assignment should also be muted

refs #CNVS-12483

Change-Id: I124141ae088cb70a4d93f4270c5ad103c4b24a3a
Reviewed-on: https://gerrit.instructure.com/33415
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>
2014-04-17 15:37:14 +00:00
Nick Houle decd207481 support for trusted developer keys
fixes CAT-66

Auto-authorize trusted developer keys during without prompting the end-
user. This will allow for more seamless integrations with other in-house
apps.

Also fix remember-me access so it works when you re-auth into canvas
(previously it only worked if you were already authenticated into
canvas)

Expand test coverage around oauth login scenarios

test plan setup:
* set up a web-based oauth integration with canvas
* ensure your app doesn't currently pass force_login=1 during oauth
* ensure your app doesn't currently delete access tokens during logout
* for part 2, ensure your app uses the /auth/userinfo scope (for part
  1 it doesn't matter)
* for part 3, ensure your app does token request flow (not userinfo)

test plan part 1 (trusted keys):
1. in the canvas console, set trusted=true on the app's developer key
2. do an oauth login as and end-user
3. confirm that you are authenticated into the app without being prompted
   to give it canvas access
4. log out of the app (but not canvas)
5. click to log in again
6. confirm that you are automagically logged in without any prompts

test plan part 2 (remember access):
1. in the canvas console, set trusted=false on the app's developer key (or
   set up your app to use a different one)
2. do an oauth login as and end-user
3. confirm that you are prompted to authorize the app
4. check the box to remember access
5. log out of canvas and the app
6. do an oauth login again
7. confirm you are not prompted to authorize the app
8. log out of the app (but not canvas)
9. click to log in again
10. confirm that you are automagically logged in without any prompts

test plan part 3 (untrusted key, not-userinfo)
1. in the canvas console, set trusted=false on the app's developer key (or
   set up your app to use a different one)
2. do an oauth login as and end-user
3. confirm that you are prompted to authorize the app
4. confirm there is no box to remember access
5. log out of canvas and the app
6. do an oauth login again
7. confirm you are prompted to authorize the app again
8. log out of the app (but not canvas)
9. click to log in again
10. confirm that are prompted to authorize the app again

Change-Id: Ifb2eb29e4da163b595cb070455ebae21a4618ba4
Reviewed-on: https://gerrit.instructure.com/32926
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
2014-04-16 23:18:19 +00:00
Jason Madsen 6dd6129c96 move quiz importing to individual class
closes CNVS-12397

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

Change-Id: I25b778aea06ffbd1ad23a7076cd597e9123c32bf
Reviewed-on: https://gerrit.instructure.com/33294
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Jason Madsen <jmadsen@instructure.com>
2014-04-16 21:32:22 +00:00
Nick Cloward f1009a38fe canvas kaltura gem
fixes CNVS-10479

test plan:
  - in a course with kaltura enabled
    - go to a discussion and add media
    - upload a video (use right tab, not the webcam)
    - save the video/discussion post
    - the video should be saved properly and viewable
      (this sometimes takes a minute of two)

Change-Id: I40b9174807707dd1fb41125e04705422a8711d5d
Reviewed-on: https://gerrit.instructure.com/32024
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-04-16 19:39:45 +00:00
Ahmad Amireh ad2cf2b43e QuizStatistics API
Closes CNVS-8989

CHANGES
-------

  - ItemAnalysis can now be generated to a Hash as well as CSV

TEST PLAN
---- ----

  - create a quiz with a number of questions (true/false and
    multiple-choice a must-have)
  - take the quiz by 2-3 students
  - perform an API request as described below and verify that you get a
    statistics object that matches the API docs
  - do it once in legacy JSON format, e.g:
    "Accept: application/json"
  - do it once in JSON-API format, e.g:
    "Accept: application/vnd.api+json"
  - read the API docs and report any mistakes or stuff that's not clear,
    the stuff is written in the QuizStatistics module

Endpoint: [GET] /api/v1/courses/:course_id/quizzes/:quiz_id/statistics

Change-Id: I1588e1cdc8955b890c739df4c730507dad7118d1
Reviewed-on: https://gerrit.instructure.com/31141
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
2014-04-16 15:01:24 +00:00
Derek DeVries 25f426b700 fix polymorphic quiz_submission association on delayed_message
fixes CNVS-12395

test plan:
  please check for regressions around notifications on quiz submissions.
  this includes:
  - to teachers when the submission needs grading
  - to students when the submission is graded
  - to students when the grade changed

this one is very difficult to reproduce manually. data needs to be in a state
where a delayed job has been queued to send a notification message for a quiz
submission before the namespace change was deployed, and then it attempts to
execute the delayed job after the namespace change. it appears that messages
are only sent to a delayed message queue when there there are more than 500
messages per day.

Change-Id: I0869b4decaec900a2c4c8df5c6e0b8b29dd08c5c
Reviewed-on: https://gerrit.instructure.com/33307
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
2014-04-15 21:48:48 +00:00
Ahmad Amireh e95305fb7c Quiz Reports API - Index
An endpoint for retrieving all quiz reports for a given quiz.

Closes CNVS-12172

CHANGES
-------

The biggest effort in this patch was to normalize the way QuizReport
objects are interfaced with, and the generation of their CSV attachments
in particular:

  - Quiz#current_statistics_for() now ALWAYS returns a persisted object
    while still considering the freshness of the stats
  - Quiz#statistics_csv() is no longer responsible for testing whether
    the attachment should be generated or not, but instead ensures
    that the CSV will be generated ASAP
  - QuizStatistics#generate_csv() now guards against generating multiple
    attachments
  - QuizStatistics#generate_csv_in_background() now guards against
    queueing multiple generation jobs (by testing the status of the
    Progress object)

QuizReport API changes:

  - new property: "generatable"
  - new property: "readable_type"
  - new property: "url"
  - now accepts JSON-API format for all endpoints:
    - JSON-API allows you to embed file and progress objects directly in
      the QuizReport document, just pass ?include=file,progress

Quizzes API changes:

  - new property (JSON): "quiz_reports_url"
  - new property (JSON-API): "links.quiz_reports"

Some AMS changes:

  - added support for accepting side-loading requests from controllers
    by passing an :includes array to the serializer initializer
  - added support for embedding objects in root, using `embed: :object
    and embed_in_root: true` for has_one associations
  - also, in that same scenario, AMS's default behavior is to wrap
    single objects (has_one) in an array, which didn't work for me, so I
    added a new option called "wrap_in_array" which you can set to false
    when defining the association to override this behavior

Other changes:

  - covered the front-end/javascript that utilizes the reports and
    allows teachers to generate them
  - QuizReport in the front-end no longer relies on magical course_id
    exposed in window.ENV, but instead uses its URL to construct the
    generation URL (see QuizReport#baseURL)
  - Attachment now has a shallow-AMSerializer that proxies to the legacy
    one in lib/api/v1 which allows us to at least side-load them
  - Progress now has an AMS
  - QuizReport legacy serializer in lib/api/v1 removed entirely,
    replaced by the new AMS one

TEST PLAN
---- ----

Endpoint: [GET] /api/v1/courses/:course_id/quizzes/:quiz_id/reports

  - as a teacher, make a request to the endpoint above:
    - it should return a set of two quiz report objects
  - add a parameter "includes_all_versions=true" to the query parameters
    and verify that the "student_analysis" report in the returned set
    now reflects the new value (the reports have a field called
    "includes_all_versions" which should be true in this case, false
    otherwise)
  - as a student, make the request and verify that it rejects you

Endpoint: [GET] /api/v1/courses/:course_id/quizzes/:quiz_id/reports/:id

  - turn on JSON-API mode
  - as a teacher:
    - don't generate the report from the UI yet
    - make the request, and verify that you get only the report
    - generate
    - repeat the request, verify that you still get only the report
    - add a ?include=file query parameter
      - you should read the file document now
    - add a ?include=progress query parameter
      - you should read the progress document now
  - turn off JSON-API mode
  - as a teacher:
    - make the request, and verify you get the "progress_url" field and
      that the file document is embedded automatically without having to
      specify the ?include= parameter

Front-end testing:

  - go to the statistics page
  - generate all reports:
    - verify that the progress bar updates
    - verify that you can download them
    - verify that auto-download occurs unless you refresh the page
      before the report is generated
  - toggle on the "Count All Attempts" button and repeat the above:
    - verify that Item Analysis is not generatable anymore since it's
      not affected by that parameter

Please note that "item_analysis" reports will always have
"includes_all_versions" as true.

Change-Id: I0dc6d5108cbcef78b2fa17ba0476f470d33d402d
Reviewed-on: https://gerrit.instructure.com/32731
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
2014-04-15 19:22:02 +00:00
Anthus Williams 4050f5e0b3 remove OpenDataExport permissions/routes
the gem will handle the process of including them

Change-Id: I2237b4cad388756f91f67138a716ae5a8472d9df
Reviewed-on: https://gerrit.instructure.com/32586
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Nick Cloward <ncloward@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Anthus Williams <awilliams@instructure.com>
2014-04-15 15:31:02 +00:00
Jeremy Stanley a5477474f3 use binmode for s3 download file
test plan:
 - you should be able to perform content imports on rails3
   (specifically, there should not be a "Content-length does not match",
    or, for very small imports, "(something) from ASCII-8BIT to UTF-8"
    error)

fixes CNVS-12229

Change-Id: I8a549c3760972dc028461b391c87a2fcc98ff9f4
Reviewed-on: https://gerrit.instructure.com/33186
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
2014-04-14 16:25:49 +00:00
Landon Wilkins 4e08f0f7f3 adds completed_at to course_progress API
fixes CNVS-12257

test plan:
* set up a course with modules, module items
** and module completion requirements
* on each module, check the box that says:
** "students must move through requirements in
**  this module in sequential order"
* enroll a user in the course
* with that user's ACCESS-TOKEN, perform:

curl -H "Authorization: Bearer <ACCESS-TOKEN>" \
         -X GET -F 'include[]=course_progress' \
         <canvas>/api/v1/courses

* verify there is a completed_at field in the
** course_progress response
* verify that the completed_at field is nil unless
** the user has completed all the completion_requirements
** for all the modules
* if the user has completed all the completion_requirements
** for all the moduels, the completed_at date should be the
** date associated with the last thing the user did to complete
** the course.
* for example, if the last item is submitting an assignment,
** the completed_at date should be the submission date of that
** assignment
* verify that courses with 0 completion_requirements return
** nil for completed_at date

Change-Id: I6dfd6c7ec4168317cdcac0be13de52e9111f8c13
Reviewed-on: https://gerrit.instructure.com/32983
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Nick Houle <nhoule@instructure.com>
Reviewed-by: Dave Donahue <ddonahue@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
2014-04-14 15:17:15 +00:00
Ahmad Amireh 580e8d813d Numerical questions accept flexible ranges
The back-end will now accept answer ranges in a more flexible manner, so
providing a range of [50,10] or [-3,-8] will work.

Closes CNVS-11282

TEST PLAN
---- ----

  - create a quiz with a numerical question:
    - choose "answer in range" for an answer type
    - play with something similar to the combinations listed below and
      verify that you get the proper results
  - answer the quiz question by the student every-time you try a new
    combination and verify the grading is correct

Combinations:

  - from: -5, to: 10, answer: 7 (correct)
  - from: 10, to: -5, answer: 7, or 0, or -3 (correct)
  - from: -2.5, to: -3.5, answer: -3 (correct)
  - from: -3.5, to: -2.5, answer: 3 (incorrect)

Or just use your imagination :) The point is, the ranges should be
accepted and work properly regardless of if you specify the smaller
number first (this was an issue for negative ranges)

Change-Id: I3c3f8638f8244d6417effeec4b4f0e29198ea845
Reviewed-on: https://gerrit.instructure.com/32935
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
2014-04-10 22:44:18 +00:00
Derek DeVries 2c118f7e1c require a quiz to be republished when 'shuffle answers' is toggled
fixes CNVS-5359

test plan:
- with draft state off
  - create a quiz with 'shuffle answers' option OFF
  - save the quiz
  - when taking the quiz, answers should not shuffle
  - edit the quiz and turn 'shuffle answers' option ON
  - save the quiz
  - you should *NOT* need to republish here
  - when taking the quiz, answers should shuffle correctly
  - edit the quiz and turn 'shuffle answers' back OFF
  - save the quiz
  - you should get a notification that you need to 'republish'
  - republish the quiz
  - when taking the quiz, answers should not shuffle

- with draft state on
  - create a quiz with 'shuffle answers' option OFF
  - save the quiz
  - when taking the quiz, answers should not shuffle
  - edit the quiz and turn 'shuffle answers' option ON
  - save the quiz
  - when taking the quiz, answers should shuffle correctly

Change-Id: I1878683b8f4b5210584bf7dc2e3c05def5bbc947
Reviewed-on: https://gerrit.instructure.com/33109
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
2014-04-10 22:31:07 +00:00
Raphael Weiner 101cd37bb6 Cleanup google_docs
Change-Id: Iaa8545a3f39cd8708b1ea20a9c27836dcbdacb0a
Reviewed-on: https://gerrit.instructure.com/32860
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Reviewed-by: Braden Anderson <banderson@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-04-10 17:32:01 +00:00
Raphael Weiner 7054118441 Refactor google docs to be standalone not mixin.
fixes: CNVS-12096

Change-Id: I6fa7d6d57bfc9063b49334a8e528aaaa9fc7f8c2
Reviewed-on: https://gerrit.instructure.com/32715
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Braden Anderson <banderson@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-04-10 17:31:39 +00:00
Michael Nomitch 2cb906d9b5 gpa scale grading standard
fixes CNVS-8931

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

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

Change-Id: Ide1ea5ca13a70116ae3535b2c8e105ece79a34c8
Reviewed-on: https://gerrit.instructure.com/29742
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Hilary Scharton <hilary@instructure.com>
Product-Review: Mike Nomitch <mnomitch@instructure.com>
2014-04-10 16:00:28 +00:00
Mark Severson abf7daa5dc add lock_version to context module progressions
preparation for rework of the context module progression evaluation

test plan:
 * automated tests pass

refs CNVS-11818

Change-Id: I10618e576c7b44aebce0a9803876b8f543d9b61b
Reviewed-on: https://gerrit.instructure.com/32904
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
Product-Review: Mark Severson <markse@instructure.com>
2014-04-08 23:03:27 +00:00
Jeremy Stanley 6170b20b13 export/import media file captions
test plan:
 - have a course with a video file embedded in content somewhere
   (such as a wiki page)
 - create captions for the video and verify that they play back
 - export this course to an .imscc
 - import it to a new course
 - ensure the captions play back in the copied course

fixes CNVS-10228

Change-Id: Ie15076bc31ad36efabf7a718d12bd8a9b12e45e1
Reviewed-on: https://gerrit.instructure.com/32680
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2014-04-08 20:03:45 +00:00
Derek DeVries 919595406b disable ability to regrade a question if they change the question type
fixes CNVS-10868

test plan:
  - as a teacher
    - create a quiz with both multiple choice and multiple fill in the
      blank questions
    - publish the quiz

  - as a student
    - take the quiz

  - as a teacher
    1:
    - attempt to change the answer for the multiple choice question
    - regrade should be successful
    - view the results for the student's quiz - the answer should be regraded
      successfully

    2:
    - attempt to change the answer for the multiple fill in the blank
    - there shouldn't be an option to regrade
    - attempt to change the question type for the mfiib question to be a
      multiple choice question.
    - now try to change the answer
    - it should show you a message that regrade is disabled because you
      changed the question type
    - view the results for the student's quiz - all answers should show up
      and regrade should not be performed on the question

    3:
    - attempt to remove a question from the multiple choice question
    - attempt to change the answer and regrade
    - it should show you a message that regrade is disabled because you
      removed answers
    - view the results for the student's quiz - all answers should show up
      and regrade should not be performed on the question

Change-Id: I50f15a0f1485bb6e152a90d9bb9eefcffe1bd2e1
Reviewed-on: https://gerrit.instructure.com/32469
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Stanley Stuart <stanley@instructure.com>
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
2014-04-08 19:28:19 +00:00
Braden Anderson 5a278feede new conversations: fix faculty journal option
fixes CNVS-10878

test plan:
  * enable faculty journal
  * open new conversations
  * compose a message
  * add one recpient
  * verify that new conversations has the same behavior as
      old conversations in showing and hiding the faculty
      journal checkbox when composing a message
  * verify that the message is added to the faculty journal
      if the checkbox is checked

Change-Id: Ifcb868021dcc96f368cf069e626e7a0a8a90561d
Reviewed-on: https://gerrit.instructure.com/32826
QA-Review: Braden Anderson <banderson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Willesen <jonw@instructure.com>
Product-Review: Braden Anderson <banderson@instructure.com>
2014-04-07 18:49:17 +00:00
Jacob Fugal f36bfb546d default to root account's time zone
if performing a course copy/import and options[:time_zone] isn't
provided, use the default_time_zone on the root account (not the sub
account). sub accounts aren't currently expected to have their own
default time zones (but the database allowed it, and the code didn't
automatically look to the root account)

refs CNVS-9312

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

Change-Id: I6096490b7d125263421a48c552c32ed0b215f31d
Reviewed-on: https://gerrit.instructure.com/32788
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
2014-04-07 17:33:50 +00:00
James Williams 174435e685 don't use query cache for course active tab configuration
test plan:
* using rails 3, create a course
* add content through one of the initially inactive
(greyed out) tabs (e.g. Announcements, Files, etc)
* after content is added, confirm that the section is
no longer greyed out and is visible to students

fixes #CNVS-12176

Change-Id: Ideac44872f133e6f18dbf1dd9cbb41de3dfbfd1c
Reviewed-on: https://gerrit.instructure.com/32936
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2014-04-07 15:53:27 +00:00
Cody Cutrer f3f5eeb911 Merge pull request #431 from sfu/fix-alerts_spillover
Fix bug that causes alerts to affect other courses
2014-04-07 09:01:13 -06:00
Cameron Matheson 3e3d484b79 enforce no changing group_category on assignments after submissions
refs CNVS-11813

Test plan:
  * create an assignment
  * assign a group category to it (this should work)
  * remove the group category (this should work)
  * submit some homework
  * use the API to try and change the group category.  it won't let you

Change-Id: I09a56e281956d30e9213d6105bd9c75ede97da1c
Reviewed-on: https://gerrit.instructure.com/32719
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
2014-04-04 23:36:31 +00:00
Anthus Williams c0bde16e77 export account using open_data_export
open_data_export adds an option called exportable
to AR associations. If set to a truthy value, that
association is included in exports. This commit sets
this value (inside a CANVAS_RAILS2 guard) for
associations we want open_data_export to include

Change-Id: Idf8163f3139aafbf34e4e78b94dea6be87bd1cd2
Reviewed-on: https://gerrit.instructure.com/30308
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-04-04 22:41:04 +00:00
Braden Anderson 34c2f55089 rails3: fix message email html
fixes CNVS-12213

test plan:
  * launch Rails 3
  * trigger a notification email
  * view it in /messages
  * verify that it looks the same as Rails 2 emails

Change-Id: I86526453c92e489f5f18002c3fe4adb55ddacf56
Reviewed-on: https://gerrit.instructure.com/32888
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Braden Anderson <banderson@instructure.com>
2014-04-04 22:25:48 +00:00
Josh Simpson 438d9cdd0f fix cronbach's alpha on quiz stats
fixes CNVS-11518
On quizzes with larger groups of participants, the alpha
generated by QuizStatistics has been reported as being
off by quite a bit.  This was because of a faulty
float value that was used to determine the 'middle' range.

Test plan
- Not easily testable by QA.

Change-Id: I0a9d925b2770eb224de6bbbf43bd2453177e4377
Reviewed-on: https://gerrit.instructure.com/31124
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Josh Simpson <jsimpson@instructure.com>
Product-Review: Josh Simpson <jsimpson@instructure.com>
2014-04-04 21:13:56 +00:00
Jeremy Stanley 10566575a0 enrollments API requires pseudonym on course's root account
in order to enroll a user in a course via the API, the user
being enrolled must have an active pseudonym that works
with the course's root account.

test plan:
 - an account administrator or site administrator should
   receive a user-not-found (status 404) error when trying
   to use the API to enroll a user in a course where the user
   does not have a login in the course's root account (i.e.,
   the user "belongs to a different institution"),
   AND the course's root account is _not_ the default account
   (since the default account trusts everybody; this allows
   anyone to enroll in FFT courses)
 - you should be able to create an Observer via the course's
   people page and link that observer to students in the course
   before creating a login for the observer.

fixes CNVS-12020

Change-Id: Ib058d9b78830347e6fadfdc86bf4325aa557c325
Reviewed-on: https://gerrit.instructure.com/32374
Reviewed-by: Brian Palmer <brianp@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2014-04-04 20:27:19 +00:00
Nick Cloward 4748aba483 extract canvas sort gem
fixes: CNVS-11890

Test Plan:

Canvas Should not be broken, test requests that use the SortLast and SortFirst
class.  One is account settings.  Make sure its sorted correctly.  Another is
submissions_controller show method and make sure the visible rubric assesments
are sorted correctly.

Change-Id: I75a61475a928e069d6566fcc51305a6c442ec5a0
Reviewed-on: https://gerrit.instructure.com/32014
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
2014-04-04 14:53:09 +00:00
Andrew Leung 0cf0d1bb3e Fix bug that causes alerts to affect other courses
Previously, alerts_cache is modified when evaluate_for_course is called.
If the course being evaluated has alerts, they will be incorrectly added
to alerts_cache for that course's account. All subsequent courses in the
same account will see them as account alerts when evaluated, even though
they were only meant for that one course.

Test Plan:
  * Create two courses in the same account
  * Set up an alert in the first course
  * Create the circumstances that meet the criterion in both courses
  * Confirm that the alert is only triggered in the first course
2014-04-03 17:50:02 -07:00
Cody Cutrer 7d16d22369 fix unique constraint violation when re-enrolling user in a section
Change-Id: I3fa5924672c035c068b053d2d00fe24fa3818db4
Reviewed-on: https://gerrit.instructure.com/32707
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-04-03 13:25:26 +00:00
Stanley Stuart 30a84a11f8 fix quiz regrading to not change question names
Test Plan:
  - Before checking out this commit, take a quiz as a student.
  - Check out this commit and go to the quiz show page where you can see
    quiz results.
  - You should see "Question 1" instead of the question title for the
    question as the student.
  - As the teacher, you should see the question title instead of
    "Question 1" when editing the quiz.
  - Question names should show up as "Question 1" etc when previewing
    the quiz as the teacher.

fixes CNVS-11547

Change-Id: I57937c9943cabc7ba27a97ed828df6d410a38ba1
Reviewed-on: https://gerrit.instructure.com/32774
QA-Review: Myller de Araujo <myller@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
2014-04-03 01:47:29 +00:00
Braden Anderson a4d56a3bd0 discussions: add "move to" option
fixes CNVS-9044; fixes CNVS-12110

test plan:

  * open discussions as a user with moderation permissions
  * click the gear menu on a pinned discussion topic
  * click the "Move To" option
  * select a new position for the discussion topic
  * verify that the discussion topic is moved
  * refresh the page
  * verify that the change persists

Change-Id: If118e41066d224dbb3153113c67372ecdd2b3007
Reviewed-on: https://gerrit.instructure.com/32423
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Willesen <jonw@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Braden Anderson <banderson@instructure.com>
2014-04-02 22:50:40 +00:00
Mark Severson 73f552ecd8 module progression cleanup
test plan:
 * automated tests pass

Change-Id: I03dab9e13968c49387a2956c1c827d12792883f2
Reviewed-on: https://gerrit.instructure.com/31255
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Mark Severson <markse@instructure.com>
QA-Review: Mark Severson <markse@instructure.com>
2014-04-02 21:36:31 +00:00
Joseph Rodriguez 8d7622206f extract storage type responsibility out of Attachment
fixes CNVS-12045

test plan:
  - with local file storage
    * upload attachment to course and submit file
    * download attachment
  - with s3 file storage
    * upload attachment to course and submit file
    * download attachment

Change-Id: I9e3fd20a6659e53a37dae04137e2b39b0e3c3ea8
Reviewed-on: https://gerrit.instructure.com/32433
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
2014-04-02 20:56:21 +00:00
Joseph Rodriguez ccd8b38d6a Extract canvas_http into seperate gem.
Change-Id: Ib90c12b99d30853a0a1a0235c9aa1b5dd645f614
fixes: CNVS-11949
Reviewed-on: https://gerrit.instructure.com/32176
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
Reviewed-by: Stanley Stuart <stanley@instructure.com>
QA-Review: August Thornton <august@instructure.com>
2014-04-02 17:22:38 +00:00
Dave Donahue 0fa0a3dce5 course progress API fixes (CNVS-12156, CNVS-12157)
Fixes CNVS-12156

Problem:
  Removing a module item (ContentTag) should update the completion
  requirements on its ContextModule. This is not directly related
  to the course progress API, but rather a separate bug deeper
  in the code that is affecting the API response.

Test plan:
  1. Add an assignment to a module, and set completion requirements
     on the module.
  2. Assert that the completion requirements are set:
       ContextModule.find_by_name('Module name').completion_requirements
  3. Remove the assignment from the module through the UI.
  4. Assert that the completion requirements no longer reference the
     old assignment:
       ContextModule.find_by_name('Module name').completion_requirements

Fixes CNVS-12157

Problem:
  Obsolete completion requirements were tripping up the progress API
  response. For instance, turning in an assignment that used to be a
  requirement but no longer is would have an impact on the
  requirement_completed_count, sometimes causing it to be larger
  than requirement_count, leading to completion percentages greater
  than 100.

Test plan:
  1. As a student, complete a required assignment on a module.
  2. Using your favorite LTI tool that uses the progress API (e.g. Catalog),
     check the course completion percentage.
  3. As an admin, remove the completion requirement for that assignment.
  4. Check the course completion percentage again and verify that it has
     decreased.

Change-Id: I80a932657eada20717ca2e0df7b57a005a5b276a
Reviewed-on: https://gerrit.instructure.com/32698
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
2014-04-02 17:00:58 +00:00
Jeremy Stanley c084a65edf don't return localized enrollment type in courses api
test plan:
 - have a user whose language is something other than english
 - enroll that user in a course
 - use the courses API as that user
 - the returned enrollment types should be "teacher", "student", etc.
   and not a localized enrollment type
 - consult enrollment api docs: the "type" and "role" fields
   should not have an identical description

fixes CNVS-12065

Change-Id: I572ecd0d9bdadb0da00fe3d8b7359645ad59e183
Reviewed-on: https://gerrit.instructure.com/32550
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
2014-04-02 16:33:43 +00:00
Joel Hough cbe3625355 AppointmentGroup.context returns first AppointmentGroupContext.context
accessor was hiding a method. looks like we want to use the method
because of multi-context appointment groups

test plan
- from the console, ensure that a new appointment group returns
 non-nil from .context

Change-Id: I36ef6bc073b4e1d0bcf02277b1e4fdec43630382
Reviewed-on: https://gerrit.instructure.com/32254
Reviewed-by: Braden Anderson <banderson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
2014-04-01 16:39:05 +00:00
Cameron Matheson b88ee6583b respect "leave different" option on rubric association
fixes CNVS-11195

Test plan:
  * make an assignment with 10 points possible
  * add a rubric with 20 points possible
  * choose "leave different"
  * refresh the page
  * the assignment should still have 10 points possible

Change-Id: I0e606a946ab0c67de5878eddf949f30ad09af677
Reviewed-on: https://gerrit.instructure.com/32486
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>
2014-04-01 04:08:59 +00:00
Cameron Matheson 29e5a772a8 Crocodoc: handle nil response from upload
Test plan:
  submit a Crocodocable assignment.  it should upload successfully (if
  Crocodoc cooperates)

Change-Id: I16f99526bb4a32467a584cc2ab6b6b824e13b358
Reviewed-on: https://gerrit.instructure.com/32523
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>
2014-03-31 19:59:16 +00:00
Raphael Weiner 5704e9247d Remove duplicate code for finding uniq array elements.
Change-Id: Ib574f903a52b27d0075029f2afb7845c58d61dba
fixes: CNVS-11932
Reviewed-on: https://gerrit.instructure.com/32153
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
2014-03-31 16:21:35 +00:00
Brandon Broschinsky 9876ed921f api to create grading standard
refs: PS-923, PS-924

**test plan
1. create account and course level grading
standards via api, see docs for example
2. associate course and account level
grading scheme to course via course
update api, see docs
3. associate course and account level grading
scheme to assignment via assignment update api,
see docs

Change-Id: Ib4d7606e23115376f111f3aabbbd8c51e102fe1b
Reviewed-on: https://gerrit.instructure.com/30601
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Adam Phillipps <adam@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2014-03-31 15:45:42 +00:00
Rob Orton 443b55d589 don't allow students to have view reports permission
fixes CNVS-12085

test plan
 - before updating set the "View usage reports
   for the course" permission to enabled
 - /accounts/84968/permissions
 - should not be able to enable "View usage reports
   for the course" permission for students

Change-Id: I60e817641436230564b0a50a8a7d46e29cb355a6
Reviewed-on: https://gerrit.instructure.com/32509
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Nick Cloward <ncloward@instructure.com>
QA-Review: August Thornton <august@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2014-03-30 00:54:45 +00:00
Josh Simpson ca4c95ae53 fix quiz grading when a quiz with a time limit is exited prematurely
fixes CNVS-12074
If a student takes a quiz with a time limit, and quits the quiz
without explicitly submitting it, the quiz will get stuck in a state
where it won't be automatically graded. This commit fixes the #needs_grading?
method on QuizSubmission to prevent this.

Test plan
- As a teacher, create a quiz with a time limit
- As a student, take the quiz, but close the browser before the quiz
  auto submits.
- As the teacher, navigate to the moderate page, and click on the
   student's submission
- The student's submission should show up and be graded.

Change-Id: I161937365f01d0f87e2cb56c8579c060337a8dd9
Reviewed-on: https://gerrit.instructure.com/32538
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Josh Simpson <jsimpson@instructure.com>
2014-03-28 21:16:00 +00:00
Braden Anderson 4f52a5e4c3 outcome gradebook: add export link
fixes CNVS-10638

test plan:
  * open outcome gradebook
  * select a section
  * click on "export report"
  * download and open the export
  * verify that the export format matches the Jira documentation
  * verify that the export data matches the data from your browser

Change-Id: I35bd78719880026b71b30da5794c9afe7dd31868
Reviewed-on: https://gerrit.instructure.com/31774
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Reviewed-by: Jon Willesen <jonw@instructure.com>
Product-Review: Braden Anderson <banderson@instructure.com>
2014-03-28 20:37:03 +00:00
Jason Madsen a290dba8ae quiz namespace translation fix
fix namespace issue for quizzes/quiz.
will now have new keys, and need new translations, but this will fix
generated YAML file

closes CNVS-12006, CNVS-12089

Change-Id: I895978b38a22b21a3d2a1c503ed7c1c174e449a6
Reviewed-on: https://gerrit.instructure.com/32524
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Jason Madsen <jmadsen@instructure.com>
2014-03-28 19:55:32 +00:00
Derek DeVries 33d5f7b7c8 disable auto-submissions of quizzes in background until we can do more
regression testing with due dates and lock dates

fixes CNVS-12048

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: Ib91286466dc83aa2ad66d7206449a0956d8c0fe8
Reviewed-on: https://gerrit.instructure.com/32430
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
2014-03-27 00:11:15 +00:00
Derek DeVries 3261328010 fix issue where speedgrader sidebar doesn't load in quiz submission attempts
fixes CNVS-11994

test plan:

the problem on this one comes up when we are trying to view submission versions
that were created before the namespace change. So we have to massage the data in
the console to reproduce what's going on here, or test it with data that was
created before the namespace changes.

- as a teacher
  - create a quiz that allows multiple attempts

- as a student
  - take the quiz two times

- in the console
  Version.update_all("versionable_type='QuizSubmission'", "versionable_type='Quizzes::QuizSubmission'")

- as a teacher
  - visit speedgrader for the student's submission
  - you should be able to switch between quiz attempts in the sidebar

Change-Id: I6e16abd91dcaa8d42bf66bcbacab0cce6eaed9e6
Reviewed-on: https://gerrit.instructure.com/32383
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
2014-03-26 20:26:52 +00:00
Brad Humphrey ce66769b69 implement lti outbound adapter
also, refactor lti outbound adapter parameters and
convert integration tests to use lit outbound adapter

test plan
 - Ensure that LTI launch parameters are the same before and after this change.
 - Test all of the different kinds of launches for differences

Change-Id: I749e7f7b887eaac87dd104f195b526b18040a2b9
Reviewed-on: https://gerrit.instructure.com/30087
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
2014-03-26 16:49:22 +00:00
Raphael Weiner 66e4ee8e66 create utf8_cleaner gem
test plan:
  * run specs

Change-Id: Ic2a76e3c6290c06f68f06796babbdc5ff3b405d9
Reviewed-on: https://gerrit.instructure.com/29733
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-03-25 21:56:33 +00:00
Nick Cloward 10aa2d8131 add the current user to sis imports
fixes: CNVS-11546

Adds a user relation to sis batches so we can relate a sis batch job back to the
user who initiated it.

Test Plan:
  - Initiate SIS Imports.
  - The associated sis batch records user_id column should have the correct value.

  * SIS Imports should not be broken.

Change-Id: Ic5d0807af4d945a150a0268776e51c6db96b29c6
Reviewed-on: https://gerrit.instructure.com/31172
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Nick Cloward <ncloward@instructure.com>
2014-03-25 21:38:37 +00:00
Cody Cutrer 17635638f5 don't use AR objects as hash keys
Change-Id: If81761036a28ab16a37bbc287dbf6363b5fbd483
Reviewed-on: https://gerrit.instructure.com/32329
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-03-25 19:40:34 +00:00
Derek DeVries d85c1006b4 fix namespace issue with attachment relationship on quiz submissions
fixes CNVS-11986, CNVS-11672

test plan:

the problem on this one comes up when we are trying to view an attachment that
was created before the namespace change. So we have to massage the data in the
console to reproduce what's going on here, or test it with data that was created
before the namespace changes.

- as a teacher
  - create a quiz with a file upload question type

- as a student
  - take the quiz and upload the file

- in the console
  Attachment.update_all("context_type='QuizSubmission'", "context_type='Quizzes::QuizSubmission'")

- as a teacher
  - visit the moderate page for this student's quiz, and the attachment link
    should be visible to download the file.

Change-Id: I329bb422770e0d22fa33be189c0229298c12f759
Reviewed-on: https://gerrit.instructure.com/32319
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Clare Strong <clare@instructure.com>
2014-03-25 02:34:32 +00:00
Rob Orton 1326ba7053 only delete scribd_docs from self
don't delete scribd_docs when attachments are destroyed

fixes CNVS-11923

test plan
 - have attachment with scribd_doc  that has
   root_attachment with scribd_doc
 - call delete_scribd_doc on child
 - parent scribd_doc should be un-touched

Change-Id: I1cbac580e40c6b8f5c2a8612f5390dfae681d9c4
Reviewed-on: https://gerrit.instructure.com/32123
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2014-03-24 22:02:40 +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
Michael Ziwisky 311738d5b3 add dashboard_url setting to root accounts
fixes CAT-13

test plan:
- in rails console (for canvas):
-- a = Account.default
-- a.settings[:dashboard_url] = 'http://www.hackaday.com'
-- a.save
- visit canvas root url
-- if already logged in, you'll be redirected to hackaday.com
-- else, log in, then you'll be redirected to hackaday.com

Change-Id: Ib6e48ae9c3be3761810f0e859b441dcc2edd1f23
Reviewed-on: https://gerrit.instructure.com/32011
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeff Belser <jbelser@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
2014-03-24 16:22:22 +00:00
Nick Cloward 7dd31931a7 submission missing for submission types and scores of zero
refs: CNVS-10301

This is the canvas-lms part of the fix for the ticket.  This adds logic to
the submission model missing? method to take into consideration whether the
assignment expects a submission or not and has been graded with a grade of zero.

Change-Id: I043dab161e1765268e34464ec49fd0276b16acbb
Reviewed-on: https://gerrit.instructure.com/29186
Reviewed-by: Nick Cloward <ncloward@instructure.com>
Product-Review: Nick Cloward <ncloward@instructure.com>
QA-Review: Nick Cloward <ncloward@instructure.com>
Tested-by: Nick Cloward <ncloward@instructure.com>
2014-03-21 22:25:12 +00:00
Simon Williams 98f1648c3d fix url for undeleting quizzes
also fix undeleting practice quizzes

fixes CNVS-11955

test plan:
- in a course, delete a quiz
- go to /courses/:id/undelete
- click the button to undelete the quiz
- it should work

- quick regression on undeleting quizzes/discussion_topics both linked and not
  linked to assignments

Change-Id: I88d30d1baa5685e6c4f16280c9aa34c8965b31fe
Reviewed-on: https://gerrit.instructure.com/32217
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-03-21 21:53:08 +00:00
Liz Abinante f7ed5fdbe4 allow undelete-ing with draft state enabled
fixes CNVS-11856

test plan
- in a course with draft state enabled
- delete an assignment with submissions
- navigate to /course/:id/undelete
- restore the deleted item
- refresh page; verify item is not listed
- navigate to assignments index; verify item is not listed
- repeat for assignment without submissions

Change-Id: I4e1cf09ad8172de30aea137e69c8c9ed6770041e
Reviewed-on: https://gerrit.instructure.com/32202
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Liz Abinante <labinante@instructure.com>
2014-03-21 21:43:54 +00:00
Rob Orton 9418d9d0fb split grade calculations into groups of 1000
also only send user_ids one time per course
and don't run if there are no user_ids

test plan
 - specs should pass

Change-Id: I168758ff00413380b1bf1b2729488a7f95a4a9b1
Reviewed-on: https://gerrit.instructure.com/31985
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2014-03-21 20:12:15 +00:00
Jeremy Stanley ffc9402ec8 fix WikiPage#locked_for? to handle sequential modules
test plan:
 - have a course with draft state enabled
 - have a module requiring sequential completion
 - put a wiki page in the module after an item with a requirement
 - as a student that has not completed this requirement,
   attempt to access the page via All Pages
   - should get a message indicating the page is locked

fixes CNVS-11842

Change-Id: Id91cde3677a7c0b6bdcdfb89d565e72f347c3d13
Reviewed-on: https://gerrit.instructure.com/32028
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mark Severson <markse@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2014-03-19 20:37:18 +00:00
Bracken Mosbacker 2b5fdf080d module headers should be created unpublished with draft state
Test Plan:
 * With draft state on add a module header item to a module
 * it should be unpublished

closes CNVS-11839

Change-Id: Ia36326b63bbbf980534cb4d163c648016ddb41fe
Reviewed-on: https://gerrit.instructure.com/32047
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
2014-03-19 15:57:46 +00:00
Jeremy Stanley 8e433b1731 log kaltura bulk API error instead of failing import
refs CNVS-11602

Change-Id: I0a5a26a455d08361b69e12f6e6bd552b9a149dfe
Reviewed-on: https://gerrit.instructure.com/31352
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Bracken Mosbacker <bracken@instructure.com>
2014-03-17 21:45:46 +00:00
Nick Cloward 0216ac2018 extract canvas statsd gem
fixes: CNVS-11605

Change-Id: I44d708d77014d6c4d0f8d0b2f7bcedcdeb307829
Reviewed-on: https://gerrit.instructure.com/31261
QA-Review: August Thornton <august@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Nick Cloward <ncloward@instructure.com>
Product-Review: Nick Cloward <ncloward@instructure.com>
2014-03-14 15:03:23 +00:00
Anthus Williams 2955ee76b8 account notifications by role bugfix
specs were not catching the case where the
notification was created by site admin intended for
account roles on other accounts; as a result, a
NoMethodError slipped through. This commit fixes
the error and adds specs for this case

Change-Id: Ie3b3659aacae277a30a6e59ee0e0833504c0cd67
Reviewed-on: https://gerrit.instructure.com/31840
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Anthus Williams <awilliams@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Anthus Williams <awilliams@instructure.com>
2014-03-13 19:41:58 +00:00
Braden Anderson 1e15193e00 faculty journal: don't title every private message "Today"
fixes CNVS-11579

test plan:
  * enable faculty journal
  * open old conversations
  * compose a private message to a student
  * check "Add as a Faculty Journal entry"
  * send the message
  * open the student's faculty journal
  * verify that the journal entry is not titled with "Today"

Change-Id: If7ee55a4c6f9839b5828157a57554d74155db3ca
Reviewed-on: https://gerrit.instructure.com/31804
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Joel Hough <joel@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Braden Anderson <banderson@instructure.com>
2014-03-12 23:10:23 +00:00