使用照片或图形以及循环和合并在 Qualtrics 中进行随机化 [英] Randomization in Qualtrics using Photos or Graphics and Loop and Merge

查看:23
本文介绍了使用照片或图形以及循环和合并在 Qualtrics 中进行随机化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在 Qualtrics 中创建一项调查,其中包含许多照片,比如 1000 张.我希望每个调查参与者回答,说 6,每张照片的问题.每位参与者将看到 5 张随机分配的照片.

I am creating a survey in Qualtrics with many photos, say 1000. I want to have each survey participant answer, say 6, questions per photo. Each participant will see 5 photos that are randomly assigned.

在调查之前,我假设有一种方法可以上传 1000 张照片,在 Qualtrics 中创建一个块(带有 6 个问题),然后简单地随机化出现的照片,并重复 5 次.

Before looking into things, I assumed that there would be a way to upload the 1000 photos, create one block in Qualtrics (with the 6 questions) and then simply randomize the photo that occurs and have this be repeated this 5 times.

但这似乎不可能或不明显.我打电话给 Qualtrics,他们说我需要手动创建 1000 个块(除了标题和照片之外,每个块都完全相同).然后我需要进入调查流程并在那里使用随机化器并手动添加所有 1000 个块并让它随机呈现 5 个元素.

But it seems like this is either not possible or not obvious. I called Qualtrics and they said that I would manually need to create 1000 blocks (each block would be exactly the same with the exception of the title and the photo). I would then need to go into the Survey Flow and use the Randomizer there and manually add all 1000 blocks and have it randomly present 5 of the elements.

我真的希望有更好的方法.如果我必须这样做,这将花费大量时间.

I really hope that there is a better way. This will take a ton of time if I have to do it this way.

如果没有,有什么方法可以自动化吗?

If not, is there any way to automate anything?

  1. 创建新块并自动填充照片.我知道 python 并且可能会编写一个脚本来生成块,但照片名称已从原始名称更改为 Qualtrics 生成的一些复杂代码.
  2. 一次性将照片全部加载到 Qualtrics 中(目前需要一次加载一张照片).

推荐答案

事实证明,有一种比 1000 个块修复更快的方法来做到这一点.

It turns out that there is a much better faster way to do this than the 1000 blocks fix.

有很多事情要做,但这是可能的.

There is a bunch of stuff going on to accomplish it, but it is possible.

首先,需要通过图形库将照片放入Qualtrics.最好的方法是简单地将照片拖放到所需的位置.幸运的是,人们不必一一执行此操作.确保它们按您想要的顺序排列.

First, one needs to put the photos into Qualtrics through the Graphics Library. The best way to do this is to simply drag and drop the photos into the desired location. Luckily one does not have to do this one-by-one. Make sure that they are in the order you want.

其次,创建一个带有问题"的块,您希望随机照片出现在其中.这个块也应该有所有 6 个问题.

Second, create a block with a "question" where you want the random photo to appear. This block should also have all 6 questions.

第三,在与照片对应的 URL 的电子表格(例如 Excel 中)中创建一列.这应该是有序的.底部提到了一种方法.

Third, create a column in a spreadsheet (in, eg. Excel) of the URLs corresponding to the photos. This should be in order. One way to do this is mentioned at the bottom.

第四,转到此块的循环和合并选项.将 URL 列复制并粘贴到字段 1 中.幸运的是,此选项存在并且您也不必一一执行此操作.旁注是,如果更改行左侧灰色框中的数字,则会更改结果中显示的内容.但是没有明显的方法可以一次一个一个地改变这些.

Fourth, go to the Loop and Merge option for this block. Copy and paste the column of URLs to, say, Field 1. Luckily this option exists and one does not have to do this one-by-one either. A sidenote is that if one changes the numbers in the gray boxes to the left of the rows, this changes what appears in the results. But there is no apparent way to change these more than one-by-one at a time.

那么你应该准备好了.

最后,稍微介绍一下如何获取照片的 URL.再次确保库中的照片按您想要的顺序排列.然后您可以使用网页抓取来抓取图像名称,然后将其放入正确的 URL.我使用 Python 的 Selenium 和 BeautifulSoup 来实现这一点.这是我使用 mac 所做的.代码至少给了你这个想法:

Finally, a little bit about how to get the URLs of the photos. Once again, make sure the photos in the library are in the order you want. Then you can use web scraping to scrape the image names, which can then be put into the proper URL. I used Python's Selenium and BeautifulSoup to accomplish this. Here is what I did, using a mac. The code at least gives you the idea:

from bs4 import BeautifulSoup
import codecs
import os
from selenium import webdriver
import re

chromedriver = "File path to /chromedriver"
os.environ["webdriver.chrome.driver"] = chromedriver
driver = webdriver.Chrome(chromedriver)

*在出现的Chrome浏览器中,手动导航到照片库页面,然后:

*In the Chrome browser that has appeared, manually navigate to the photos library page, then:

abc = driver.find_elements_by_css_selector(".thumbframe")    
file = codecs.open('outputURLs.txt', 'w', encoding = 'utf-8')
urls = {}
for i in range(0,len(abc)):
    h = abc[i].get_attribute("innerHTML")
    soup = BeautifulSoup(h)
    t = soup.find_all("img", attrs={"p4":re.compile('.*')})
    urls[i] = t[0]['p1']
    file.write("<img src=*Qualtrics Path/Graphic.php?IM=" + urls[i] + "/> + '
')

人们可以找到合适的第一部分来坚持Qualtrics Path",例如.转到 Qualtrics 调查编辑器,使用 Rich HTML Editing(或类似方法)插入照片,插入照片,单击查看源",然后查看要使用的模式文件路径.它可能以 https://qualtrics.com/...

One can find the proper first part to stick in "Qualtrics Path" by, eg. going to the Qualtrics Survey Editor, inserting a photo using Rich HTML Editing (or something similar), inserting the photo, clicking on View Source, and then looking at the pattern file path to use. It may begin with something like https://qualtrics.com/...

然后将结果复制到电子表格程序中,您应该可以进行复制和粘贴了.

Then copy the results into a spreadsheet program and you should be ready to copy and paste.

这篇关于使用照片或图形以及循环和合并在 Qualtrics 中进行随机化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆