Celebrate Excellence in Education: Nominate Outstanding Educators by April 15!
Found this content helpful? Log in or sign up to leave a like!
We are trying to add a pop up declaration which require student to agree when then click on a button and will like to record the action on the databases. If the student clicked on agree button on the declaration they are allow to proceed and if they will not be able to proceed if they do not agree.
Have anyone done something similar and what is the approach on this?
I am thinking of using custom theme to use javascript to do this.
The only thing I've seen like this is from @bbennett2
Spit and Tape to Get Some Data | ohhey[blog]
Another popular option is to setup an orientation module or course with a single assignment/quiz.
Here's an example, https://community.canvaslms.com/message/190851-re-ruby-programming-assistance
You can store custom fields on a user in the Canvas data model, but I've not done that personally. The challenge with a popup is that Canvas is moving over to JS frameworks like React, so the HTML is generated dynamically and watching for changes becomes more difficult than looking for a div class and appending, etc.
James Jones has written about using a MutationObserver for dynamic changes, and here's an example of that working. You can write a function that authorizes an API call as the current user which puts data into the user model, like I already mentioned. It's a trick to decide when and where to make that popup happen though.
Robert's idea about using a single-quiz Module with subsequent modules locked until that quiz is completed would be much less overhead.
Thanks Brian. Agreed that it is a challenge to keep the JS updated to be able to look for the HTML elements in Canvas.
This looks like a good and safe way to save custom data on Canvas end. We can use themes JS to save the custom data by reusing the authenticated user session.
The only thing is that we would like to inform our server that the button was clicked and send an email out. I am still struggling to find a way secure endpoint on the server so that it only receives request from authorized user in Canvas. Wanted to avoid having to embed key in JS and also avoid the endpoint serve requests from anyone on the internet.
I am also very interested in this topic as downloading the document for the student to sign and then upload it again a tedious.
@jgingfai_chong Months later...
Were you able to get this worked out? It seems to me that if you only expose the form internally once the user is signed in, you wouldn't get any spam clicks on the confirmation dialog. If you did get it working, would you be willing to share a code snippet?
Hi, wondering if anyone got a solution to this? Thanks
To participate in the Instructure Community, you need to sign up or log in:
Sign In