Hello Canvas Devs!
I'm working on an update to @James awesome Canvancement script Add a student's name to their Grades page and I ran into a snag.The jQuery function adds appended code into the HTML, but the content isn't visible within the browser.
Here's the jQuery code:
if (matches) { $("aside#right-side").css("display", "inline-block").append(' Grading NotesThe total grade is not necessarily a predictor of an end of term grade, rather it is a snapshot of current progress. For example, prior to large assignments (test, projects, papers) being graded, smaller assignments heavily influence the overall grade. Students and parents are urged to speak with your Teacher if you have questions.
Assignment is turned in."-" Assignment has not been logged or is missing.
A digital file was submitted and grades are pending. Grading Scheme Name Range A 100% to 92.5% A- < 92.5% to 89.5% B+ < 89.5% to 86.5% B < 86.5% to 82.5% B- < 82.5% to 79.5% C+ < 79.5% to 76.5% C < 76.5% to 72.5% C- < 72.5% to 69.5% D+ < 69.5% to 66.5% D < 66.5% to 62.5% D- < 62.5% to 59.5% F < 59.5% to 0% '); }Here's the whole block for contex:
// ==UserScript==// @name Add Name to Grades page// Adapted from James Jones' Canvancement Tools// Canvancement Tools can be found at https://github.com/jamesjonesmath/canvancement/// ==/UserScript==var includeSisId = true;var nameOrder = [ 'short_name', 'name', 'sortable_name'];var regex = new RegExp('/users/([0-9]+)/grades$');var matches = regex.exec(document.location);if (matches) { $.getJSON('/api/v1/users/' + matches[1], function (data) { var name; for (var i = 0; i < nameOrder.length; i++) { var key = nameOrder[i]; if (typeof data[key] !== 'undefined' && data[key]) { name = data[key]; break; } } if (includeSisId && typeof data.sis_user_id !== 'undefined' && data.sis_user_id) { name += ' (' + data.sis_user_id + ')'; } console.log(name); if (typeof name !== 'undefined') { $('h2:contains("Courses ")').text(name); } if (matches) { $("aside#right-side").css("display", "inline-block").append(' Grading NotesThe total grade is not necessarily a predictor of an end of term grade, rather it is a snapshot of current progress. For example, prior to large assignments (test, projects, papers) being graded, smaller assignments heavily influence the overall grade. Students and parents are urged to speak with your Teacher if you have questions.
Assignment is turned in."-" Assignment has not been logged or is missing.
A digital file was submitted and grades are pending. Grading Scheme Name Range A 100% to 92.5% A- < 92.5% to 89.5% B+ < 89.5% to 86.5% B < 86.5% to 82.5% B- < 82.5% to 79.5% C+ < 79.5% to 76.5% C < 76.5% to 72.5% C- < 72.5% to 69.5% D+ < 69.5% to 66.5% D < 66.5% to 62.5% D- < 62.5% to 59.5% F < 59.5% to 0% '); } });}Any suggestions on getting this code to be visible would be deeply appreciated!
Thank you,
Jason