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.