We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.
Would appreciate to receive your tips and comments.
Thank you very much in advance.!!
What kind of fields do you use for the answers (text, radio-button, drop-down, something else)? What are the names of these fields?
I´m using Text Fields. The names of the fields follow the standard "TextXX". I´m not renaming them.
OK... Then you can use something like this as the custom calculation script of the score field:
var score = 0; if (this.getField("Text1").valueAsString == "A") score++; if (this.getField("Text2").valueAsString == "B") score++; if (this.getField("Text3").valueAsString == "5") score++; if (this.getField("Text4").valueAsString == "Apple") score++; event.value = score;
Of course, you'll need to adjust the field names as well as the correct answer for each question.
Be aware that JS is case-sensitive, though, so if the student enters "apple" it won't match "Apple".
Also, "an Apple" won't match it, or even "Apple " (with a space after it). It has to be a perfect match (although there are ways around it, like using regular-expressions).
Thank you very much!! I will test this script and make the necessary adjustments. Have a nice day!