Calculating Quiz With Multiple Results/Outcomes

Am trying to get the output of multiple results at the same time.

Using a select-many option, I would wish that every correct selection gives the results for a Quiz in the NOTE variable using XLS Forms…

My success so far works with only one (of the select-multiple) being correct. Any further correct additions selected (say three are correct out of four) do not give the result. I have to delete the extra additions for it to give the accurate result.

I need it to give a cumulative score, in that:-- If one is correct and selected, then 1 is assigned (0r whatever value given).
If second correct selection is made, it sums them and assigns 2.
Or in the event all four are correct and selected, it sums them assigning that value, in this case 4.

I would appreciate the calculate formula that would make this happen. Below is an example of one of the variations I have gone thru not yielding the desired result.

type name label calculation
start start
end end
select_multiple q1 q1 1. Check calc 3 correctly selected
calculate c1 if(${q1},‘1’,1 or if(${q1},‘3’,1 or if(${q1},‘4’, 1,0)))
note Nc1 Q1. 3 displayed correctly calc: ${c1}

I have a challenge totalling a QUIZ with multiple select/correct responses. I posted my query and 7 days in no response yet.

QUIZ query can be found here…

I worked out a long work-around where I declare each individual correct response of the multiple select options as below.

  • *ADDED up each question individually… *
  • SUMMED section totals to ascertain results accuracy and ease troubleshooting…
  • SUMMED collective section totals for grand total at the end.

I put an As you can see, that was a heck of work. Hard to repeat in any other situation.

Below is an excerpt of the work-around for the Select Multiple Option questions I used.

type name label required appearance parameters calculation
select_multiple q11 q11 11. This is true of consultants and counsellors TRUE randomize=true
calculate c11a TRUE if(selected(${q11},‘1’), 1,0)
calculate c11b TRUE if(selected(${q11},‘2’), 1,0)
calculate c11c TRUE if(selected(${q11},‘3’), 1,0)
note sum11 TRUE ${c11a}+${c11b}+${c11c}
note Nc11 Q11. displayed correctly calc: ${sum11} FALSE

Could you kindly please help me out?


@amailuk, this post discussed previously should help you solve your issue:

And this one too …

And this one too …

Thank you @Kal_Lam, for responding. Though I eventually found a workaround it was still lacking. More so it kept giving a ZERO.

However, this option gave me an idea which has resolved the ZERO problem. I added a Relevant Column and added selected(${q1},‘1’) as below

selected(${q1},‘1’) or selected(${q1},‘2’) or selected(${q1},‘4’)

applying it to the select_multiple options selected. This now leaves it blank as I had all along purposed.

1 Like

@amailuk, :clap: :heart: :partying_face: