Hello,
I am new at coding. I have an educational site and would like to integrate my free test to native code. I set slides with couple of questions and try to connect to with code;
My idea for the code is;
-Everytime you click in one radiobutton the value of the radio button (A,B,C and D) is compared to the value of the correct answer (inserted in code) and add 1 point to scoreCount if is the same.
-At the end of the test you have a submit button that will store scoreCount into a field (score) of a database (dataset3) .
-Then be displayed connecting text to the dataset and filtering by users.
I spent 4 days digging into code and this is what I was able to do;
Many thanks
import wixData from ‘wix-data’;
import wixUsers from ‘wix-users’;
var scoreCount =0;
export function radioGroup1_onclick(event) {
if ($w(“#radioGroup1”).value === “A”){scoreCount +=1;}
}
export function button5_click(event) {
let scoreCount = $w( scoreCount.value)
$w("#dataset3").setFieldValue("score", scoreCount.value);
$w(“#dataset3”).save(scoreCount.value);
}