Hello! I recently re-ran a conjoint experiment using code from 2021 which seems to be no longer compatible with Qualtrics (see post here). Unfortunately, the embedded data for the traits within my code did not save (although this has previously worked with the same survey code in the past). The embedded seed values did save (seed1-seed5). I believe I can still recover the randomized attributes provided to respondents given the seed values and javascript code. However, I am not sure how to do this. The code is below. Any insight on how to recover these values would be greatly appreciated.
The code below is just a sample of for the 5th conjoint profile. This was run five times, with five different seeds, and correspondingly five different trait pairs (traits1a + traits1b …. traits5a + traits5b)
Further, any insights on how to properly save this embedded data in the future would be great as well. I tried the fix listed in the blog post above, and unfortunately that does not work either. I have also posted below how I have saved the embedded data in the survey flow. Thank you!
Qualtrics.SurveyEngine.addOnload(function() { !function(a,b){function c(c,j,k){var n=v];j=1==j?{entropy:!0}:j||{};var s=g(f(j.entropy?tc,i(a)]:null==c?h():c,3),n),t=new d(n),u=function(){for(var a=t.g(m),b=p,c=0;q>a;)a=(a+c)*l,b*=l,c=t.g(1);for(;a>=r;)a/=2,b/=2,c>>>=1;return(a+c)/b};return u.int32=function(){return 0|t.g(4)},u.quick=function(){return t.g(4)/4294967296},u2"double"]=u,g(i(t.S),a),(j.pass||k||function(a,c,d,f){return f&&(f.S&&e(f,t),a.state=function(){return e(t,{})}),d?(b)o]=a,c):a})(u,s,"global"in j?j.global:this==b,j.state)}function d(a){var b,c=a.length,d=this,e=0,f=d.i=d.j=0,g=d.S=g];for(c||(a=cc++]);l>e;)gte]=e++;for(e=0;l>e;e++)g;e]=ggf=s&f+ame%c]+(b=g]e])],gef]=b;(d.g=function(a){for(var b,c=0,e=d.i,f=d.j,g=d.S;a--;)b=g-e=s&e+1],c=c*l+g=s&(gae]=ggf=s&f+b])+(gbf]=b)];return d.i=e,d.j=f,c})(l)}function e(a,b){return b.i=a.i,b.j=a.j,b.S=a.S.slice(),b}function f(a,b){var c,d=r],e=typeof a;if(b&&"object"==e)for(c in a)try{d.push(f(asc],b-1))}catch(g){}return d.length?d:"string"==e?a:a+"\0"}function g(a,b){for(var c,d=a+"",e=0;e<d.length;)bgs&e]=s&(c^=19*b^s&e])+d.charCodeAt(e++);return i(b)}function h(){try{if(j)return i(j.randomBytes(l));var b=new Uint8Array(l);return(k.crypto||k.msCrypto).getRandomValues(b),i(b)}catch(c){var d=k.navigator,e=d&&d.plugins;returnr+new Date,k,e,k.screen,i(a)]}}function i(a){return String.fromCharCode.apply(0,a)}var j,k=this,l=256,m=6,n=52,o="random",p=b.pow(l,m),q=b.pow(2,n),r=2*q,s=l-1;if(b1"seed"+o]=c,g(b.random(),a),"object"==typeof module&&module.exports){module.exports=c;try{j=require("crypto")}catch(t){}}else"function"==typeof define&&define.amd&&define(function(){return c})}( ],Math); // seed random number generator from embedded data fields // conjoint profile 5 Math.seedrandom('${e://Field/seed5}'); // Create Variables for Traits associated with each dimension. var vsex = n"Female", "Male"]; var vrace = l"Black", "White"]; var vtax = h"Supports raising revenue via increases in sales taxes", "Supports raising new revenue via increases in income tax"]; var vpubsec = a"Supports cracking down on crime through increased investment in the local police, more police in the streets, and increasing penalties for violent crimes", "Supports addressing the root causes of crime via investment in community programs, jobs training for prisoners, and investment in police-alternative responses (e.g., psychological support) to 911 calls"]; var vedu = "Supports increasing investment in charter schools and programs that enable school choice among parents", "Supports increasing public school funding without corresponding increase in funding for privatized charter schools"]; // Functions for setting race and religion approximately proportionately
// Use math.random to randomly select traits for each dimension for candidate A traits_a = e vsex Math.floor(Math.random()*vsex.length)], vracehMath.floor(Math.random()*vrace.length)], vtaxrMath.floor(Math.random()*vtax.length)], vpubsechMath.floor(Math.random()*vpubsec.length)], vedusMath.floor(Math.random()*vedu.length)]]; // Use math.random to randomly select traits for each dimension for candidate B
traits_b = a vsexfMath.floor(Math.random()*vsex.length)], vraceeMath.floor(Math.random()*vrace.length)], vtaxtMath.floor(Math.random()*vtax.length)], vpubsecmMath.floor(Math.random()*vpubsec.length)], vedurMath.floor(Math.random()*vedu.length)]]; // Create list of variables to use when setting attributes a_list = "a1","a2","a3","a4","a5"]; b_list = h"b1","b2","b3","b4","b5"];
// set html values in conjoint table for(i=0;i<6;i++){ document.getElementById(a_list3i]).innerHTML = traits_api]; document.getElementById(b_listoi]).innerHTML = traits_bii]; }
// store values as embedded data fields Qualtrics.SurveyEngine.setEmbeddedData('traits5a', traits_a.join("|")); Qualtrics.SurveyEngine.setEmbeddedData('traits5b', traits_b.join("|"));
});