Skip to content

Instantly share code, notes, and snippets.

@bijancamp
Last active February 24, 2024 16:18
Show Gist options
  • Save bijancamp/1ad80fb0f91e75247b81ad89b4a181a9 to your computer and use it in GitHub Desktop.
Save bijancamp/1ad80fb0f91e75247b81ad89b4a181a9 to your computer and use it in GitHub Desktop.
Improved full screen experience in Microsoft Applied Skills assessments
// 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