Publishing Module Item on POST

Jump to solution
jason_edington
Community Member

I am creating an app with PHP that puts our assignments into a specific module based on the assignment title.  I have almost completed it with one hang up. 

The script is creating the module item with these parameters:

module_item[type]=Assignment&module_item[content_id]=19683&module_item[position]=3&module_item[indent]=1&module_item[published]=true 

Everything works but the "module_item[published]=true". No matter what I do the items are unpublished in the modules, and I'm not seeing the option in Canvas live API. 

I think I know the answer to this question, but I wanted to check with this great resource of knowledge before I do all of the extra work.  Does this mean that I have to pull from the API to first POST the module assignment and then pull from it again to get all of the Module items and do a PUT to update them?  Why wouldn't they have a way to publish the module items on POST?

Labels (1)
1 Solution
muh
Community Contributor

Thanks for sharing your experience  @jasoned ‌, but personally I think it would be better to set the default as unpublished. First, it would be consistent with other scenarios, such as assignment, discussion, and etc. Second, if the course is published, I don't want to my students to be panic when I am "playing" with the course contents. 🙂

View solution in original post