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

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

问题描述

我在中创建了一个调查问卷,其中有很多照片,比如1000.我希望让每个调查参与者回答6,每张照片的问题。每位参与者将看到5张随机分配的照片。



在研究事情之前,我认为有一种方法可以上传1000张照片,在Qualtrics中创建一个区块(有6个问题),然后简单地随机化发生的照片,并重复这5次。



但似乎这是不可能或不明显。我打电话给Qualtrics,他们说我手动需要创建1000个块(每个块与标题和照片的例外完全一样)。然后,我需要进入Survey Flow并使用Randomizer,并手动添加所有1000块,并随机出现5个元素。



我真的很希望有一个更好的办法。如果我必须这样做,这将花费大量的时间。



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


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


解决方案

原来,有1000多块的修复方法可以更快地完成这个任务。



有很多东西可以完成它,但这是可能的。

首先,需要通过图形库将照片放入Qualtrics。最好的办法是简单地将照片拖放到所需的位置。幸运的是,人们不必一一做这件事。确保它们符合您的要求。



其次,创建一个带有问题的块,以便随机照片出现。这块应该也有所有6个问题。第三,在电子表格(例如Excel)中创建一个与照片对应的URL的列。这应该是为了。一种方法是在底部提及。



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



然后您应该全部设置。



最后,稍微介绍一下如何获取相片。再一次,确保图库中的照片符合你的要求。然后,您可以使用网络抓取来抓取图像名称,然后将其放入适当的URL中。我用Python的Selenium和BeautifulSoup来完成这个任务。这是我做的,使用Mac。代码至少给你的想法:

  from bs4 import BeautifulSoup 
导入编解码器
导入os
from selenium import webdriver
import re

chromedriver =文件路径/ chromedriver
os.environ [webdriver.chrome.driver] = chromedriver
driver = webdriver.Chrome(chromedriver)

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

  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 = * Qualitative Path / Graphic.php? IM =+ urls [i] +/> +'\\\
')

通过例如,可以找到合适的第一部分来坚持Qualtrics Path。转到Qualtrics调查编辑器,使用Rich HTML Editing(或类似的东西)插入照片,插入照片,单击View Source,然后查看要使用的模式文件路径。它可能以 https://qualtrics.com/ 之类的内容开始......



然后将结果复制到电子表格程序中,然后准备好复制和粘贴。

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.

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.

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. Creating new blocks and automatically populating the photos. I know python and could possibly write a script to generate blocks, BUT the photo names are changed from their original names into some complicated code that Qualtrics generates.
  2. Loading the photos into Qualtrics all at once (it currently requires one to load photos one at a time).

解决方案

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.

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.

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

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.

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.

Then you should be all set.

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)

*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] + "/> + '\n')

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天全站免登陆