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>