Last active
August 29, 2015 14:27
-
-
Save cuzzo/f3926b655c0f611a01bd to your computer and use it in GitHub Desktop.
BankersEdge Compliance Test Advance
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
var complete_test = function() { | |
var content = window.parent.frames["ScormContent"].document.querySelectorAll("frame")[0].contentDocument; | |
if (content.querySelector("h3").innerText === "Post-Test" || content.querySelector("h3").innerText === "Posttest") { | |
clearInterval(interval_id); | |
console.log("CLEARED!"); | |
return; | |
} | |
if (content.querySelector(".artisan-question-text")) { | |
if (content.querySelector(".artisan-answer").querySelector("[type=radio]")) { | |
content.querySelector(".artisan-answer").querySelector("[type=radio]").click(); | |
} | |
else if (content.querySelector(".artisan-answer").querySelector("[type=checkbox]")) { | |
content.querySelector(".artisan-answer").querySelector("[type=checkbox]").click(); | |
} | |
else if (content.querySelector(".artisan-answer").querySelector("[type=text]")) { | |
content.querySelector(".artisan-answer").querySelector("[type=text]").value = "poopydoopy"; | |
} | |
content.querySelector("#artisan-question-submit").click(); | |
content.querySelector(".artisan-next").click(); | |
} | |
else { | |
content.querySelector(".artisan-next").click(); | |
} | |
} | |
var interval_id = setInterval(complete_test, 1000); |
Also, from the portal, you can open up all of the tests concurrently to advance them to the end by opening up the console and deleting the mask it places over the tests once you start one.
Run this command in the JavaScript console:
$(".ext-el-mask").remove();
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Paste in the console to advance to the Post-Test.