Hi,
I have a list of radio button questions, each having 3 unique (texts are different) options. For example:
Question 1:
- This is an answer
- Well this is another answer
- You could also choose this answer
I want to assign scores for each option as 1,3 and 5 respectively.
My first thought is to get the index of the selected radio button option. Such as:
index = Question1.getIndex();
if (index == 0) Score = 1;
else if (index == 1) Score = 3;
else if (index == 2) Score = 5;
I could not find a getIndex function for radio buttons, so a function to list all possible options could also work. Such as:
allOptions = Question1.getAllOptions(); // ["This is an answer", "Well this is another answer", "You could also choose this answer"]
index = allOptions.indexOf(Question1);
if (index == 0) Score = 1;
else if (index == 1) Score = 3;
else if (index == 2) Score = 5;
If there is no way to get the index of the selected radio option, maybe I can add a) b) c) to the answers:
Question 1:
a) This is an answer
b) Well this is another answer
c) You could also choose this answer
if (Question1.startsWith("a")) Score = 1;
else if (Question1.startsWith("b")) Score = 3;
else if (Question1.startsWith("c")) Score = 5;
Would it be possible? Or is there any other easier solution to this?