Assistance Needed with Kobo Formula for Multiple Choice Scoring

Dear Mr.,

I have created a test using Kobo and assigned marks to each question. However, I am facing a challenge with a multiple-choice question where I need to award full marks if the student selects 5 out of 8 options correctly. Could you please assist me in writing the appropriate formula for this?

Thank you very much.

Hanin Shurrab

This code checks if options 1, 2, 3, 4, and 5 are all selected and only those options are selected in a multiple-choice question named P1. If so, it returns β€˜1’; otherwise, it returns β€˜0’.

type: calculate

if((selected(${P1}, β€˜1’) and selected(${P1}, β€˜2’) and selected(${P1}, β€˜3’) and selected(${P1}, β€˜4’) and selected(${P1}, β€˜5’)),β€˜1’,β€˜0’)

Not quite. The calculation

if((selected(${P1}, β€˜1’) and selected(${P1}, β€˜2’) and selected(${P1}, β€˜3’) and selected(${P1}, β€˜4’) and selected(${P1}, β€˜5’)),β€˜1’,β€˜0’)

will also return true if 1,2,3,4,5 and 6 are selected.

Presumably you have a predetermined set of 5 options that are correct, and 3 that are incorrect, right? In that case you will have to explicitly check each of the correct ones are selected, and also that each of the incorrect ones are not selected. eg

if(selected(${P1}, β€˜1’) and not(selected(${P1}, β€˜2’)) and selected(${P1}, β€˜3’) and not(selected(${P1}, β€˜4’)) ... , 1, 0)

[alternatively, if you just want them to select any 5 (and 5 only) - but it doesnt matter which - then you could simplify the whole thing using count-selected():

if(count-selected(${P1})=5, 1, 0)

You could also simplify the former a little by combining the two: ie explicitly check all the 5 correct ones are selected, and then add a count-selected() to verify that exactly 5 - and no more than 5 - are selected. It’ll have the same outcome, but personally I find adding explicit checks for not(selected(...)) makes the intent of the question very clear.

2 Likes

Thank you very much, I am pleased to inform you that the issue has been resolved by utilizing the β€œcount-selected” feature.

1 Like