Commit Graph

1780 Commits

Author SHA1 Message Date
Ryan Florence 929fea181b added js_env view/controller helper
this helper is the mechanism to send data from
rails to the JavaScript w/o requiring an xhr
or dumping data into the DOM and pulling it back
out /barf

you can call it from a view or a controller

test case:
1. call `js_env :FOO => 'bar'` in a view or
   in a controller
2. load the page
3. open the web console and inspect the ENV
   global JavaScript variable
4. ENV.FOO should be 'bar', wassupnow?

Change-Id: Ie079ba0ee610fc6a9e837cd1301ee29b08201e65
Reviewed-on: https://gerrit.instructure.com/8170
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
2012-01-19 16:10:19 -07:00
Simon Williams 5b67d4de94 show outcomes from all associated accounts; fixes #6800
we were showing outcomes for associated accounts for course contexts but not
sub-account contexts. now we are.

test plan:
- create an account level outcome
- create a sub-account level rubric
- click find outcome criteria
- ensure that the account level outcome is available

Change-Id: I64a8feacadecd3bbc12eedc3c1c5ccea9b16360c
Reviewed-on: https://gerrit.instructure.com/8125
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2012-01-19 12:58:07 -07:00
Ryan Shaw 2bc8ebd637 show muted assignment indicator in gradebook2
there was already a tooltip as you hover over
each submission and the header menu let you mute/
unmute but I guess people wanted to see the little
'muted' icon in the header as well

in the process I broke it out into its own
handlebars template

fixes: #6804

test plan:
 * mute an assignment
 * go to gradebook2
 * look for a little mute icon in the header of
   that  column like on gradebook1

Change-Id: If728a4f11241440d377264123c0824edf05f12b3
Reviewed-on: https://gerrit.instructure.com/8114
Tested-by: Hudson <hudson@instructure.com>
Tested-by: Jake Sorce <jake@instructure.com>
Reviewed-by: Jake Sorce <jake@instructure.com>
2012-01-19 12:39:51 -07:00
Brian Whitmer 5ec76f22b3 fix sizing on external tool buttons
tinymce buttons are by default 20x20, but the external tool
icons are expected to be standard 16x16 icons, so they were
getting stretched. This fixes that using css to add some
padding for external tool buttons in tinymce.

fixes #6937

test plan:
- configure an external tool with an editor button on a course
  (like http://lti-examples.heroku.com/config/editor_button.xml)
- go to the rich editor in that course
- make sure the icon isn't stretched and ugly
- make sure the rest of the styling for the rich editor still
  looks the same

Change-Id: Ic46e37a812c20f70c00771cebe4e5cb9ccadc5f3
Reviewed-on: https://gerrit.instructure.com/8138
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
2012-01-19 09:36:23 -07:00
Brian Palmer f279c75443 process page views from redis in transactional batches
This should make the database much happier

test plan: turn on queue mode for page views, generate a few page views,
and verify that they're still stored to the db after the job runs.

Change-Id: If90b543b805c7f599ce1865b669d4943cafb220d
Reviewed-on: https://gerrit.instructure.com/8161
Reviewed-by: Zach Wily <zach@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2012-01-18 17:01:03 -07:00
Simon Williams db37920cf0 hide discussions from observers; closes #6825
provides a role override permission for viewing discussions. primarily useful
for disallowing observers from reading discussion, although by default it is
enabled.

test plan:
- create a course
- create a discussion (d1) in that course
- create a discussion assignment (d2) in that course
- log in as an observer and make sure you can see both discussions above
- log in as an admin and revoke the read_forum permission for observers
- log back in as the observer and make sure you can't see the discussions
- also check that the assignment shows the assignment page, but does not
  redirect to the associated discussion.

Change-Id: I4c6441c781c24e6aadacbfc23dcc307c772ecd2c
Reviewed-on: https://gerrit.instructure.com/8069
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Cody Cutrer <cody@instructure.com>
2012-01-18 14:49:22 -07:00
Brian Whitmer 1ecfa15a2f course_navigation typo in stylesheet
fixes #6936

test plan:
- add a tool with course navigation from the external tools tab
  (like http://lti-examples.heroku.com/config/course_navigation.xml)
- make sure the tool says "Course navigation configured"
  in the external tools tab

Change-Id: I745d64d6557be4b90851c3301409ffb459a32fe2
Reviewed-on: https://gerrit.instructure.com/8137
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
2012-01-18 11:19:56 -07:00
Brian Whitmer e0a12c0d97 account-level tools couldn't be configured by url
previously this would only work for course-level tools

fixes #6935

test plan:
- try adding a tool to an account by url configuration
- make sure it doesn't die

Change-Id: Id04a0619bd733d351098731cf2db67f8a26936dd
Reviewed-on: https://gerrit.instructure.com/8136
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
2012-01-18 11:16:42 -07:00
Brian Palmer f8ada30070 only queue the process_attachment job when the attachment is created
If the job took more than a few seconds to start, more jobs for the same
attachment would get continually queued up.

fixes #6931

test plan: try to download a eportfolio export or submissions zip with
delayed jobs not running. you should only see one job queued up, no
matter how many times your browser does AJAX queries for status.

Change-Id: Icbdb75bf1c9e9f76af82b8d1bcb48e4b7e17abe5
Reviewed-on: https://gerrit.instructure.com/8129
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2012-01-18 09:19:34 -07:00
Brian Palmer 23a9facbee handle Timeout::Error in redis caching
Hook into the redis library at a pretty low level, to try and do
everything we can to avoid erroring if redis goes down. This applies to
both redis-as-cache and redis-as-data-store.

test plan: Set up redis and caching in your local instance. Point it to
both an existing box on a port not running redis, and a non-existent IP.
In both situations, you should not see caching errors or redis data
errors. After the first error, it shouldn't attempt to hit redis again for 5
minutes.

Change-Id: I101b2d3d2123151b244eb82ba78b176ed1f4d5ad
Reviewed-on: https://gerrit.instructure.com/8097
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2012-01-17 13:13:50 -07:00
Jon Jensen 7acc8b91be make group conferences available to course admins, fixes #6681
this brings the overly strict tab display permission in line with the
other controller/view checks... provided an admin can manage or even
just view group pages, they can see web conferences.

Change-Id: I8412b3e62ad053e33a1219f1c52dbdf0b1110958
Reviewed-on: https://gerrit.instructure.com/8102
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jon Jensen <jon@instructure.com>
2012-01-17 10:23:00 -07:00
Ryan Shaw ea973909f5 fix include_ungraded_assignments behavior of gradebook2
When I made gradebook2 I thought "include ungraded
assignments" was to show/hide "not-graded" assignments
it is actually there to adjust how final scores are
displayed. So that was bug 1

bug 2 was that toggling that setting did not
actually update final grade percentages.

also, reword the setting in the header to say:
"Treat ungraded as 0's"
instead of:
"Include Ungraded Assignments"
because it is less confusing

test plan

 * create an assignment of type 'not-graded'
 * make sure it does not show up in gradebook2
 * in gradebook2 click the "Treat ungraded as 0's"
   option in the cog menu in the header
 * make sure that total columns change to reflect
   treating ungraded assignments as a score of 0

Change-Id: I276d02dfcf13acafd49ce2697a8f4b4bca6bef64
fixes: #6765
Reviewed-on: https://gerrit.instructure.com/8107
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jake Sorce <jake@instructure.com>
Tested-by: Jake Sorce <jake@instructure.com>
2012-01-17 09:47:11 -07:00
Cody Cutrer e8c05e675d fix returning the correct pseudonym in the API
test plain:
 * create a user with multiple pseudonyms in multiple accounts
 * API requests should return the pseudonym info only of
   pseudonyms that apply to the account related to the request
   being sent
 * SIS info should be returned even if a non SIS pseudonym is
   listed first

Change-Id: I895cc6fe2854dcd768590eeae16304b6092f2317
Reviewed-on: https://gerrit.instructure.com/8081
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2012-01-17 08:50:22 -07:00
Ryan Florence 6ce1be26b6 moved rubric criterion comments fixes #6659
comments were supposed to display when you clicked
a green bubble in the grade summary page, but they
didn't

this commit changes the behavior to display the
comments in the table instead of hidden in a popup

test plan:

1. create a new assignment
2. add a rubric to the assignment
3. click 'user this rubric for assignment grading'
4. ensure that 'free-form' comments is unchecked
5. turn in the assignment as a student
6. open the assignment in speed grader
7. click "view rubric"
8. click the green comment bubble and add a comment
9. go to /courses/:course_id/grades/:student_id
10. click 'show all details'
11. view the "instructor comments" under the
    description of the criterion

Change-Id: I80008fb1ea8b17db045edc067595d7430978bb78
Reviewed-on: https://gerrit.instructure.com/8067
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
2012-01-16 20:31:36 -07:00
Zach Wily 5896d1fd78 don't error on the comm prefs page; refs #6914
When a user's immediate messages start getting throttled (like when they've
received 50 in a day), we create a NotificationPolicy for that user with no
Notification. That's not an ideal design, but rather than fix that now, we're
just going to make sure those policies don't cause errors

test plan:
 * See specs.

Change-Id: Ib262b256a9d4fe5fe7fd882d6848883e7a40cb59
Reviewed-on: https://gerrit.instructure.com/8096
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2012-01-16 14:46:48 -07:00
Bracken Mosbacker 52d33b968b add ability to add designers on course settings page
Before this you could only add designers through SIS, now
you can add it like any of the other roles

Test Plan:
* add a designer to a course
* Note, because of #6194 designers can't see unpublished courses right now

closes #4057

Change-Id: Ia1fc0dba52605430097c663de876bdc4b951b09b
Reviewed-on: https://gerrit.instructure.com/7253
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2012-01-16 14:19:22 -07:00
Ryan Shaw 6d54e8335b populate middle_score of curveGradesDialog on open
Change-Id: I1ea86a4146be03496668946192938d13957f75a4
Reviewed-on: https://gerrit.instructure.com/8071
Tested-by: Hudson <hudson@instructure.com>
Tested-by: Jake Sorce <jake@instructure.com>
Reviewed-by: Jake Sorce <jake@instructure.com>
2012-01-16 13:49:10 -07:00
Jon Jensen 4e3bec93cf prevent duplicate key errors, fixes #6379
1. fixed a double ajax post issue in chrome/safari
2. more generally, added transactional retry smarts to
Assignment.find_or_create_submission for anywhere else this could happen

test plan:

1. ensure submissions are created without errors in all supported dbs
(e.g. normal submission and what-if scores for unsubmitted assignments)
2. ensure what-if scores are logged properly in all supported browsers
and do not result in duplicate ajax calls

Change-Id: I0ea7c3de4588f8da4d4707dc8ee547929648a5f8
Reviewed-on: https://gerrit.instructure.com/7950
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
2012-01-16 10:50:03 -07:00
Cody Cutrer 31f9b3ffea explicitly use memoizeable in communication_channel
we include memoizable in AR::Base in an initializer, but that runs
after plugin initializers, so we have to do this if a plugin needs
to use CommunicationChannel in its initializer

test plan: n/a

Change-Id: Iddd4141ab816b0b98358bdda3a325a0725f81994
Reviewed-on: https://gerrit.instructure.com/8082
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
2012-01-16 10:14:18 -07:00
Jacob Fugal 39b5821b13 fix adding logins from user-in-account page
with recent refactoring around API, PseudonymsController#create started
assuming @context was an Account. but POSTing to /users/X/pseudonyms
still sets a User as the @context. make the controller treat that
correctly.

test-plan:
  - go to the account page (/accounts/X)
  - add a user; go to that user's page (/accounts/X/users/Y)
  - click "Add Login" and fill in and submit the form
  - there should not be an "Oops" flash

Change-Id: I61eba093b6cb9c46849f5d03426fce039645e47e
Reviewed-on: https://gerrit.instructure.com/8080
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2012-01-15 23:26:25 -07:00
Jacob Fugal 317378f775 straighten out course designer permissions
fixes #6194

test-plan:
  - create a course
  - create a user
  - add the user to the course as a designer
    (course.add_designer(user).accept in script/console)
  - the user should be able to do almost everything a teacher can in the
    course
  - the user should *not* be able to view grades or user notes
  - the user should *not* be included in the course roster

Change-Id: Id0e642fb19906529627917fffac26f0dae378bcc
Reviewed-on: https://gerrit.instructure.com/8047
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jacob Fugal <jacob@instructure.com>
2012-01-13 18:56:50 -07:00
Cody Cutrer a81a4ea5c3 add data model validation that a pseudonym has an account and user
this is already true, just make sure it stays that way

test plan: n/a

Change-Id: Ia7340e8de57b18da509d51580b5827c7069af80a
Reviewed-on: https://gerrit.instructure.com/7166
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: JT Olds <jt@instructure.com>
2012-01-13 16:25:51 -07:00
Cameron Matheson 045d38855b conversations, fixes #6594
Test plan:
- send a message to multiple people you have not previously had a
  conversation with
- observe that the message was successfully sent (but nothing is added
  to the conversation list)

Change-Id: I3b3b57a58faa10bfeb3067112810226434ffd532
Reviewed-on: https://gerrit.instructure.com/8001
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
2012-01-13 15:35:20 -07:00
Ryan Shaw 338842952c don't show assignment's course name if you are there
as a student, when you go to /courses/x/assignments
it was showing the course name under each assignment,
which was unneeded since it is inferred since you
are "in" that course.

fixes: #6792

test plan:
go to /courses/x/assignments as a student
verify that it looks like this:
http://cl.ly/2m0j450E2C1i3G0A271J
not this:
http://cl.ly/11011P2O1R1z433a2F3F

Change-Id: I5c5944b2d8abd948fbbf05bb38ff8428f26c195e
Reviewed-on: https://gerrit.instructure.com/7888
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
2012-01-13 14:08:13 -07:00
Zach Wily 9222bcfd4f fix showing default notification preferences, again; refs #6876
It turns out that the defaults for daily/weekly policies actually do work -
the issue before was that they won't work for a user whose first communication
channel is retired. This fixes that problem by using the first active email
channel.

Another problem was that we would only build placeholder policies if the user
had NO notification policies at all. However, that rarely happens - when a
user receives a notification and they don't have a policy for it, that policy
gets built. In this case, when the user went to their preferences page, they
would see all the notification categories they didn't have policies for as
"never". This creates placeholder policies for all the notification categories
the user doesn't have one for.

It also makes sure the correct defaults are displayed on the preferences
screen.

test plan:
 * Create a new user A, and enroll them in a course.
 * As another user B, create a calendar event in that course. A calendar event
   is by default a "never" item.
 * As user A, go to your communication prefs and notice that all the default
   preferences are still appearing. In the console you can verify that the
   policy was created for you too:
   > User.find(<A.id>).notification_policies
 * Now, delete that policy from the database.
 * As user A, add a new comm channel and delete the old one.
 * As user B, create another calendar event
 * Verify in the console that user A got a notification policy created for the
   second communication channel.
 * As user B, create a discussion topic.
 * As user A, add an entry to that topic.
 * As user B, comment on that topic as well.
   Discussion entries are by default 'daily', so user A should have a
   DelayedMessage. Verify in console:
   > DelayedMessage.last

Change-Id: I3f7827d2aa83d5b72ab5f8f96aa92ef96652f115
Reviewed-on: https://gerrit.instructure.com/8062
Reviewed-by: JT Olds <jt@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2012-01-13 13:12:19 -07:00
Zach Pendleton 887fea56be add pseudonym index api. fixes #6842
affects: pseudonyms_controller, api
test plan:
  * as an authorized user, make request and verify that
    requested user's pseudonyms for given account are
    returned;
  * make same request for a user with multiple pseudonyms
    in a single account and verify that all are returned;
  * make request as an unauthorized user and verify that
    401 is returned.

Change-Id: I0633e79108c0c6e626cf52f5d39d91a9e67edbb6
Reviewed-on: https://gerrit.instructure.com/8025
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2012-01-13 10:38:57 -07:00
Zach Wily 885d32f304 show the default notification policies for users with no policies; fixes #6876
When a user had not configured any notification policies, on the communication
preferences page, they would see everything as "immediate". That would lead
people to believe that those are the defaults.

Note that for now, only "immediate" notifications actually will be sent by
default. All others are assumed to be never, so that should be reflected in
the UI.

test plan:
 * Create a new user
 * Go to the Profile -> Communication Preferences page
 * Notice that the pre-selected preferences are immediate for immediate
   notifications, and never for everything else.

Change-Id: Ibbd908a5b6f38d144fd4f752bc57258e96c4dc78
Reviewed-on: https://gerrit.instructure.com/8050
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2012-01-13 10:34:38 -07:00
Brian Palmer 2bc80871d6 reload enrollment association before caching
we are seeing an issue with some requests where the account association
info in a course loaded with these enrollments is getting a proc stored
on it, so that it can't be Marshal'd and the caching throws an error.

We're still investigating the cause, but this fixes up the errors.

fixes #6867

Change-Id: Ibc24e7583d7f3a4f1f4362680f6a2c080a53ba53
Reviewed-on: https://gerrit.instructure.com/8051
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2012-01-13 10:26:18 -07:00
Ryan Shaw 208a24afbd make section-to-show menu in gradebook2 update
the functionality where, if you chose a different
section to show, it would show only users from that
section in the gradebook2 broke. this fixes it.

refs: #6844, fixes: #6849

test plan:
 * go to /courses/x/gradebook2 for something with 2
   sections
 * choose a different section to show in the top
   left
 * verify that it filtered the students it is
   showing to just those in that section

Change-Id: I8051c6778e6959c9f2767edaa9e89ae453727bdb
Reviewed-on: https://gerrit.instructure.com/7990
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
2012-01-12 17:18:19 -07:00
Ryan Shaw 26df737606 fix rounding issue in gradebook2, fixes: #6802
test plan:
 * in gradebook1, have the total grade for a row
   have a decimal (like 33.3%)
 * load gradebook2 and verify that it is a decimal
   rounded to 1 place too (so 33.3% and not 33% or
   33.33%)

Change-Id: I5f5f2de5b3fe953690b678aa956279c471c84d9d
Reviewed-on: https://gerrit.instructure.com/8036
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jake Sorce <jake@instructure.com>
Tested-by: Jake Sorce <jake@instructure.com>
2012-01-12 17:16:01 -07:00
Zach Pendleton 54fc56e36d fix course creation message. fixes #6854
affects: course creation on /accounts/:id
test plan:
  * navigate to courses page for account;
  * click 'Add a New Course' button;
  * fill out new course form and click 'Add Course';
  * verify that (1) modal closes, and (2) flash message
    appears.

Change-Id: Idce434d288dd8b81a29edfd1b5144c0dcedfc7ea
Reviewed-on: https://gerrit.instructure.com/8032
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
2012-01-12 17:03:59 -07:00
Zach Pendleton 0399355a78 add pseudonym creation api. fixes #6841
affects: pseudonyms_controller/api
test plan:
  * as authorized user, post request and verify
    that new pseudonym is created;
  * as authorized user, post duplicate pseudonym
    and verify that 400 is returned.
  * as unauthorized user, post request and verify
    that 401 is returned.

Change-Id: I4b2ad73dd68f43a935e37d3fe9f02f4d0269b72a
Reviewed-on: https://gerrit.instructure.com/8024
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
2012-01-12 16:55:13 -07:00
Jacob Fugal 89a1e422c0 don't redirect to /courses/X xhr to settings
for a user with :read_as_admin but not :read permissions to a course
(odd, but currently happens for designer enrollments in an unpublished
course) the user is redirected from the course "Home" to the course
settings. however, the settings page turns around and makes an xhr
request to /courses/X again for some data. don't redirect that call or
you get an infinite loop.

also, this change cuts out the unnecessary remainder of
CoursesController#show for xhr requests; before we still did all that
work and then just ignored it.

Change-Id: I4b6d39c8bf4e12173a4aa168903d2148f89c7a3d
test-plan:
  - create an unpublished course
  - enroll a designer in that course (currently only possible via sis or
    console)
  - while logged in/masquerading as the designed, visit the course's
    settings page
  - confirm there is *not* a runaway xhr recursion
Reviewed-on: https://gerrit.instructure.com/8039
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
2012-01-12 16:53:08 -07:00
Brian Palmer 28d57eb3c7 don't do extra redirect in LDB popup window
fixes #6636

there seems to be a race condition where this redirect will sometimes
happen before the LDB notices the params telling it to go into
fullscreen lockdown mode. so we just avoid the redirect, which isn't
necessary since we didn't make a post request anyway.

test plan: in the LDB, go to a quiz that requires the LDB, ensure that
it goes fullscreen.

Change-Id: Idf94ae56ce5e695f51fe75da9d98611f60164666
Reviewed-on: https://gerrit.instructure.com/7564
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
2012-01-12 15:35:14 -07:00
Ryan Shaw 7ccb815b87 get rid of a debugger
Change-Id: I538d6f1d8bf793a1e5774e27e82c72d87f3e30ac
Reviewed-on: https://gerrit.instructure.com/7942
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
2012-01-12 15:15:01 -07:00
Zach Wily d3b25ae4dc use the first active email channel when using default notification policy
We were just finding the first CommunicationChannel, which might even be
retired. This will make sure we get an active one and it's an email one.

test plan:
 * (perform all these steps on a new account, and don't go into the
   notification preferences screen)
 * Create a new account with an email address X
 * Add a new, secondary email address Y to your account
 * Delete the email address X
 * As another user, start a conversation with the user created above.
 * Verify that you received the email notification at email address Y and not
   X.

Change-Id: I7b16001918c5f39b5929e0f520069838a10bcf66
Reviewed-on: https://gerrit.instructure.com/8035
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Zach Wily <zach@instructure.com>
2012-01-12 13:05:47 -07:00
Cody Cutrer 7ccca7a827 only include submissions visible to a user in zip fixes #5998
test plan:
 * create a course, assignment, and submissions
 * add a ta limited to a section
 * download the submissions zip for an assignment
 * it should only include submissions for students
   in the section the ta is a part of

Change-Id: I68e580301ad284186ec25742bc5869ae031baa69
Reviewed-on: https://gerrit.instructure.com/8015
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
2012-01-12 12:44:09 -07:00
Cody Cutrer 7027820df7 fix masquerading with shard-global ids refs #3520
find_by_* does a data type check, so doesn't work with non-integer ids

test plan:
 * log in as site admin
 * access an account on a different shard
 * masquerade as someone
 * unmasquerade

Change-Id: I672d96560d1598801a51f3e5252b32bcbd365fc7
Reviewed-on: https://gerrit.instructure.com/7817
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
2012-01-12 11:52:11 -07:00
Zach Wily def5121fa7 try harder not to create scribd jobs for non-scribdable files
Somehow the after_attachment_saved callback in Attachment was getting called
on non-scribdable attachments with a workflow_state of 'processing'. We were
previously only skipping non-scribdable attachments if the workflow_state was
'pending_upload'. Now we will skip scribd processing for any non-scribdable
attachment, no matter it's state.

Also changed UnzipAttachment to only create a scribd job if there are any
scribdable attachments.

test plan:
 * Since we're not sure how the attachments originally got in the state
   described above, it's hard to describe repro steps. However, if you upload
   some images, they should not get scribd jobs created for them.

Change-Id: I7381af3f0928c2decf4f224834780cc90fbbc103
Reviewed-on: https://gerrit.instructure.com/8028
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2012-01-12 11:09:06 -07:00
Zach Pendleton eb744ac9ea include site admin css and js in all sub-accounts. fixes #6760
if the site admin account has a global stylesheet or
javascript include, include those files in all other
accounts.

affects: application layout
test plan:
  * run specs

Change-Id: I87031fef39eac7ec77e318257c26b5378819a669
Reviewed-on: https://gerrit.instructure.com/7963
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
2012-01-11 18:25:25 -07:00
Zach Wily 1b75432516 make conversation message "immediately" by default
When a user didn't have any notification policies, default values are used to
decide when to send them notifications to their communication channel. Since
Conversation Message didn't have a default set, it used 'daily'.

It looks like there's another issue where anything except for 'immediately'
would not get sent at all. (It wouldn't get batched up for the digest email).
See communication_channel.rb:216. That should probably be fixed separately.

This fix will just address the common use case where people expect to get
emails about Conversations without having to do anything extra.

test plan:
 * create a new user, verify the email address, etc, but do not save any
   notification preferences.
 * as another user, start a conversation with the new user.
 * verify that the new user got a Message or email about the conversation
   message.

Change-Id: Ib198ba528a80a8b1576d236bfbd91b3cc72980db
Reviewed-on: https://gerrit.instructure.com/7991
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2012-01-11 09:32:18 -07:00
Cody Cutrer 7e97621462 store sis_batch_id as an integer, not a string
test plan:
 * run the migration
 * redo the migration
 * do a batch mode sis import

Change-Id: I0204256f3825ffe0b4d252bbb83a0604d7a58942
Reviewed-on: https://gerrit.instructure.com/7904
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Reviewed-by: Ben Chobot <bench@instructure.com>
2012-01-11 09:14:36 -07:00
Zach Wily f26826f7fc fix showing the date range for a reserved appointment in scheduler
semanticDateRange returns html, so the handlebars template needs to use {{{}}}
so the html isn't escaped.

test plan:
 * Create an appointment group as a teacher
 * Reserve one of the slots as a student
 * Verify that the green box in the appointment list shows the time chosen
   correctly without any of the html.

Change-Id: If4f4732b5dea9e169c7c88701b3c7c10faf69720
Reviewed-on: https://gerrit.instructure.com/7977
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Tested-by: Zach Wily <zach@instructure.com>
2012-01-10 16:05:49 -07:00
Jon Jensen 22306b53e1 more efficient User#messageable_users
when a user is enrolled in one or more courses, we now give the query
planner a more efficient way of finding rows in the course subselect in
User#messageable_users. the new condition is redundant (and less
restrictive than the course_sql ones), but it ensures the planner will
use the index on enrollments.course_id and then filter on the other
fields.

the performance gains are most relevant in mysql when there are multiple
conditions in course_sql (from ~4s down to <0.01s)

test plan:

ensure the various course_sql paths work (e.g. section visibility).
existing specs should already cover these different flows

Change-Id: I11d41daa1134146abd2b099be24e873d47ef567b
Reviewed-on: https://gerrit.instructure.com/7450
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jacob Fugal <jacob@instructure.com>
2012-01-10 13:41:11 -07:00
Jon Jensen a41081cf22 fix dashboard notifications for appointments
display stream items for new and updated appointment groups, as well as
when someone signs up another user (e.g. group signup)

removed unused message templates, fixed date_string range to just show a
single date if date parts are the same

test plan:

1. publish an appointment group and ensure all pertinent students get a
dashboard notification
2. add times to an appointment group and ensure all pertinent students
get a dashboard notification
3. sign up a group for a timeslot and ensure all other group members
get a dashboard notification

Change-Id: Id0dec52c0376fb6e14b0f26bb60e4695b25f7591
Reviewed-on: https://gerrit.instructure.com/7938
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2012-01-10 13:40:25 -07:00
Ryan Shaw e08e43620b highlight days with appointment slots available
Change-Id: I7ce826d60a78b7b50e13835226115d8c259c90f6
Reviewed-on: https://gerrit.instructure.com/7928
Tested-by: Zach Wily <zach@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2012-01-10 13:39:02 -07:00
Cameron Matheson dfe2864a36 fix time block bug
I kind of think the real bug is being able to delete the last blank row,
but maybe we want people to be able to delete that

test plan:
- fill out a time range
- fill out a second time range
- delete the 3rd (blank) row
- click split

Change-Id: I8339bca9f84bf913b41a65446ef738d86b366cf6
Reviewed-on: https://gerrit.instructure.com/7945
Reviewed-by: Zach Wily <zach@instructure.com>
Tested-by: Zach Wily <zach@instructure.com>
2012-01-10 13:16:54 -07:00
Bracken Mosbacker f6a458d7d6 improve errors on content migrations list
Test Plan
 * Import any ol' non-canvas zip file so the import will fail
 * Follow the now-friendlier link in the email that was sent to you
 * Expand the errors/warnings and see if there is a link to download your file and (if you are site admin) there is a link to the error report.

refs #6607

Change-Id: Ia49070d94ccb26c9c20833a36f3ac7caa742806b
Reviewed-on: https://gerrit.instructure.com/7870
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Cody Cutrer <cody@instructure.com>
2012-01-10 13:04:13 -07:00
Bracken Mosbacker cc146e1b2e make saml entity use the account's domain
AccountAuthorizationConfigs now require the entity_id to
be set for SAML configs. It will be set to the domain of
the account. For existing SAML configs, the entity_id will
be set to what is in the SAML config file if there is one.

This commit also allows SAML meta data to show up for all
domains even if they're not configured for SAML. This helps
admins set up initial SAML configurations.

Test Plan:
 * Create a saml configuration for an account
 * Look at the metadata, the entity_id should be set to the domain/saml2 and not what is in the saml config file
 * Try loading the meta data for an account with no SAML config. It should load and have the proper entity_id

closes #6713

Change-Id: Ia98543c996285d9b1febd788c3f3ec072b672b12
Reviewed-on: https://gerrit.instructure.com/7967
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2012-01-10 12:45:08 -07:00
Zach Pendleton cc06e7e741 add option to send notifications for quizzes. fixes #2416.
when updating a quiz, give user an option to notify or not
notify users of the change.

affects: quizzes_controller, quiz model
test plan:
  * create quiz;
  * modify quiz with notify checkbox checked, verify
    that message is created;
  * modify quiz with notify checkbox unchecked, verify
    that message is not created;

Change-Id: I847741e36b601523eb8e46c36f4e9b70a7f119ec
Reviewed-on: https://gerrit.instructure.com/7939
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
2012-01-10 12:25:20 -07:00