Skip to content

Instantly share code, notes, and snippets.

@b1azk0
b1azk0 / Qualtrics_ReverseAnswerChoices.js
Created June 27, 2019 11:56 — forked from marketinview/reverseMCAnswerChoices.js
Qualtrics: Randomly reverse answer choices in multiple choice question. #qualtrics #js #jq #mc #random #reverse
Qualtrics.SurveyEngine.addOnload(function() {
var rand = Math.round(Math.random());
if(rand == 1) {
var choices = jQuery("#"+this.questionId+" li.Selection");
var lastChoice = choices.last();
for(i=0;i<choices.length-1;i++) {
lastChoice.after(choices[i]);
}
}
});
@b1azk0
b1azk0 / Rdataframe.csv
Created May 6, 2019 18:47
Code for powerCurves in simr
We can make this file beautiful and searchable if this error is corrected: It looks like row 9 should actually have 15 columns, instead of 13. in line 8.
recnumb,subj,day,scc,tri,Posevent,NegEvent,pa,na,posC,negC,paC,naC,anx,anxC
1,1,1,4.75,5.333333492,2.571428537,1,4.400000095,2.200000048,-0.308779798,-1.062499995,0.418750137,-0.568749934,39,-4.378076127
2,1,2,4.75,6,2.285714388,0.75,4.199999809,1.700000048,-0.594493948,-1.312499995,0.218749851,-1.068749934,39,-4.378076127
3,1,3,4.5,3,2.071428537,1.25,3.599999905,3.599999905,-0.808779798,-0.812499995,-0.381250054,0.831249923,39,-4.378076127
4,1,4,4.75,6,2.5,1.083333373,4.199999809,1.899999976,-0.380208336,-0.979166622,0.218749851,-0.868750006,39,-4.378076127
5,1,5,5.25,6,1.214285731,2.083333254,3.5,2,-1.665922605,0.020833259,-0.481249958,-0.768749982,39,-4.378076127
6,1,6,4,5,2.428571463,2.833333254,4.599999905,2.5,-0.451636873,0.770833259,0.618749946,-0.268749982,39,-4.378076127
7,1,7,3,5.666666508,2.440476179,1.75,3.900000095,4.099999905,-0.439732157,-0.312499995,-0.081249863,1.331249923,39,-4.378076127
8,1,8,2.75,3,2.357142925,2.166666746,3.200000048,4.699999809,-0.523065411,0.104166751,-0.781249911,1.9312