Degraded AWS performance is currently impacting some Canvas users in the North American region. Check Canvas Status for updates.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
sami_soinio
Community Member

Removing import all content

Greetings!

We started pushing our lecture times directly to Canvas as events from TimeEdit. Now lecture times are neatly in the Canvas calendar with assignments and other dated events. However, a problem has come about with this integration. As the events exist within a course, they also migrate with the course in a full course copy. Despite lecturers being informed about this, they have already learned to copy courses directly with the "Import content -> All content function".

However, instead of fixing the damage, we are looking to hide the "All content" option from the import and leave only the "Select specific content" option for them. This makes the lecturers look at each individual part when copying content and perhaps leave the events out of the equation. Naturally, this helps with other events as well (e.g. we get some from EvaluationKit automatically).

This requires a bit of CSS or Java, which I have been unable to determine. While canvas/branding/javascript/element_targetting at master · unsupported/canvas · GitHub has provided some clues.

Tags (2)
2 Replies
sami_soinio
Community Member

#migrationConverterContainer .selectContent > .radio:first-child{
display: none
}

This seemed to work, but have not been able to confirm how safe it is to use with regards to other functions. Additionally, as it does not default to "Choose content" it needs to be separately pushed.

sami_soinio
Community Member

Updated:

CSS:

/************* Removes select all from course import */ #migrationConverterContainer .selectContent > .radio:first-child{ display: none }

Java:

// force selective import on the Copy Course page $(document).ready(function(){     $("#copy_course_form input[name=selective_import][value=true]").click();     $("#copy_course_form input[name=selective_import]:first").parent().parent().parent().parent().hide(); });  // force selective import on the Import Course page $(document).ready(function() {     var mut_obs = new MutationObserver(function(mutations) {         for (var i = 0; i < mutations.length; i += 1) {             var mutation = mutations[i];             if (mutation.type == "childList") {                 $("#migrationConverterContainer input[name=selective_import][value=true]").click();                 $("#migrationConverterContainer input[name=selective_import]:first").parent().parent().parent().parent().hide();             }         }     });     var form = document.querySelector("#migrationConverterContainer #converter");     if (!form) return;     mut_obs.observe(form, { childList: true });      var select_elem = document.querySelector("#migrationConverterContainer #chooseMigrationConverter");     select_elem.selectedIndex = 1;     var change_event = new Event("change", {         bubbles: true,         cancelable: true,     });     select_elem.dispatchEvent(change_event); });