[CM-16] Create plug-and-chuggable embedded CM#14
Conversation
progressReport/canvasEmbedding.js
Outdated
|
|
||
| // Check if the current URL matches the target page URL | ||
| if (currentUrl === targetPageUrl || currentUrl === alternateTargetPageUrl) { | ||
| const accessToken = '26530~etwvNZ2z3WXDxP9CXDeDNCmKN3MCWEKtDaYrQ7JRVGJ6nkBUcR8V4VURDVMBuLeW'; |
There was a problem hiding this comment.
Totally forgot to remove this. I have disabled this access token.
There was a problem hiding this comment.
Please make sure to review all code before committing. I get it, mistakes happen, but in industry, committing a private key would be a major issue and you'd have a full retro meeting just for this.
| const courseId = '141'; | ||
| const studentId = ENV.current_user_id; // Replace with the actual student ID |
There was a problem hiding this comment.
How are these going to be sourced?
There was a problem hiding this comment.
The courseId will be entered as a constant
I meant to remove the in-line comment on line 10. Sorry about that! Please disregard the comment. The studentId can be accessed by by ENV.current_user_id, which is the user id of the user for whom the page is being generated.
| const targetPageUrl = 'https://ucberkeleysandbox.instructure.com/courses/141/pages/concept-map?module_item_id=418'; | ||
| const alternateTargetPageUrl = 'https://ucberkeleysandbox.instructure.com/courses/141/pages/concept-map'; | ||
| // Paste Canvas API key here | ||
| const accessToken = ''; |
There was a problem hiding this comment.
Whose access token is this?
There was a problem hiding this comment.
We discussed not using student access tokens, so if this is a service account access token, that's fine, but only if the students cannot see this js. How is this handled?
There was a problem hiding this comment.
This is a service account access token. Students will not be able to see this js; the Canvas Theme Editor allows this code to be run server-side.
Jira Ticket
Jira Ticket
Description
Type of Change
Changes
Testing
Checklist
<ticket-id>/<brief-description-of-change>[<ticket-id>] <brief-description-of-change>Screenshots/Video
Additional Notes