Commit Graph

780 Commits

Author SHA1 Message Date
Cameron Matheson d315baa896 keep root_account_id in sync between course/enrollments
fixes #6142

test plan: Create a course and enroll some students.  Move the course to
  another root account.  The following SQL query should return 0:

    SELECT COUNT(e.id) FROM enrollments e
    INNER JOIN courses c ON e.course_id = c.id
    WHERE e.root_account_id != c.root_account_id

  To test the migration, mess up some of the enrollment
  root_account_ids:

    UPDATE enrollments SET root_account_id = 99

  Before migrating, the SELECT COUNT snippet above should return
  false, after migrating, it should return true.

Change-Id: I9b18dded8a763a8a05f5e631907f77b4e9a1bd49
Reviewed-on: https://gerrit.instructure.com/7081
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
2011-11-28 14:29:58 -07:00
Cody Cutrer 6caf502bb8 drop SisCrossListedSection
it's ancient cruft

test plan: n/a

Change-Id: I20912454e9b35be4a292efff33a5fe2913f0bd09
Reviewed-on: https://gerrit.instructure.com/7169
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: JT Olds <jt@instructure.com>
2011-11-28 14:27:10 -07:00
Cody Cutrer 9bb60e48b2 don't allow setting sis id on root accounts
testplan: try to set an sis id via the UI, a raw request, or the console

Change-Id: I9749031729bf7d94070f4fd67c0a2f595ce337ed
Reviewed-on: https://gerrit.instructure.com/7007
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2011-11-28 13:54:14 -07:00
Cody Cutrer dd5ef48836 don't special case the default account to be "Instructure"
that's only true for Instructure, and not for hosted or open source
installations

test plan: n/a

Change-Id: I63c3c163fba410da758c4b0fe132332c0460abbc
Reviewed-on: https://gerrit.instructure.com/7009
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: JT Olds <jt@instructure.com>
2011-11-28 12:50:46 -07:00
Cody Cutrer 1546835901 create pseudonyms in the target account when merging temporary users
refs #6177, #6199

test plan: (only relevant with a plugin that changes the behavior of
  Pseudonym#works_for_account?; otherwise behavior should be unchanged)
  enable open registration, invite a user that already exists, but
  doesn't have a pseudonym in the account you're inviting them to.  accept
  as the existing user.  they should now have a pseudonym in the target
  account, copied from another account (preferentially the default account)

Change-Id: Ia86888524a5132387bb120df3262d7205d8e04d1
Reviewed-on: https://gerrit.instructure.com/6983
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: JT Olds <jt@instructure.com>
2011-11-28 11:32:32 -07:00
Cody Cutrer 310ebfccd4 remove unused methods
Change-Id: I4605e263c1ed5369ac83fea3b8c6f784faf92b10
Reviewed-on: https://gerrit.instructure.com/6998
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: JT Olds <jt@instructure.com>
2011-11-28 10:48:06 -07:00
Jacob Fugal 5e9ae28f13 cleanup links in quiz questions; fixes #6212
find links in quiz questions from courses other than the course the
question's quiz is in; find related assessment question and pull the
corresponding link from there to use instead.

Change-Id: I4dd2f0c279a6263f753ec898dc17e91e62997923
Reviewed-on: https://gerrit.instructure.com/6910
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2011-11-22 16:23:44 -07:00
Brian Palmer 4ef50c16d8 make "stay logged in" use a one-time token
closes #6382

Previously, the "stay logged in" cookie just used the authlogic default
implementation, which is the pseudonym persistence_token. This is a
problem, because that persistence_token only ever changes when the
pseudonym password changes, so it's the same everywhere; so if that
cookie is stolen, it's valid for a very long time.

This switches us to one-time-use tokens that expire as soon as the token
logs the user in once. Each user agent also gets a different
one-time-use token.

Change-Id: I4f20cd7759fd74590e82ed55797552e342243d49
testplan:
  * Check that no token is set at all when "stay logged in" isn't
    selected.
  * Check "stay logged in", and verify:
    * That you don't have to login again after restarting your browser,
      but your _normandy_session got reset.
    * That if you save and try to replay using the same
      pseudonym_credentials, they don't work the second time.
    * That a second browser will get a different pseudonym_credentials
      value, and using one token doesn't affect the other.
    * That once the token is used, a new one is generated and set in
      your cookies. Verify this new token works as well.
    * That logging out removes the pseudonym_credentials cookie in your
      browser. And also that manually restoring this cookie still
      doesn't log you in, since it was removed server-side as well.
  * Change your password, and verify that the existing "stay logged in"
    tokens no longer work.
  * Delete your pseudonym, and verify the same.
Reviewed-on: https://gerrit.instructure.com/7093
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2011-11-22 10:15:13 -07:00
Brian Palmer aa1bc1f6f2 don't return the session cookie when remember_me isn't selected
refs #6382

testplan:
  * Login without selecting "stay logged in", and verify that no
    pseudonym_credentials cookie is set, not even a session cookie.
  * Verify the same when logging in via SSO.

Change-Id: I3bbb4f1057d2876541772b868f03f13df947c96a
Reviewed-on: https://gerrit.instructure.com/7092
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
2011-11-21 15:33:32 -07:00
Jon Jensen ca0c0c43b4 fix performance and correctness of triggers, closes #4471, #5168
fixes the behavior such that we only toggle ungraded assignment counts
related to a particular user when his active enrollments in a given
course go from zero to one and vice versa.

also fixes performance issues in mysql. this required a custom trigger
body. see https://github.com/jenseng/hair_trigger/commit/326a10c for
the related hairtrigger commit to support this

Change-Id: Ie36b3d33ced69321f3a87468ab56480b1378d235
Reviewed-on: https://gerrit.instructure.com/6808
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-11-21 09:06:43 -07:00
Cody Cutrer 0fb3b5a925 show invitations for temporary users to users that have the same e-mail
refs #5833

testplan: enable open registration, invite a user, have that user accept
  and create a new account.  Then invite with the same e-mail again,
  login as the old user, and the invitation should be visible in the UI.
  Accept the invitation, using the existing account, and the enrollment
  should not be duplicated in the UI.

Change-Id: I64c886617f87f64bad35593229ee18434163ca7b
Reviewed-on: https://gerrit.instructure.com/6778
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-11-18 13:38:19 -07:00
Brian Whitmer adc975475c Basic LTI link selection helper
In current BLTI there are two options for adding links:

- know the URL beforehand
- know a "naked" URL that can be associated with a resource
  but not until after embed

Neither of these are great for the end-user. This commit
adds a third option, as discussed with some other users of
BLTI, where instead the user can click a link in the UI
to load an iframe where they can then find the specific
resource they want to embed. They never need to know
any URLs to make this happen.

to configure an external tool:
tool.settings = {
  :resource_selection => {
    :url => "http://<canvas_domain>/selection_test",
    :text => <label>,
    :selection_width => <iframe_width>,
    :selection_height => <iframe_height>
  }
}

test plan:
- configure an external tool on the course
- click to add an item to a course module
- select "external tools"
- pick the tool from the list
- select a link from the dialog
- make sure the link was inserted correctly

- try clicking the first "bad" link in the tool and confirm error is caught

- try clicking the second "bad" link in the tool and confirm error is caught

- try clicking the this "bad" link in the tool and confirm no errors occur

- make sure an account-level tool also appears

Change-Id: I47fd8461f1050c332e5cae32d9a3141a8de5b38d
Reviewed-on: https://gerrit.instructure.com/6326
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Whitmer <brian@instructure.com>
2011-11-18 11:52:39 -07:00
Cody Cutrer 0369527db4 fix saving notification preferences with score notifications disabled
closes #6114

test plan:
 * disable "Students can opt-in to receiving scores in email
   notifications", then try to update your notification preferences

Change-Id: I47df45da741fbbc349b746c590b5d5a25feab7f5
Reviewed-on: https://gerrit.instructure.com/7040
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2011-11-18 08:56:59 -07:00
Bracken Mosbacker 6e4eab5f42 add api for copying course content
Test plan:
 * use the /api/v1/courses/:course_id/course_copy endpoint to start a course copy
 * use the returned status url to make sure the status works
 * when the copy is complete make sure the course has all expected data

closes #6250

Change-Id: I95c2567d0a566d97836579dd3b7b0a224328ec38
Reviewed-on: https://gerrit.instructure.com/7032
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-11-18 08:29:23 -07:00
Cody Cutrer 9b9fd331a2 fix permission check for TAs refs #5833
also add a checkbox for admins to only search for existing users
(i.e. ignore open registration)

Change-Id: I84d2ba7992339b37506e41a50c336325af0ac73b
testplan:
 * add a student to a course as a TA
 * add a user to an account or a course as an admin, with and without
   open registration, with and without manage_user_logins permission,
   with and without checking "search only existing users" (not all
   combinations applicable, each underlying condition is checked in
   specs)
Reviewed-on: https://gerrit.instructure.com/6969
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-11-16 10:28:51 -07:00
Cody Cutrer d571046729 update account assocations when a pseudonym is deleted fixes #6215
testplan: delete all logins for an account from a user, and check
  their associations

Change-Id: I13939947e38525d4fe821cc991f622f5e117804c
Reviewed-on: https://gerrit.instructure.com/7001
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-11-16 09:02:44 -07:00
Bracken Mosbacker ba28a28d16 copy and export/import external tool assignments
External tools weren't copied when copying a course
so that is implemented here as well

test plan:
 Export/Import:
  * Create an external tool assignment
  * export the course
  * import the course into a new course
  * set the secrets on the external tool
  * make sure the assignment works in the new course
 Copy:
  * Copy a course into a new course
	* make sure the assignment works

refs #5892

Change-Id: I4aab8966b53ca2d144fddd71eefd0acbdb7c0bff
Reviewed-on: https://gerrit.instructure.com/6958
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-11-15 15:33:20 -07:00
Cody Cutrer b7bf2ba3fb introduce a named scope for finding non-account-pseudonyms
refs #6199, #6177

makes it easier for a plugin to modify the logic. also removed dummy
method in Account that is never hooked into.

Change-Id: I87e2cad5172f6dece4448d61dc4681a94c44cecb
testplan: login
Reviewed-on: https://gerrit.instructure.com/6982
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-11-15 14:47:11 -07:00
Brian Palmer a6548805ca UI for creating external tool assignments
refs #5892

Change-Id: Ife359ff2cf77926560e862366e904be43f71f10a
Reviewed-on: https://gerrit.instructure.com/6870
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Whitmer <brian@instructure.com>
2011-11-11 14:54:49 -07:00
JT Olds bf4bde1de1 order the gradebook csv assignment columns by due_date, then position
fixes #5824

testplan: for each sort criteria, make a number of assignments that
  differ in every field but the already matched sort criteria, and
  make sure the sort order is right in the csv.

  sort criteria are whether or not there is a due date, due date,
  assignment group, position, and title

Change-Id: Ia18f32de5ab2f44e3e64b582cca3df1bedd9553a
Reviewed-on: https://gerrit.instructure.com/6791
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
2011-11-11 10:07:07 -07:00
Bracken Mosbacker 28a62efa7b give option to adjust assignment points possible based on rubric points possible
Test plan:
 * create assignment worth 5 points
 * add a rubric for grading worth 10 points
 * save the rubric and choose to change or not change assignment points
 * make sure the assignment points were adjusted or not

closes #5788

Change-Id: I13668261010480ccd0c239d73eb01417d889da62
Reviewed-on: https://gerrit.instructure.com/6844
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-11-10 13:15:36 -07:00
Jacob Fugal 89d79c1ac3 create submissions when a discussion gains an assignment
if a discussion goes from ungraded to graded create any missing
submissions in the newly associated assignment for existing entries.
also, find any situations where this should have already happened and
rectify them.

test-plan:
 * using old code, create two ungraded discussions
 * have a student contribute to each discussion
 * switch the discussion to being graded
 * note there are no submissions for the student in the speedgrader
 * apply migration
 * note there are submissions for the student in the speedgrader
 * using new code, create a third ungraded discussion
 * have the student contribute to the third discussion
 * switch the third discussion to being graded
 * note there is a submission for the student in the speedgrader

fixes #5748

Change-Id: I30b90ba36c5d688cd9512bdb2d9d2df2cee06a08
Reviewed-on: https://gerrit.instructure.com/6822
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-11-10 13:06:53 -07:00
Brian Palmer ed275b3293 restrict submission actions to sections
teachers and TAs can be limited to a specific section, in which case we
need to enforce those limitations in the submissions api.

testplan: set up a course with 2+ sections, and a teacher who is only
allowed to access 1 of those sections. then verify:
  * GET /submissions should not list users in other sections
  * GET /submissions/:id for a user in another section should 404
  * PUT /submissions/:id for a user in another section should 404
  * GET for_students with user ids in other sections should not return those users
  * all of the above should return no submissions if the user attempts to access the api via /sections/:section_id of the other section

close #5859

Change-Id: I102b13d1462f588277ca559f418785452e58e816
Reviewed-on: https://gerrit.instructure.com/6796
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2011-11-10 12:08:58 -07:00
Zach Wily 5f3a79011d log the id of the assessment question when link translation fails
Change-Id: I2b0e41de7e2c9da14cbef7aa7b01e015efc69d43
Reviewed-on: https://gerrit.instructure.com/6850
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-11-10 11:57:36 -07:00
Cody Cutrer 5d5b44373d ensure that assignments are associated with a group
Change-Id: I7b6bc417bae332a9b4c95b7f32ce1b0b37cf0db2
Reviewed-on: https://gerrit.instructure.com/4338
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Whitmer <brian@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-11-09 15:01:15 -07:00
JT Olds 3783768a45 adding content tag url validation
testplan: check to make sure:
 * nil urls are allowed
 * surrounding whitespace is stripped
 * empty urls are not allowed
 * it parses a wide variety of urls
 * it adds missing schemes
 * it ensures a host exists
 * invalid schemes are rejected

Change-Id: I93e89f8e67d847d488693f7dd4f95e52c898054d
Reviewed-on: https://gerrit.instructure.com/6659
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-11-09 13:38:42 -07:00
Bracken Mosbacker 859840ef42 recalculate cached grades when an assignment is deleted/undeleted
Test plan:
 * create an assignment
 * grade a student on that assignment
 * download grade csv and make sure the final/current grades are same as web UI
 * delete the assignment
 * download/check grade csv again
 * undelete the assignment
 * download/check grade csv again

refs #5395

Change-Id: Ice1c2882f75e734758346243d8ff1a283633067a
Reviewed-on: https://gerrit.instructure.com/6755
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-11-09 07:41:04 -07:00
Zach Wily edad137315 add support for SAML encrypted assertions; fixes #5299
Change-Id: I12b9db32e324ecff043f4f72051999b0515f4e72
Reviewed-on: https://gerrit.instructure.com/6727
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
2011-11-08 15:54:22 -07:00
Brian Palmer ad8fcba2e6 remove the new wiki page notification
closes #4692

This email was sent as soon as the record was created, which wasn't at
all helpful since at that point it has no content. It also caused issues
with teachers who wanted to create hidden wiki pages, since it is sent
before the teacher has a chance to hide the page.

updated wiki page notifications will still be sent out.

Change-Id: Ie6762eafd67d683dbf942a5fb5c443dd1b2288e6
Reviewed-on: https://gerrit.instructure.com/6786
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2011-11-08 12:46:05 -07:00
Jacob Fugal c0b56aa569 force dtstart in ics to utc
fixes #5953

Change-Id: I0486b3dce2dd10f0e9881dbcc224e220ad0e257d
Reviewed-on: https://gerrit.instructure.com/6192
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2011-11-08 10:25:04 -07:00
Cody Cutrer e9eec02be8 fix display of sortable name in users list refs #5317
test plan:
  create a user with a sortable name other than what is automatically
  inferred; make sure it displays correctly in the users list for the
  account

Change-Id: I12528436571ffdd211d6d2719eb1789d9afffdd2
Reviewed-on: https://gerrit.instructure.com/6732
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
2011-11-07 16:13:41 -07:00
Cody Cutrer 84443a88b3 touch the users when transferring enrollments or merging refs #5833
Change-Id: I74dc05e1c73402aae5506893d9e746f4de8a756c
Reviewed-on: https://gerrit.instructure.com/6685
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
2011-11-07 12:20:26 -07:00
Cody Cutrer d9b4a245ba redesign merge/registration/confirmation page closes #6149
* Don't show merge opportunities for confirmation or transfer enrollment flows
 * Combine current user and other user sections into a single section
 * Use simplified wording for single merge opportunity
 * Use "add e-mail address" for logged in, non-matching single e-mail opportunity
 * Hide the registration form behind an additional click if there are merge
   opportunities
 * When a login is required to complete the action, automatically do the action
   after login, assuming they logged in as the correct user

Change-Id: If07b38702c15509af6798fc00bc062f286789438
Reviewed-on: https://gerrit.instructure.com/6649
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-11-07 12:19:24 -07:00
Brian Whitmer 6b83b9227c basic lti navigation links
By properly configuring external tools (see
/spec/models/course_spec/rb:898 for examples) they can
be added as left-side navigation links to a course,
an account, or to the user profile section of Canvas.

testing notes:
- you have to manually set options on the external tool:
- for user navigation the tool needs to be created on the root account
  with the following settings:
  {:user_navigation => {:url => <url>, :text => <tab label>} }
  (there are also some optional language options you can set using
  the :labels attribute)
- for account navigation it's the same
- for course navigation it's the same, except with :course_navigation
  there's also some additional options:
  :visibility => <value> // public, members, admins
  :default => <value> // disabled, enabled

test plan:
- configure a user navigation tool at the root account level,
  make sure it shows up in the user's profile section

- configure a course navigation tool at the account level,
  make sure it shows up in the course's navigation

- configure a course navigation tool at the course level,
  make sure it shows up in the course's navigation

- make sure :default => 'disabled' course navigation tools don't
  appear by default in the navigation, but can be enabled on
  the course settings page

- make sure :visibility => 'members' only shows up for course members

- make sure :visibility => 'admins' only shows up for course admins

- configure an account navigation tool at the account level,
  make sure it shows up in the account's navigation, and
  any sub-account's navigation

Change-Id: I977da3c6b89a9e32b4cff4c2b6b221f8162782ff
Reviewed-on: https://gerrit.instructure.com/5427
Reviewed-by: Brian Whitmer <brian@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-11-04 17:07:17 -06:00
Zach Wily 81949b2ebe don't html escape user answers in fimb questions; fixes #5628
Test Plan:

Create a quiz with a FIMB question. As a student, take the quiz and enter '<'
in one of the blanks for that question. Submit the quiz. See the results and
verify that '<' was not changed to '&lt;'.

Change-Id: I83df931bb0b3fa28d6a03d6d715d9ad27ddf8881
Reviewed-on: https://gerrit.instructure.com/6691
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-11-04 16:15:42 -06:00
Bracken Mosbacker 5c57abea78 don't show discussion responses in stream when not allowed
Discussions have an option to not allow users to see replies
until they've posted themselves. This worked correctly on the
discussion page itself, but the user would still see the
replies in their stream

This also removes that option, and the delayed posting option
from group discussion topics. These settings are useless in
that context because all users are admins and can see the
topics anyway.

Test Plan:
 * create a topic in a course and check the box "Replies are not visible until after users post"
 * post a reply to that topic as the teacher
 * log in as a student in that course and go to your dashboard
 * you should see the topic in the stream but not the response you created as a teacher

closes #4706

Change-Id: I0c50a3adb8e18ea74d209f4c9a5ac429b7faaf0e
Reviewed-on: https://gerrit.instructure.com/6684
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2011-11-04 12:27:27 -06:00
Jacob Fugal 9e9040146a disable 'randomly assign students' for restricted self-signup groups
also, make the random assignment happen on the server via an ajax call.
before, it would make one ajax call per student assigned, which is
rather inefficient when there are many students to assign.

fixes #6099

Change-Id: I89e5059fa1bd42b1a25e5cb88d552841c426530a
Reviewed-on: https://gerrit.instructure.com/6576
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2011-11-04 12:25:44 -06:00
Jacob Fugal 94000c86f0 finish discussion topics API
supports creating and listing top-level entries in a discussion topic,
and creating and listing replies to a discussion entry. listing
discussion topics was already supported. includes support for
attachments on top-level entries.

test-plan:
  creating an entry under a topic
    should allow creating an entry under a topic and create it correctly
    should return json representation of the new entry
    should allow creating a reply to an existing top-level entry
    should not allow reply-to-reply
    should allow including attachments on top-level entries
    should silently ignore attachments on replies to top-level entries
    should include attachment info in the json response
  listing top-level discussion entries
    should return top level entries for a topic
    should return attachments on top level entries
    should include replies on top level entries
    should sort top-level entries by descending created_at
    should sort replies included on top-level entries by descending
  created_at
    should paginate top-level entries
    should only include the first 10 replies for each top-level entry
  listing replies
    should return replies for an entry
    should sort replies by descending created_at
    should paginate replies
  require initial post
    should allow admins to see posts without posting
    shouldn't allow student who hasn't posted to see
    shouldn't allow student's observer who hasn't posted to see
    should allow student who has posted to see
    should allow student's observer who has posted to see

fixes #4752

Change-Id: I0da83e6c301be74f1ac5d2d957ebb6338a98179c
Reviewed-on: https://gerrit.instructure.com/6690
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2011-11-04 12:25:27 -06:00
Ryan Shaw 7b3c47b2ff don't error when using grading_scheme and no score
Change-Id: Ib1b83e617d555a5b3834f5d8f2fb28ca031d5ded
fixes: #6164
Reviewed-on: https://gerrit.instructure.com/6634
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2011-11-04 09:59:25 -06:00
Brian Palmer b9b5409d39 add readResult support to LTI grade passback, refs #5892
testplan: you can set up an assignment as an external_tool type
manually, and then hit the IMS certification test tool to verify that
replaceResult and readResult are now fully supported.

Change-Id: Id193ba1943f51b3cb4b6a2d078d8a2262c26659e
Reviewed-on: https://gerrit.instructure.com/6678
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Whitmer <brian@instructure.com>
2011-11-04 09:42:23 -06:00
Brian Palmer c1957aac1a launch lti tool when viewing external_tool assignment
There isn't current any way to create this assignment type in the UI.
This just gets us far enough that we can test out the API functionality
against the IMS tests and some other tools that use grade passback.

refs #5892

Change-Id: I6f806a53bca0708702ff9e64e8e520be26234430
Reviewed-on: https://gerrit.instructure.com/6661
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Whitmer <brian@instructure.com>
2011-11-04 09:42:13 -06:00
Bracken Mosbacker f15c5cc9c1 make sure matching questions are formatted correctly when imported
imported matching answers were missing the required 'left' field

import the package attached to the ticket to test

closes #6146

Change-Id: I97e4af7070cb2068e677af91d3f23cde8e077987
Reviewed-on: https://gerrit.instructure.com/6615
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-11-03 09:17:36 -06:00
Brian Palmer 25d77ac15d add replaceResult support to LTI grade passback, refs #5892
Also versioned the URI and removed the tool_id param. As part of the
processing it pulls the tool from the assignment and verifies that it's
the same tool as was used to launch, by looking at the sourcedid.

Assignments now have an external_tool type and link to a
ContextExternalTool.

testplan: there isn't a way in the UI to configure an assignment as an
external tool yet, so it'll need to be manually configured in the
console.

Change-Id: I0cf5ec85d450409d6ea1ec71ce1d5d4c19622d4c
Reviewed-on: https://gerrit.instructure.com/6652
Reviewed-by: Brian Whitmer <brian@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-11-02 16:32:55 -06:00
Brian Whitmer 28c9895295 don't rename external tools when the tag is renamed
Other asset types (like assignments, wiki pages and files)
have a required linking between the name of the asset and
the name of the tag. This is for consistency's sake.
However, it doesn't make sense to enforce this kind of
policy for external tools, since tools can be configured
at the account level, and instructors shouldn't have the
ability to rename tools somewhere up the chain. This
change disconnects external tools from tags linking to
those external tools.

fixed #6170

testplan:
- configure an external tool
- add an external tool to a course module
- rename the link to something other than the tool's name
- check to make sure the tool's name didn't also change

- configure an external tool
- add an external tool to a course module
- rename the tool
- check to make sure the link's name didn't also change

- add an assignment to a course module
- rename the link in the module
- check to make sure the assignment's name also changed

- add an assignment to a course module
- rename the assignment
- check to make sure the module link's name also changed

Change-Id: I2291b4ca0ee2c83da1dd9a81bc46eb05d1925982
Reviewed-on: https://gerrit.instructure.com/6641
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: JT Olds <jt@instructure.com>
2011-11-02 16:29:04 -06:00
Cody Cutrer 70b1c6b70b avoid establishing a connection during initialization
Change-Id: I26cdb531d47fe495833d2de2b8ee9b841e1b72c8
Reviewed-on: https://gerrit.instructure.com/6612
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
2011-11-01 13:54:00 -06:00
Jacob Fugal 847175bf32 enable showing group rosters on student groups view
when a student is viewing the list of groups they are in and that they
may join, enable viewing the roster of each group. :read_roster
permission is given to students that are eligible to join the group or
request an invitation to the group. fix pageless so that if the
container is hidden when a load completes, the loader is still properly
hidden. fixes #5931

Change-Id: I50aee8c19e927ce25afa17d9b1533df0aa7239e9
Reviewed-on: https://gerrit.instructure.com/6184
Reviewed-by: Brian Whitmer <brian@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-11-01 13:34:42 -06:00
Jon Jensen 74fb788200 include invited enrollments in course dropdown, show state
also made general purpose methods for ranking (in ruby and sql) and
distinct on.

Change-Id: I4052472eb700cbdfe6b586ed6d12f61fd51bf08f
Reviewed-on: https://gerrit.instructure.com/6593
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-11-01 12:37:34 -06:00
Zach Wily 834b8517f0 fix names on the access report, other tweaks; fixes #4682
This makes the access report actually show the right names for things, and it
also displays icons next to them to indicate the type.

Change-Id: I0241bc9546555a0796dee35786cdfcddb930ef1a
Reviewed-on: https://gerrit.instructure.com/3869
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: JT Olds <jt@instructure.com>
2011-11-01 11:56:54 -06:00
Bracken Mosbacker 8ec102aa0e don't try to delete an already deleted group membership
A group membership could have been deleted before this pre-processing
so if the membership isn't found don't try to delete it

closes #6145

Change-Id: I7bac508f52de0e3b07a83d2eb5c87b22886ce5cc
Reviewed-on: https://gerrit.instructure.com/6606
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-11-01 10:33:19 -06:00
JT Olds b0f4c0cf6d a GoogleDocEntry is not a model
Change-Id: I1f59e486a7c7a6d63a216d00004cd2e0acd5740d
Reviewed-on: https://gerrit.instructure.com/6503
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-10-31 17:12:57 -06:00