Create javascript links reflecting availability of assigments
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For a few days I have been trying to create a javascript that fetches json from the api.
Finally I figured out something that works more or less...
The idea is to generate a list of assignments on a course page.
The locked ones will be grey, the unlocked ones will be green.
For now I am just trying to fetch the json fromt he api and show it on a page.
or rather, the text response, since the json file starts witjh while(1) .. and is not correct json
I got it to work but I am not allowed in I think, while tyhe script is called form within the coursesite itself.
The response.text I get form the fetch() is:
"while(1);{"errors":[{"message":"The specified resource does not exist."}]} "
I am calling the script from within the canvas site.
The fetch_test.html file ( contents below) is placed in the files directory of the course.
In a course page I embedded it in an iframe:
<p>
<iframe style="display: block; margin-left: auto; margin-right: auto;" src="https://xxxx/courses/yyyy/files/XXXX/download" width="100%" height="459" data-api-endpoint="https://xxxx/api/v1/courses/yyyy/files/XXXX" data-api-returntype="File"></iframe>
</p>
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
haha, sorry, that could have been phrased so much better. Yup, LTI running from another server is probably the way to go. You will need specific Canvas permissions to be able to configure it for your course.
UCF has a python 2.7 LTI starter template, which I have been able to successfully use.
https://github.com/ucfopen/lti-template-flask
I'm in the process of migrating that to 3.9 and expanding it for my needs.