Commit Graph

873 Commits

Author SHA1 Message Date
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
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 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 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
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
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 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
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
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
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 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
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
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
Cody Cutrer f491308163 drop unused user.creation_* columns
test plan: run the migration

Change-Id: I75184edd64ddee384de485c443d4c7eee45cc26f
Reviewed-on: https://gerrit.instructure.com/7895
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
2012-01-10 10:49:49 -07:00
Zach Wily b3a6deadc2 Revert "add id to wiki page urls."
We've decided to approach this another way. See redmine #2635.

This reverts commit d9d5715b2b.

Change-Id: Ib497319994294a4fc0fe0da47acbde692e00fd91
Reviewed-on: https://gerrit.instructure.com/7961
Tested-by: Zach Wily <zach@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2012-01-10 10:45:48 -07:00
Simon Williams 64d687ec87 handle decimal points in rubrics correctly
allow points in rubric criteria and ratings to have decimal values. in working
with brian, we're operating under the following assumptions:
- round to 2 decimal places
- splitting always gives you a integer by default (you can change it yourself after)
- if there's not room to split with an integer, repeat the low value

test plan
- create a new rubric
- change a criterial value to something with a decimal point
- try setting specific ratings with decimals
- try to split between a large space (ie 10.5 and 0), should be 5
- try to split between a small space (ie 0.5 and 0), should be 0

closes #5355

Change-Id: I17e26fe18dda0847fa59dd40976e4d6f38851287
Reviewed-on: https://gerrit.instructure.com/7882
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Brian Palmer <brianp@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
2012-01-06 16:34:48 -07:00
Cody Cutrer 3686b2d1eb drop unused column accounts.type
test plan: run the migration, then the specs

Change-Id: Idec29c0a9cf43a581e0ca9eae00248599270745c
Reviewed-on: https://gerrit.instructure.com/7896
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
2012-01-06 15:56:23 -07:00
Cody Cutrer d9a23a9bd0 improve communication channel uniqueness check
fixes #6786, #6789

the uniqueness check was failing if there was a matching retired cc,
even though this cc is the only active/unconfirmed one.  so
instead write a custom validator that only searches for
active/unconfirmed ccs.

test plan:
 * manually add the same email address to a user multiple times,
   in a retired state (in script/console, or directly in the db)
 * try to add that email address to the user in the UI
 * it should work

Change-Id: I41bdff34ffcd273d82d1d251e45c1ce48b61d51c
Reviewed-on: https://gerrit.instructure.com/7889
Tested-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
2012-01-06 15:35:19 -07:00
Jacob Fugal daf2a48e23 fix typo; fixes #6755
test-plan:
  - create a course A
  - create a graded quiz in course A
  - create a course B
  - go to import content from course A into course B
  - make sure "Copy Everything from A", "Quizzes for A", and the
    specific quiz from A are all unchecked.
  - check the assignment for the specific quiz from A.
  - click "Import Course Content"
  - the quiz should be imported from A to B without error

Change-Id: I88511511f6c8494ec04d551af3f15a2b32e374f1
Reviewed-on: https://gerrit.instructure.com/7914
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2012-01-06 15:05:50 -07:00
Jon Jensen 640008a869 calendar redirection, switcher link
added a domain-account-level setting controlling whether or not the
scheduler is enabled. when it is turned on,

 1. /calendar requests redirect to /calendar2 by default
 2. both the new and old calendar pages include a link to the other
    calendar (sets a user preference so that it redirects correctly in
    the future)

Change-Id: I1817c7f8e9075282ab1988088f5c0ef8d63325f6
Reviewed-on: https://gerrit.instructure.com/7840
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2012-01-06 14:33:44 -07:00
Ryan Florence c2eca84757 Use versions in Submission#quiz_submission_version
fixes #6048 

somehow the submission's submitted_at.usec was
less than the quiz submissions finished_at.usec

this caused the speed grader to display the wrong
quiz version for affected quizzes

changed the logic around to find the latest
version using the version number, instead of dates

Change-Id: I78d6045f07ee76fa5e2b5abeeb42eed539f5da7c
Reviewed-on: https://gerrit.instructure.com/7898
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
2012-01-06 14:12:44 -07:00
Zach Wily 6059b1ca20 calendar2 and scheduler front-end; refs #3395
Change-Id: I784270214246ef7e816dede01ccf35e0c263e0a8
Reviewed-on: https://gerrit.instructure.com/7824
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
2012-01-06 13:15:37 -07:00
Jon Jensen 80c90587d6 calendar and scheduler apis; refs #3395
Change-Id: I0bafb21630086ff2a99b8b881568bff51afabedc
Reviewed-on: https://gerrit.instructure.com/7823
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2012-01-06 12:35:27 -07:00
Zach Pendleton 28198d2699 remove identity bar from cache when inbox count changes. fixes #6027.
affected areas: conversations, identity header view.
test plan:
  * create two users, A and B;
  * enable caching in your test environment;
  * send message to user A from user B;
  * as user A, read message;
  * refresh conversations page and verify that
    identity header no longer has "1" next to
    "Inbox."

Change-Id: I7a2c8845619d122b10b6d27f9585ce036de25113
Reviewed-on: https://gerrit.instructure.com/7865
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2012-01-05 15:38:29 -07:00
Cody Cutrer 057a8c8930 remove sis_source_id from enrollments API
this hasn't been released yet, and doesn't actually mean anything

test plan: run the specs

Change-Id: I391623e63fa7710717c26f33dac9c5ae220577e3
Reviewed-on: https://gerrit.instructure.com/7902
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Cody Cutrer <cody@instructure.com>
2012-01-05 15:36:56 -07:00
Ryan Shaw a417559b2e help dialog overhaul fixes: #5784
does a few things: consolidate the help
and support links at the bottom of the page
into 1 and calls them "help"

allows a school to set their own custom
help links to show in the help dialog so
they can link to their campus LMS support
in addition to our help options.

also cleans up the flow for teacher feedback and
submitting a ticket.

test plan:

* go to the account settings page of a root account
* you should see an option there to set up "custom
  help links", create a couple
* click the help link in the footer and the top left,
  a dialog should appear with the old options as well
  as the ones you set up.
* as a student, click the help link, click the teacher
  feedback option, fill out the form, the teacher AND TA's
  in that class should have got a canvasation.
* click the file a ticket option, fill out the form,
  zendesk should have a new issue with the
* and of course the specs in helpDialogSpec.coffee and
  help_dialog_spec.rb should pass

Change-Id: If2d841c00b28ece55eb118085ee8728b0de96c08
Reviewed-on: https://gerrit.instructure.com/7153
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
2012-01-05 09:19:42 -07:00
Brian Palmer 2c160d745f don't send notifications to unconfirmed communication channels
fixes #4805

test plan:
- set up a new email address or SMS in your profile
- in the notifications tab of the profile, add that new unconfirmed
  address to "For new conversation messages" and save
- as another user, message your first user, confirm the notification
  goes to the active channel but not the new uncofirmed one.

Change-Id: Id34540486e9107e829cacf9a7badcac15ede1dd6
Reviewed-on: https://gerrit.instructure.com/7859
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
2012-01-04 16:33:39 -07:00
Cody Cutrer b9fee70ee6 use Pseudonym.custom_find_by_unique_id instead of find_by_unique_id
so that it's case insensitive

also fix some latent CommunicationChannel.find_or_initialize_by_path
discovered by specs for this

test plan:
 * run the specs
 * use forgot password with a username that differs in case
 * self-register a new user multiple times (without confirming)
   with e-mail addresses that differ in case

Change-Id: I476325f591c997fc8d50d5f38480177f732f07a7
Reviewed-on: https://gerrit.instructure.com/7724
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2012-01-04 15:58:40 -07:00
Brian Palmer fe83f12449 only queue one recompute_final_score per user+course
for users with multiple enrollments in a course, we were queuing a job
for each enrollment.

closes #6761

test plan: this doesn't have a user-visible effect, it just cuts down on
the number of jobs and avoids deadlock possibilities on postgresql,
since it does row-level update locking.
  * run the specs
  * ensure that final scores are still computed

Change-Id: I7024c7a2e524ffc4e7561d7a65327874d685e28b
Reviewed-on: https://gerrit.instructure.com/7816
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2012-01-04 11:24:25 -07:00
Cody Cutrer 795b372024 don't add items to list if their scope is nil
also remove existing attachments that aren't in a folder from their list

test plan:
 * run specs
 * create sis batches - make sure their position is NULL
 * destroy their associated attachment, the query logs should not indicate
   an UPDATE attachments SET position = position - 1... being executed

Change-Id: I6117c2ade0ef5ec41a3ffeeb13096b9d8473f3f9
Reviewed-on: https://gerrit.instructure.com/7843
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2012-01-04 11:16:50 -07:00
JT Olds f9a8f32164 api json conversion improvements
* adds course url to course record
 * adds avatar url to users record more globally

test plan: make api calls that return courses or users, ensure they still work

Change-Id: I1db69fe3865a39744ba7f3fcc7fc885f46c6551b
Reviewed-on: https://gerrit.instructure.com/7496
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2012-01-03 15:09:20 -07:00
Cody Cutrer de92da47b0 remove the account.root_account || account idiom
just make Account#root_account return self if it is a root account

test plan:
 * run existing specs

Change-Id: Iff3f621bb722e0f5e90659c4b711d48d8d3c510f
Reviewed-on: https://gerrit.instructure.com/7700
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
2012-01-03 11:47:33 -07:00
Cody Cutrer e280a309d2 don't use presence/absence of root_account(_id) to determine if an account is a root account
in preparation for having Account#root_account return self if it is a root account

also remove some unused named scopes

test plan:
 * run specs

Change-Id: I8c78c45f0d2f6002021bc2bba594de8bcbaa086b
Reviewed-on: https://gerrit.instructure.com/7698
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
2012-01-03 11:47:22 -07:00
Cody Cutrer 2b2f49d66f search for communication channels case insensitively fixes #6750
test plan:
 * create a user via SIS import with an e-mail address
 * add a different e-mail address to the user
 * re-import the user via SIS, and set their e-mail address
   to the second e-mail you added, but with a different case
 * the user should have a single e-mail address, the one set
   in the second SIS import

Change-Id: Iab6b16e0b37cfb8caac3faa453be570b99621a9e
Reviewed-on: https://gerrit.instructure.com/7784
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
2011-12-30 19:36:29 -07:00
Brian Palmer bd14bce32c fix assignment after_saves not running
the initial implicit external_tool_tag save was failing, causing the
after_saves to silently fail. this commit fixes things up to use more
standard rails functionality, and do validation correctly.

test plan:
  * create an assignment that isn't an external tool, select more
    options, confirm that the assignment saves and things like the cache
    invalidation happened.
  * create an assignment that is an external tool, confirm that the save
    succeeds.

fixes #6488

Change-Id: Ibb52af218b5fb975cfbfb13cc5af25750479fcbf
Reviewed-on: https://gerrit.instructure.com/7753
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-12-30 10:18:01 -07:00
Bracken Mosbacker 2478f305a8 don't strip numeric (and other) types when saving questions
The translating of attachment links caused non string/array/hash
types to become nil in the question_data hash

Test Plan:
 * Create a question in a question bank
 * Edit the points possible
 * reload the page, the points possible should be what you set them to

closes #6718

Change-Id: Ib4eaecff3a8540ffe1349603ce9236960f762461
Reviewed-on: https://gerrit.instructure.com/7761
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-12-29 21:32:50 -07:00
Brian Whitmer b02a09c626 xml config for blti extensions
test plan:
- copy xml from http://lti-examples.heroku.com/config/editor_button
- go to course settings and start creating a new tool
- choose xml paste, and paste xml
- save the tool
- confirm the tool says "Editor button configured"
- load a WYSIWYG in the course, confirm the new editor button appears

- do the same thing but by URL instead of XML paste

- confirm that normal tool configurations still work correctly

Change-Id: I6bb53bde1986e9dda40488018e167bb626907453
Reviewed-on: https://gerrit.instructure.com/7527
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-12-29 15:10:48 -07:00
Bracken Mosbacker c6ba1db5af correctly account for time zone in quiz#due_at=
Test Plan:
 * Make sure your user's time zone is not UTC
 * Create a quiz with a due at date and time
 * After saving the quiz go to the show page for the quiz "/quizzes/:id"
 * The date/time on that page should be the same as you set it

closes #6723

Change-Id: I69c4e08d90d4f384465a789582c4b1457539265d
Reviewed-on: https://gerrit.instructure.com/7699
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-12-27 16:46:59 -07:00
Bracken Mosbacker 200ab29600 api for external tools on courses and accounts
Test Plan:
 * Create a tool with api
 * Edit tool with api
 * Get tool with api
 * List tools with api
 * Delete tool with api
 * Etc., etc.

closes #6589

Change-Id: I3f1adc97937588534f8005574bd0278b6f03cbde
Reviewed-on: https://gerrit.instructure.com/7612
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-12-27 09:05:32 -07:00