Skip to content

Commit

Permalink
check retakes added
Browse files Browse the repository at this point in the history
  • Loading branch information
tafakkur committed Dec 24, 2020
1 parent 4faf893 commit e53c0c6
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions JavaScript Files/check retake.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

Qualtrics.SurveyEngine.addOnload(function(){
qid = this.questionId;
puran = document.querySelector("#puran").innerText;
document.querySelector("#puran").remove();
this.getQuestionContainer().hide();
this.hideNextButton();
function range(start, end, by = 1) {
var ans = [];
for (let i = start; i <= end; i+=by) {
ans.push(i);
}
return ans;
}
mid = "${e://Field/mid}";
jadid = atob(puran) + "\n" + mid + "," + (new Date).toISOString() + "\n";
jadid = jadid.replaceAll(/\r+|\n+/gm,"_").replaceAll(/\_+/gm,"\n")
jadid = btoa(jadid);

Qualtrics.SurveyEngine.setEmbeddedData("jadid", jadid);

hr = atob(puran).split(/\s|\,/).filter((item) => item != "");
range(2, hr.length - 1, 2).forEach((item) => {
if(hr[item] === mid){
Qualtrics.SurveyEngine.setEmbeddedData("khurooj", 0);
}
});
this.clickNextButton();
});

0 comments on commit e53c0c6

Please sign in to comment.