Commit Graph

338 Commits

Author SHA1 Message Date
Ryan Shaw b6127a2453 upgrade slickgrid
this updates slickgrid to:
github.com/mleibman/SlickGrid/commit/0b5dff4

test-plan:
 * go to gradebook2, make sure it looks right
 * go to jobs page, make sure it looks right

Change-Id: Iff8d994deaefb30a37911e5fae3acf804d0c3c4f
Reviewed-on: https://gerrit.instructure.com/7513
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-12-28 09:05:12 -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
Jon Jensen 7c01e34e2f latest es translations
Change-Id: I48c60e64d7bf8a5389d4d68e66209807dcc56200
Reviewed-on: https://gerrit.instructure.com/7641
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
2011-12-22 12:06:35 -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
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
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
Ryan Shaw 5bc5b7674f scroll gradebook2 "section to show" if needed
fixes: #6252
If a course had a lot of sections you could not see the bottom ones
because the popover did not scroll. this fixes that

test plan:
 * go to gradebook2 in a course with a lot of sections (> 20 or so)
 * make sure that you can see the bottom ones by scrolling

Change-Id: I47919c247f662da880e714287772665d62c7ba07
Reviewed-on: https://gerrit.instructure.com/7370
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
2011-12-15 16:31:22 -07:00
Cody Cutrer acb7ee93ba move Delayed::Job priorities into the plugin
test plan: n/a

Change-Id: Ie00daf98dd13293cc4d6b80953175f3f28489066
Reviewed-on: https://gerrit.instructure.com/7499
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-12-15 16:18:16 -07:00
Jacob Fugal a577fcb033 create admin API call
tags the user as an admin in the account. the membership type may be
specified by a parameter, defaulting to AccountAdmin.

refs #6176

test-plan:
 - create user through API; user should not be an admin
 - POST to accounts/<account_id>/admins with that user_id; user should
   now be an admin with membership type AccountAdmin
 - create another user; POST to the same URL with that new user_id and a
   membership_type specified; user should be an admin with membership
   type matching the specified value.

Change-Id: I003c23324298d8c4214a31be0276067de4b9630b
Reviewed-on: https://gerrit.instructure.com/7443
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2011-12-14 12:21:15 -07:00
Jacob Fugal 4e0ce7735e AccountAuthorizationConfig#update_all as API
Just coopts the existing API used by the UI, documents it, tests it, and
adds a little parameter hygiene.

fixes #6176

test-plan:
  create, update, and delete authorization configs through API posts

Change-Id: I26434f27a3df11586acf0a0abbc93b9dd7cb3f59
Reviewed-on: https://gerrit.instructure.com/7444
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-12-12 17:22:07 -07:00
Ryan Shaw ec6cd62e6f add opt-in button for gradebook2
fixes: #6268

test plan:
* go to the gradebook, there should be a button
  that says "Try out the new Gradebook" click it
* go to a new page then click the 'grades' tab on
  the left nav, it should take you to gradebook2
* click the "Go back to the old gradebook" on
  gradebook2, it should take you to old gradebook
* go to a new page, click the 'grades' link in the
  left nav, it should take you the old gradebook

Change-Id: Ifcf0046915e79e8afc983d35d62343ca72cdde72
Reviewed-on: https://gerrit.instructure.com/7246
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
2011-12-12 16:41:57 -07:00
Brian Palmer cc26d1e0fe don't return description of locked assignments in the API
fixes #6510

Most of this is a refactor so that all API JSON generation goes through
an api_json method, in order to standardize stuff like permissions and
:include_root. The existing specs verify that this doesn't inadvertently
change any existing responses -- except the discussion topics responses,
which were returning the :permissions array in the json unintentionally.

The refactor fixes the locked assignment response as a side effect.

Change-Id: I287b366fe05ef6116f713fc52075aff93d5e87b6
Reviewed-on: https://gerrit.instructure.com/7262
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-12-09 11:15:33 -07:00
Jon Jensen 6e869ddcff add missing route, fixes #6537
test plan: confirm the account-level groups page loads again

Change-Id: I3b09d8796c351c7cc6394434d16d5f8784eb0682
Reviewed-on: https://gerrit.instructure.com/7301
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: JT Olds <jt@instructure.com>
2011-12-06 12:30:34 -07:00
Jon Jensen 8c3a8d9f30 ERB::Util.h speedup
Change-Id: Ia789b46b69c7f2e85fe1a2c250188cdbdb415033
Reviewed-on: https://gerrit.instructure.com/7284
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-12-06 10:03:21 -07:00
JT Olds b7ff643c71 moving delayed job message sending extensions into DJ plugin
test plan:
 * don't start delayed jobs
 * go to your local jobs page: http://localhost:3000/jobs
 * open script/console and type: "now or later".send_now_or_later :later, :to_s
 * refresh the "Jobs List" and see if a String#to_s job appeared
 * start DJ and refresh to make sure the job was run

Change-Id: Iab997a4fcb252b481774309194dc6a0e937ecf4a
Reviewed-on: https://gerrit.instructure.com/7194
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-12-02 14:22:27 -07:00
Brian Palmer 9d45cf520a allow specifying browser path in selenium.yml
testplan: add a path to your selenium.yml and verify the right browser
launches

Change-Id: I162d64ef48f9241982f7e103bb497ce4c40bfadc
Reviewed-on: https://gerrit.instructure.com/7220
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2011-12-01 09:38:52 -07:00
Bracken Mosbacker 2ea48c5cae refactor qti exporter and make all specs run in CI
The qti exporter uses the "Qti" module namespace but was in
the lib folder 'qti_exporter'. This moves everything to a 'qti'
folder and renames the 'exporter' to 'converter' to match
the convention of migration tool converters

The specs also weren't in spec_canvas to the CI tool wouldn't
run them, they were moved and made to only run if the python
qti tool is available

Test plan:
 * Import some qti packages and make sure the still work correctly

refs #5178

Change-Id: I9277f2c4ecb0845b21ecb2e00102543e18a77aef
Reviewed-on: https://gerrit.instructure.com/7138
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-11-30 15:55:08 -07:00
Cody Cutrer 23d0a6d8c9 drop sticky_xlists from course_sections
test plan: n/a

Change-Id: I246f5f9bcd955f5f2034fd8c20402e6fa1fea792
Reviewed-on: https://gerrit.instructure.com/7170
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2011-11-28 14:58:08 -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
Zach Wily 5590e34474 add a route for the translated assessment question links
Apparently the /assessment_questions/XX/files/YY/download?verifier=ZZ route
stopped working at some point. Rather than changing all the assessment
questions' links, we're adding that route back, along with a spec.

Test Plan:
 * Create a question in a question bank with an image
 * Manually change the URL of the image to look like the link above
 * Create a quiz and add that question from the question bank to the quiz
 * Take the quiz as a student. You should be able to see the image
 * The specs also verify that these style URLs work

Change-Id: I2f07f822de4e92d4f5a7fdf4e40ec0f1e4313633
Reviewed-on: https://gerrit.instructure.com/7148
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-11-23 15:48:25 -07:00
Jon Jensen f613cf44ac postgresql 9.1 GROUP BY fix
test plan:
ensure canvas works and specs pass in postgres 9.0 and 9.1 (as well as
mysql and sqlite)

Change-Id: I30889e7fd960848f7ea372d5b5e6877d017ea228
Reviewed-on: https://gerrit.instructure.com/7005
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-11-23 13:05:30 -07:00
Zach Pendleton 9e1e6c3001 add user/pseudonym creation api. fixes #6331
adds api endpoint at [POST] /account/:account_id/users.
allows setting of user's name, short name, sorting name,
time zone, and the associated pseudonym's unique_id,
password, and sis_user_id.

test plan:
(1) create an account;
(2) make a post request with an admin user's access token
    to /accounts/:account_id/users that includes at least
    the following fields:
      * user[name]
      * pseudonym[unique_id]
      * pseudonym[password]
(3) verify that new user is created;
(4) create a user via the api and send
    pseudonym[send_confirmation] parameter as "1;"
(5) verify that new user receives an email confirmation of
    account creation.

Change-Id: Ibb4f0387019e694af923d8742ad13cacc04e1d6a
Reviewed-on: https://gerrit.instructure.com/7057
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-11-23 10:37:23 -07:00
Brian Whitmer ae717a8f6a external tool resource selector in WYSIWYG editor
Configured external tools can show up as buttons in the
rich editor. If you click the button then it'll pop up
a dialog that uses basic lti to load a page for the
external tool.  The user can pick a resource in that
tool and the tool will then redirect back to a Canvas
url that will fire a callback and embed the content
into the editor.

See spec/selenium/external_tool_buttons_sel.rb for an
example of how to manually configure one of these tools.
Adding configuration to the UI will come in another
commit.

testing notes:
to configure an external tool to show up in the editor:
tool.settings = {
  :editor_button => {
    :url => "http://<canvas_domain>/selection_test",
    :text => <button_label>,
    :selection_width => <width_of_iframe>,
    :selection_height => <height_of_iframe>,
    :icon_url => <url_of_button_icon>
  }
}

test plan:
- configure an external tool in the course with an editor button
- check to see if the button shows up in the rich editor in that course

- configure an external tool in the account with an editor button
- check to see if the button shows up for courses in that account

- configure more than 3 external tools
- check to see if the "more tools" dropdown works correctly

Change-Id: I681db0af578df6a9c7a2c840d293703937d81c46
Reviewed-on: https://gerrit.instructure.com/5429
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
2011-11-22 16:12:12 -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
Brian Palmer a8f6fa9326 always give the session cookie browser session expiry
testplan:
  * login with "stay logged in" and without "stay logged in"
    * in both cases, check your _normandy_session cookie, it should have
      no expiration set (which means it expires when the browser session
      ends)
  * for the non-"stay logged in" case, close your browser, re-visit the
    site, you'll have to login again

fixes #6364

Change-Id: Ibff32aa2f4225fd9cf05f5ce3abf9dd9f448d4ff
Reviewed-on: https://gerrit.instructure.com/7084
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
2011-11-21 15:21:05 -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
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
Brian Palmer cea6d1ca0f cast ids in acts_as_list update_order
testplan: post a list of ids that contain non-numeric data or SQL
commands to /users/XXX/files/reorder (or another reorder URL) and verify
that such data does not make it into the SQL query.

closes #6377

Change-Id: If5cee005853a944cb14761ce3d910ea4cae09433
Reviewed-on: https://gerrit.instructure.com/7025
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: JT Olds <jt@instructure.com>
2011-11-16 19:25:07 -07:00
Brian Palmer ca269be847 avatar image caching and invalidation, closes #5210
testplan: with rails caching enabled, change a user's avatar settings to
(a) a different service or (b) a different image url. verify that the
change is immediately visible, rather than having to wait 30 min.

Change-Id: I03c63a0e5a2cccd59ed8d9f324d2e391b46c4675
Reviewed-on: https://gerrit.instructure.com/5284
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-11-16 10:29:42 -07:00
Jon Jensen 35d3f16e57 don't request thumbnail until it's ready, fixes #5800
thumbnail creation is asynchronous in production, so when uploading a
new image we will now wait until it has been generated before we link
to it (since that gets cached for 30 minutes)... we'll just keep
showing the loading icon in the interim.

implemented a simple ajax backoff poller

Change-Id: I5f19265caad2f86b72611e91e17c85147a2a6d7a
Reviewed-on: https://gerrit.instructure.com/6567
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
2011-11-09 17:59:28 -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
Ryan Shaw cfaa154759 changes to allow using more things as AMD modules
* all Handlebars templates now register as AMD
   modules. this makes using the Template class
   unnecessary.  by requiring it in your module
   you will have a variable is the precompiled
   function that you can call to interpolate the
   template.
 * register I18n as an AMD module.
 * switch from using curl.js to require.js

Change-Id: I84193c7f8e99072fe8b4766982a2a612a85065d7
Reviewed-on: https://gerrit.instructure.com/6720
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
2011-11-08 14:45:33 -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
Brian Palmer 22de1808a2 implement blti extensions 0.0.4 outcome service, refs #5892
This older specification has the same semantics as the new official LTI
v1.1 outcome service specification, but there are a lot of differences
in request/response formatting.

Change-Id: I7cc4ce1e5888573fc6b2706356982926b84bed0f
Reviewed-on: https://gerrit.instructure.com/6749
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Whitmer <brian@instructure.com>
2011-11-08 08:25:20 -07:00
Brian Palmer 0e72be8bcf change to a more generic lti outcome service url scheme
refs #5892

according to the spec, this url shouldn't change for each
user/assignment, so we've refactored so that only the tool id is in the
url.

This involved some refactoring to include the user, course and
assignment in the sourcedid, rather than just the signature of those
values, and using those values to look up the objects.

As a consequence we now return "unsupported" rather than a 401 error if
the sourcedid is incorrect, which I think is more correct according to
the spec anyway.

Change-Id: I612d48cbd63b527d9f9209b858ebeca28ebe9202
Reviewed-on: https://gerrit.instructure.com/6699
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Whitmer <brian@instructure.com>
2011-11-08 08:25:07 -07:00
Brian Whitmer 047842784f allow basic lti links from arbitrary content
Basic LTI links before could only be added as items in context
modules.  This extends that functionality to also support inserting
Basic LTI links into rich content fields.  There is no UI provided
for inserting these links, that comes in another commit.

test plan:
- create an external tool in a course with a specific url
- manually create a URL to
  /courses/:id/external_tools/retrieve?url=<url>
- the tool should be loaded at the given url

Change-Id: I658b838b8c9a2a6826cf803fd41cb9924fb287ef
Reviewed-on: https://gerrit.instructure.com/5428
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
2011-11-07 12:38:19 -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
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
Brian Palmer a70c0f45f0 fix incompatible change in prefixing of api routes
testplan: this fixes currently broken specs in some canvas plugins

Change-Id: I3c1c9f3ff34a2c1e6011adbc4c4f5ca0b7b40d5a
Reviewed-on: https://gerrit.instructure.com/6670
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-11-03 12:38:40 -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 Palmer 7efd4c62b2 add LTI grade passback infrastructure, refs #5892
The endpoint is
/api/lti/tools/:tool_id/courses/:course_id/assignments/:assignment_id/submissions/:user_id

This shouldn't ever be hit manually, the URI is passed to the LTI assignment
tool in the lis_outcome_service_url param. The shared secret and the
lis_result_sourcedid parameter will prevent abuse.

Currently the endpoint doesn't support any queries, it responds
unsupported to all valid signed xml requests. Next step is to actually
implement viewing and changing the grade for the course/assignment/user
combination.

testplan: hit the url with a valid signed oauth request with xml body,
get back an "unsupported" api response

Change-Id: I2f938f3d45ec71488dd81ac74131acfe13b6d8cb
Reviewed-on: https://gerrit.instructure.com/6623
Reviewed-by: Brian Whitmer <brian@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-11-02 15:59:47 -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
Ryan Florence cc4522fc04 incorporated AMD into the main application
- added AMD support for Template, but it still
  exports to window.Template until we convert all
  recent stuff into modules

- converted objectCollection, CustomList, and
  courseList to modules

- added specs for objectCollection

Change-Id: Ib4ca4e25374c656b7b583ec7284c37672c117d2a
Reviewed-on: https://gerrit.instructure.com/6545
Reviewed-by: Ryan Florence <ryanf@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-11-01 10:33:49 -06:00
Brian Palmer 03d8d6df64 remove cruft around unused image search library and model
We do support flickr searches, but it happens completely in javascript.
I guess originally it was going to go through a controller action and
use the individual user's flickr api credentials as a UserService or
something.

Change-Id: I531777458d0e59ca0f1180aa11e3b31029975f34
Reviewed-on: https://gerrit.instructure.com/6480
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2011-10-31 14:52:15 -06:00
Cody Cutrer 3f3f72637a expose sortable name to user, fixes #5317
* expose sortable name directly to the user
 * don't downcase it
 * use a LOWER(sortable_name) index for postgres
 * set sortable name as "last_name, first_name" explicitly for SIS imports
 * populate sortable name intelligently in the UI

Change-Id: I476641f4817e27a11b573d91f102c5a74d3eba26
Reviewed-on: https://gerrit.instructure.com/6512
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
2011-10-31 12:22:08 -06:00
Ryan Florence 357b621691 placeholders for quiz answers fixes #5438
The previous fix for this in #4949 broke some
other question types where the app would get stuck
in a loop of selecting 3-4 inputs rendering the
page useless.

Added jQuery.fn.placeholder, can now use the
placeholder attribute on input elements, and then
call $(selector).placeholder(); to support IE.

The plugin checks for support and does nothing for
browsers that support placeholder, so we don't
need to do it ourselves.

also fixes #4949 (again)

Change-Id: Ifbb3e8110ea259ccbe235e3e364050ab29a51b68
Reviewed-on: https://gerrit.instructure.com/6572
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jon Jensen <jon@instructure.com>
2011-10-31 10:47:42 -06:00
Jon Jensen c758b85f85 en.yml snapshot for es and jp translations
Change-Id: I97c63c07e1c2b0f1e8611f68f6ae5abcec99974b
Reviewed-on: https://gerrit.instructure.com/6505
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-10-27 13:57:51 -06:00