Hi Qualtrics Community,
I am writing to seek assistance with developing a Java Script code for a survey that I have created. I have to score a text entry and I need the answer to be scored taking case-sensitivity into account ("Wr12" would be correct, but "wr12" would not be). From this previous thread I understand that Qualtrics is case insensitive and that the solution is to develop a Java Script. (https://community.qualtrics.com/XMcommunity/discussion/5151/case-sensitive-scoring-validation-for-a-text-entry-question).
Unfortunately, it is my first time using a Java Script and was hoping that a colleague in this forum could assist me in creating a script I could implement.
Thank you in advance. Please let me know if you require any additional information.
Case-sensitive scoring
Best answer by Rudi
hi all,
I just modified your example slightly and it worked perfectly fine
I created a text entry question and evaluated the entry on PageSubmit
the string I compared against is stored in the embedded data field text3
Qualtrics.SurveyEngine.addOnPageSubmit(function(){let solution = "${e://Field/text3}"let textEntry = document.getElementById('QR~'+this.questionId).valuelet score;
console.log(textEntry)
if(solution === textEntry){score = 1
}else{score = 0
}
let text2 = Qualtrics.SurveyEngine.setEmbeddedData("score", score)});
best regards
Rudi
Sign up
Already have an account? Login
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join.
No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Login with Qualtrics
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join. No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Login to the Community
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join.
No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Login with Qualtrics
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join. No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
