Passing UserID to Qualtrics from CourseraThis information below is a copy of Rene Kizilcec's MOOC Researcher Wiki at wiki.kizilcec.com. Note that this method requires admin access to your Coursera course, which is not allowed for researchers - only teachers and TAs. (Coursera wants to protect user privacy.) So either get yourself a TA position, or perhaps coordinate with the teacher/TA to use their account under their supervision.
<a href="#" id="custom-survey-link">You should be redirected momentarily - otherwise, click here to start the survey.</a> <script> window.onload = function() { var userId = parseInt($('.course-topbar-nav-list-item:last a').data('user-id')); var url = "[***YOUR QUALTRICS SURVEY LINK HERE***]"; var newUrl = url + "&X=" + userId; $('a#custom-survey-link').attr('href', newUrl); window.location = newUrl; }; </script>
Survey as in-video quiz with user IDThis information below is a copy of Rene Kizilcec's MOOC Researcher Wiki at wiki.kizilcec.com. This shows you how to place a Qualtrics survey into an in-video quiz on Coursera such that it passes the user ID. Instructions
<div id="survey"><iframe src="https://stanforduniversity.qualtrics.com/SE/?SID=YOUR_SURVEY_ID_HERE" width="780" height="470" seamless></iframe></div> <script> $.getJSON( "https://class.coursera.org/COURSE_URL_CODE/api/user/information", function( data ) { $("#survey").html("<iframe src=\"https://stanforduniversity.qualtrics.com/SE/?SID=YOUR_SURVEY_ID_HERE&uid=" + data['id'] + "\" width=\"780\" height=\"470\" seamless></iframe>"); }); </script> |