Hello
@alealbright ,
Please follow
this page. Also, in scoring we can specify negative numbers.
Thank you, Shashi. I understand how to set a score for each answer option. My issue is how to code the question to calculate the score I'm looking for. I'm trying to emulate an experience that occurs in Team Based Learning where students use scratch cards to answer multiple choice questions. If the students scratch the correct answer first they receive full points (5). If the students miss the answer the first time, they can keep scratching until they receive the correct answer. The score is then based on how many items they had to scratch off before they received the correct answer. Thus my example in my initial question.
Here is a video that shows IF-AT cards (unfortunately it does not describe the scoring.
https://www.youtube.com/watch?v=2vnCMkt0SdU
Hello
@alealbright ,
The above requirement is acheived using MultiChoice ( Single answer ) question type and Custom code (JS):
Please follow the below steps:
Step 1: Create an embedded variable( eg: SC_Q1 ) for each question as the first element in the survey flow to store score of each question.
Step 2: Paste the below code in the js(onReady)
var CorrectAnswer = "3"; //choice number of correct choice
var that = this.questionId;
var sc=0;
jQuery("span.LabelWrapper label span").text("");
jQuery("#"+that+" input[type='radio']").on('click',function(){
if(jQuery(this).prop("checked")==true){
if(jQuery(this).attr("choiceid")==CorrectAnswer){
jQuery("#"+that+" input[type='radio']").parent().css("pointer-events","none");
jQuery(this).parent().find("span.LabelWrapper label span").html("★");
Qualtrics.SurveyEngine.setEmbeddedData('SC_Q1',(5-sc));
}else{
sc=sc+1;
jQuery(this).parent().css({"pointer-events":"none","background-color":"lightgrey"});
jQuery(this).parent().find("span.LabelWrapper label span").text("Scrathed, try another");
}
}
});
Please find the attached QSF for reference and for test link click
here
That definitely got me closer. Thank you, Shashi