diff --git a/JavaScript Files/Visibility Change.js b/JavaScript Files/Visibility Change.js index fe12120..1d1b76f 100644 --- a/JavaScript Files/Visibility Change.js +++ b/JavaScript Files/Visibility Change.js @@ -15,7 +15,7 @@ Qualtrics.SurveyEngine.addOnload(function () { }); document.addEventListener("fullscreenchange", function () { - if (document.fullscreenElement !== null) { + if (document.fullscreenElement != null) { full_screen = setInterval(() => { time_fs++; }, 100); diff --git a/JavaScript Files/all three.js b/JavaScript Files/all three.js new file mode 100644 index 0000000..8ff7654 --- /dev/null +++ b/JavaScript Files/all three.js @@ -0,0 +1,36 @@ +Qualtrics.SurveyEngine.addOnload(function(){ + this.hideNextButton(); + Qualtrics.SurveyEngine.setEmbeddedData("First", "Empathy"); + + var vidlen = 120; + var maxlen = vidlen*4; + time_off = 0; + var that = this; + + document.addEventListener("fullscreenchange", function () { + if (document.fullscreenElement != null) { + Qualtrics.SurveyEngine.setEmbeddedData("full_screen", "TRUE"); + } + }); + + document.addEventListener("visibilitychange", function () { + if (document.visibilityState != "visible") { + Qualtrics.SurveyEngine.setEmbeddedData("tab_changed", "TRUE"); + off_screen = setInterval(() => { + time_off++; + Qualtrics.SurveyEngine.setEmbeddedData("time_off", time_off); + }, 100); + }else{ + clearInterval(off_screen); + } + }); + + (function(){that.showNextButton();}).delay(vidlen); + (function(){ + Qualtrics.SurveyEngine.setEmbeddedData("too_much_time", "TRUE"); + that.clickNextButton(); + }).delay(maxlen); + + + +}); \ No newline at end of file diff --git a/functions/Randomize by blocks.js b/functions/Randomize by blocks.js new file mode 100644 index 0000000..93ca5be --- /dev/null +++ b/functions/Randomize by blocks.js @@ -0,0 +1,43 @@ +Qualtrics.SurveyEngine.addOnReady(function () { + x = document.querySelectorAll(".QuestionOuter"); + vids = []; + for (i = 0; i < x.length; i++) { + vids.push(x[i].classList[3]); + } + + // Sort them and split them into blocks + vids = vids.sort(); + block_a = vids.slice(0, 5); + block_b = vids.slice(5); + + // Generate three unequal random numbers for Block A + ra1 = Math.floor(Math.random() * 5); + do { + ra2 = Math.floor(Math.random() * 5); + } while (ra2 == ra1); + do { + ra3 = Math.floor(Math.random() * 5); + } while (ra3 == ra1 || ra3 == ra2); + + hide_a = [ra1, ra2, ra3]; + + // Generate three unequal random numbers for Block B + rb1 = Math.floor(Math.random() * 5); + do { + rb2 = Math.floor(Math.random() * 5); + } while (rb2 == rb1); + do { + rb3 = Math.floor(Math.random() * 5); + } while (rb3 == rb1 || rb3 == rb2); + + hide_b = [rb1, rb2, rb3]; + + // Hide the selected questions + hide_a.forEach((item) => { + document.querySelector("#"+block_a[item]).hide(); + }); + + hide_b.forEach((item) => { + document.querySelector("#"+block_b[item]).hide(); + }); +}); \ No newline at end of file diff --git a/personal_qualtrics_theme.css b/personal_qualtrics_theme.css index 65df593..67fb3a8 100644 --- a/personal_qualtrics_theme.css +++ b/personal_qualtrics_theme.css @@ -5,7 +5,7 @@ /*Change next and previous button colors ("static" and on mouseover/focus*/ .Skin #Buttons #NextButton, .Skin #Buttons #PreviousButton { - background-color: #002554; + background-color: #271c88; } .Skin #Buttons #NextButton:hover, .Skin #Buttons #NextButton:focus, @@ -140,7 +140,7 @@ body, @media (min-width: 770px){ .Skin .SkinInner { - background-color: #0c3452; + background-color: #71b6eb; width: 900px; max-width: 95%; }