Adding scores to generate a total score

Hi Amelia,

I am readjusting the Quality adjustment app after feedback from Jeremy.
One of the scores is breaking and I can’t understand why.

The form is this:
https://www.commcarehq.org/a/quality-assessment-tool/apps/view/11edf24a9209930dbc9847d6b7e18685/modules-0/forms-2/source/

What we are calculating is the CC proficiency score for the CHW after
assessing how she uses CC.

The total points that she can possiblly earn are variable depending on the
app. The variable components are captured in datanodes, where if Not
applicable is chosen as the option in the relavant question, then the total
pts possible for that question is 0. Then we add these nodes to the points
that are not variable to get the total point possible:

(number(/data/text_score) + number(/data/number_score) +
number(/data/date_score) + number(/data/play_audio_video_score) +
number(/data/navigate_modules_score) + number(/data/multi_select_score) +
number(/data/single_select_score) + number(/data/edit_form_score) +
number(/data/close_form_score) + 22)

where text_score is : if(/data/Entering_text=“1” or
/data/Entering_text=“0”, “1”," 0") and so on for the other nodes.

The CC proficiency score is what the CHW scored on the assessment. I have
tried to capture it by adding all the non-variable points straight from the
choice values, and using coalese to pick between the choice value or 0 in
case of the variable points. In case not applicable is chosen, the choice
value is - so I hope that the coalesce will choose 0 as the score right?

So:
number(/data/finding_CC)+number(/data/Opening_CC)+…+
number(coalesce(/data/Entering_text, 0)) +
number(coalesce(/data/enter_dates, 0)) +
number(coalesce(/data/entering_numbers, 0)) +
number(coalesce(/data/play_audio_video,0))
+number(coalesce(data/multi_select, 0))
+number(coalesce(/data/single_select, 0))
+number(coalesce(/data/use_edit_form, 0)) +
number(coalesce(/data/use_close_form, 0))

Before was trying if statements eg:

number(/data/finding_CC)+number(/data/Opening_CC)+…+
number(if(/data/Entering_text=’-’,0, /data/Entering_text)

Which was not working, and got a score of 0 for the whole proficiency score
each time…

What do you think is the problem with the scoring? How can I fix??

Thanks,
Sangya