Copy link to clipboard
Copied
I'm creating a exam with multiple choices per question. The idea is to, when the student clicks on one of the chekboxes, he receives a feedback color on that checkbox through colors.
A simple system with red when wrong and green when right.
In the forms options I didn't find nothing like that, and the only alternative I found was to create a JavaScript, but I don't know anything about that.
I anexed a example file. The checkboxes are placed, but a just don't know how to gave this system with the colors.
You want to change fill color or border color?
You can aproach this a few way, simpliest being just change color (Il use fill color as example) when checkbox is clicked,
since you use checkboxes as radio buttons, you can use this code in first checkbox as Mouse UP event, where "0" in field name represent field widget (In a group first field will have widget 0, second will have 1, then 2,3...etc)
if(this.getField("eqexam.Part1.2.0").value != "Off"){
this.getField("eqexam.Part1.2.0").fillColor = colo
...
Copy link to clipboard
Copied
You want to change fill color or border color?
You can aproach this a few way, simpliest being just change color (Il use fill color as example) when checkbox is clicked,
since you use checkboxes as radio buttons, you can use this code in first checkbox as Mouse UP event, where "0" in field name represent field widget (In a group first field will have widget 0, second will have 1, then 2,3...etc)
if(this.getField("eqexam.Part1.2.0").value != "Off"){
this.getField("eqexam.Part1.2.0").fillColor = color.red;}
In the second checkbox replace "0" with "1" in third checkbox with "2"...etc
also change "red" to "green" in a checkbox you want to be green.