I have a matrix table - likert - drag and drop question. The ‘selected choices’ are images (I’ve tried setting them using the GUI and HTML tags). I’d like to read them in as embedded values (to do some math and then update the embeddedValue).
I see that it works to return the image when I pipe the embedded value for the choice, i.e. “${q://QID45/ChoiceGroup/SelectedChoicesForAnswer/1}” in a question but how do I extract the HTML of the selected choice? Eventually I’d like to get a string but open to other ideas (new to JS). This is an example of the code I’m trying to write.
// Get the value of the embedded variable
var embeddedValue = "${q://QID45/ChoiceGroup/SelectedChoicesForAnswer/1}"; /* blue tractor gas can image */
// Do something to get a string ?...
// Based on the string, do something...
switch (embeddedValue) {
case "Blue Can":
console.log("This is a blue can.");
break;
default:
console.log("Test.");
}