Solved
not able to use Javascript successfully
I am trying to enable a rolling dice on my survey with the instruction from the link below.
https://tschiemer.github.io/qualtrics-gambling/dice/dice.html
https://github.com/tschiemer/qualtrics-gambling
However, I am not successful to realize it. I saved the dice javascrip file and dice image files into my dropbox and insert the code below to my qualtrics survey. I am not familiar with Javascript language. Can anyone help to figure out how can I fix the problem?
Thank you very much in advance.
<!-- include dice source.-->
<script src= "https://www.dropbox.com/sh/460ga74bw0mdw02/AAC2ngEyoH41YjGjgwTBU5ada?dl=0/dice.js" type="text/javascript"> </script>
<!-- Actual dice html here -->
<div id="dice"></div>
<br>
<button id="throw">Throw dice!</button>
new Dice('dice','throw',{
value_set: [
{key: '1',probability: 1},
{key: '2',probability: 1},
{key: '3',probability: 1},
{key: '4',probability: 1},
{key: '5',probability: 1},
{key: '6',probability: 1}
],
images : {
base_url: “https://www.dropbox.com/sh/460ga74bw0mdw02/AAC2ngEyoH41YjGjgwTBU5ada?dl=0/image/“,
ext: '.png',
init: 'qmark1.png'
},
result_callback: function(throw_nr,result_key){
// Save result to embedded data field (need
//not be set through survey flow settings)
Qualtrics.SurveyEngine.setEmbeddedData('result_matrix_embedded'+throw_nr, result_key);
}
});
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
