Commit Graph

1140 Commits

Author SHA1 Message Date
Bracken Mosbacker 264a14ef19 copy rubrics associated with assignment even when not selected
Previously rubrics used by an assignment wouldn't copy unless
the rubric was selected. This makes it so that an assignment
will always bring its rubric when copied.

This also copies the two rubric properties you can select
when adding a rubric to an assignment.

Test Plan:
 * Create an assignment with a rubric. Mark the rubric to be used for grading
 * Copy the course and don't select the rubric to be copied
 * In the new course the rubric should be there, and should be used for grading

closes #8474 #8475

Change-Id: I3c117c10c159fed2d8a3d6c083f8251e8a97bee6
Reviewed-on: https://gerrit.instructure.com/10606
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
2012-05-09 10:31:06 -06:00
Bracken Mosbacker 65db1c051d copy attachments referenced in html content when copying course
This only gets files linked to in html content, files referenced
by context modules will come in a different commit

Test Plan:
 * Upload some files to a course
 * reference those files from various html content in the course like wiki pages, assignment descriptions, syllabus body, etc.
 * Copy the course, but do a selective copy and don't select any attachments to copy
 * When the copy is finished the new course should have the referenced files and the html content should appear correctly

closes #8410

Change-Id: If81979b850ef71d06a56b88561e2991fd864e66f
Reviewed-on: https://gerrit.instructure.com/10577
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
2012-05-09 10:31:02 -06:00
Mark Ericksen 4d5b72f064 Link new RubricAssociation to existing assessment_requests Fixes #7837
The "Show Rubric" link on the Peer Review page did not display
if the Rubric was created AFTER the peer-review assignments
were already made. This change makes a RubricAssociation
link itself to the AssessmentRequest that was already created.

Test Plan: (Taken from case #7837 steps to reproduce)
* As the Teacher, create an Assignment that will use Peer Reviews
* Before creating a Rubric or assigning Peer Reviews, submit the assignments as the Students
* As the Teacher, assign students to peer review and THEN create a Rubric that will be used for grading
* As the Student(s), go to the assignment, click on the student's name to which a peer review has been assigned, and you should now be able to locate the "Show Rubric" link to display it.

Change-Id: Idd66204b1f53b665a7f64ec6a90af8ce4457e9b7
Reviewed-on: https://gerrit.instructure.com/10500
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Joe Tanner <joe@instructure.com>
2012-05-08 16:45:34 -06:00
Jon Jensen 994bfeb6c1 fix ungraded counts, fixes #7774
fixes two issue with the ungraded count logic:

1. the submission triggers updated the count regardless of the enrollment
   status (or existence). teachers or people not even in the course could
   cause the count to change (e.g. by taking/previewing a quiz)
2. the enrollment triggers did not factor in the enrollment type. so
   teachers/tas (un)enrolling in the course would cause the count to
   change if they had any submissions (e.g. from a quiz)

test plan:
1. create a quiz with essay questions (so that submissions will need to be
   graded)
2. enroll a student in multiple sections in the course
3. take the quiz as the student
4. take the quiz as the teacher
5. take the quiz as an admin not in the course
6. confirm the ungraded count is just 1
7. unenroll the teacher
8. confirm the ungraded count is still 1
9. unenroll the student
10. confirm the ungraded count is now 0

Change-Id: I11dbf3915d79f9820267469fad8949abfa008e14
Reviewed-on: https://gerrit.instructure.com/10451
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Joe Tanner <joe@instructure.com>
2012-05-08 16:26:05 -06:00
Cody Cutrer b92c17f11d don't infer the current user for nil DiscussionTopic#user in the stream
fixes #8403

test plan:
 * import an external content package with discussion topics
 * make sure to find a discussion topic that has no author
 * on the dashboard of a user that has a stream item about that topic
   it should not show that the current user is the author

Change-Id: I681be31462a82591d60665dce967aa1548ef3a07
Reviewed-on: https://gerrit.instructure.com/10579
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
2012-05-08 12:55:24 -06:00
Cody Cutrer 8beb4e0fd4 only perform batch sis removal for the types of data that were supplied
fixes #8310

test plan:
 * load some sis data for terms/courses/sections/enrollments into an
   account
 * do a batch mode import of an enrollments.csv with just the headers,
   no data
 * all enrollments should be deleted, but courses and sections should
   be left alone

Change-Id: I05beb577bfb4573e97f8b398aeb4bfff5df78a4f
Reviewed-on: https://gerrit.instructure.com/10265
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2012-05-08 09:46:49 -06:00
Bracken Mosbacker 38ab6c39ce correctly prepare quiz questions when copying course
some quiz questions weren't being processed for import
correctly because they were pointing to an AQ and
expected to get the AQ question data

Test Plan:
 * Create some quizzes with images in the questions
 * Copy the course
 * The new course should have the images in the quiz questions

closes #8476

Change-Id: Ieaaef88f9551afa79aa8daab8b784ce388857f48
Reviewed-on: https://gerrit.instructure.com/10591
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-05-08 09:10:41 -06:00
Bracken Mosbacker 873f374da4 check for existing deleted attachments when cloning
Don't create a new attachment if there is one already that
is just deleted

Test Plan:
 * Run specs

Change-Id: I0ba43bb181d15bf56a7b0fd66affb8a60b11abd1
Reviewed-on: https://gerrit.instructure.com/10585
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2012-05-08 08:53:58 -06:00
Bracken Mosbacker ce12af199d undelete course objects on course copy
If you copied content into your course, then deleted an item
and copied it again it wouldn't be active. It is now.

Test Plan:
 * Create an assignment
 * Copy the course and delete the assignment in the new course
 * Copy the original course into the new one again
 * The assignment should be active

closes #8298

Change-Id: Ief8476d2befff999ed85a35039604d34253bfa1f
Reviewed-on: https://gerrit.instructure.com/10487
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2012-05-07 09:24:14 -06:00
Mark Ericksen 7f6b72fe49 Minor fixes to StudentEnrollment associations.
Association "student" was explicitly linking to class "Student" that doesn't exist.
Underlying table was linked to users table so changed that to be consistent.

Change-Id: Iac6bb8a9b43c41bfbac949ca82a2b02327b215b2
Reviewed-on: https://gerrit.instructure.com/10434
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Joe Tanner <joe@instructure.com>
2012-05-04 16:46:43 -06:00
Bracken Mosbacker bbeb0a097a allow frozen assignments to be copied by any user
Copying a frozen assignment would fail if the user doing
the copying didn't have frozen assignment editing priveleges.

Test Plan:
 * Enable assignment freezing plugin
 * As a non-admin teacher create a course that has a frozen assignment
 * Copy that course
 * The course copy should succeed

Change-Id: I1775141701647cf2a2791a027e7c1312c59c6997
Reviewed-on: https://gerrit.instructure.com/10550
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-05-04 10:59:32 -06:00
Cameron Matheson d8bd6bba6c make canvas Y3K-compliant
Actually this is mostly helpful for making assignment-sorting work on
32-bit ruby builds

Change-Id: Iae699882d6005a7012cd8a10c0b3bc3042280329
Reviewed-on: https://gerrit.instructure.com/10539
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-05-03 17:31:04 -06:00
Ryan Shaw 4725d3a81b don't allow students to edit graded discussions, fixes: #7289
test plan:
* make a discussion topic that is a graded group assignment
* make a reply as the teacher
* view it as a student, verify that you cannot edit the
  teacher's entry.

Change-Id: I2af43dfda854d85b86f7dda0aa652c6c62b1292b
Reviewed-on: https://gerrit.instructure.com/10501
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-05-03 13:59:57 -06:00
Simon Williams 0a3008e9d6 force content migration emails to send immediately; fixes #8318
content migration notifications used to be in a category that forced them to be
sent immediately, but they inadvertently got moved to a category without that
enforcement. now they have their own category that forces sending again.

test plan:
- set your 'For Administrative Alerts' to something other than 'immediately'
- do a content import or export (not course copy)
- you should get an email as soon as the migration succeeds or fails (not in
  a summary at the end of the day/week).

Change-Id: Ifb0eddf586f3e0defc11f6159f48625e7493ccf8
Reviewed-on: https://gerrit.instructure.com/10385
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2012-05-03 10:35:49 -06:00
Simon Williams f1e441b0dc use latest complete version for quiz statistics; fixes #8106
when there are multiple quiz submission attempts and the latest one is in
progress, we want to use the lastest complete one for quiz statistics when
we're only considering the most recent submission.

test plan:
- create a quiz that allows multiple attempts
- as a student, complete the quiz, then start it again and leave the page
- as a teacher, view the quiz statistics. you should see statistics for the
  complete attempt by the student
- try with multiple students and multiple completed quiz submissions as well
  and make sure that when switching to statistics for all submission versions,
  the counts do not include any in-progress submissions

Change-Id: I7e32e65e3ee483fcf0b958402cf79fcbc897e880
Reviewed-on: https://gerrit.instructure.com/10429
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
2012-05-03 09:21:42 -06:00
Jon Jensen 0510d801b7 create media object if it doesn't exist, fixes #8420
when adding a media comment with a conversation message, don't require the
media object to exist beforehand. this is important since there is no
(published) media object endpoint, so mobile apps (and other api users)
need to set the media comment info after uploading to kaltura. this brings
conversations in line with how we do things elsewhere.

test plan:
1. create a conversation message against the api, setting a media comment
   that doesn't already have a media_object
2. it should work, and the media_object should get created

Change-Id: Ibf1b1e417e85288c19614af66a9960b738dc8813
Reviewed-on: https://gerrit.instructure.com/10488
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
2012-05-02 21:29:59 -06:00
Bracken Mosbacker 9ab9082874 don't copy course setting if not selected
Test Plan:
 * Set the syllabus body, navigation settings and default view for a course
 * copy the course without selecting the course settings option
 * those items should not be copied into the new course

closes #8391

Change-Id: Idd0efe85273d23881a3f3bfd0e04eb226d505a08
Reviewed-on: https://gerrit.instructure.com/10433
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2012-05-02 09:31:00 -06:00
Bracken Mosbacker c5908d4f10 correctly copy dates across daylight savings shifts
Test Plan:
 * Create an assignment before a daylight savings shift, like Jan 5 12pm
 * Copy the course and shift the dates so they go past the shift, like Jun 5
 * The copied date should be at the same time of day as the original

closes #8312

Change-Id: Ic5f974c399b050b7cf841d663fa881a77f309b1c
Reviewed-on: https://gerrit.instructure.com/10460
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
2012-05-02 09:05:43 -06:00
Jeremy Stanley 69aefd22a2 don't rename assignment to match subtopic; fixes #7357
test plan:
 * create a discussion assignment
 * edit the assignment, changing its name and making it
   a group assignment
 * ensure, after saving the assignment, that its name is not
   appended with a group name

Change-Id: I87806eba91888680c153c551a21d3829b3fe26e8
Reviewed-on: https://gerrit.instructure.com/10388
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2012-05-01 16:06:15 -06:00
Joe Tanner e34ae57047 Show term info when you show course name, fixes #6837
affected pages:
- courses in this account /accounts/:id
- account users /accounts/:id/users/:id
- course home page /courses/:id

test plan:
- ensure there is a course with a term other than the default term
- look at the affected pages to verify that the term name is visible

Change-Id: I681bd20545a462643564899511adab0b8b71d3db
Reviewed-on: https://gerrit.instructure.com/9852
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
2012-05-01 13:04:49 -06:00
Cody Cutrer 05fa8d8adf don't allow date-inactive teachers to get read-only access to courses
fixes #8389

test plan:
 * create a course
 * invite and accept a teacher (or create and add a teacher via SIS)
 * change the dates for the term the course is in to the future
 * the teacher should not be able to get read-only access to the course

Change-Id: I0474e6d5a46fd3b95a319281d18f9115371c8d75
Reviewed-on: https://gerrit.instructure.com/10425
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
2012-05-01 12:58:35 -06:00
Cody Cutrer 2e888dfc67 infer attachment namespace on-demand
Change-Id: I7e3ca3ad6c05894a9489e96be33dadf8fa628c46
Reviewed-on: https://gerrit.instructure.com/10445
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-05-01 12:21:29 -06:00
Zach Wily 5868bd8b34 allow saml configurations to use the eppn
Schools want to be able to specify a saml attribute used for the user's login
instead of NameId. Usually that will be the EPPN (or the portion before the
@). This adds a Login Attribute settings to the SAML settings page, with
options for NameID (the default and historic behavior), the
eduPersonPrincipalName, and the eduPersonPrincipalName with the domain part
stripped.

test plan:
 * Set up Shibboleth... just kidding. Better to just look at the spec.
   Standing up your own shib instance is a ton of work.

Change-Id: I04e32022b940da4cb82ea5f9a59012eb48de2ab6
Reviewed-on: https://gerrit.instructure.com/10120
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Zach Wily <zach@instructure.com>
2012-04-30 16:26:09 -06:00
Simon Williams 51e4d08a14 improve quiz grading while new version in progress
fixes #8314
fixes #8315

fix the interplay between submission and quiz_submission when manually grading
a quiz_submission's questions or fudge points while another version of the
quiz_submission is currently in progress. we overcorrected slightly in the last
fix.

test plan:
- on a quiz that allows multiple submissions (try with both keep-highest and
  keep-latest settings)
- as a student, complete this quiz, then start taking it again and leave the
  page
- as a teacher, try grading it from the quiz history page or the speedgrader.
  change question points and fudge points. changes should save across reload
  and the score should be in the gradebook.
- also try changing the grade directly in gradebook. and check that the change
  is mirrored in the quiz history page
- as the student, finish the second attempt and start a third.
- repeat the above checks as the teacher, ensuring that the appropriate score
  (highest or latest) comes through in the gradebook.

Change-Id: Id5c0b60c9d0c5f56aae625c3192bd50f93d671b8
Reviewed-on: https://gerrit.instructure.com/10373
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2012-04-30 16:12:40 -06:00
Jake Sorce b1598d8039 don't display un-dated assignments first fixes #7859
also added sorting by assignment title after sorting
by due_at

test plan:

  1. create an assignment with a due date
  2. create an assignment don't give it a due date
  3. as a student go to /courses/[course.id]/assignments
  4. notice the undated assignments don't sort first
  5. notice assignments sort by first due

Change-Id: I57401c0a4c6c3faf60460ce6fd079c192da2e49b
Reviewed-on: https://gerrit.instructure.com/10387
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
2012-04-30 15:43:55 -06:00
Cameron Matheson a2a6579c10 multiple contexts per appointment group
closes #7561

Test plan:
  - create some appointment groups:
    - make one with multiple courses
    - make one with a course, and then add more courses after saving
    - make one restricted to some (not all) sections in a course [1]
    - make one that has students sign up in groups [1]
  - make sure that only students that match the above criteria are able
    to see/reserve those appointment groups

  [1] you can only choose the group-signup option or restrict
      appointment groups to certain sections on creation (these options
      won't be availabe when editing later)

Change-Id: I1cff5fb4ed233882c2061f8fd8a7ba6f2d4959b0
Reviewed-on: https://gerrit.instructure.com/9407
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
2012-04-30 15:30:03 -06:00
Bracken Mosbacker 81593a3680 don't fail content import with nil wiki page
Test Plan:
 * Run a WebCT migration, it shouldn't fail when importing

closes #8382

Change-Id: I47f2ad343d06568c4bac115e78434ba77607595c
Reviewed-on: https://gerrit.instructure.com/10413
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-04-30 15:22:39 -06:00
Bracken Mosbacker 649e9a2495 properley handle query string params on translate links
If there were existing query string parameters when
translating link on an Assessment Question the resultant
string would have two '?' instead of separating them with '&'

Test Plan:
 * Create an assessment question and have the description point to an image in the course by selecting one in the wiki sidebar
 * Before you save the question, add something like "?wrap=1" to the end of the img src
 * Save the question
 * Looking at the source of the question text after save should show that the wrap has a '&' before instead of a '?'

refs #8365

Change-Id: I5e5bb6499013b43a4fd3b2144dc9d8f9536ad174
Reviewed-on: https://gerrit.instructure.com/10411
Tested-by: Brian Palmer <brianp@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2012-04-30 14:29:04 -06:00
Jon Jensen 7285a705b4 fix incorrect conversation tags, fixes #8274
this is similar to #7231, though the root cause is a little different.
users with duplicate concluded enrollments (e.g. two sections in a course)
may have had improperly tagged private conversations. this was because we
weren't uniq'ing User#conversation_context_codes, so it naively assumed
that both users were in those concluded courses in Conversation#
current_context_strings

the data migration is just like the one we ran in #7231, but a little more
broad (in this case, the Conversation#tags are correct, but the
ConversationParticipant#tags are not). refactored migration code and specs
accordingly, and made it a little nicer on the db.

test plan:

1. enroll user A in two sections of course A (may only be possible via SIS
   or console)
2. conclude course A
3. enroll user A and user B in course B
4. start a private conversation between the users (doesn't matter who
   starts it), but be sure to find the recipient by searching, NOT by
   browsing the course
5. ensure that both users only see course B as the tag on the conversation

Change-Id: I3065b827433b33dbb7ff6a4d0d2affa73cc06e37
Reviewed-on: https://gerrit.instructure.com/10340
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
2012-04-30 14:16:35 -06:00
Brian Palmer f63d6a4ce1 don't fail the page view batch if one row fails
test plan: difficult to test manually. you could add two duplicate page
views to the queue and verify the second one doesn't kill the whole
transaction when it gets a dup key error.

Change-Id: Ic6f20f9a7ff7c844d1f3125323ce881d4f9293ad
Reviewed-on: https://gerrit.instructure.com/9257
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
2012-04-30 09:23:01 -06:00
Cameron Matheson 6416844817 allow assigning section-subsets to appointment group
closes #6832

Test plan:
  - in a separate branch (master), create a new appointment group and
    assign it a group category or section
  - switch to this branch and migrate; the appointment group should
    still be assigned to the group or section you chose earlier
  - create a new appointment group and assign it some course sections
  - verify that students in those sections can reserve appointments, but
    not students that do not belong to those sections

Change-Id: I1662374c5e6d2e5e9f7d6b54b0bc91420f150b7a
Reviewed-on: https://gerrit.instructure.com/8765
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
2012-04-27 16:59:40 -06:00
Simon Williams b0178fef6c add new 'external' avatar image type; closes #7763
support for a new type of avatar image, which is simply a url
pointing to an externally hosted image. the use case is that schools
who host there own repository of user images want to simply refer to
these image for canvas profile pictures.

test-plan:
this features is currently only available via the api, so try
setting your profile picture to an external URL via the api, and make
sure it shows up correctly. also try setting your avatar to something
that is larger than 50px and non-square (we're encouraging people to
use 50px square images, but not enforcing it).

Change-Id: I5a1de6159d6e5fd490dd59871e98d823d0177d7a
Reviewed-on: https://gerrit.instructure.com/9665
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-04-27 16:08:44 -06:00
Simon Williams 9cd67f277f user avatar api; refs #7763
this commit provides a new api endpoint that exposes the possible profile
pictures of a given user that can be set as her avatar. it also modifies the
existing user update api to allow the avatar image to be set. this permission
is given to the user herself and any account admin that has manage student
permissions

test-plan:
- make sure editing a user from the /users/x page and the /profile page still
  works.
- with the api, try querying the users profile pictures, and setting a new
  avatar.
- make sure to exercise different permissions:
  * look up and change your own avatar => should succeed
  * as an admin, look up and change a student's avatar => should succeed
  * as a student, try to change another student's avatar => should return 401

Change-Id: Idefe8549a92e109a248936970f9e3ef2bc414a59
Reviewed-on: https://gerrit.instructure.com/9645
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
2012-04-27 14:23:16 -06:00
Bracken Mosbacker c9025f3151 don't send import-related emails when copying course
Test Plan:
 * Copy a course
 * It shouldn't send you emails

closes #8231

Change-Id: Iade6a5ce46b5c8a846c272f790c4d61f3922fc87
Reviewed-on: https://gerrit.instructure.com/10360
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2012-04-27 12:57:44 -06:00
Bracken Mosbacker 98fe5ee5c0 enable assignment properties to be locked
this creates a "plugin" that allows an account to choose
assignment properties that can be locked when a course is
copied

Test Plan:
 * enable the plugin for an account
 * create an assignment and set it to be locked on copy
 * copy the course to another course
 * as an admin of the account you should still be able to edit the assignment
 * as a non-admin teacher of the course you should not be able to edit the frozen properties

refs #7931

Change-Id: I61d5dbfdf10f8f7519f8db06449b14ef5e7b8454
Reviewed-on: https://gerrit.instructure.com/10190
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2012-04-27 10:41:41 -06:00
Zach Pendleton 979d7757fc give students taking a quiz time extensions. fixes #8195
when a student is taking a timed quiz and the teacher or admin
increases the time limit, student now receives a message about
being given extra time and their countdown timer updates
accordingly.

test plan:
  * create a timed quiz;
  * as student, start the quiz;
  * as admin, edit the quiz and increase the time limit
  * as student, change a quiz answer (to force a backup);
  * verify that flash message notifies student of extra
    time and the "Time Left" countdown updates to reflect
    the new time available.

Change-Id: I5ebd9008dded9a43cc0021b51c5d053af1cfa28e
Reviewed-on: https://gerrit.instructure.com/8916
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2012-04-26 16:31:46 -06:00
Jon Jensen 897531c883 fix calendar event linking issues, fixes #8337, #8338, #8339
remove links from calendar2 into event show page, unless the user has edit
privs (since there is no readonly view with the section-event change).
also fix links to event show page for section-level events (#8337).

fix dashboard notifications so that event creators aren't notified of
section-level events they create (#8338).

implement route and redirect for section-level events so that event
participants can click on the dashboard link and be taken right to the
event in calendar2 (#8339).

test plan:
1. create a regular dated event and a section-level dated event in
   calendar2
2. confirm that you can get to the advanced edit page via the title link
   or the more options link for both events
3. confirm that you do not get dashboard (or email) notifications about
   either event
4. as a student, confirm that you get dashboard notifications about both
   events
5. confirm that clicking on the dashboard link takes you right to each
   event
6. confirm that you don't get any links to the advanced options page for
   either event in calendar2

Change-Id: Ia0efcdbc7f8fa623cf0415ac630f80fee48a885d
Reviewed-on: https://gerrit.instructure.com/10369
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Tested-by: Jon Jensen <jon@instructure.com>
2012-04-26 16:29:41 -06:00
Cody Cutrer 34913800c9 don't give concluded students access to unpublished courses
fixes #7386

test plan:
 * create a course and enroll a student via SIS
 * DO NOT publish the course
 * change course date restrictions to be in the past
 * as the student, you should not be able to access the course
 * manually conclude the student
 * as the student, you should not be able to access the course

Change-Id: I268ba0562eb8ca5aae9ef62ca1ac34dd39993487
Reviewed-on: https://gerrit.instructure.com/10303
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2012-04-26 14:22:05 -06:00
Cody Cutrer e8d5c5ba62 apply date restrictions to invited enrollments
otherwise they'll see the course to accept it, and then it will
disappear - jarring

test plan:
 * publish a course
 * set date restrictions to the future
 * invite an existing user
 * the course should not show up in the user's course menu
 * the user should get a message about the course not starting yet
   if trying to accept the invitation via e-mail

Change-Id: I950ac729ae3ccbf453dd0a4e71acc607bb527e4a
Reviewed-on: https://gerrit.instructure.com/10162
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
2012-04-26 14:21:37 -06:00
Cody Cutrer 43f33049e3 only send conference invitations to active members fixes #5290
test plan:
 * create and publish a course
 * invite and accept a student
 * change the course dates to the future, and restrict access to
   them
 * create a web conference
 * the student should not get a notification

Change-Id: I06b0226c01fd38f99afed0ce767e9e7207864fbe
Reviewed-on: https://gerrit.instructure.com/10288
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2012-04-26 14:19:50 -06:00
Brian Palmer 834f53d889 fix module loading for QuizQuestion::UserAnswer
test plan: do anything that'll trigger scoring a quiz (submit a quiz
attempt, etc), verify the quiz is scored without error.

Change-Id: Ibb2780595901deda3d7118d189eb3b7f7c9a2572
Reviewed-on: https://gerrit.instructure.com/10347
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-04-26 13:46:55 -06:00
Bracken Mosbacker 56184d8bc6 don't copy name, course code, and start/end dates on course copy
These values are usually set on a course before copying and
shouldn't be overwritten

Test Plan:
 * Copy a course and set a different name, code, and dates for the new course
 * Those different values should not be overwritten when the copy is finished

closes #8263 #8344

Change-Id: I88524638f93a18e23e7aa53e22d9dcba0988e6c9
Reviewed-on: https://gerrit.instructure.com/10289
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2012-04-26 10:24:55 -06:00
Jon Jensen 1b1dd74816 renamed specs so they run on hudson
also removed obsolete/broken spec (superseded by newer spec/migration) and
removed unused :dependent => :destroy from model (we never actually
destroy, so it wasn't getting called. also we want those records to stick
around)

test plan:
* run specs

Change-Id: I5a3e101cd4c26200003650543a89c16f99361b77
Reviewed-on: https://gerrit.instructure.com/10336
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2012-04-25 16:18:40 -06:00
Brian Palmer 59d6a9af8d refactor and bug fixes for QuizQuestion.score_question
fixes #8267

This refactors the large switch into an individual class for each
question type. The hope is that we can start using these classes for
other type-specific code as well, such as the giant switch in the
parse_question method.

While refactoring, I fixed all the bugs that had pending specs in
quiz_question_spec.rb

test plan: verify that quizzes are still scored correctly. the only
visible changes should be the bug fixes for the pending specs:
  * there should be no floating point errors in scoring numerical questions
  * there should be no issues with floating point errors causing some
    question types to give 0 instead of full credit in edge cases
  * a blank answer shouldn't be treated as 0.0 in numerical questions
  * no answer shouldn't be treated as a blank answer for the purposes of
    undefined_if_blank (not currently exposed in the UI)

Change-Id: I74d2efcf6b087247adeafc5d4685cb3ea2bba9c2
Reviewed-on: https://gerrit.instructure.com/10263
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2012-04-25 10:34:03 -06:00
Cody Cutrer 6d05e5378f allow specifying s3 bucket with PluginSetting
test plan:
 * use s3 for attachments
 * change/remove bucket_name from amazon_s3.yml
 * set bucket_name at /plugins/s3
 * attachments should still display, and be able to be saved

Change-Id: I66a464af05fcad842d332e8fc6dcc52b3789c63f
Reviewed-on: https://gerrit.instructure.com/10257
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2012-04-25 09:09:59 -06:00
Brian Palmer 4259e0449a remove unused tags associations
these stopped being used around oct 2010

order by LOWER(title), ouch

Change-Id: I91999e553887c719fb5912f39cc012eeae9bcfb6
Reviewed-on: https://gerrit.instructure.com/10277
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2012-04-25 08:43:49 -06:00
Simon Williams a419a64a04 allow teachers to resubmit to turnitin; closes #7981
add more structure to the turnitin_data hash on a submission to keep track of
what state things are in, so that we can present errors to the user as they
happen and provide a way to resubmit. there are three states: 'pending',
'error', and 'scored'.

submissions start out as 'pending', and can move to 'error' if anything goes
wrong in the submission process (either in creating the assignment, enrolling
the user, or actually submitting the paper). there are built in retrys, and the
error state only gets set if there is still an error after the retry limit. if
this succeeds, we stay pending until the score is successfully retrieved from
turnitin, at which point it is marked 'scored'.

this change is primarily in speed grader, although icons have been updated in
the gradebooks and submission pages as well. in the 'scored' state, (or without
a state) things should work exactly as they have previously - display a score,
which can be clicked to see the full report. in the 'error' state (indicated
with an exclaimation point icon), clicking the icon gives you more details
about the error and the option to resubmit. in the 'pending' state (indicated
by a clock icon), clicking the icon just explains that the submission is
pending.

test-plan:
- locate some submissions that were scored with turnitin before this change was
  applied and verify that they still work as expected
- submit something new that will get sent to turnitin. verify that it initially
  gets marked as pending, and then after 5-10 minutes has a score.
- submit something that will result in a turnitin error (eg: < 20 words,
  password protected pdf). verify that it initially gets marked as pending,
  then after ~30 minutes (to account for retries) is marked as an error.
- click the icon, and click the resubmit button. verify that it goes back to
  pending.
- verify that the new turnitin icons for these submission in gradebooks 1 and
  2 look correct and don't mess up the layout.

Change-Id: Ia5e1b04842de16aaa44d498eefe59ddb716dc014
Reviewed-on: https://gerrit.instructure.com/10125
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2012-04-24 16:49:42 -06:00
Simon Williams f1505f09ef store turnitin failures; fixes #7686; refs #7981
when the submission of a paper to turnitin fails, this change will store the
error code and message in the hash on the submission or assignment object so
that we can start to get a sense of what our most common error messages are.

test-plan: (note: there is no UI for this commit; it is coming soon)
- in an account with turnitin enabled
- submit an assignment and make sure it still works
- submit an assignment where you've changed a .txt to a .doc or something, and
  then check the submission object in the console to see if the error is stored
  in the turnitin_data hash

Change-Id: I17c98f6aaefa092f65a931a9c53d3daa0542f6f6
Reviewed-on: https://gerrit.instructure.com/9984
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2012-04-24 16:49:19 -06:00
Brian Whitmer 7ab81e483a change tool load order to let courses override accounts
This is a somewhat significant change. Before, domain-matching
took precedence over url-matching, and account-level tools
took precedence over course-level tools. This didn't make sense
to any of us, but was based on what we thought was part of the
LTI spec.

Turns out it isn't part of the spec, so we're going to take
the opportunity to change the order or precedence to something
that makes sense to us, which is url before domain matching,
and course before account matching. The new code will start at
the course and work up looking for an exact URL match. If it
can't find one then it will start at the course and work up
looking for a domain match, and will use the first one it
comes across.

test plan:
- verify that the following precedence holds:
  (you can use the fake lti tool included in canvas to
  run these tests, "<canvasdomain>/selection_test" is the
  URL to launch. The easiest way to test would be to set
  a different consumer key for each tool).
1. course-level url matching
2. sub-account-level url matching
3. root account-level url matching
4. course-level domain matching
5. sub-account-level domain matching
6. root account-level domain matching

Change-Id: If58e055c605524f7a8ea9941c1b71dbcbd5ab816
Reviewed-on: https://gerrit.instructure.com/9913
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2012-04-24 15:09:50 -06:00
Jon Jensen 0307861c10 show section-level events in syllabus, fix notifications
hide parent events and show section-level events in syllabus. also start
showing (manageable) appointment groups

fix notifications so that they don't go out for parent events but do go
out for section-level events

test plan:

1. create a section-level event
2. confirm that notifications are sent for the section-level events but
   not for the parent event
3. confirm that the section-level dates/times appear in the syllabus but
   the parent ones do not
4. create an appointment group and confirm that it appears in the syllabus

Change-Id: I0851edceb4f12656aca8152abdcec4cb02ce9f23
Reviewed-on: https://gerrit.instructure.com/10253
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
2012-04-24 12:03:54 -06:00