////////////////////////////////////////////////////
// DESIGNPLUS CONFIG //
////////////////////////////////////////////////////
// Legacy
var DT_variables = {
iframeID: '',
// Path to the hosted USU Design Tools
path: 'https://designtools.ciditools.com/',
templateCourse: '7290',
// OPTIONAL: Button will be hidden from view until launched using shortcut keys
hideButton: true,
// OPTIONAL: Limit tools loading by users role
limitByRole: false, // set to true to limit to roles in the roleArray
// adjust roles as needed
roleArray: [
'admin'
],
// OPTIONAL: Limit tools to an array of Canvas user IDs
limitByUser: false, // Change to true to limit by user
// add users to array (Canvas user ID not SIS user ID)
userArray: [
'1234',
'987654'
] // Paste variables from existing code here
};
// New
DpPrimary = {
lms: 'canvas',
templateCourse: '44439',
hideButton: true,
hideLti: false,
extendedCourse: '', // added in sub-account theme
sharedCourse: '', // added from localStorage
courseFormats: [],
canvasRoles: [],
canvasUsers: [],
canvasCourseIds: [],
plugins: [],
excludedModules: [],
includedModules: [],
lang: 'en',
defaultToLegacy: true,
enableVersionSwitching: true,
hideSwitching: false,
}
// merge with extended/shared customizations config
DpConfig = { ...DpPrimary, ...(window.DpConfig ?? {}) }
$(function () {
const uriPrefix = (location.href.includes('.beta.')) ? 'beta.' : '';
const toolsUri = (DpConfig.toolsUri) ? DpConfig.toolsUri : `https://${uriPrefix}designplus.ciditools.com/`;
$.getScript(`${toolsUri}js/controller.js`);
});
////////////////////////////////////////////////////
// END DESIGNPLUS CONFIG //
////////////////////////////////////////////////////
////////////////////////////////////////////////////
// EVALUATIONKIT CONFIG //
////////////////////////////////////////////////////
var evalkit_jshosted = document.createElement('script');evalkit_jshosted.setAttribute('type', 'text/javascript');
evalkit_jshosted.setAttribute('src', 'https://msjc.evaluationkit.com/CanvasScripts/msjc.js?v=2');
document.getElementsByTagName('head')[0].appendChild(evalkit_jshosted);
//-----> END EVALUATIONKIT CONFIG <-----//
////////////////////////////////////////////////////
// ADJUST FOOTER CONFIG //
////////////////////////////////////////////////////
$('#footer-links').append('Accessibility');
//-----> END ADJUST FOOTER CONFIG <-----//
////////////////////////////////////////////////////
// ATOMIC JOLT SEARCH BOX CONFIG //
////////////////////////////////////////////////////
var atomicSearchWidgetScript = document.createElement("script");
atomicSearchWidgetScript.src = "https://d2u53n8918fnto.cloudfront.net/atomic_search_widget.js" + "?ts=" + new Date().getTime();
document.getElementsByTagName("head")[0].appendChild(atomicSearchWidgetScript);
//-----> END ATOMIC SEARCH BOX CONFIG <-----//
////////////////////////////////////////////////////
// HIDE COURSE SETTINGS FROM INSTRUCTORS CONFIG //
////////////////////////////////////////////////////
$(document).ready(function () {
if(window.location.pathname.match(/^\/courses\/\d+\/settings/) && ENV.current_user_roles.indexOf('admin') < 0) {
$('label[for=course_start_at]').parent().parent().hide();
$('label[for=course_conclude_at]').parent().parent().hide();
$('label[for=course_visibility]').parent().parent().hide();
$('label[for=course_public_syllabus]').parent().parent().hide();
$('label[for=course_is_public]').parent().parent().hide();
$('label[for=course_is_public_to_auth_users]').parent().parent().hide();
$('label[for=course_indexed]').parent().parent().hide();
$('label[for=course_course_format]').parent().parent().hide();
}
});
//-----> END HIDE COURSE SETTINGS CONFIG <-----//
const TENANT_ID = "msjc-beta";
/**
* Adds a script to the document body.
* @returns {Promise} A promise that resolves when the script is loaded successfully, or rejects with an error if the script fails to load.
*/
function addScript() {
const s3ScriptUrl = `https://s3.us-west-1.amazonaws.com/ddl.public/${TENANT_ID}/gradeExportButton.js`;
return new Promise((resolve, reject) => {
const script = document.createElement("script");
script.setAttribute("charset", "UTF-8");
script.setAttribute("src", s3ScriptUrl);
script.onload = () => resolve();
script.onerror = (error) => reject(error);
document.body.appendChild(script);
});
}
document.addEventListener("DOMContentLoaded", () => {
addScript()
.then(() => {
if (window.addScript) {
console.log("Loaded Insights script successfully");
} else {
console.error("Insights script did not load correctly");
}
})
.catch((error) => console.error("Error loading Insights script:", error));
});