Moving to next segment via external tool

Jump to solution
brystfire08
Community Explorer

Hi!

Is there a way to programmatically move to the next segment after finishing an exercise in the external tool (triggered after doing a grade pass back on the current exercise)? Or like create a button that functions like the Next Button below. 

Labels (1)
0 Likes
1 Solution
brystfire08
Community Explorer
Author

I had to use the API
https://canvas.instructure.com/doc/api/modules.html#method.context_module_items_api.item_sequence 

Just need to provide the canvas CourseId and moduleItemId

curl https://<canvas>/api/v1/courses/<course_id>/module_item_sequence?asset_type=Assignment&asset_id=123 \
  -H 'Authorization: Bearer <token>'

then from the result get the html_url property of the  next object inside the items.

Then use that to change the parent window location... canvas won't block this because you are changing the current page.

top.window.location.href = html_url ; 

View solution in original post

0 Likes