Files
Gainsight/CustomerNotes/Aiim/custom_css.html

132 lines
4.2 KiB
HTML
Raw Permalink Normal View History

<style>
@font-face {
font-family: 'dotsfont';
src: url('https://s3.amazonaws.com/static.northpass.com/AIIM/dotsfont.ttf');
}
div[data-test="quiz-summary"] {
display: none;
}
</style>
<script>
window.addEventListener('load', function() {
asd = setInterval(function(){
var a = document.getElementById('password-required');
if (a) {
passwordSetup();
}
else {
showNotPasswordResults();
}
}, 200);
});
function hideAnswer() {
var answers = document.querySelector('[data-test="quiz-summary"]');
if (answers && answers.innerHTML != 'Incorrect Password, Please Try Again') {
if (answers.getElementsByClassName('fa-times-square').length > 0) {
answers.innerHTML = 'You provided wrong password';
answers.style.display = 'block';
}
else {
var a = document.querySelector('[data-test="continue-button"]')
if (a){
a.click();
}
}
}
}
function hideInput() {
var inputField = document.getElementsByTagName('textarea');
if (inputField.length > 0) {
inputField[0].setAttribute('placeholder', '');
inputField[0].style.fontFamily = 'dotsfont';
}
}
function passwordSetup() {
var a = document.getElementById('password-required');
if (a) {
hideAnswer();
hideInput();
}
}
function showNotPasswordResults() {
var answers = document.querySelector('[data-test="quiz-summary"]')
if (answers) {
answers.style.display = 'block';
return true;
}
}
</script>
<script>
window.addEventListener('DOMContentLoaded', (event) => {
skipQuizSummaryPage()
removeIdFromQuestion()
removeIdFromAnswers()
window.Northpass.subscribe("activityRender", () => {
skipQuizSummaryPage()
removeIdFromQuestion()
removeIdFromAnswers()
})
const targetNode = document.querySelector('.activity');
const config = { childList: true, subtree: true };
const callback = (mutationList, observer) => {
skipQuizSummaryPage()
removeIdFromQuestion()
removeIdFromAnswers()
};
const observer = new MutationObserver(callback);
observer.observe(targetNode, config);
})
// function skipQuizSummaryPage() {
// setTimeout(() => {
// if (document.querySelector('[data-test="activity-title"]').innerHTML.trim() === "2023 Beta CIP Exam" && document.querySelector('[data-test="summary-headline"]')) {
// var completionCondition = document.querySelector('[data-test="summary-headline"]').innerHTML.trim() == 'You completed this quiz'
//
// if (completionCondition) {
// document.querySelector('[data-test="quiz-summary"]').innerHTML = "<h2 data-test='summary-headline' class='H2-sc-1bdnwwu-0 dZdbwG'>Thank you for completing the exam. We will be in touch with your final score.</h2>"
// }
// }
// }, 500)
// }
// function removeIdFromQuestion() {
// setTimeout(() => {
// if (document.querySelector('[data-test="question-text"]') && document.querySelector('[data-test="activity-title"]').innerHTML.trim() === "2023 Beta CIP Exam")
// document.querySelector('[data-test="question-text"]').innerHTML = document.querySelector('[data-test="question-text"]').innerHTML.trim().split("] ").pop();
// }, 500)
// }
// function removeIdFromAnswers() {
// setTimeout(() => {
// if (document.querySelector('[data-test="multiple-answer-answer"]') && document.querySelector('[data-test="activity-title"]').innerHTML.trim() === "2023 Beta CIP Exam") {
// document.querySelectorAll('[data-test="multiple-answer-answer"] .fr-view').forEach((item) => {
// item.innerHTML = item.innerHTML.trim().split("] ").pop();
// })
// }
// if (document.querySelector('[data-test="multiple-choice-answer"]') && document.querySelector('[data-test="activity-title"]').innerHTML.trim() === "2023 Beta CIP Exam") {
// document.querySelectorAll('[data-test="multiple-choice-answer"] .fr-view').forEach((item) => {
// item.innerHTML = item.innerHTML.trim().split("] ").pop();
// })
// }
// }, 500)
// }
</script>
<style>
[data-test="summary-headline"] {
text-align: center;
}
</style>