Last active
February 24, 2024 16:18
-
-
Save bijancamp/1ad80fb0f91e75247b81ad89b4a181a9 to your computer and use it in GitHub Desktop.
Improved full screen experience in Microsoft Applied Skills assessments
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Hide all elements except the VM and the right-hand instruction pane (use the | |
// "Split Windows" option in the hamburger menu of the pane to pop it out). Pass | |
// `true` to also "hide" the bottom section containing the "Cancel Assessment" | |
// and "Submit Assessment" buttons (it can still be accessed by scrolling down | |
// on the page). | |
function focusLab(hideBottomAssessmentSection) { | |
elementIds = [ | |
"ms--primary-nav", | |
"ms--secondary-nav", | |
"article-header", | |
"footer", | |
]; | |
for (id of elementIds) { | |
document.getElementById(id).style.display = "none"; | |
} | |
if (hideBottomAssessmentSection) { | |
bottomAssessmentSection = "#assessment-container section:nth-child(2)"; | |
document.querySelector(bottomAssessmentSection).style.height = 0; | |
} | |
} | |
// Restore the page back to its default state with all elements visible. | |
function unfocusLab() { | |
elementIds = [ | |
"ms--primary-nav", | |
"ms--secondary-nav", | |
"article-header", | |
"footer", | |
]; | |
for (id of elementIds) { | |
document.getElementById(id).style.display = ""; | |
} | |
bottomAssessmentSection = "#assessment-container section:nth-child(2)"; | |
document.querySelector(bottomAssessmentSection).style.height = ""; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment