Integrating a Qualtrics Survey with OpenEdXIn any unit of a course, click the HTML element button to add an HTML element block and choose the "Anonymouse User ID" block type. Next, click "edit" and view the HTML tab of the editor. In that view, you should see the following instructions for adding a Qualtrics survey in the block: <p>Your explanatory text here.</p> <p><a href="https://YOUR_UNIVERSITY.qualtrics.com/SE/?SID=SV_###############&a=%%USER_ID%%" target="_blank"> YOUR_LINK_TEXT</a></p> <!-- You can include %%USER_ID%% to include an anonymized user ID in your outside services so that you can relate them later. This example is a Qualtrics template: - Replace the "###############" with your Survey ID. - Also replace "YOUR_UNIVERSITY" with your qualtrics ID. - Finally, replace "YOUR_LINK_TEXT" with your link text. - If you wish to embed your survey into the courseware instead of opening a new tab, replace the above HTML with what is provided below. <p>Your explanatory text here.</p> <iframe src="https://YOUR_UNIVERSITY.qualtrics.com/SE/?SID=SV_###############&a=%%USER_ID%%" height="1000" width="800" /> --> Following these instructions you can easily add a link or embed a survey in your course. using the %%USER_ID%% parameter will pass the user ID to Qualtrics, so you can track performance for students across multiple surveys. This method relies on passing information to Qualtrics via query string. Running an A/B testCondition assignmentIn the simplest case, you have only one survey and it will only be taken by each student at most one time. In this case you can try to use Qualtrics' built-in randomization to randomize for each student. However, this may cause problems for students who exit and return to the module later on and who will be randomly assigned to (potentially) a different condition from what they have seen already. Unfortunately, Qualtrics' built-in Survey Protection features don't seem to work properly on OpenEdX, possibly due to students logging in from different computers in different places, or for other reasons. However, you can also randomize consistently across conditions using User IDs. User IDs are hexadecimal (base-16) numbers, so each digit has a value between 0 and 15. Assuming that the digits are generated randomly, you can base your condition assignment on the value of one or more of the digits. For instance, here is how we assigned conditions for an experiment with 6 conditions: <iframe id="qualtrics_survey" src="" height="1000" width="800" /> <script type="text/javascript"> var usrid = "%%USER_ID%%"; //get the User ID as a string var id_last = parseInt(usrid.substr(usrid.length - 1), 16); //parse the last digit into a number assuming base 16 var id_scndlast = parseInt(usrid.substr(usrid.length - 2, 1), 16); //parse the second-to-last digit var idCond; if (id_scndlast === 15) { //the number distribution was not evenly dividable so we put extra people in the control cond idCond = 0; } else if (id_last <= 7) { if (id_scndlast <= 4) { idCond = 0; } else if (id_scndlast > 4 && id_scndlast <= 9) { idCond = 1; } else { idCond = 2; } } else { if (id_scndlast <= 4) { idCond = 3; } else if (id_scndlast > 4 && id_scndlast <= 9) { idCond = 4; } else { idCond = 5; } } var surveySource = $("#qualtrics_survey").attr('src'); /get the "src" attribute for the survey iframe var newSurveySource = "https://YOUR_UNIVERSITY.qualtrics.com/SE/?SID=SV_###############" + '&idcond=' + idCond + "&UID=%%USER_ID%%"; //generate a new src with your survey and condition and User ID appended to it $("#qualtrics_survey").attr('src', newSurveySource); //make the iframe's src the new src. </script> This will ensure that no matter how many times people open new survey sessions, they always see the same condition. It will also allow you to assign people to the same condition across different course units or modules. In qualtrics, we first randomly assign a condition using a randomizer, and then overwrite that information using the idCond variable passed in via the URL. This ensures that if something goes wrong and the User ID is not captured correctly users will be randomly assigned to a condition. |