Commit Graph

364 Commits

Author SHA1 Message Date
Cody Cutrer 56b4d73b7e CAS single sign out
fixes CNVS-6343

test plan:
 * without Redis
 * normal CAS logins should work (rubycas-server is easiest to test
   with)
 * do a POST to /login/cas (with CURL)
 * it should 404
 * enable Redis, restart server
 * normal CAS logins should work
 * enable single sign out on the CAS server (if not already enabled;
   it's a separate setting for rubycas-server)
 * log in to Canvas via CAS
 * in another tab, sign out on the CAS server
   (just go to /logout with rubycas-server; there's no link to it)
 * refresh the page in Canvas; it should redirect you to the CAS
   server
 * log in to Canvas via CAS
 * clear your Redis database
 * refresh the page in Canvas; you should still be logged in
 * in another tab, sign out on the CAS server
 * refresh the page in Canvas; it should redirect you to the CAS
   server

Change-Id: Ie3bc286f1284886cf211c4ecce14c3dbf5e4deb7
Reviewed-on: https://gerrit.instructure.com/21496
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-06-29 01:07:08 +00:00
Zach Pendleton 102c261e54 new conversations ui.
fixes CNVS-6401

new conversations ui and html. accessible from
/conversations/beta. only functionality right now is
message list and display of messages.

also only accessible to site admins.

test plan:
  * as site admin, navigate to /conversations/beta and
    verify that the page renders without any layout
    issues;
  * verify that messages load in left pane and, when
    clicked, appear in the right pane.
  * verify that page is not accessible to users who are
    not site admins.

Change-Id: Id88b113c214b059728f4e06c2762603e1d5c9a13
Reviewed-on: https://gerrit.instructure.com/21789
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mark Ericksen <marke@instructure.com>
QA-Review: Cam Theriault <cam@instructure.com>
Product-Review: Zach Pendleton <zachp@instructure.com>
2013-06-28 21:52:40 +00:00
Mark Ericksen fd1d4a897b fix course "undelete" feature for discussions
fixes CNVS-6397
refs CNVS-6308

testing steps:
* using /courses/x/undelete, select a DiscussionTopic
  or Announcement to undelete. (can create one then delete
  if needed)
* verify deleted entries appear
* verify it correctly undeletes the Discussion or
  Annoucement
* using /groups/x/undelete should now be supported
* verify a student group's discussion can be
  deleted and undeleted

Change-Id: I3fe46868aebf3ab73656bbc9806c91c4b2b36907
Reviewed-on: https://gerrit.instructure.com/21656
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
QA-Review: Cam Theriault <cam@instructure.com>
Product-Review: Mark Ericksen <marke@instructure.com>
2013-06-27 19:03:57 +00:00
Brian Palmer d2bbc3e0be integrate fake_rails3_routes
This allows us to upgrade our routes file to rails 3 syntax while still
staying compatible with rails 2.3

refs CNVS-5146

test plan:

This affects literally every URL in Canvas, but shouldn't introduce any
new behavior. The automated integration and selenium tests still pass,
which is a good smoke test. Other than that, it's really just making
sure that routes are generated and recognized as before (regression
testing).

Change-Id: I443d006e3fcb5a0a0f8d6db46a8873a498ae7fd4
Reviewed-on: https://gerrit.instructure.com/21729
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
2013-06-26 21:22:20 +00:00
Landon Wilkins 2ee53907aa CNVS-6431
adds users/user_id alternate endpoints for updating/deleting group memberships

test plan)
1) verify that the documentation has been updated to show the alternate endpoints
     that is, verify that there are now two URLs and two example requests under
     "Leave a group" and "Update a membership"
2) follow the api documentation for "Leave a group" and "Update a membership" to
     verify that this functionality works the same with the alternate endpoints.
     that is, verify that you can:
     a) Accept a membership request, or add/remove moderator rights.
        example (where group_id = 2 and user_id = 3):
        PUT http://localhost:3000/api/v1/groups/2/users/3
     b) Leave a group if you are allowed to leave (some groups, such as sets of
        course groups created by teachers, cannot be left). You may also use
        'self' in place of a membership_id.
        example: (where group_id = 52 and user_id = 3)
        DELETE http://localhost:3000/api/v1/groups/2/users/3

fixes #CNVS-6431

(also adds not_found helper to the application controller)

Change-Id: I7883cb1a9ec26a2bdb6428a60008dc7e2892adfa
Reviewed-on: https://gerrit.instructure.com/21736
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
2013-06-26 18:07:51 +00:00
James Williams 6c7598144d create course and group endpoints to preview html processing
test plan:
* use the course and group API to preview html content
through the preview_html action
* should return html processed in the same fashion
that other html content is (such as assignment descriptions)

closes #CNVS-6413

Change-Id: Ibfaea9d8b0ccfd45938e5bf91b03980597428516
Reviewed-on: https://gerrit.instructure.com/21701
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: August Thornton <august@instructure.com>
2013-06-26 16:52:51 +00:00
Jon Jensen b38630148b image upload model, refs CNVS-2858
also tweak local file api uploads to accept either file or
attachment[uploaded_data] param

ensure File models don't pass along any superfluous attributes to s3

test plan:
* see specs and corresponding plugin commit
* also, do a regression of the quiz file upload types (see g/21586 test
  plan)

Change-Id: I496b150dbdc0684083bf320c77cced4c3b8eeaa0
Reviewed-on: https://gerrit.instructure.com/21434
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
2013-06-26 15:37:50 +00:00
Mark Severson f4c318ee24 added the wiki pages index
test plan:
 * navigate to /courses/:id/pages
 * ensure that all current pages are represented
 * ensure all links navigate to /courses/:id/pages/:page_slug

   note: creating new pages from the pages index is intentionally
         not implemented; this functionality will be added after
         the new page view/editing implementation is complete

fixes #CNVS-5271

Change-Id: I059efb5961b77920221859d37a25234fd5068cdc
Reviewed-on: https://gerrit.instructure.com/21559
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-06-22 03:34:56 +00:00
Brian Palmer 7c46ae5080 rename the submissions :id param to :user_id
it was brought to my attention that it's really not very clear that :id
is referring to the user id, not some unobtainable submission id.

test plan: specs should still pass. re-generate the api documentation,
and the submissions api docs should refer to :user_id instead of :id in
the show and update actions.

Change-Id: I2edb11f4b94a3ae4b7e960b92b46f0d5a5264140
Reviewed-on: https://gerrit.instructure.com/21607
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
2013-06-21 14:51:52 +00:00
Brian Palmer d1f7cde2ce fix up some routing issues
* feeds isn't a resource (there isn't even a feeds controller)
* course_assignments_update_submission action doesn't exit
* :index is a default resources action, adding it to :collection confuses rails
* jobs batch_update was responding to all verbs

test plan: specs should still pass

Change-Id: Ib7ffc1522c1f6d66fb5fa5a873fcb30891c65e44
Reviewed-on: https://gerrit.instructure.com/21580
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
2013-06-18 19:19:50 +00:00
Joel Hough 65986cfaac discussion topic subscription flag and api
fixes CNVS-6238

test plan
using the api:
- view a discussion topic as a user that did not author it
- ensure that subscribed: false

- view a discussion topic as the authoring user
- ensure that subscribed: true

- unsubscribe from a discussion topic that the user authored
- ensure that subscribed: false

- subscribe to a discussion topic
- ensure subscribed: true

- subscribe to a topic that requires an initial post with a user
 that hasn't posted yet
- ensure that it is an invalid request

- subscribe to a topic that requires an initial post with a user
 that has posted
- ensure subscribed: true

Change-Id: Ie76a046bb6e9b5253088c371ffdc4dc6ddf08231
Reviewed-on: https://gerrit.instructure.com/21402
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mark Ericksen <marke@instructure.com>
QA-Review: Cam Theriault <cam@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
2013-06-14 21:40:50 +00:00
Landon Wilkins 6441ef9d14 api functionality: unassigned group members, with search
adds list and search users functionality to group_category api,
  including the ability to filter to only list/search unassigned
  users.

depends on #CNVS-6152

test plan)

0) verify that the api doc is error free and makes sense
1) make the following requests for both a course and an acccount
     group category, then verify the results:
  a) list all the users (i.e. no search_term)
  b) list all the unassigned users (i.e. no search_term)
  c) search users (e.g. search_term=bob )
  d) search unassigned users (e.g. search_term=bob&unassigned=true)

fixes #CNVS-6151

Change-Id: I99b33f29531579478ccece595a20971a1f8ad914
Reviewed-on: https://gerrit.instructure.com/21292
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
Tested-by: Landon Wilkins <lwilkins@instructure.com>
2013-06-13 18:04:38 +00:00
James Williams 3a0f5884ff fix role api routing to find roles with periods
test plan:
* create a custom role with a period
* should be able to update/delete it through the
interface (which goes through the API)

fixes #CNVS-3904

Change-Id: Ifc2c9893786b0a3ce06d664c863f78e5e125161a
Reviewed-on: https://gerrit.instructure.com/21158
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2013-06-05 19:00:59 +00:00
Eric Berry ba0dd818a5 added the ability for users to review app center apps
test steps:
- enable the app center with a valid access token
- visit the app center under account settings
- click on a tool and ensure the reviews appear in the list at the
  bottom
- click the link 'Rate this tool' and add a review
- ensure that the review list reloads

** note: you will not see the actual app star rating or review
count change when you add/modify a review. this is expected behavior.

Change-Id: I79ab0769f56b3a17b6eb2056de1416eb1a0a71ca
Reviewed-on: https://gerrit.instructure.com/21054
Reviewed-by: Brad Humphrey <brad@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Brad Humphrey <brad@instructure.com>
2013-06-04 19:16:20 +00:00
Cameron Sutter e7c24b05eb assignment groups API
fixes CNVS-6064

test plan
- using the API, create, get, and update an assignment group
- using the API, delete an assignment group with and without assignments
and both specify an assignment group to move the assignments to
and don't specify an assignment group
- it should throw an error if there are no other active assignment groups

Change-Id: I0d637d73255115258dc42e73541146c889a68afc
Reviewed-on: https://gerrit.instructure.com/20993
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2013-06-03 18:02:46 +00:00
James Williams d71b258ed2 allow any wiki page to be set as front page
test plan:
* confirm that wiki pages can be created and updated
with the parameter wiki_page[front_page]
 * if true, this will set the wiki page as the
 front page for the context (assuming the page is
 not hidden to students)
 * if false, this will unset the page as the front page
 (assuming it was the front page to begin with)

* confirm that /courses/:course_id/front_page acts
as a proper endpoint for show/update/destroy and
acts just as /courses/:course_id/pages/:url
for whichever page is set as the front page

* confirm that none of the above page breaks
normal wiki functionality

closes #CNVS-5528

Change-Id: I3f51d740e90ff0a5a39f2aafc988a1a33947ca18
Reviewed-on: https://gerrit.instructure.com/20938
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
2013-05-30 02:51:35 +00:00
Jon Jensen 8710cb94b2 stream item summary api, fixes CNVS-5779
new endpoints for getting totals/stats of stream items. for each asset
type (e.g. DiscussionTopic), you can get the total count and the unread
count

test plan:
see specs. also, hit the following endpoints in a browser:
/api/v1/users/self/activity_stream/summary
/api/v1/courses/:id/activity_stream/summary
/api/v1/groups/:id/activity_stream/summary

Change-Id: I101d239a788c28d2cd4c39230a401e36a31007f5
Reviewed-on: https://gerrit.instructure.com/20836
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-05-29 03:37:58 +00:00
Brad Humphrey 6b3274a095 sessionless launch of LTI tools
test plan:
 * add an external tool to each of:
   - context module item
   - course navigation (tabs)
   - assignment
 * exercise the index methods for each API
 * ensure a url is returned for each external tool
   - this url should be to the sessionless launch API
 * query the sessionless launch API with the url
   - this call will return another url which allows a launch of the LTI tool in a browser not logged into Canvas
 * copy/paste the url into a browser that is not logged into Canvas (incognito)
 * ensure the LTI tool launches correctly

fixes #CNVS-5854

Change-Id: I6b50f965f4714e7efb9cfe0f99e1cd0b5f2055f2
Reviewed-on: https://gerrit.instructure.com/20868
QA-Review: Clare Strong <clare@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-05-25 00:06:39 +00:00
Bracken Mosbacker b885d5cb8f add api endpoint for selective content migration data
this endpoints returns all the items for a migration so
that you could build a UI around selecting what to copy
when importing/copying courses

Test Plan:
 * Start a content migration but don't finish the selection part
 * use the /api/v1/courses/:id/content_migrations/:id/selective_data endpoint
   * if called without args you should get the top-level areas
	 * if called with ?type=assignments (or the types in the top-level list)
	   you should get a list of just the specified type

closes #CNVS-5940

Change-Id: Idfc8bd9b02738801a3bf5b18df25314350929762
Reviewed-on: https://gerrit.instructure.com/20873
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Sterling Cobb <sterling@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-05-24 19:59:34 +00:00
Stanley Stuart a7e713fab9 draft state: add delete action to quiz api and published field
test plan:
  - As a student, try to publish/unpublish a quiz through the api. You
    should get unauthorized errors.
  - As a teacher, try deleting a quiz through the API. It should be a
    successful response, and you should not see the quiz in the course
    index after you delete it.
  - As a teacher, try publishing/unpublishing a quiz through the api.
    To do this, simply make an update request to the api and pass a
    field called "published" which has the value true or false. When you
    get a response back, the "published" field should reflect the value
    you sent to the API. For good measure, make the same request against
    the show action in the API.
    (/api/v1/courses/:course_id/quizzes/:quiz_id) and the "published"
    field should have the same value.
  - As a teacher, create a quiz, and make sure it's published. As a
    student, take the quiz.
  - As a teacher, edit one of the quiz questions. You should see the
    normal "You have made unpublished changes to this quiz" message on
    the quiz show page, but when you query the API for the quiz the
    "published" parameter should be true.
  - As a teacher, try to unpublish the quiz from the API by including a
    "published" parameter with a value of "false". You should get an
    error response. The quiz should still be published in Canvas when
    you go back to it.

fixes CNVS-5673

Change-Id: Ie32aa48e0976374605419d180c373861a1397aa9
Reviewed-on: https://gerrit.instructure.com/20773
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Ryan Florence <ryanf@instructure.com>
2013-05-24 19:42:00 +00:00
Joel Hough 008df729be add unread conversation count api endpoint
fixes CNVS-5780

test plan
- ensure that /api/v1/conversations/unread_count correctly reports
 a user's unread conversation message count

Change-Id: I9999b5c43b249c1db1ca003d84b1e06c7ac9e434
Reviewed-on: https://gerrit.instructure.com/20769
Reviewed-by: Jon Willesen <jonw@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
2013-05-23 23:54:43 +00:00
Ryan Florence 534d92b5b3 added tour guide libs
closes CNVS-5736

test plan:
1. see specs

Change-Id: I1edbd4062d3c1a25394bdaaf028fa8198609a881
Reviewed-on: https://gerrit.instructure.com/17312
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Stanley Stuart <stanley@instructure.com>
Product-Review: Ryan Florence <ryanf@instructure.com>
QA-Review: Ryan Florence <ryanf@instructure.com>
2013-05-22 19:30:13 +00:00
Sterling Cobb 947f458d85 Add new content migration UI
This adds the ability for you to process migrations quickly. Includes a
paginated list for migrations and issues.

Test Plan:
 * Make sure old migrations UIs work the same
 * Make sure new UI works wonderfully
   * go to /courses/:id/content_migrations to see the new UI

fixes: CNVS-4732

Change-Id: I7cabc51348c32ed03d581e495756eefbf1060ad3
Reviewed-on: https://gerrit.instructure.com/20349
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-05-18 04:58:35 +00:00
Bracken Mosbacker 98bb4c7980 add migration endpoint to list available migrators
allows api users to find available migrators since different
canvas installs can have different oens available.

Test Plan:
 * Hit the api/v1/courses/:id/content_migrations/migrators
   endpoint and verify it works

refs #CNVS-4228

Change-Id: I3a2585cea8286b09c9e1039fd722d05a2e82d558
Reviewed-on: https://gerrit.instructure.com/20318
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
2013-05-17 22:34:25 +00:00
Bracken Mosbacker 93643f6d6c content migration creation api
allows creating content migration through the api

Test Plan:
 * Create a content migration through the api along with a file upload
 * You should be able to follow along with the progress and
   the migration should be complete when the progress is done
 * Try to update the migration type, you should get an error
 * Upload a wrong file type the first time, then go through
   the file upload process again on the update endpoint.

refs CNVS-4228

Change-Id: Iab1082ca68b61d1b0493c191b48169a164444d06
Reviewed-on: https://gerrit.instructure.com/19108
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
2013-05-17 22:34:09 +00:00
Stanley Stuart 5ad43c33bd add ability to download all file uploads for a quiz as a zip
test plan:
  - as a few different students, take a quiz with at least two questions
    that are file upload questions. Answer each question as each
    student.
  - as the teacher, you should see a "Download All Files" button on the
    right on the Quiz Show Page next to "Quiz Stastics" and "Moderate
    This Quiz".
  - You should get a pop up that successfully downloads all the zips
    (make sure you have delayed jobs running!). Make sure all the files
    you submitted as the students are there, with the student's name,
    user id, question number, and attachment display name in the
    filename of each file.

closes CNVS-3048

Change-Id: I23cb2d4262bb0446476eeac4fdcb356e604e6a05
Reviewed-on: https://gerrit.instructure.com/20495
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Reviewed-by: Eric Berry <ericb@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
2013-05-16 21:14:19 +00:00
Brad Humphrey be800d1e1f adding additional api support for the app center
Reworked how the calls were passed through to take advantage of the
app center pagination.  Also added an endpoint for retrieving app reviews.

The following canvas api calls should work, after configuring the app center plugin
 - /api/v1/accounts/:account_id/app_center/apps
 - /api/v1/accounts/:account_id/app_center/apps/:app_id/reviews
 - /api/v1/courses/:course_id/app_center/apps
 - /api/v1/courses/:course_id/app_center/apps/:app_id/reviews

These should also accept a page and per_page params

Change-Id: I15fe1225c01d04bc2ad6efa1736013b88e541c51
Reviewed-on: https://gerrit.instructure.com/20455
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Brian Whitmer <brian@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
2013-05-15 17:22:31 +00:00
Zach Pendleton 4752e16a0d add toggle for discussion auto-mark as read option.
fixes CNVS-5706

users are now able to toggle the discussion auto-mark
as read feature. this setting is user-level, and when
it is off, discussion entries will only be marked as
read when manually marked by the user.

manual marking is part of CNVS-5705.

test plan:
  * create a discussion in a course;
  * as user A, post an entry to the discussion;
  * as user B, navigate to the discussions index page and
    click the gear menu; check the "manually mark
    posts as read" checkbox and save the setting;
  * click into the discussion posted to by user A and
    verify that user A's post is not automatically marked
    as read;
  * uncheck the "manually mark posts as read" checkbox
    and save the setting;
  * revisit user A's post and verify that is marked as
    read without any input.
  * repeat steps above twice: once with user B as a
    teacher, once with user B as a student.

Change-Id: I2ff13705dfbee7d90e4e6c4003215d617fc0ef48
Reviewed-on: https://gerrit.instructure.com/20441
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
2013-05-10 22:50:45 +00:00
James Williams f9237bc856 add create/update/delete to api for context modules and items
test plan:
* refer to the API documentation to:

 * create a module
 * update existing module
 * delete a module

 * create a module item
 * update a module item
 * delete a module item

closes #CNVS-5534 #CNVS-5555

Change-Id: Icf13300d015e37bae636324a218ecf9ab9f2f8d0
Reviewed-on: https://gerrit.instructure.com/20200
QA-Review: Adam Phillipps <adam@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-05-10 15:16:34 +00:00
Jon Jensen a07b2ee772 async quiz report generation UI, fixes CNVS-4512
add button to create item analysis report, and make student analysis
creation async. make both buttons show a progress indicator, and auto-
download the file when it's ready (or not, if you refresh the page)

test plan:
1. make sure delayed jobs are running
2. create a quiz that allows multiple submissions
3. have some students take the quiz
4. go to the quiz statistics page
5. click "Generate Item Analysis"
6. it should be generated and prompt you to download
7. the data should be useful/correct
8. click "Generate Student Analysis
9. it should be generated and prompt you to download
10. the data should be useful/correct
11. have another student take the quiz
12. you should be able to regenerate both reports
13. have a student retake the quiz
14. you should get the link to view stats for all submissions
15. you should be able to download a different "Student Analysis" report
    for all submissions vs latest submission
16. the "Item Analysis" report should be the same for all submissions and
    latest submissions

Change-Id: Ib6bfa259f386a6660a41cd7e093d3a6eb0119eda
Reviewed-on: https://gerrit.instructure.com/20137
Reviewed-by: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
2013-05-08 23:11:52 +00:00
Jacob Fugal 7a6a816715 invalidate all sessions on explicit logout
when a user explicitly logs out of one pseudonym session, invalidate all
the others

fixes CNVS-1923

test-plan:
  - create a user in two different accounts
  - log them in to both accounts
  - click "log out" in one account
  - should be logged out of both accounts

Change-Id: I79e70017d753c8201429901421e015f5d20e2000
Reviewed-on: https://gerrit.instructure.com/20096
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
2013-05-08 19:43:55 +00:00
Stanley Stuart 552dae8070 implemented ui for quiz file upload question type
test plan:
  - enable the quiz file upload feature for your account.
  - make sure you have s3 credentials for your Canvas installation
  - as a teacher, create a quiz with some file upload questions
  - as a student, take the quiz, making sure the following works:
    - you should get a warning if you leave any questions unanswered
    - you should see your file in the right spot if you refresh the page
  - when you finish the quiz, make sure a link to the file shows up on
    the quiz show page and the display name for that file is the same
    name of the file you uploaded
  - take the quiz again and make sure files you uploaded for hte
    previous submission don't show up when you first take the quiz.

closes CNVS-1153
closes CNVS-5331

Change-Id: Id3f8706e87cef9876946b52fd564caf31f31e4b5
Reviewed-on: https://gerrit.instructure.com/20174
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
2013-05-07 17:34:03 +00:00
Brad Humphrey 6c02d94551 app center external apps endpoint
provides an unpublished, backbone accessible api endpoint for the app center to consume.
In this commit the apps api just acts as a proxy to the external apps website based on plugin
settings, but in the future this endpoint will be able to match up data to tools installed in the
current context, cache data from the external website, return data to the external website,
and so forth.

Test Plan:
  - Before installing the plugin:
    * Visit /api/v1/accounts/:account_id/app_center/apps
    * You should get an empty json array
  - Enable the app center plugin
    * Visit /api/v1/accounts/:account_id/app_center/apps
    * You should get a json formatted array of app data

Change-Id: I48072053950e67aa583a3c79e2a582d30e7cd409
Reviewed-on: https://gerrit.instructure.com/20161
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Bracken Mosbacker <bracken@instructure.com>
2013-05-03 15:16:30 +00:00
Cameron Matheson b6ae08da01 quiz submissions file upload api end-point
closes CNVS-4188

Test plan:
  * Follow the file upload api instructions but use
    /courses/:course_id/quizzes/:quiz_id/quiz_submissions/self/files as
    the end point

Change-Id: I12aea4332f149656f04d4a3253d99caa4abd3beb
Reviewed-on: https://gerrit.instructure.com/19799
Reviewed-by: Stanley Stuart <stanley@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
QA-Review: Cameron Matheson <cameron@instructure.com>
2013-05-01 20:08:14 +00:00
Duane Johnson 8b8c141a71 add API for user's upcoming_events
Test Plan:
- the dashboard sidebar should still work (it was refactored)
- the upcoming events should be accessible via the API
  i.e. curl /api/v1/users/self/upcoming_events and should return
  an array of calendar events and/or assignments for the user

fixes CNVS-5253

Change-Id: I9cbd231427b3f574c2484f69f479e28f5e8fcd84
Reviewed-on: https://gerrit.instructure.com/19992
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Duane Johnson <duane@instructure.com>
2013-04-30 15:43:46 +00:00
Joe Tanner 5fea28ce02 async json API to generate quiz stats reports
closes #CNVS-4511

refactor of some of the QuizStatistics model so it can be used with multiple report types

test plan:
just ensure the current quiz stats page and csv report still work,
the item analysis UI commit will have a more comprehensive test plan

Change-Id: I2973a2e3aa572bc272c59b4b97015c7f93d756d7
Reviewed-on: https://gerrit.instructure.com/20057
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Joe Tanner <joe@instructure.com>
QA-Review: Joe Tanner <joe@instructure.com>
2013-04-29 15:05:47 +00:00
Jacob Fugal 69a0254845 add gradebook history feed API endpoint
fixes CNVS-2802

test-plan:
 - create a course with multiple students and assignments
 - create submissions for those students and assignments
 - grade the submissions, including multiple gradings of some of them
 - GET /api/v1/courses/X/gradebook_history/feed
   - each grading should match the SubmissionVersion object described in
     the API docs
   - should include gradings for any assignment and student in the
     course
   - should include all gradings for any submission that's been graded
     multiple times
   - should paginate the returned gradings
   - should order the most recent gradings first
 - GET /api/v1/courses/X/gradebook_history/feed?assignment_id=Y
   - should only return gradings for submissions on that assignment
 - GET /api/v1/courses/X/gradebook_history/feed?user_id=Z
   - should only return gradings for submissions by that user
 - GET /api/v1/courses/X/gradebook_history/feed?ascending=1
   - should order the oldest gradings first
 - Repeat with combinations of the various parameters

Change-Id: I44aae11919116519f87a097f2d5cf1849acc4db3
Reviewed-on: https://gerrit.instructure.com/19680
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
2013-04-27 03:41:05 +00:00
Jeremy Stanley 8bdfdd3103 wiki pages CRUD API
fixes CNVS-5279

test plan:
 - see API documentation to create/retrieve/update/delete pages
 - exercise endpoints, including
   - CRUD functionality (above)
   - test renaming page
   - test publishing / unpublishing
   - test creating the front page in a new course or group

Change-Id: I5d3b36615b7bdbfda0d4781db14cd7d49d32eba1
Reviewed-on: https://gerrit.instructure.com/19952
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2013-04-26 18:17:25 +00:00
Simon Williams dfd6f86bf9 support persistent headless state for quizzes
also supporting forcing the quiz show page to require a user even in a public
course.

closes CNVS-5250

test plan (api):
- make sure the quiz api returns a mobile_url that sets these parameters

test plan (headless):
- go to a one question at a time quiz
- add ?headless=1 to the url
- notice that the quiz loads without top/side bars
- start the quiz
- the top/side bars are back
- now go back to the show page and add ?persist_headless=1
- start the quiz
- the top/side bars should still be gone

test plan (force user):
- as a logged-out user, go to a quiz show page in a public course
- it should work
- now add ?force_user=1 to the url of the show page
- it should redirect to the login page
- after logging in, you should end up back at the show page

note: please also check that getting notified when logged out of a quiz still
work, as that code was refactored slightly.

Change-Id: Id17ce336f8d12a6f4dd0f4d1324e7b4dd5cca1d0
Reviewed-on: https://gerrit.instructure.com/19597
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Reviewed-by: Stanley Stuart <stanley@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2013-04-21 00:03:02 +00:00
Cameron Matheson 1daa706def put statistics.csv in an attachment
refs CNVS-4887

Test plan:
  Make sure you can still download quiz statistics csv

Change-Id: I1dea60ce3465e4b536620f1dc6d515f4badf18e0
Reviewed-on: https://gerrit.instructure.com/19061
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
2013-04-17 17:22:56 +00:00
Simon Williams 607406eee0 notify students taking a quiz when session is invalidated
if the backup routine fails (401), show a modal popup to the user
indicating they have been logged out with a link to log back in.

closes CNVS-2773

test plan:
- as a student, start taking a quiz
- choose an answer or two, verify that it's saving according to the
  "Quiz saved at %s" label at the bottom
- launch a new tab, log-out from canvas in that tab
- go back to the quiz tab, choose an answer or modify one you chose
  earlier
- gaze into the beauty that is the dialog asking you to login again
- click the button to log back in
- you should end up at the login screen
- after logging back in you should be redirected back to the quiz show
  screen
- you should be able to resume the quiz

other things to test:
- try closing the dialog
- it should pop back up next time to make an action
- try logging back in from your second tab
- then close the dialog
- it should successfully backup on your next action
- try with a one question at a time quiz
- try with a can't go back quiz
- you shouldn't lose your place

note:
- this is currently disabled in lockdown browser

Change-Id: If9236c2aac419cfc4916338250c9c6973d8dd3b2
Reviewed-on: https://gerrit.instructure.com/18868
Reviewed-by: Stanley Stuart <stanley@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2013-04-15 18:58:31 +00:00
Jon Willesen 495db783d5 Add API for admins to access user messages
There are three parts to this:
 - API access for site admins and account admins. Account
   admins can only see messages for their account.
 - Includes start and end time parameters for basic searching
 - Summary notification are gathered up per account now, so
   account admins will not see a summary notification from
   multiple accounts.

fixes CNVS-3695

test plan:
 - Verify Admin Access:
   - Have a user enrolled in two courses in separate root
     accounts.
   - Send the user ASAP notification from each account.
   - Go to /users/:id/messages (the old interface) and verify
     the messages appear there.
   - As a site admin, get /api/v1/comm_messages for the user
     (see documentation for the api).
   - Verify that data for both messages are returned.
   - Use the console to give an account admin on one of the
     accounts :read_messages permissions.
   - As the account admin, get /api/v1/comm_messages for the
     user.
   - Verify that only the message for the admin's account is
     returned.
 - Verify start_time and end_time parameters
   - Use the console to modify the created_at field for the
     user's messages
   - As a site admin, get /api/v1/comm_messages for the user,
     specifying various combinations of start_time and
     end_time, and make sure the appropriate messages are
     returned.
 - Verify account based summaries
   - Set the notification policies for the user to a summary
     setting (daily or weekly)
   - Send multiple notifications to the user from each account.
   - Use the console to run the
     SummaryMessageConsolidator::process function.
   - View /messages for the user and verify that separate
     summaries are sent for each account.

Change-Id: Ie33ec02cc2033a1cc2f1fcbe538b76792aab0e6c
Reviewed-on: https://gerrit.instructure.com/18586
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mark Ericksen <marke@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
2013-04-11 19:38:02 +00:00
Ryan Florence 6601753eb7 implemented dress_code
also added styles to make .form-controls look
good in dialogs.

closes #CNVS-4302

Change-Id: Ibe54ee4046ac255b0b0ea83d32afc88e4a820464
Reviewed-on: https://gerrit.instructure.com/19331
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
QA-Review: Ryan Florence <ryanf@instructure.com>
Product-Review: Ryan Florence <ryanf@instructure.com>
2013-04-09 15:43:16 +00:00
Eric Berry ffd0fe56c3 HTMLify the outbound email messages and update the /messages UI
All of the outbound email notifications have been updated to have
a matching HTML version of the email in order for us to send multi-
part emails. There has also been some tweaking of the other email
messages (summary, plain text, etc) with a better looking layout

fixes CNVS-4728
fixes CNVS-4795

test steps:
- generate email messages for each template and review the results
  in the users message list view (/users/1/messages)

Change-Id: I1fd9cf2b134209e42c8d174f19b50963e6502f6a
Reviewed-on: https://gerrit.instructure.com/18942
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Product-Review: Eric Berry <ericb@instructure.com>
2013-04-03 20:03:34 +00:00
Brad Humphrey 49c6521ad8 turning in homework from LTI tools
adds a new LTI extension, "content", that
defines the interaction for sending content from
a tool provider to the tool consumer.  This extension
will replace the "embed_content" and '"select_link"
selection_directives, as well as adding allowing
am external tool to submit content for a homework
submission.

also starts sending intended_use, return_types, return_url
and file_extensions as part of the LTI launch with the new
extension.

test plan:
- make sure the "more" tab only shows up when there are valid tools

- install at least one valid tool
  (make a homework_submission tool by taking the xml for
  a resource_selection tool and replace "resource_selection"
  with "homework_submission")
- click "more"
- make sure you can't submit the assignment when no
  resource has been selected

- set an assignment that only allows file uploads
- try selecting a url from the tool
- make sure it errors out

- set an assignment that only allows file uploads
- limit the file types
- try selecting a file with a non-supported file extension
- make sure it errors out

- set an assignment that only allows file uploads
- try selecting an invalid file from the tool
- try submitting the homework
- make sure it errors out gracefully

- set an assignment that only allows file uploads
- try selecting a file from the tool
- make sure the submission works correctly

- set an assignment that only allows urls
- try selecting a file from the tool
- make sure it errors out

- set an assignment that only allows urls
- try selecting a url from the tool
- make sure the submission works correctly

Change-Id: I8df682bc73087681159110ab02f77f0e5a2b3911
Reviewed-on: https://gerrit.instructure.com/13419
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Product-Review: Brad Humphrey <brad@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
2013-03-27 14:52:12 +00:00
Sterling Cobb 0f308db11d add admin tools for undeleting courses
You can now restore a course if you have its id from the admin tools
page.

Test Plan
1. Go to an accounts page.
2. Click on 'admin tools' in the left hand navigation.
3. Enter the ID of a deleted course into the field under 'Find a deleted
course'
4. Click 'Restore'
5. View the course and ensure its now in an Unpublished state.

Permissions Part
1. Go to the permissions page
2. In account permissions change the course restore permission to be an
X for all roles.
3. Log into an account that can see course settings for the account you
changed the permission on.
4. The "Account tools" should not show up.

fixes CNVS-3797
fixes CNVS-3692

Change-Id: I009fbdc8f1d5cf86a9ccd1b6652d0153cfb363c9
Reviewed-on: https://gerrit.instructure.com/18492
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2013-03-22 17:59:24 +00:00
James Williams c0b4dd54ca remove files rss feed
fixes #CNVS-4569

Change-Id: I3785eaa00517e9cd552dec760119907ff0b6f6d4
Reviewed-on: https://gerrit.instructure.com/18541
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2013-03-18 14:26:04 -06:00
Bracken Mosbacker b03b6645fb create migration issues and start content migration api
this will allow migrations to have flexible todo items
and allow us to make a super awesome UI for helping
teachers fix any migration problems

Test Plan:
 * Run a migration that has issues. :)
 * exercise the issue api

closes CNVS-4230

Change-Id: I4577f811dd3b16aa200d381f039632b7cc2cd184
Reviewed-on: https://gerrit.instructure.com/18639
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2013-03-18 12:21:58 -06:00
Simon Williams f4c3d5a2c2 kill gradebook rss feed
closes CNVS-4565

test plan:
- before checking out this ps, find a gradebook rss feed url
  (it'll look like /feeds/gradebooks/<enrollment_uuid>) and you
  can probably find it on the gradebook1 page (or gradebook history)
- now check out the patch set
- that feed show no longer work, and the pages shouldn't advertise
  them anymore

Change-Id: I0c7cc4183da64ec51c62d5e850384ff05ce91db2
Reviewed-on: https://gerrit.instructure.com/18503
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Stanley Stuart <stanley@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
2013-03-12 14:37:10 -06:00
Jon Willesen f863d072a4 api call to delete a conversation for everybody
fixes CNVS-4437

test plan:
 - The api endpoint is:
   https://<canvas>/api/v1/conversations/:id/delete_for_all
   no other parameters (besides authorization header) are
   required.
 - Create a group conversation involving multiple users.
 - Get the group conversation's id
 - Try delete_for_all as one of conversation's users. Should
   receive 401.
 - Try to delete_for_all the conversation as an account admin
   user. Should receive 401 error.
 - Try to delete_for_all the conversation as a site admin
   without "become user" permission. Should receive 401 error.
 - Try to delete the conversation as a site admin with "become
   user" permission. Call should succeed.
 - The conversation should be gone from all involved users'
   inboxes.

Change-Id: Idf5d1f8d66aaa2c5bb26cec451dffcac1aaafcaa
Reviewed-on: https://gerrit.instructure.com/18393
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Eric Berry <ericb@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
2013-03-12 10:30:56 -06:00