Commit Graph

1513 Commits

Author SHA1 Message Date
Cody Cutrer c506b1a7de cross-shard user merging
test plan:
 * merge a user in one shard into a user in another shard
 * email addresses should come over (try pairs of users with
   different combinations of duplicate e-mail addresses and
   workflow states)
 * being an admin should come over
 * enrollments and pseudonyms also should come over, but aren't
   visible in the UI yet
 * user_services (twitter, facebook, linkedin, etc. on the profile)
   should come over
 * conversations and perma-observerness does *not* work yet
 * three users, all from different shards, together, and confirm
   the above again (especially being an admin, since that's what's
   visible in the UI)

Change-Id: I2b2cac62a18663e22faf72ebaae8123f703146c6
Reviewed-on: https://gerrit.instructure.com/14182
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2012-10-24 13:22:11 -06:00
Mark Ericksen ac9182cf56 Fix deleted admin enrollments enabling student to see discussion topics without a post. Fixes #11192
Fixed the DiscussionTopic#user_ids_who_have_posted_and_admins method to only
look at active admin enrollments. Was picking up the TA's deleted admin enrollment.

Testing Steps:
===========
* Create a course as a teacher and add a TA
* Create a Discussion Topic that requires a user to post before
   seeing other user's responses.
* As a student, add a response
* Verify that the TA can see the other student's response
   without having created a post themselves.
* Remove the TA's enrollment in the course and
   add the TA as a Student.
* As the TA-turned-student, visit the discussion
  and verify that you cannot see the replies
  without first making a post.

Change-Id: I35ed1a6b05128e8e3636574df3779449a5ee3c69
Reviewed-on: https://gerrit.instructure.com/14617
Reviewed-by: Joel Hough <joel@instructure.com>
Reviewed-by: Jon Willesen <jonw@instructure.com>
Reviewed-by: Marc LeGendre <marc@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-10-23 14:58:02 -06:00
Joel Hough 7b93ba46f0 add api for listing visible navigation tabs
test plan:
- fetch tab list using some command like:
curl -H 'Authorization: Bearer <token>' \
 https://<canvas>/api/v1/courses/<course_id>/tabs\?include\="external"
- ensure that the returned list corresponds to the left-hand tab list on the
  web interface

fixes #10891

Change-Id: If3371472b58f849a9736ab6747f69551178e99a4
Reviewed-on: https://gerrit.instructure.com/14615
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
2012-10-23 10:13:20 -06:00
Jacob Fugal be6093f9cd VDD: Assignment#due_dates_for(user), et al.
a convenience method to get all due dates applicable to and/or visible
to a specific user for an assignment. new named scopes on
AssignmentOverride to facilitate it, and minor bug fixes

Change-Id: I7f400fd13b7903b362e9ca0e6991f1d287f5f783
Reviewed-on: https://gerrit.instructure.com/14581
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
2012-10-23 09:06:30 -06:00
Jacob Fugal de1676cd4b rename user_(is|has_been)_teacher to instructor
also, make the implementations of those and user_(is|has_been)_student
consistent, and fix a bad cache key.

test-plan:
 - everything but the cache key is just a refactor
 - create and then delete a student enrollment in a course so that
   user_is_student? and user_has_been_student? should be different
 - enable caching
 - call user_is_student?; should be false
 - call user_has_been_student?; should be true

Change-Id: Ia9458605273741ef3971d8701fe3cff56453f9b4
Reviewed-on: https://gerrit.instructure.com/14580
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
2012-10-23 09:06:16 -06:00
Jacob Fugal 7aaf63db52 VDD: Assignment#overrides_visible_to(user)
scopes the assignment's overrides to just those that the user can see.
intended for use with admin users (e.g. teachers or tas) not students,
since a student technically can see other students and thus this scope
will let them see the other students' adhoc overrides, which is not
desired. but this should never need to be called in the context of a
student.

test-plan:
 - architectural, run specs

Change-Id: I4e1515c263870a13f073af1b39cb19d223b41ab9
Reviewed-on: https://gerrit.instructure.com/14486
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-10-22 09:32:58 -06:00
Joel Hough d1f1d46f0d fixed css class typo for tab in group model
Change-Id: I4a2cc56e2dc3411f11b99326516a20cb4bd158aa
Reviewed-on: https://gerrit.instructure.com/14556
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
2012-10-19 12:21:42 -06:00
Cody Cutrer 78fe942dc7 catch all exceptions during LDAP bind
it wasn't catching ENETUNREACH

test plan:
 * set up an LDAP server with an IP address in a private address
   range that you can't reach from your computer and a login id
   attribute set
 * try to log in (probably from another browser, so you can remove
   these settings with your current login session)
 * you should not get a page error

Change-Id: Ibfe1a1dfe5493ed527b114ed5adf33d4f45896a4
Reviewed-on: https://gerrit.instructure.com/14559
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-10-19 10:27:40 -06:00
Brian Palmer a4317b20db store and query hashed access tokens
refs #8943

This is phase 1. Once this is rolled out and the migrations have
finished, we can implement phase 2, which is dropping the token field so
that plaintext tokens are no longer stored in the database.

There should no longer be any code that reads the token attribute, it's
kept in the database purely to help with the transition.

test plan: before the postdeploy migration runs, access tokens should
still work. after it runs, access tokens should still work.
newly-created access tokens should work as expected. expired access
tokens should still error. For now, the plain-text token field should
still be populated for new tokens.

Change-Id: Icb1b4fdc8e2627ba6540d96d23eb28d874020acb
Reviewed-on: https://gerrit.instructure.com/14491
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-10-18 13:03:53 -06:00
Jacob Fugal 9441925122 VDD: efficient application of assignment overrides
refs #10831

test-plan:
 - create a course, student, and assignment
 - create an assignment override that applies to the student
 - the return value of assignment.overridden_for(student) should act
   just like assignment, but with the overridden values in place
 - the overridden assignment should not be able to be saved
 - create multiple assignment overrides that apply to the student
   (adhoc, group, sections, etc.)
 - the overrides should be applied in the correct order
 - overrides that don't affect a field should let lower priority
   overrides affect it
 - create an override and then delete it (without changing the
   assignment version in between)
 - the override should not apply
 - create an override, then bump the assignment version, then delete the
   override
 - the override should apply to the old version of the assignment but
   not the new one
 - bump the assignment version, then create an override
 - the override should apply to the new version of the assignment but
   not the old one

Change-Id: Ib632903640cb8aeae5bbc8959c244f6923690f29
Reviewed-on: https://gerrit.instructure.com/14135
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
2012-10-17 12:47:50 -06:00
Jacob Fugal 6fc0e64581 VDD: assignment override data structures
refs #10831

test-plan:
  - run specs. this is all infrastructure, no real separate test plan.

Change-Id: Ic67f574b7e4cbffd114f6ed34d306a393a6bd93c
Reviewed-on: https://gerrit.instructure.com/14117
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
2012-10-17 12:47:37 -06:00
Jon Willesen a9d1a9ea60 move infer_defaults to before_validation so validation passes
this will allow an existing invalid assessment question name to
be updated instead of continually failing validation

fixes #11230

test plan:
 - create a question bank with a question that has a name longer than 255 characters (see #11230)
 - edit the question and modify its name so it is shorter than 255 characters
 - save the question; it should save successfully now

Change-Id: I9342d5aeb0541947196e132481d77c83b0ba750c
Reviewed-on: https://gerrit.instructure.com/14419
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2012-10-17 09:58:10 -06:00
Jon Jensen 52f04579ba fix bulk private message attachment regression, fixes #11277
ensure that the attachment associations get created for each bulk private
message. previously we would explicitly create each message, and thus tell
it which attachments it should have. now we create a single message (the
root one) and do the other ones in a delayed job. since we were just
cloning the root message, the associations were not being copied

fortunately, we have all the data, so we can restore any associations that
should have gotten created

test plan:
1. send a bulk private message to a bunch of people, specifying one or
   more attachments
2. ensure that the attachment appears in each created/updated conversation
   (for both sender and recipient)

Change-Id: I1a72b3ef0a047a413b84e780811b84b298c6ec57
Reviewed-on: https://gerrit.instructure.com/14474
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
2012-10-17 09:35:35 -06:00
Jake Sorce e7de009d7b add data validation to learning outcome title
fixes #11057

test plan:
  1. login as a teacher and go to a course
  2. click 'Outcomes' in the left nav
  3. click 'Add Outcome Group' on the right
  4. try to type a string longer than 255 characters
  5. validate that the textbox stops you and it saves
     correctly

Change-Id: I9fb323fe6360d173c44b00206583e391dda0c0cc
Reviewed-on: https://gerrit.instructure.com/14430
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2012-10-16 11:01:18 -06:00
Duane Johnson 9dd3830253 Refactor "score out of points possible" for quizzes and curb unrestrained high precision quiz scores.
E.g. There's no need for "5.2333333333333 out of 10".
- Now uses render_score in Activity stream, as well as quiz question partial.
- Fixed that recent_feedback and quiz history did not use render_score.
- Refactored readable_grade into helper method; now uses I18n
- Recent Feedback stream now uses render_score via readable_grade

Test Plan:
* Take a quiz that allows for fractional scores
* Answer the quiz in such a way that you get a fraction for a score e.g. 1/3 out of 1
* Check that the quiz total score has reasonable precision (2 decimals): 6.33 out of 10
* Check that individual questions with fractional scores have reasonable precision

Fixes #11159

Change-Id: Icea14042bf8d33d7f6f91fe9086c232216ef0838
Reviewed-on: https://gerrit.instructure.com/14250
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Bryan Madsen <bryan@instructure.com>
2012-10-16 10:15:13 -06:00
Jeremy Stanley 9abc4d7126 memoize and improve specs for User#assignments_needing_grading
refs #11187

I removed memoize before, since the thing being returned is an
array rather than a named scope once we restrict by section,
and thus would not return updated results on a single User
instance - but I noticed the _total_count functions are all
memoized and can't be expected to update either; also, we
probably don't expect these counts to change within a single
request.

also, move tests for User#assignments_needing_grading into
their own specs that actually test summing over multiple
assignments

test plan:
 * no visible behavior change (other than possible speedup)
 * specs should pass

Change-Id: I76c9d91b75ebcdf4dd48b356171f1bd13b011520
Reviewed-on: https://gerrit.instructure.com/14345
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2012-10-16 09:48:02 -06:00
Brad Humphrey 4a1f79d28e fixes numerical answers in quiz_statistics_csv
fixes #11160

test plan
 * create a quiz with a numerical question type.
 * have two users take the quiz Have one get the correct answer and one get it wrong
 * go to the quiz statistics page and download the csv
 * both answers should show up in the csv

Change-Id: Iad630629458abe578ffb9d5a985d172d7171c4a2
Reviewed-on: https://gerrit.instructure.com/14346
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
2012-10-15 15:39:53 -06:00
Bracken Mosbacker 8f61877b70 add discovery url ui to saml config page
Test Plan:
 * Add a SAML config and a discovery url
 * It should save
 * Delete the url
 * It should delete. :)

refs #10497

Change-Id: I244aa3a39ee04a6d0c83558da4962909510e9c15
Reviewed-on: https://gerrit.instructure.com/14295
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2012-10-12 13:45:05 -06:00
Simon Williams 80142ac00f don't .send() with an interpolated string
favor method searchability over brevity in this case.

test plan:
- no detectable change to behavior
- ContentParticipationCount.unread_count_for should still work

Change-Id: I7fe5b9dc2f60da884949cba3d143d88bf9cd1828
Reviewed-on: https://gerrit.instructure.com/14286
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2012-10-11 15:29:04 -06:00
Ryan Shaw a22f8c13a3 Use html5 to show videos by default & show subtitles
using a library called mediaElement.js, try to show
all kaltura video and audio using html5 and fall back
on flash if needed.  fixes #3969

test plan:
in all the different browsers (including mobile safari/chrome)
try recording webcam videos (as homework submission, as content in a wiki page, etc)
view those same pages
view recorded submission in speedgrader

AND...
Allow uploading subtitle tracks to videos

when you upload a video, you will now see a [cc]
box in the player for that video if you are
the uploader of that video and in a modern browser.
it will have a link to upload a caption track in
SRT or WebVTT format in any language you specify.
once you attach a caption track to any of your
videos, other people that view it will be able
to choose that track while playing it.

helpful for people that are deaf or that speak
another language!

this change also adds google analytics tracking to
videos so we know when a given media_id was
played, paused, and ended.

test plan:
* record a video, go to play the video
* (only) you should see a [cc] button (make sure others don't)
* click the "upload subtitles" link, a dialog should appear
  that lets you choose a language and file to upload.  here's
  one you can test with:
  http://mediaelementjs.com/media/NT113_u008_v005_transcript.srt
* refresh, you (and anyone else that can see video)
  should now have the option to select that track
  for subtitles. (if using in HTML5 player)
* (only) you should see a delete 'x' on it to delete
  it, when you click it it should go away. reload
  to make sure it is not there.

Change-Id: I8ed8f14167e68c750815ec6496a9f992b744aa56
Reviewed-on: https://gerrit.instructure.com/2963
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
2012-10-11 12:28:48 -06:00
Cody Cutrer 181904c489 fix PseudonymsController to work cross-shard fixes #6902
test plan:
 * on a user's own shard, go to their user page (/users/self
   is probably easiest)
   * create a login
   * refresh
   * update the login
   * refresh
   * delete the login
   * refresh
 * repeat for the same user, from a different shard
   * for this case, all logins for the user from any shard should
     display

Change-Id: I7d60a6a70e0f5166db05abcafd498bbe754cffb7
Reviewed-on: https://gerrit.instructure.com/14262
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-10-11 12:17:45 -06:00
Zach Pendleton 5c7957e317 don't include future enrollments in current enrollments list.
fixes #10840

test plan:
  * create and publish a future course with the "users can only
    participate in the course between these dates" option selected;
  * enroll a student;
  * log in as the student and navigate to /courses. verify that the
    course displays in the future enrollments list but not in the
    current enrollments list.

Change-Id: I0c14b9d10df5e221f9e5e0ca53ce4c31a9054e0a
Reviewed-on: https://gerrit.instructure.com/14257
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mark Ericksen <marke@instructure.com>
2012-10-11 10:45:59 -06:00
Jeremy Stanley 62332d3e04 put back User#assignments_needing_grading_total_count
we use this after all.  fixes #11187

test plan:
 * have a course with 9 or more assignments needing submissions
 * as a student, make a submission to each (so 9 need grading)
 * as a teacher, try to view the front Canvas page; you should
   not see a page error

Change-Id: If865eed8fd69b85154dd1a38d2637fd14f43f984
Reviewed-on: https://gerrit.instructure.com/14287
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Reviewed-by: Mark Ericksen <marke@instructure.com>
2012-10-11 09:34:40 -06:00
Cameron Matheson a464718000 retry failed crocodoc uploads
fixes #11100

Test plan:
  * prevent crocodoc submits from working
  * upload a crocodocable assignment submission
  * make sure a job retries the upload once

Change-Id: I1c4b79e64bf94bcf98ba9915c6eaa00548354035
Reviewed-on: https://gerrit.instructure.com/14141
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2012-10-10 11:20:35 -06:00
Jacob Fugal e30ebfe99e include comment created_at in speed grader json
fixes #11034

test-plan:
 - load a speed grader page that has submission comments on it
 - the comment bylines should include the comment post datetime

Change-Id: Id563f5e9226756de99b030521e0f5f807424df38
Reviewed-on: https://gerrit.instructure.com/14268
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
2012-10-10 09:32:28 -06:00
Jon Jensen 8dcdacad37 fix development fallback images for gravatar
gravatar has started proxying fallback images, which breaks things if the
host is localhost or something not publicly accessible. set fallback host
to canvas.instructure.com in dev and selenium environments (w/ a
mechanism to override it).

test plan:
1. run canvas locally
2. gravatar fallback images should work again
3. run canvas in beta/production
4. gravatar fallback images should still work, and the url should have the
   current hostname in the proxy path (e.g.
   https://i1.wp.com/foobar.instructure.com/images/.. )

Change-Id: Idfd2129e0d78026b2bcfd57e8c7399e0b29f8a3a
Reviewed-on: https://gerrit.instructure.com/14245
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
2012-10-10 09:10:36 -06:00
Bracken Mosbacker c7bf21901c copy/export custom properties on canvas lti extensions
Test Plan:
 * Create an external tool with a canvas extension that has custom properties
 * Copy that course to a new course
 * The custom properties should be copied

closes #9949

Change-Id: I30ec578a5f2122bd3f7b94748c954fb7e43a7c1a
Reviewed-on: https://gerrit.instructure.com/14219
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-10-09 10:46:33 -06:00
Brian Palmer d11ecb89c5 optionally show concluded enrollments in gradebook2
and handle showing concluded courses (and other situations where the
gradebook is read-only because the logged in user has access to
view_all_grades, but not :manage_grades)

closes #6809, closes #6922

test plan:
* verify that changing the setting in the cog
  menu of gradebook2 reloads the page and
  causes concluded enrollments to show/hide
* make sure that you can't turn off
  'show concluded enrollments' in a course that
  has been concluded
* make sure that the gradebook is in a read-only state when the course
  has been concluded (and you're a teacher, not a site admin). but
  verify the grade information is still displayed (this required some
  relaxing of conditions in the api)

Change-Id: I56b668c6593671e4db8b1c218b0bd06e0f1fdb2a
Reviewed-on: https://gerrit.instructure.com/9398
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-10-09 10:09:22 -06:00
Simon Williams 0f53105c2e submission unread counts
refs #10541

add a new unread count to the left nav bar, indicating how many grade changes
have occured since you last viewed the course.  a grade change can either be
a change in score or a comment left on a submission.  when the grades page is
visited, there will be a small new dot next to each submission with new grade
activity, and the count will clear after visiting the grades page.

todo: specs

test plan:
- as a teacher, set up some assignments, including some that are muted, and
  some that are peer review
- as a student, submit these assignments
- the counts should not change
- as another student, complete the peer review
- as the original student the count should be up by one, and there should be
  a blue dot next to the peer review assignment
- as the teacher, grade the other assignments, including the muted one
- as a student the count and dots should represent what was graded and visible
  (everthing but the muted assignment)
- after leaving/refreshing the page, the count and dots should be gone
- as a student, reply to comments on the submissions
- the counts should not change

Change-Id: Ifd5988e37831c4c63314f2aad27ddd2875389dd0
Reviewed-on: https://gerrit.instructure.com/14051
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-10-09 09:41:27 -06:00
Jeremy Stanley f8012a8b6b make needs-grading counts respect sections; fixes #11001
test plan:
 * Create a course with multiple sections
 * Enroll students in both sections, and submit assignments. Keep
   track of how many submissions were made in each section.
 * Create a TA in one section, with limited privileges, and log in
   as that TA.
 * Check the to-do list on the right panel, and make sure it only
   includes submissions from the TA's section.
 * Check the TODO items API, and make sure the needs_grading_count
   figure only includes submissions from the TA's section.
 * Check the needs_grading_count in the Assignments API;
   it should include only submissions in the TA's section
 * Check the needs_grading_count in the Courses API;
   it should sum all the submissions to all the assignments
   in the TA's section of the course

Change-Id: I5f1f47321bb909abc24deabdfa47b8301dc83d8f
Reviewed-on: https://gerrit.instructure.com/14026
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
2012-10-09 08:44:26 -06:00
Zach Pendleton 126246bba5 respect course/account locale settings in notifications.
fixes #10690

previously, notifications only considered user locale settings
when translating; they now consider the context as well.

test plan:
  * create a course with a spanish or russian locale;
  * enroll an english user in the course;
  * verify that the enrollment email is sent in the course
    locale and not the user locale.

Change-Id: Ib942f35dff770ec02aa4e39880a5234e318f26a9
Reviewed-on: https://gerrit.instructure.com/14103
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
2012-10-08 13:17:10 -06:00
Bryan Madsen a9b83fea43 scrub commas from user names sent to crocodoc, fixes #11137
crocodoc does not allow viewing sessions to be created when the user
name sent to crocodoc has a comma, we need to scrub it out.

test-plan:
* as a student, submit a crocodocable file as a submission
* change the teacher short name(display name) to have a comma
* make annotations on the student submission as the teacher
* view teacher annotations as the student
* during both viewing sessions, the teacher's name on the annotiations
should not have a comma

Change-Id: Iebfc7f8137ea8e49fef139fdfec932bdb464d85d
Reviewed-on: https://gerrit.instructure.com/14208
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
2012-10-08 13:07:06 -06:00
Simon Williams 5ce9fb146e unread badges in left nav
refs #10541

add counts of how many unread discussions and announcements a user has in
a course or group in the left hand nav bar of the course or group, next to the
appropriate navigation link.

these counts are cached in a context/user/content_type join table.
unfortunately, there are situations that can change whether or not a discussion
or announcement is visible to the user (and thus unread) without triggering any
backend action. for example, a post delayed announcement, a locked discussion
assignment, or a discussion with prereqs in a module. because of these types of
situations, the count has to be re-queried every so often, and the time chosen
for this is if it's been stale for 10 minutes.

test plan:
- as a teacher, create some announcements and discussions
- as a student, you should have unread counts in the left nav
- read the announcements and discussions
- the counts should update appropriately
- (see explanation above for the following)
- try post delayed announcements
- try locked discussion assignments
- try discussions locked in a module
- make sure the count badge looks good in all browsers

Change-Id: Ia6428717e91ed389c63ca97a065232dac7121b7e
Reviewed-on: https://gerrit.instructure.com/13926
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
2012-10-08 11:38:01 -06:00
Bracken Mosbacker ed545bd44e mark submission comments as hidden for submission zip uploads
When a teacher uploaded a submission zip on a muted assignment
the comments weren't being marked as hidden like they're
suppose to. They do now.

Test Plan:
 * Create an assignment and have some test students submit files.
 * Download the submissions.
 * Open the speedgrader and mute the assignments.
 * Close the speedgrader and go back to the other page
 * Re-upload the submissions.
 * Check the conversation messages for one of the users who submitted the assignment.
 * There should be no message for the submission
 * As a the student, view submission details, you should not see the reuploads as submission comments

closes #10335

Change-Id: I96d47ae18bed0140c66b6ff78f606a651e48a448
Reviewed-on: https://gerrit.instructure.com/14204
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
2012-10-08 09:55:50 -06:00
Zach Pendleton d0d4be96d0 allow users to accept enrollments in pending courses.
fixes #9792

users who receive a course invitation link from canvas can now
accept the invite, even if the course hasn't begun and is restricted
by begin/end dates. they still are not able to participate in the
course until it begins.

test plan:
  * create a course with a start date in the future that has its
    participation restricted by course date;
  * create a student enrollment in the course;
  * using the link given in the enrollment invitation email, attempt
    to accept the enrollment;
  * verify that the enrollment is accepted and the user is redirected
    to the dashboard page.

Change-Id: I4f876232a550ca3616723ecad9dc7049e76e67d8
Reviewed-on: https://gerrit.instructure.com/13412
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
2012-10-05 11:22:52 -06:00
Bracken Mosbacker bae80e8bee don't allow students to submit blank media assignments
Test Plan:
 * Create a media submission assignment
 * As a student go to submit the assignment
 * The submission button should be disabled unless you have recorded media

closes #11048

Change-Id: Ia2c25535da9ab38d51b3fd5562e0a3250b14e710
Reviewed-on: https://gerrit.instructure.com/14126
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
2012-10-04 15:22:21 -06:00
Mark Ericksen 799462e1bd Capture a users initial_enrollment_type when invited to a course. Fixes #10893
This also refactors the UserList constructor to better support passing this
information in when a user is being created through an invitation.

Testing Steps:
=========
* In a course, go the Settings > Users tab.
* Under "Add Course Users", select a type (ex: "Students") and
  give the user information.
   * Ex: "Student Test" <studenttest@example.com>
* After adding the user, verify in the console that the user has
  the correct initial_enrollment_type. (As far as I know, this
  information isn't displayed anywhere)
   * Sample console script:
      * u = User.last
      * u.initial_enrollment_type   #=> "student"

Can verify that this works for the following supported types
"student", "teacher", "ta", "observer".
Anything else (like Designers) doesn't get stored.

Change-Id: I5d900c421a04e95b5b92e21cd57e7694d1e98958
Reviewed-on: https://gerrit.instructure.com/14110
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
2012-10-04 14:26:15 -06:00
Simon Williams 0047480574 correctly schedule stream item cleanup job
fixes #11087

test plan:
- manually run StreamItem.destroy_stream_items_using_setting
- it should work
- you should not have stream items over a month old (you might be able to see
  this on a user that hasn't had any activity in the last month)

Change-Id: I64ae4458d18295537daeaf08cd131aea4d01091b
Reviewed-on: https://gerrit.instructure.com/14131
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2012-10-04 10:45:41 -06:00
Cody Cutrer 9b632164c4 search all associated_shards for User#accounts
test plan:
 * add a user from one shard as an admin in an account in another
   shard
 * that account should show up in the user's home menu, and their
   all accounts page

Change-Id: Ib92b1a7f9283f6444d4a59108dc783f583b245bc
Reviewed-on: https://gerrit.instructure.com/14077
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-10-03 19:58:12 -06:00
Cody Cutrer c37b5dd01e support cross-shard trusted accounts for UserList
test plan:
 * have a site admin user in shard 1
 * add that user by their login id as an admin to an account in
   shard 2 (in the UI)
 * it should work
 * repeat for enrolling in a course

Change-Id: I403f0f853056d4ea1dd9628c70e882fdc3cfd8bf
Reviewed-on: https://gerrit.instructure.com/14090
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2012-10-03 16:24:56 -06:00
Bracken Mosbacker c54d3060b2 allow multiple saml auth configs and full aac api
An account can now have multiple SAML configurations, and
can set an auth discovery url.

The old AAC API has been deprecated and this adds a normal
resource API for AACs

Test Plan:
 * Test the api be doing lots of things
 * Create two saml configurations
 * Test the individual login urls for each (/login/{id}) and verify they work
 * Test that the new SAML AAC UI works.
 * Test that the SAML configuration in position 1 is used as the default

closes #10497

Change-Id: Ibe35fcf788d9506542b1079cc7420912a1e9d9a2
Reviewed-on: https://gerrit.instructure.com/14042
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2012-10-03 15:23:56 -06:00
Jake Sorce eb49f9b1c8 add data validation to new folder creation, fixes #10906
test plan:
  1. login as a teacher
  2. go to a course
  3. click on files on the left nav
  4. click 'Add Folder'
  5. try to give it a name over 255 characters
  6. text stops at 255 characters, press enter to add
     the folder
  7. folder is saved with no DB error

Change-Id: I1da8595350b3d0c6f23e3052e514bcb55446f141
Reviewed-on: https://gerrit.instructure.com/13982
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jake Sorce <jake@instructure.com>
2012-10-02 15:54:37 -06:00
Cody Cutrer d70945c1bd remove unused twitter tables and no-op jobs
test plan:
 * edit course settings, there should not be an error
 * copy a course, there should not be an error

Change-Id: I733bef83b69d9c513be801d3e4b25422bcd10ebd
Reviewed-on: https://gerrit.instructure.com/13832
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2012-10-02 13:11:13 -06:00
Jon Willesen c508d0dab0 Email replies to locked topics should be ignored.
fixes #9594

test plan:
 - Configure Canvas to send emails to you.
 - Create a student account and set notifications for annoucements and discussions to "ASAP."
 - Create an annoucement and a discussion and make sure you get the notification emails.
 - Reply to the notification emails and see that the replies get posted as normal.
 - Lock the announcement and discussion.
 - Reply to the emails again and see the replies don't get posted.
 - See that you get an appropriate bounce message.

Change-Id: I4436c61a202d3285ee35a9f9002cefa0f18954fd
Reviewed-on: https://gerrit.instructure.com/13912
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2012-10-02 12:57:39 -06:00
Brian Palmer ea61131f12 limit the submit_to_turnitin job max attempts
now that it's on a strand, it's important we don't retry 15 times
because that'll hold up the rest of the jobs on the strand.

test plan: no user-visible changes, though admins can see the new max
attempts in the /jobs ui

Change-Id: I4b032b88c62e053528096337eecc6caaaa3337cb
Reviewed-on: https://gerrit.instructure.com/14047
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-10-01 11:01:21 -06:00
Zach Pendleton bfaaed12c1 allow access to gradebook2 with :manage_grades permissions.
fixes #10556

users with :manage_grades permissions that don't have
:view_all_grades permissions should be able to view and
use the gradebook without receiving permissions errors.

test plan:
  * create a custom role that has :manage_grades permissions
    but not :view_all_grades permissions;
  * as that user, attempt to load gradebook2 and verify that
    it loads as expected.
  * smoke test other roles to ensure that they continue to
    work as expected.

Change-Id: Ifbf2c2d9352fe6429497b5c54c269c4973ba7a26
Reviewed-on: https://gerrit.instructure.com/13781
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
2012-10-01 09:37:22 -06:00
Cody Cutrer a993ba3cbb remove default_wiki_wiki_pages relations fixes #10993
it was a has_many :through that is broken for auto-created wikis

existing specs cover all changes except /undelete page, which
is unsupported

test plan:
 * ensure user's rss feed can be opened correctly
 * ensure wiki sidebar loads and has wiki pages in it

Change-Id: I7c3f0f68641b67f602e6b412ab5a386140bb68b2
Reviewed-on: https://gerrit.instructure.com/14023
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
2012-10-01 09:15:25 -06:00
Brian Palmer b8ea2cfd23 ability to change an Attachment's namespace
Including renaming the actual file on disk / in S3

refs #10841

test plan: from the console, call change_namespace on a root attachment,
passing in the new namespace (new_account.file_namespace normally).
verify that the file is moved in storage, and all child attachment
namespaces are updated as well.

Change-Id: If0463344c52fbd52e45047a4c0794da44d1e19b2
Reviewed-on: https://gerrit.instructure.com/13972
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2012-09-30 22:46:46 -06:00
Cameron Matheson 745ccff998 submit to scribd unless a crocodoc document is present
Test plan:
  * turn off scribd submission filtering
  * upload a document to your course files
  * make sure the document is previewable in scribd

Change-Id: I3f5cc1b4971d901407a0665edeef9af40b68092b
Reviewed-on: https://gerrit.instructure.com/14044
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Bryan Madsen <bryan@instructure.com>
2012-09-28 21:28:00 -06:00
Sterling Cobb 3b0fada705 Alphabetize files and folders
fixes #10036

This commit removes the ability to sort files and folders by
dragging and replaces it with a default of alphabetizing every
item.

Test plan:
  *Folder
    1. Go the to files page http://localhost:3000/dashboard/files
    2. Create a folder named "d_folder" then add a folder named "a_folder"
    3. Ensure "a_folder" is before "d_folder"
  *Files
    1. Go the to files page http://localhost:3000/dashboard/files
    2. Upload a file named "d_file.txt" then add a file named
"a_file.txt" (must have characters in the file"
    3. Ensure "a_file.txt" is before "d_file.txt"

Change-Id: I3776ff996e338f8aa6fc3858b59e1460b8b1cdf0
Reviewed-on: https://gerrit.instructure.com/13554
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
2012-09-28 14:49:05 -06:00