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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>