Note
This XBlock is part of the xblocks-extra collection.
An XBlock to ease linking to Qualtrics surveys.
The tool makes it easy for instructors to link to a Qualtrics survey from within their course.
To install the XBlock on your platform, you will need to install the package collection it belongs to.
Add the following to your platform's requirements.txt file:
xblocks-extra
You may also need to ensure this is in your INSTALLED_APPS:
qualtricssurvey
To enable the XBlock in your course, access your Advanced Module List:
Settings -> Advanced Settings -> Advanced Module List
and add the following:
qualtricssurvey
To add a Qualtrics Survey link to your course:
- go to a unit in Studio
- select "Qualtrics Survey" from the Advanced Components menu
You can now edit and preview the new component.
Using the Studio editor, you can edit the following fields:
- display name
- survey id
- university
- link text
- extra parameters
- message
Operators can configure system-wide defaults via XBLOCK_SETTINGS in
the Django settings:
XBLOCK_SETTINGS["QualtricsSurvey"] = {
"DEFAULT_UNIVERSITY": "stanforduniversity",
"USER_QUERY_PARAMS": {
"edxuid": "user_id",
"email": "email",
},
}DEFAULT_UNIVERSITY- The default Qualtrics subdomain for your institution. Used when the per-instance university field is left blank.
USER_QUERY_PARAMSA mapping of URL parameter names to user attributes. The key is the query parameter name that appears in the survey URL, and the value is the user attribute to resolve. Supported attributes:
user_id- platform user ID (with fallback to anonymous ID)anonymous_id- course-specific anonymous user IDemail- primary email addressusername- platform username
These values come from the XBlock user service. edx-platform only provides them for authenticated users, so any attribute that cannot be resolved (for example, for an anonymous visitor) is left out of the URL.
If
USER_QUERY_PARAMSis not configured, no user parameters are sent by default. To start sending user data to Qualtrics, operators must explicitly configure this setting. Existing blocks that already store a legacyparam_namevalue continue to use that value as a fallback.
Values sent through USER_QUERY_PARAMS become part of the survey URL.
Query strings are recorded in web server and proxy logs, kept in browser
history, and may be forwarded in Referer headers. Before mapping
email, username, or user_id, confirm that sending that data to
Qualtrics is acceptable under your institution's privacy policy.
anonymous_id is the least identifying option.
Version 2.0 changed two defaults. Blocks that never set these fields in Studio relied on the old defaults will behave differently after upgrading.
param_namedefault changed from"a"to""Blocks that never set this field used to send
?a=<anonymous id>. They now send no user parameters. The field is no longer editable in Studio; blocks that explicitly saved a value keep using it. To restore the old behaviour platform-wide, configure:XBLOCK_SETTINGS["QualtricsSurvey"] = { "USER_QUERY_PARAMS": {"a": "anonymous_id"}, }
your_universitydefault changed from"stanforduniversity"to""Blocks that never set this field now render a link without a subdomain unless
DEFAULT_UNIVERSITYis configured. To restore the old behaviour platform-wide, configure:XBLOCK_SETTINGS["QualtricsSurvey"] = { "DEFAULT_UNIVERSITY": "stanforduniversity", }
Students click on a link within the unit and this takes them to the survey.