//This is used for the MRL/K8 platform Dynamic Classroom. It is required. if (!String.prototype.includes) { String.prototype.includes = function(search, start) { if (typeof start !== 'number') { start = 0; } if (start + search.length > this.length) { return false; } else { return this.indexOf(search, start) !== -1; } }; } function dc_observer_callback() { var oItem = document.getElementsByTagName("k8-content-page")[0]; var cookie = JSON.parse(getCookie("bimdata")); var student = getCookie("student"); var teacher = getCookie("teacher"); if ($('.state-specific').length > 0) { $('.state-specific').hide(); switch (cookie.program_id) { case "FL2020": $('.state-specific.state-fl').show(); break; case "CC2019": $('.state-specific.state-cc').show(); break; case "BHS19": $('.state-specific.state-bhs19').show(); break; case "K8": $('.state-specific.state-mrl').show(); break; case "AL2022": $('.state-specific.state-bhs19').show(); $('.state-specific.state-mrl').show(); break; default: } } if ($("k8-header-nav").is(":visible")) { if ($('.username').text() == "ltiTeacherResourceUser") { $("k8-header-nav").hide(); } } if ($("div.k8-header-dropdown.hidden").length > 0 && $("div.k8-header-dropdown.srfix").length <= 0) { $('div.k8-header-dropdown a').attr("hidden", "hidden"); $('div.k8-header-nav-section.menu button').click(function() { if ($("div.k8-header-dropdown.hidden").length > 0) { $('div.k8-header-dropdown a').attr("hidden", "hidden"); } else { $('.k8-header-dropdown a').removeAttr("hidden"); } }); } /*Temporary Fix for Unlock container scrolling and padding*/ if($(".student-lock-container").length > 0){ if($(".student-lock-container.tempfix").length == 0){ $(".student-lock-container").css("overflow","scroll").addClass("tempfix"); } } if($(".student-lock-container > div.single-student-assign").length > 0 && $(".student-lock-container > div.single-student-assign.tempfix").length <=0){ $(".student-lock-container > div.single-student-assign").css("padding","5px").addClass("tempfix"); } /* if ($('.k8-book-selections').length > 0) { $('.k8-book-selections').each(function() { $(this).remove(); }) }*/ if (($('iframe[src*="viewer.php"]').length > 0) && ($('.clickthrough-example-button').length == 0) && teacher == 1 && $('#mainContentArea').length > 0 && $('h1.k8-debug:contains("ELEMENT: Video")').length == 0) { $('iframe[src*="viewer.php"]').each(function() { let items = $(this).attr("src").split("videoRef=")[1].split(","); let cntr = 0; var $exdiv = $('
'); for (var i = 0; i < items.length; i++) { var item = items[i]; var btntext = ""; cntr++; if (items.length > 1) btntext = cntr; var btn = ''; $exdiv.append("
" + btn + "
"); } $exdiv.css('float', 'right'); $(this).parent().parent().append($exdiv); }); } if (cookie.location_id == 80) { //We don't want Tennessee users to see Common Core //program selection dropdowns if ($('div.program-selection-dropdown > select').length > 0) { $('div.program-selection-dropdown > select').find("option").each(function(opt, opt2) { if ($(opt2)[0].label != "Tennessee 2024") { //allow National 2022 for Tennessee if($(opt2)[0].label != "2022 K - AGA"){ $(opt2).remove(); } } }); } //Assignment Builder if ($('k8-custom-tree[role="listbox"]').length > 0 && $('#program-box').length == 0) { let foundProgramBox = false; $('k8-custom-tree[role="listbox"]').children().each(function(x, y) { if ($(y)[0].innerText.substring(0, 21) == "No Associated Program" || $(y)[0].innerText.substring(0, 14) == "Tennessee 2024" || $(y)[0].innerText.substring(0, 13) == "2022 K - AGA") { $($(y)[0].parentNode).attr("id", "program-box"); foundProgramBox = true; } }); if (foundProgramBox) { $('#program-box').children().each(function(x, y) { if ($(y)[0].innerText.substring(0, 21) != "No Associated Program" && $(y)[0].innerText.substring(0, 14) != "Tennessee 2024" && $(y)[0].innerText.substring(0, 13) != "2022 K - AGA") { $(y).remove(); } else { if ($(y)[0].innerText == "Tennessee 2024") { $("#treeNodeId_FL2023").css("backgound-color", "rgb(255, 255, 255)").css("border", "1px solid rgb(223, 229, 249)").css("margin", "0px 16px 16px 16px") $("#treeNodeId_FL2023").css("padding-left", "0px").css("border", "none"); $("#treeNodeId_FL2023").css("padding", "5px 0px 3px 16px"); } } }); } } //progression Benchmark if ($('#BHS19_customDropdownContainer').length > 0 || $('#AL2022_customDropdownContainer').length > 0) { if ($('#BHS19_customDropdownContainer').length > 0) { if ($('#BHS19_dropdown_selected')[0].innerText == "Bridge to Success HS 2019") { $('#BHS19_dropdown_selected')[0].innerText = "Tennessee 2024"; $('#BHS19_dropdown_wrapper').click(); $('#TN2024').click(); } $('#BHS19_listWrapper li').each(function(x, y) { if ($(y)[0].innerText != "Tennessee 2024") { $(y).remove(); } }); } if ($('#AL2022_customDropdownContainer').length > 0) { if ($('#AL2022_dropdown_selected')[0].innerText == "Alabama 2022") { $('#AL2022_dropdown_selected')[0].innerText = "Tennessee 2024"; $('#AL2022_dropdown_wrapper').click(); $('#TN2024').click(); } $('#AL2022_listWrapper li').each(function(x, y) { if ($(y)[0].innerText != "Tennessee 2024") { $(y).remove(); } }); } } } //custom for district in Florida if($('div.main-list table#assignmentListTable div.title:contains(\(district assignment\)')){ $($('div.main-list table#assignmentListTable div.title:contains(\(district assignment\)').parents()[4]).remove(); } if (cookie.location_id == 79) { //We don't want Florida users to see Common Core //resources page if($('span.text-assignment:contains(\(district assignment\)')){ $($('tfoot tr')[0]).css("display","none"); } if ($('div.program-selection-dropdown > select').length > 0) { $('div.program-selection-dropdown > select').find("option").each(function(opt, opt2) { if ($(opt2)[0].label != "Florida’s B.E.S.T. Standards for MATH") { $(opt2).remove(); } }); } //assignment builder if ($('k8-custom-tree[role="listbox"]').length > 0 && $('#program-box').length == 0) { let foundProgramBox = false; $('k8-custom-tree[role="listbox"]').children().each(function(x, y) { if ($(y)[0].innerText.substring(0, 21) == "No Associated Program" || $(y)[0].innerText.substring(0, 12) == "Florida’s B.") { $($(y)[0].parentNode).attr("id", "program-box"); foundProgramBox = true; } }); if (foundProgramBox) { $('#program-box').children().each(function(x, y) { if ($(y)[0].innerText.substring(0, 21) != "No Associated Program" && $(y)[0].innerText.substring(0, 12) != "Florida’s B.") { $(y).remove(); } else { if ($(y)[0].innerText == "Florida’s B.E.S.T. Standards for MATH") { $("#treeNodeId_FL2023").css("backgound-color", "rgb(255, 255, 255)").css("border", "1px solid rgb(223, 229, 249)").css("margin", "0px 16px 16px 16px") $("#treeNodeId_FL2023").css("padding-left", "0px").css("border", "none"); $("#treeNodeId_FL2023").css("padding", "5px 0px 3px 16px"); } } }); } } //progression Benchmark if ($('#BHS19_customDropdownContainer').length > 0 || $('#AL2022_customDropdownContainer').length > 0) { if ($('#BHS19_customDropdownContainer').length > 0) { if ($('#BHS19_dropdown_selected')[0].innerText == "Bridge to Success HS 2019") { $('#BHS19_dropdown_selected')[0].innerText = "Florida’s B.E.S.T. Standards for MATH"; $('#BHS19_dropdown_wrapper').click(); $('#FL2023').click(); } $('#BHS19_listWrapper li').each(function(x, y) { if ($(y)[0].innerText != "Florida’s B.E.S.T. Standards for MATH") { $(y).remove(); } }); } if ($('#AL2022_customDropdownContainer').length > 0) { if ($('#AL2022_dropdown_selected')[0].innerText == "Alabama 2022") { $('#AL2022_dropdown_selected')[0].innerText = "Florida’s B.E.S.T. Standards for MATH"; $('#AL2022_dropdown_wrapper').click(); $('#FL2023').click(); } $('#AL2022_listWrapper li').each(function(x, y) { if ($(y)[0].innerText != "Florida’s B.E.S.T. Standards for MATH") { $(y).remove(); } }); } } /* $('select').find('option:contains("CC")').each(function(opt,opt2){ $(opt2).remove(); }); $('ul,ol').find('li:contains("CC")').each(function(opt,opt2){ $(opt2).remove(); }); $('div.node-container:contains("CC")').each(function(opt,opt2){ $(opt2).remove(); }); $('select').find('option:contains("Common Core")').each(function(opt,opt2){ $(opt2).remove(); }); $('ul,ol').find('li:contains("Common Core")').each(function(opt,opt2){ $(opt2).remove(); }); $('div.node-container:contains("Common Core")').each(function(opt,opt2){ $(opt2).remove(); }); $('select').find('option:contains(" cc ")').each(function(opt,opt2){ $(opt2).remove(); }); $('ul,ol').find('li:contains(" cc ")').each(function(opt,opt2){ $(opt2).remove(); }); $('div.node-container:contains(" cc ")').each(function(opt,opt2){ console.log("found cc div"); $(opt2).remove(); }); */ } if (cookie.location_id == 41 || cookie.location_id == 73 || cookie.location_id == 74) { var dcLink = ''; switch (cookie.location_id) { case 41: switch (cookie.grade_level_id) { case "7.00": dcLink = 'https://www.bigideasmath.com/protected/content/dynamic-classroom/ok2019/grade_6/'; break; case "8.00": dcLink = 'https://www.bigideasmath.com/protected/content/dynamic-classroom/ok2019/grade_7/'; break; case "9.00": dcLink = 'https://www.bigideasmath.com/protected/content/dynamic-classroom/ok2019/pre-algebra/'; break; case "11.00": dcLink = 'https://www.bigideasmath.com/protected/content/dynamic-classroom/ok2019/algebra_1/'; break; case "12.00": dcLink = 'https://www.bigideasmath.com/protected/content/dynamic-classroom/ok2019/geometry/'; break; case "13.00": dcLink = 'https://www.bigideasmath.com/protected/content/dynamic-classroom/ok2019/algebra_2/'; break; default: dcLink = 'https://www.bigideasmath.com/protected/content/dynamic-classroom/ok2019/'; } break; case 74: switch (cookie.grade_level_id) { case "1.00": case "2.00": case "3.00": case "4.00": case "5.00": case "6.00": case "7.00": case "8.00": case "9.00": dcLink = ""; break; case "11.00": dcLink = 'https://www.bigideasmath.com/protected/content/dynamic-classroom/hsbts/algebra_1/'; break; case "12.00": dcLink = 'https://www.bigideasmath.com/protected/content/dynamic-classroom/hsbts/geometry/'; break; case "13.00": dcLink = 'https://www.bigideasmath.com/protected/content/dynamic-classroom/hsbts/algebra_2/'; break; default: dcLink = 'https://www.bigideasmath.com/protected/content/dynamic-classroom/hsbts/'; } break; case 73: default: switch (cookie.grade_level_id) { case "11.00": dcLink = 'https://www.bigideasmath.com/protected/content/dynamic-classroom/hsint/math_i/'; break; case "12.00": dcLink = 'https://www.bigideasmath.com/protected/content/dynamic-classroom/hsint/math_ii/'; break; case "13.00": dcLink = 'https://www.bigideasmath.com/protected/content/dynamic-classroom/hsint/math_iii/'; break; default: dcLink = 'https://www.bigideasmath.com/protected/content/dynamic-classroom/hsint/'; } } if (dcLink == '') { //put the stuff back $('.k8-dashboard-books-wrapper').show(); $('div.skill-trainer-nav-header div.selector-button-container').show(); $('span.component-label:contains("Dynamic Classroom")').show(); if ($('.oklahoma-dc-link').length > 0) { $('.oklahoma-dc-link').remove(); $('a.k8-menu-item[href$="dynamic-classroom"]').show(); $('span.component-label:contains("Dynamic Classroom")').show(); $('span.component-label:contains("Dynamic Classroom")').siblings('img').show(); $('div.module-item:contains("Dynamic Classroom")').show(); } if ($('.k8-dashboard-skills,.k8-dashboard-skills-wrapper').length > 0) { $('.k8-dashboard-skills,.k8-dashboard-skills-wrapper').show(); } } else { //if our location is the dynamic classrooom - make it the dashboard. if (document.location.href.indexOf('dynamic-classroom') != -1) { document.location.href = "/MRL/public/app/#/teacher/dashboard"; } if ($('button.grade-button.selector-button.selected').length > 0) { } else { $('button.grade-button.selector-button').click(); } $('div.skill-trainer-nav-header div.selector-button-container').hide(); //we are in Oklahoma -- remove/replace dynamic classroom links if ($('.k8-dashboard-books-wrapper').length > 0) { $('.k8-dashboard-books-wrapper').hide(); } // modify css for resource-wrapper after hiding book-wrapper $('#k8-dashboard-book-and-resource-wrapper').css('row-gap','32px'); $('#resources-title').css({'margin':'0','min-height':'40px'}); $('#k8-dashboard-book-and-resource-wrapper .k8-dashboard-resources-wrapper').css('row-gap','8px'); if ($('.k8-dashboard-skills,.k8-dashboard-skills-wrapper').length > 0) { $('.k8-dashboard-skills,.k8-dashboard-skills-wrapper').hide(); } if ($('.oklahoma-dc-link').length == 3) { //do nothing if ($('.oklahoma-dc-link').attr("href") != dcLink) { $('.oklahoma-dc-link').attr("href", dcLink); } } else { if (teacher == 1) { if ($('.oklahoma-dc-link.k8-menu-item').length == 0) { $('a.k8-menu-item[href$="dynamic-classroom"]').parent().prepend('Dynamic Classroom'); } if ($('.oklahoma-dc-link.component-oklahoma-link').length == 0) { $('span.component-label:contains("Dynamic Classroom")'). parent().append('Dynamic Classroom'); $('span.component-label:contains("Dynamic Classroom")').hide(); $('span.component-label:contains("Dynamic Classroom")').siblings('img').hide(); } if ($('.oklahoma-dc-link.module-item').length == 0) { $('div.module-item:contains("Dynamic Classroom")'). parent().append('Dynamic Classroom'); $('div.module-item:contains("Dynamic Classroom")').hide(); } if ($('.oklahoma-dc-link').attr("href") != dcLink) { $('.oklahoma-dc-link').attr("href", dcLink); } } // Dynamic Classroom"); $('a.k8-menu-item[href$="dynamic-classroom"]').hide(); } } } else { $('.k8-dashboard-books-wrapper').show(); $('div.skill-trainer-nav-header div.selector-button-container').show(); if ($('.oklahoma-dc-link').length > 0) { $('.oklahoma-dc-link').remove(); $('a.k8-menu-item[href$="dynamic-classroom"]').show(); $('span.component-label:contains("Dynamic Classroom")').show(); $('span.component-label:contains("Dynamic Classroom")').siblings('img').show(); $('div.module-item:contains("Dynamic Classroom")').show(); } if ($('.k8-dashboard-skills,.k8-dashboard-skills-wrapper').length > 0) { $('.k8-dashboard-skills,.k8-dashboard-skills-wrapper').show(); } } if ($('.book-' + cookie.book_id).length > 0) { $('.book-' + cookie.book_id).each(function(idx) { $(this).show(); $('#' + $(this).data('pid')).hide(); }); } if ($('.category-link').length > 0) { $('.category-link').each( function(i) { if ($($('.category-link')[i - 1]).text() == $(this).text()) { $(this).hide(); } } ); } if ($('#dcwidth').length == 0) { $("head link[rel='stylesheet']").last().after(""); $('body').append(""); $('body').append(""); $('body').append(""); //fullscreen_watch(); } $("button.view-example").off("click").on("click", function(that) { $("#" + $(this).data("attr")).toggle(); }); $("button.key-idea, button.toggler, button.margin-notes, button.margin-note").off("click").on("click", function(that) { $("#" + $(this).data("attr")).css("position", "relative"); $("#" + $(this).data("attr")).css("width", "400px"); $("#" + $(this).data("attr")).css("background-color", "#fff"); $("#" + $(this).data("attr")).css("border-color", "#0050a7"); $("#" + $(this).data("attr")).css("border", "solid"); $("#" + $(this).data("attr")).css("float", "left"); $("#" + $(this).data("attr")).css("clear", "both"); $("#" + $(this).data("attr")).css("top", 0 - $(this).height() - $("#" + $(this).data("attr")).height() - 32 + "px"); $("#" + $(this).data("attr")).css("margin-bottom", 0 - $(this).height() - $("#" + $(this).data("attr")).height() - 32 + "px"); //$("#" + $(this).data("attr")).css("top",0 - $(this).height() - $("#" + $(this).data("attr")).height() - 5 + "px"); $("#" + $(this).data("attr")).toggle(); }); /* //replace explorations with new window $('iframe[src*="explorations"]').each(function(){ $(this).replaceWith(""); }); */ //vocab stuff $("div.k8-content-view span.vocab, div.k8-content-view span.vocabulary").css("text-decoration", "underline").css("background-color", "yellow").css("cursor", "pointer"); $("div.g5-content-viewer span.vocab, div.g5-content-viewer span.vocabulary").css("text-decoration", "underline").css("background-color", "yellow").css("cursor", "pointer"); $("div.lauries-notes span.vocab").css("color", "red"); $('div.k8-content-view span.vocab, div.k8-cotnent-view span.key-vocab, div.k8-content-view span.vocabulary, div.k8-content-view ul.vocab-review-word li, div.k8-content-view ul.vocab-review-words li, div.k8-content-view span.core-vocabulary').css("cursor", "pointer"); $("span.core-vocab,div.g5-content-viewer span.vocab, div.g5-content-viewer span.vocabulary, div.k8-content-view span.vocab, div.k8-cotnent-view span.key-vocab, div.k8-content-view span.vocabulary, div.g5-content-view ul.vocab-review-word li, div.k8-content-view ul.vocab-review-word li, div.g5-content-view ul.vocab-review-words li, div.k8-content-view ul.vocab-review-words li, div.k8-content-view span.core-vocabulary").off("click").on("click", function(that) { $($('select.k8-select-classroom')[1]).attr('id', 'pageBookSelector'); switch (cookie.grade_level_id) { case "1.00": mygrade = "k"; mygradeBand = "el"; break; case "2.00": case "3.00": case "4.00": case "5.00": case "6.00": mygrade = cookie.grade_level_id - 1; mygradeBand = "el" break; case "7.00": case "8.00": case "9.00": mygrade = cookie.grade_level_id - 1; mygradeBand = "ms" break; case "7.50": mygrade = "adv1"; mygradeBand = "ms" break; case "8.50": mygrade = "acc"; mygradeBand = "ms" break; case "9.50": mygrade = "adv2"; mygradeBand = "ms" break; case "10.00": case "11.00": case "12.00": case "13.00": mygrade = "hs"; mygradeBand = "hs"; break; default: mygrade = "k"; mygradeBand = "el"; } let vWord = ""; if ($(this).attr("data-term")) { vWord = encodeURI($(this).attr("data-term").replace(/\s/g, ' ')); } else { vWord = encodeURI($(this).text().replace(/\s/g, ' ')); } if (mygrade == 'hs' && !($(this).hasClass('k8-vocab'))) { window.open('https://static.bigideasmath.com/protected/content/mlg/cchs/hs2.php?word=' + vWord + '&grade=' + mygrade); } else { window.open('https://static.bigideasmath.com/protected/content/mlg/k8/k8.php?word=' + vWord + '&grade=' + mygrade); } }); //dashboard common core resource addition if (cookie.location_id == 67) { if ($('#cc-mp-resource').length == 0 && $('div.resource-wrapper').length != 0) { if (cookie.grade_level_id == "2.00") { $('div.resource-wrapper').append(''); } if (cookie.grade_level_id == "3.00") { $('div.resource-wrapper').append(''); } if (cookie.grade_level_id == "4.00") { $('div.resource-wrapper').append(''); } if (cookie.grade_level_id == "5.00") { $('div.resource-wrapper').append(''); } if (cookie.grade_level_id == "6.00") { $('div.resource-wrapper').append(''); } if (cookie.grade_level_id == "7.00") { $('div.resource-wrapper').append(''); } if (cookie.grade_level_id == "8.00") { $('div.resource-wrapper').append(''); } if (cookie.grade_level_id == "9.00") { $('div.resource-wrapper').append(''); } if (cookie.grade_level_id == "7.50") { $('div.resource-wrapper').append(''); } if (cookie.grade_level_id == "8.50") { $('div.resource-wrapper').append(''); } if (cookie.grade_level_id == "9.50") { $('div.resource-wrapper').append(''); } } } else { if ($('#cc-mp-resource').length > 0) { $('#cc-mp-resource').remove(); } } //I don't think this is needed any more for the resources if ($($('div.resource-container div.chapter-selection-dropdown select option')[0]).length != 0) { if ($($('div.resource-container div.chapter-selection-dropdown select option')[0]).attr("disabled") == "disabled") { $($('div.resource-container div.chapter-selection-dropdown select option')[0]).attr("disabled", false); } } else { } if ($($('div.resource-container div.section-selection-dropdown select option')[0]).length != 0) { if ($($('div.resource-container div.section-selection-dropdown select option')[0]).attr("disabled") == "disabled") { $($('div.resource-container div.section-selection-dropdown select option')[0]).attr("disabled", false); } } if ($('.activity-container').length != 0) { $('iframe .activity-container')[0].append(''); } //This is to get content into the math musicals about Anne and Michael if ($('.math-musical-resources-header').length != 0 && $('#mm-authors').length == 0) { $('.math-musical-resources-book-title').append("
Story by Anne Lazo
Songs and Lyrics by Michael Wiskar
"); } //this is for the example display button when needed if ($('div#section-practice-example-container').length != 0 && $('button#section-practice-example-button').length == 0) { $('.element-title.page-title').append(''); } //this fixes title sizing? if ($('h2.element-title').length != 0 && $('h1.element-title').length == 0) { $($('h2.element-title:not(.element-tabbed)')[0]).replaceWith(function() { return "

" + $(this).html() + "

"; }); } //adds the key under any list in Laurie's notes that uses the question or learning target bullets if ($('.k8-lauries-notes ul').length != 0 && $('.k8-lauries-notes ul.ln-list-key').length == 0) { $.each($('.k8-lauries-notes ul'), function() { if ($(this).find('.question').length > 0 || $(this).find('.target').length > 0) { $(this).after( 'Key:' ); return false; } }); } if ($('.g5-content .k8-lauries-notes ul').length != 0) { $.each($('.g5-content .k8-lauries-notes li>strong'), function() { if ($(this).text().indexOf(":") > 0 && $(this).text().toLowerCase().indexOf("exercise") == -1 && $(this).css("color") != "red" && !$(this).hasClass('ignore-run-in')) { $(this).css("color", "red"); } }); } } function activity_fullscreen() { $('.activity-container')[0].addClass('fullscreen'); } function fullscreen_watch() { /*$(document).on('webkitfullscreenchange mozfullscreenchange fullscreenchange', function(e) { if(!window.screenTop && !window.screenY){ console.log("fullscreen"); }else{ console.log("left fullscreen"); if($('.activity-container')[0]){ $('.activity-container')[0].removeClass('fullscreen'); } } });*/ } function getCookie(cname) { var name = cname + "="; var decodedCookie = decodeURIComponent(document.cookie); var ca = decodedCookie.split(';'); for (var i = 0; i < ca.length; i++) { var c = ca[i]; while (c.charAt(0) == ' ') { c = c.substring(1); } if (c.indexOf(name) == 0) { return c.substring(name.length, c.length); } } return ""; } document.cookie = "loggedin=1;domain=.bigideasmath.com;path=/"; document.onreadystatechange = function() { var state = document.readyState; if (state == 'complete') { console.log("Calling DC QA SCRIPT"); var dc_observer = new MutationObserver(dc_observer_callback); dc_observer_node = document.getElementsByTagName("body")[0]; dc_observer.observe(dc_observer_node, { childList: true, subtree: true }); } $('body').append(''); }