cancel
Showing results for 
Search instead for 
Did you mean: 
brystfire08
Surveyor II

Moving to next segment via external tool

Jump to solution

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 (5)
0 Kudos
1 Solution

Accepted Solutions
brystfire08
Surveyor II

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 Kudos
1 Reply
brystfire08
Surveyor II

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 Kudos