The Instructure Community will enter a read-only state on November 22, 2025 as we prepare to migrate to our new Community platform in early December. Read our blog post for more info about this change.
Hi,
I've been trying to mimic what was done in this discussion to change the text on the "Take the Quiz" button in a Canvas quiz. Many of our quizzes are not actual quizzes; rather, just assignments that are better suited to be delivered as a "quiz" in Canvas.
That being the case, I am looking to change the "Take the Quiz" text on the quiz button to say something different, like "Begin Assignment".
I am tech savvy, but a novice in JavaScript. I have admin access to be able to upload custom JavaScript files to Canvas. Our instance currently has custom JavaScript and CSS files included.
I've tried updating the code and reuploading the JavaScript file in the theme editor, but what I've tried hasn't worked. Either my code is wrong, or I'm adding it incorrectly to the JavaScript file. Code:
Can any of you point me in the right direction here? Any advice is much appreciated.
Thanks,
Jake
Solved! Go to Solution.
Try this:
$("#take_quiz_link").text("Begin")However, relying on CSS IDs is a bit risky with jQuery code is a bit risky as Instructure will at some time potentially change their UI such that the CSS ID could become no longer relevant someday down the road. It is the institutions responsibility if they make use of JS overrides for the Canvas UI to check each release for potential UI breakage.
You can also base it off of a jQuery filter by a URL pattern. The <a> element selector in jQuery syntax can use a pattern for the href property. The URL in the <a> element for the 'Take Quiz' button contains the string of 'take?' in it. Since Canvas calls its own API, that's less likely to change than a UI/CSS change so this expression may last longer:
$('a[href*="take?"]').text("Begin")Hope that helps.
Try this:
$("#take_quiz_link").text("Begin")However, relying on CSS IDs is a bit risky with jQuery code is a bit risky as Instructure will at some time potentially change their UI such that the CSS ID could become no longer relevant someday down the road. It is the institutions responsibility if they make use of JS overrides for the Canvas UI to check each release for potential UI breakage.
You can also base it off of a jQuery filter by a URL pattern. The <a> element selector in jQuery syntax can use a pattern for the href property. The URL in the <a> element for the 'Take Quiz' button contains the string of 'take?' in it. Since Canvas calls its own API, that's less likely to change than a UI/CSS change so this expression may last longer:
$('a[href*="take?"]').text("Begin")Hope that helps.
Jeffrey,
Thanks for taking the time to answer. This worked like a charm. Really appreciate the help.
Best,
Jake
Where do I find the place to input this code?
Community helpTo interact with Panda Bot, our automated chatbot, you need to sign up or log in:
Sign inTo interact with Panda Bot, our automated chatbot, you need to sign up or log in:
Sign in
This discussion post is outdated and has been archived. Please use the Community question forums and official documentation for the most current and accurate information.