Adding checkbox coded question responses

Hi, is there a formula one can use in adding the scores of a checkbox question, with each response coded to a specific number?
Thanks in advance.

Hm, if you want a weighted sum I think the easiest way to achieve it would be to make a quick lookup table for the list of choices and include the scores for each choice in the table.

Then you could calculate a score by referencing the table and summing each item which has a selection. Something like the following:

sum(instance('item-list:fruit')/fruit_list/fruit[selected(#form/selected_choices, type)]/score)

Thank you for the swift reply, but let's say I have a checkbox question like:
What did you have for breakfast?
a) Cereals
b) Tea
c) Bread
d) Eggs
e) pancakes
Suppose we need a score for breakfast and we allocate a score for each response : Cereals (1), Tea (2), Bread (2), Eggs (4), Pancakes (1)
How can one go about it?