I've created an exam with a button at the top that cycles through all the correct answers and adds them up for a final score using the variable total. Things I would like to do? Highlight the incorrect answer in red and show the correct answer in the exclusion group. See comments in the code below: (can anyone help?)
var fields = xfa.resolveNodes("subQuestions.Answers[*]");
var total = 0;
for (var i = 0; i <= fields.length-1; i++) {
if (fields.item(i).rawValue == 1){
total = total + 1;
}
else if (fields.item(i).rawValue != 1){
//MAKE THE SELECTED MEMBER OF THE EXCLUSION GROUP RED
//MARK THE CORRECT ANSWER IN THE EXCLUSION GROUP
fields.item(i).border.fill.color.value = "255,180,180";
}
}
form1.DUEL_INSPECTION_FUELLING_EXAM.subDetails.txtScore.rawValue = total;