Commit Graph

863 Commits

Author SHA1 Message Date
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
Cameron Matheson 926865e3f9 always wrap content-disposition-filename in quotes
fixes #6715

Test plan:
- configure canvas to use s3 as file store
- upload a file with a space in its filename
- download the file in firefox

Change-Id: I1ea40bc63965369e7ce26b09ea910db7032ac8ae
Reviewed-on: https://gerrit.instructure.com/7671
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
2011-12-22 19:18:35 -07:00
Cameron Matheson 46b392afbb properly handle unicode filenames (fixes #6376)
Test plan:
 * use s3 as your file store
 * upload a file that has unicode characteres in its filename (糟糕)
 * download the file

Change-Id: Ic3d2e99ac7e6840cb3a6e992873db9feb1148886
Reviewed-on: https://gerrit.instructure.com/7361
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
2011-12-22 19:18:05 -07:00
Jacob Fugal dc07470919 Roles API; refs #6182
only adds the creation mechanism requested by #6182 for now

test-plan:
  - try the API action to create a new admin role specifying
    explicit/enabled/lock for some or all permissions
  - try without giving a role name; should fail
  - try giving an already used role name; should fail
  - try using a reserved role name; should fail

Change-Id: I3b38247dccb704da694b0fd32df16cdd63df6810
Reviewed-on: https://gerrit.instructure.com/7553
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-12-21 09:27:47 -07:00
Jacob Fugal 399355c9dc replace usage of Date.today
Date.today does not accomodate Time.zone. This is a problem when the
time at the time of the call is between Time.zone's midnight and the
system time zone's midnight; Date.today will think it's a day
earlier/later (depending on direction of offset) than Time.zone.today in
that case.

Change-Id: I54083d26dcf704ac00d812597ee6aec95ffa0685
Reviewed-on: https://gerrit.instructure.com/7584
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2011-12-20 15:25:45 -07:00
Zach Pendleton 82ad7ee0f5 add course enrollment creation api. fixes #6559.
new api available at /courses/:course_id/enrollments.
takes params:
  * enrollment[user_id]
  * enrollment[type]
  * enrollment[workflow_state]
  * enrollment[sis_source_id]
  * enrollment[course_section_id]
  * enrollment[limit_privileges_to_course_section]

affects: api
test plan:
  * post all params and ensure that new enrollment is
    created;
  * post params with workflow_state of active and
    verify that user is properly enrolled in course;
  * post only user_id and type to verify that they
    are only required params;
  * post as unauthorized user to verify that 401 is
    returned;
  * post without user_id and/or type to verify that
    error message is returned with 403 status.

Change-Id: I38e8df930efb2793bf0fa6a190f74f7fb37c7f78
Reviewed-on: https://gerrit.instructure.com/7375
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-12-19 16:48:50 -07:00
Zach Pendleton 3ca0c208c9 fix spelling of "privileges" in enrollments.
enrollments previously had attribute
"limit_priveleges_to_course_section," but should
be spelled "privileges." replaced spelling in a
migration and across app.

affects: enrollments model
test plan:
  * run specs

Change-Id: I15dcf9a023ead9bb1aed42abc2d1a7c233610840
Reviewed-on: https://gerrit.instructure.com/7431
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-12-19 16:48:42 -07:00
Cody Cutrer f9f9f53426 use the association for User#email=
test plan:
 * run specs

Change-Id: I793b54206c7d10ce9f2986064dc3463d7c97dc7a
Reviewed-on: https://gerrit.instructure.com/7558
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-12-19 16:37:03 -07:00
Bracken Mosbacker e98c5059d7 fix infinite recursion in outcome groups
The learning outcome UI has some bugs that allow you to
drag groups into other groups. This causes groups to have
multiple parents and so they'll show up on the page more
than once. Once that happens you can even drag a group
into itself. Once in that state loading the outcomes
page would cause an infinite render.

This commit makes the page render even with the existing
bad data. It also prevents groups from being added to a
group of any of its ancestors. It also fixes groups
having multiple parents.

This commit doesn't address the current bugs in the UI that
allowed these problems to happen, it just prevents those
from creating relationship loops.

Test Plan:
 * Load outcomes page and create two groups
 * Drag one group into the other group
 * Refresh page, there should not be two of the group you dragged
 * If you want to test the page loading despite existing bad relations:
 * Create a content tag that makes a group point to itself like the specs do. (You can't make this happen in the UI anymore)
 * Loading the outcomes page shouldn't freeze

Change-Id: I416e99b3bc57a3b8c82db5cc895bccd141dc3dab
closes: #6384
Reviewed-on: https://gerrit.instructure.com/7559
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-12-19 16:28:26 -07:00
Cody Cutrer 2a5dd2ab17 allow access to authentication settings for site admin
pseudonyms are now created directly under site admin, so it makes to
allow a different auth backend

test plan:
 * go to site admin, should see authentication tab on the left

Change-Id: I1f6487f922a6223a7b7269791c4be896dc472a93
Reviewed-on: https://gerrit.instructure.com/7459
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-12-19 10:58:55 -07:00
Zach Pendleton 86580eb0a8 add course creation to api. fixes #6539
courses can now be created by posting to
/api/v1/accounts/:account_id/courses. it accepts
the following params:

  * account_id
  * offer
  * course[name]
  * course[course_code]
  * course[start_at]
  * course[conclude_at]
  * course[license]
  * course[is_public]
  * course[allow_student_wiki_edits]
  * course[allow_student_assignment_edits]
  * course[allow_wiki_comments]
  * course[allow_student_forum_attachments]
  * course[open_enrollment]
  * course[self_enrollment]
  * course[sis_source_id]
  * course[sis_name]
  * course[sis_course_code]

test plan:
  * post the above params to /api/v1/accounts/:account_id/courses
    as a site or account admin and verify that a new course is
    created;
  * post an empty params[:course] to the api as a site or account
    admin and verify that it creates a course named 'Unnamed
    Course.'
  * attempt to create a course as a non-admin user and verify
    that a '401 Unauthorized' response is returned.
  * attempt to create a new course as a site or account admin and
    set the 'offer' param to true. verify that the course is
    immediately available.

Change-Id: Ie5f9af8bfe3a7ec189c5532b73f5ab28314d02cb
Reviewed-on: https://gerrit.instructure.com/7330
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
2011-12-19 08:27:49 -07:00