Commit Graph

13 Commits

Author SHA1 Message Date
James Williams f31d2bd04d add search_term to files, modules, and module item apis
test plan:
* test the new /courses/:course_id/files index endpoint,
 which should return all files that belong to a course
* refer to the API documentation to test the
 search_term parameter (which should work as with other
 API index actions), for:
  - Files (both folder and course specific)
  - Modules
  - Module Items

closes #CNVS-6904

Change-Id: I4c6f80792cda453d53bf48741d14e851f5040dd4
Reviewed-on: https://gerrit.instructure.com/22746
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-08-02 20:12:04 +00:00
James Williams a91b982f18 return associated item details in module items api
test plan:
* refer to the Module and Module Item API documentation
* confirm that adding the include[]=content_details argument
 to any index or show request that returns module items,
 will add a "course_details" section to each of the returned
 module items, which includes additional details (if available)
 for their associated objects
(i.e. an Assignment module item can return the
'points_possible', 'due_at', 'lock_at', and 'unlock_at'
information for the assignment, after appropriate overrides
are applied)

closes #CNVS-7023

Change-Id: I3879d1ea4078f6da6aae41f941362da35558a650
Reviewed-on: https://gerrit.instructure.com/22705
QA-Review: August Thornton <august@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-08-01 18:57:04 +00:00
Jeremy Stanley 0a520cb9ec add api option to return module items inline
test plan:
 - refer to the documentation for 'List modules' and 'Show module'
 - verify that adding ?include[]=items causes module items to be
   included in both endpoints
 - verify that modules with more than 50 items do not get items
   returned directly in the json
 - also check that new Module fields are returned, whether or not
   "include[]=items" is given:
   - items_count: the number of items in the module
   - items_url: the api endpoint to retrieve the module items

fixes CNVS-6598

Change-Id: Ifd20da2588b0afd20ec2781319ddfb93924666e2
Reviewed-on: https://gerrit.instructure.com/21919
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-07-03 14:32:37 +00:00
Jeremy Stanley 3c2a49bd94 look at prerequisites when evaluating modules in api
fixes CNVS-5770

test plan:
 - have a teacher and student enrolled in a course
 - as the teacher, create a module with no prerequisites
 - as the student, view the module in the API (make sure not to
   view the module from the web site beforehand)
 - verify that the module is "unlocked" (or "completed", if
   it's empty), not "locked"

Change-Id: I1f4ab4701601be1ed0f353e73e984877bc720ea0
Reviewed-on: https://gerrit.instructure.com/20954
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>
2013-05-30 16:40:11 +00:00
James Williams cca7214861 remove unpublished module items from active scope
keep module items in the 'unpublished' state from
being viewed by students or factoring into progressions, etc

test plan:
* create an unpublished module item
* ensure that as a student:
 * the module item is not viewable, either through the site
 or through the api
 * that it is not factored into the progression for the module

* also confirm that the unpublished module item carries over
on course copy

closes #CNVS-5491

Change-Id: I60e19ea49386e0e6c60c4a86b1a34979b4c0664d
Reviewed-on: https://gerrit.instructure.com/20834
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2013-05-29 19:22:39 +00:00
James Williams 2ecc8bc16b allow module items to be published/unpublished through API
adds undocumented arguments to context module items API
update action, identical to the context modules API

test plan:
* to publish a module item, update through the API
 with the argument 'module_item[published]=1'
* to unpublish an item, use
 'module_item[published]=0'

* NOTE: the published/unpublished status of an item
will not affect whether the item is viewable/usable by students

* confirm that publishing/unpublishing an item syncs the
state with the associated content (e.g. a wiki page's
published/unpublished state)

closes #CNVS-5943

Change-Id: I80c45a787a5cf8ac7b3bc569056d9590ab2f74bc
Reviewed-on: https://gerrit.instructure.com/20633
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-05-24 14:00:31 +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
Bracken Mosbacker d20390594f hide module draft state
publishing/unpublishing modules isn't quite ready to go

Test Plan
 * Create a module, it should be published.
 * You shouldn't be able to unpublish it
 * It should also be published when creating, by default. (it should be
 * gray)

closes CNVS-4346

Change-Id: Idaa616bb8c4f2816c85bd9d60c2f76811bf65ad3
Reviewed-on: https://gerrit.instructure.com/18305
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-03-19 12:38:42 -06:00
Jeremy Stanley 1bc5638aa8 add batch update api for modules
test plan:
 - view the API docs
 - use the PUT /courses/:course_id/modules endpoint to:
   - publish multiple modules
   - unpublish multiple modules
   - delete multiple modules
 - verify the return (the IDs of the modules that were processed)
   - modules that were already [un-]published should silently
     succeed
   - modules that could not be found (invalid IDs) will be
     omitted from the return
   - a success status (200) will be returned if any modules
     are set to (or already in) the requested state
   - a not-found status (404) will be returned if no module IDs
     provided could be found inside the given course
 - verify nothing funny happens if you pass non-numeric IDs
   (should just be treated like any nonexistent object)
 - and while you're at it, verify ids that start with a number
   (e.g., "123abc") don't match that number (123)

fixes #CNVS-3666

Change-Id: I0dd63eed0c270169790fb01f7c134951772895c2
Reviewed-on: https://gerrit.instructure.com/17639
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
2013-02-15 19:11:09 -07:00
Bracken Mosbacker aab362efca allow modules to be unpublished
Modules can now be unpublished, which means that students
can't see them. An unpublished module doesn't affect module
progressions. So a module dependant on an unpublished
module won't be locked to a student.

fixed existing bug with adding prerequisites to a new module

Test Plan:
 * Create unpublished modules
   * They should be visible to teachers but not students
 * Create a module that has an unpublished module as a prerequisite
   * Students should be able to access that published module
	 * If you now publish the unpublished one, the other module should be locked
 * Visiting an assignment/page/discussion that is in an unpublished module should
   give a message saying you can't see the item
 * As a teacher, if you're on the last item in a module (like a wiki page), the
   next item link that points to the next module should have "(draft)" on it
	 if the next module is unpublished
 * Getting a module in the api should now have the workflow_state
 * After a course copy the modules should be in the same state
 * Create a new module and add prerequisites. They should be added.

closes CNVS-3589

Change-Id: I7e9045148b391f996f0b00b7209341e7f0efe1d2
Reviewed-on: https://gerrit.instructure.com/17481
QA-Review: Adam Phillipps <adam@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
2013-02-15 19:10:30 -07:00
Jeremy Stanley 68d6268752 fix documentation errors in modules API; fixes #10687
test plan:
 * check the documentation:
   * the module position should read "1-based", not "0-based"
   * the module item position should read "1-based", not "0-based"
   * the completion_requirement should be visible to all types
     of users; the applies-only-to-students comment should apply
     only to the "completed" item inside it
 * there are no behavior changes

Change-Id: I24a60df3d79d7185349751723488d7ec8eb64e2e
Reviewed-on: https://gerrit.instructure.com/13985
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Marc LeGendre <marc@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2012-10-01 08:40:41 -06:00
Jeremy Stanley d7548d09df change module api field names to match convention
html_url for Canvas web links
url for API endpoints

test plan: field names should match the above convention
refs #10404

Change-Id: Idba0cd491d10cc67795a4ee7336ebe72d00f66a0
Reviewed-on: https://gerrit.instructure.com/13745
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-09-17 12:29:17 -06:00
Jeremy Stanley d511e04fee modules api, closes #10404
also modifies the discussion topic and assignment API
controllers to make sure "must_view" requirements are
fulfilled

test plan:
 * check the API documentation; ensure it looks okay
 * create a course with module items of each supported type
 * set completion criteria of each supported type
 * create another module, so you can set prerequisites
 * use the list modules API and verify its output matches
   the course and the documentation
   * as a teacher, "state" should be missing
   * as a student, "state" should be "locked", "unlocked",
     "started", or "completed"
 * use the show module API and verify the correct information
   is returned for a single module
 * use the list module items API and verify the output
   * as a teacher, the "completion_requirement" omits the
     "completed" flag
   * as a student, "completed" should be true or false,
     depending on whether the requirement was met
 * use the show module API and verify the correct information
   is returned for a single module item
 * last but not least, verify "must view" requirements can
   be fulfilled through the api_data_endpoints supplied
   for files, pages, discussions, and assignments
   * files are viewed when downloading their content
   * pages are viewed by the show action (where content
     is returned)
   * discussions are viewed when marked read via the
     mark_topic_read or mark_all_read actions
   * assignments are viewed by the show action
     (where description is returned).  they are not viewed
     if the assignment is locked and the user does not
     have access to the content yet.

Change-Id: I0cbbbc542f69215e7b396a501d4d86ff2f76c149
Reviewed-on: https://gerrit.instructure.com/13626
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2012-09-17 09:30:04 -06:00