-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
7,256 additions
and
36 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
Qualtrics.SurveyEngine.addOnReady(function () { | ||
let w_loc = window.location.pathname.split("/"); | ||
let quest = this; | ||
let mario = document.querySelector("#mario_button"); | ||
let buttons = quest.questionContainer.querySelectorAll(".q-checkbox"); | ||
if (w_loc.indexOf("SV_8HBDY4VRJnFn40J") > -1) { | ||
mario.onclick = function () { | ||
mario.toggleClassName("active"); | ||
mario.toggleClassName("glow"); | ||
if (mario.hasClassName("active")) { | ||
mario.innerText = "Fast Select Mode Active"; | ||
quest.questionContainer.style.border = "7px solid red"; | ||
buttons.forEach((but) => { | ||
but.parentElement.onmouseover = function () { | ||
this.querySelector("input").click(); | ||
}; | ||
}); | ||
} else { | ||
mario.innerText = "Activate Fast Select Mode"; | ||
quest.questionContainer.style.border = "none"; | ||
buttons.forEach((but) => { | ||
but.parentElement.onmouseover = function () {}; | ||
}); | ||
} | ||
}; | ||
} | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
Qualtrics.SurveyEngine.addOnReady(function () { | ||
let w_loc = window.location.pathname.split("/"); | ||
let quest = this; | ||
let fast_mode = false; | ||
let mario = document.querySelector("#mario_heading"); | ||
if (w_loc.indexOf("SV_8HBDY4VRJnFn40J") > -1) { | ||
quest.questionContainer.querySelector("legend").insertAdjacentHTML( | ||
"beforeend", | ||
` | ||
<style>.Skin label.q-checkbox { | ||
border-radius: 50%; | ||
border: 2px solid green !important; | ||
} | ||
.Skin label.q-checkbox.q-checked, | ||
.Skin label.q-checkbox.q-checked.q-focused { | ||
border: 2px solid green !important; | ||
background: green !important; | ||
} | ||
.Skin .SBS .Answers th { | ||
color: transparent; | ||
} | ||
.Skin .SBSMatrix th { | ||
font-weight: 900; | ||
text-align: center; | ||
} | ||
.Skin .SBS thead th span { | ||
top: 2rem; | ||
position: relative; | ||
} | ||
</style>` | ||
); | ||
|
||
let buttons = quest.questionContainer.getElementsByClassName("q-checkbox"); | ||
for (but of buttons) { | ||
but.parentElement.onmouseover = function () { | ||
if (fast_mode) { | ||
let chk = this.querySelector("label"); | ||
if (!chk.hasClassName("q-checked")) { | ||
chk.click(); | ||
} | ||
} | ||
}; | ||
} | ||
|
||
function toggle_fast_mode() { | ||
mario.toggleClassName("active"); | ||
mario.toggleClassName("glow"); | ||
if (!fast_mode) { | ||
fast_mode = true; | ||
mario.innerText = "Fast Select Mode Active"; | ||
quest.questionContainer.style.border = "7px solid red"; | ||
} else { | ||
fast_mode = false; | ||
mario.innerText = "Hold Shift to Activate Fast Select"; | ||
quest.questionContainer.style.border = "none"; | ||
} | ||
} | ||
|
||
window.onkeydown = function check_key(e) { | ||
if (e.shiftKey) { | ||
toggle_fast_mode(); | ||
window.onkeydown = function check_key(e) {}; | ||
} | ||
}; | ||
window.onkeyup = function up_key(e) { | ||
toggle_fast_mode(); | ||
window.onkeydown = function check_key(e) { | ||
if (e.shiftKey) { | ||
toggle_fast_mode(); | ||
window.onkeydown = function check_key(e) {}; | ||
} | ||
}; | ||
}; | ||
} | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
Qualtrics.SurveyEngine.addOnReady(function () { | ||
document.querySelector("#NextButton").onclick = function () { | ||
let page_ans = [], | ||
page_uans = []; | ||
document.querySelectorAll("div[id^=QID][class*=QID]").forEach((question) => { | ||
let chosen = question.querySelectorAll(".q-checked"); | ||
if (chosen.length == 0) { | ||
page_uans.push(question.id); | ||
} else if (chosen.length > 0) { | ||
page_ans.push(question.id); | ||
} | ||
}); | ||
let old_ans = String(Qualtrics.SurveyEngine.getEmbeddedData("answered")) | ||
.split(",") | ||
.filter((el, ind, ar) => { | ||
if (ar.indexOf(el) != ind || el == "null") return false; | ||
else return el; | ||
}); | ||
let old_uans = String(Qualtrics.SurveyEngine.getEmbeddedData("unanswered")) | ||
.split(",") | ||
.filter((el, ind, ar) => { | ||
if (ar.indexOf(el) != ind || el == "null") return false; | ||
else return el; | ||
}); | ||
|
||
page_ans.forEach((item) => old_ans.push(item)); | ||
page_uans.forEach((item) => old_uans.push(item)); | ||
|
||
old_uans = old_uans | ||
.filter((a) => { | ||
if (old_ans.indexOf(a) > -1) return false; | ||
else return a; | ||
}) | ||
.filter((el, ind, ar) => { | ||
if (ar.indexOf(el) != ind || el == "null") return false; | ||
else return el; | ||
}); | ||
old_ans = old_ans.filter((el, ind, ar) => { | ||
if (ar.indexOf(el) != ind || el == "null") return false; | ||
else return el; | ||
}); | ||
|
||
Qualtrics.SurveyEngine.setEmbeddedData("unanswered", old_uans.join()); | ||
Qualtrics.SurveyEngine.setEmbeddedData("answered", old_ans.join()); | ||
}; | ||
}); |
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
Oops, something went wrong.