Hello Qualtrics Community, I am trying to dynamically extract the value of a slider question and display it in a mathematically manipulated form in a consecutive question on the same page.Specifically, my question looks something like the example below:Thus, in the bottom text I would like to display the price a respondent would have to pay given the protein and quantity they selected. So, for example, if someone selects chicken breasts and 10lbs., then on the bottom it would show $20. The Javascript I tried so far was: jQuery("input[type = hidden]").change(function () {if(jQuery("#QID202~1~true-result").val().length == 0){var sliderScore = 0;} else{var sliderScore = parseInt(jQuery("#QID202~1~true-result").val());}jQuery("#totalscore").html(sliderScore);jQuery("#totalscore").text(sliderScore);Qualtrics.SurveyEngine.setEmbeddedData("eJStotalscore",sliderScore);});});But this obviously does not account for any kind of calculation (nor work at all for that matter). Any help would be grea
Hello Qualtrics Community, I am previously generated a questions (and received help with) a question where respondents are able to freely put together a frozen yoghurt or fruit cup using a multi-select format and the number of calories displayed on the bottom of the question is dynamically updated to show the total number of calories of their order (see image).The code that I was generously given for this purpose can be found here: https://www.qualtrics.com/community/discussion/14801/display-dynamically-updating-scores-to-respondents-for-multi-select-checkbox-questions#latest.However, I am now trying to update the code to not only dynamically show the total number of calories but also the total price of the item, assuming each ingredient has its own price (e.g. sprinkles are $0.40, bananas are $0.80, etc.).To do so I adjusted the original code as shown below. However, with this adjusted code I can display the total price in the second textbox, but the first textbox remains empty. Do yo
Hello, I am relatively new to Qualtrics and even newer to JS. I came across the following thread on how to dynamically display the score of a single answer MC question to the respondent:https://www.qualtrics.com/community/discussion/5854/how-to-display-score-on-survey-page-that-dynamically-updates.Contained within it is the following JS, which works fantastically for single-answer MC questions:Qualtrics.SurveyEngine.addOnload(function(){ /*Place your JavaScript here to run when the page loads*/jQuery("input[type=radio]").change(function() { if(jQuery("#QID636 input.radio").is(":checked")){var choiceNum1 = jQuery("#QID636 input.radio:checked").attr("choiceid");var recodeMap1 = {"1" : 0, "2" : 100, "3" : 200, "4" : 300, "5" : 400, "6" : 500, "7" : 600, "8" :700, "9" : 800, "10" : 900, "11" : 1000};var qScore1 = recodeMap1[choiceNum1]; } else { var qScore1 = 0; } if(jQuery("#QID653 input.radio").is(":checked")){var choiceNum2 = jQuery("#QID653 input.radio:checked").attr("
Hello Qualtrics Community, I am currently using code that enters a pre-specified value (defined in variable sum) into a textbox, which I thankfully got from another community member: var all_questions = []; var display_cal; document.querySelectorAll("div[id^=QID]:not(.Separator)").forEach((question) => { if (question.className.includes("TE")) { display_cal = question.querySelector("input"); } else { all_questions.push(question); } }); display_cal.readOnly = true; display_cal.style.cursor = "not-allowed"; function cal_sum() { var sum = 0; all_questions.forEach((question, which_q) => { question.querySelectorAll(".q-checkbox").forEach((chkbox, which_o) => { if (chkbox.className.includes("q-checked")) { sum += Object.values(q_weights)[which_q][which_o]; } }); }); display_cal.value = sum;where q_weights is a variable that was sp
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
Sorry, we're still checking this file's contents to make sure it's safe to download. Please try again in a few minutes.
Sorry, our virus scanner detected that this file isn't safe to download.