Conditionally display portions of HTML page based on student grade

Jump to solution
kelleyk2
Community Member

I would like to build a home page for my course which includes a "roadmap" of the various modules. If a student has completed a given module, I would like to overlay a checkmark image over the bitmap representing that module.

Is there some way to have the HTML editor look up whether or not a student has completed a module, and use the result as a conditional when displaying the page?

0 Likes
1 Solution
James
Community Champion

 @kelleyk2  

There is no way to get the Rich Content Editor to do this directly as JavaScript is banned at the course level. You could write a global custom JavaScript that would do it, but this would need to be loaded by your local Canvas Admin and get loaded for all courses, not just yours. You can, of course, add JavaScript that will check the course ID and only run on for your courses, but then that code needs updated each semester with a new list of courses. JavaScript can be uploaded at the subaccount level, so if all of the physics courses were in a subaccount, you might be able to upload the script there. We have one teacher who is testing an application that requires custom JavaScript at our institution, so we manually put her classes into their own subaccount so the script potentially didn't interfere with other people. Granted, that teacher is also a Canvas admin and married to our Canvas technical support guy, so she had an inside track.

One possibility would be to host the content outside of Canvas where a script could run. You could then make your homepage be a content page and embed the external content in the homepage. Note that external content does not inherit any of the formatting from Canvas, so it would not look like Canvas unless you also applied Canvas CSS to the code. It also means that you would be responsible for checking accessibility and creating full links that include the host and full path to the course rather than just the short link.

View solution in original post

0 Likes