You should have a look into Expression Manager/Script in the manual.
It can do exactly what you want. We generally don't use the "assessment mode" anymore, because it is not as flexible as using expressions for the calculation of these scores. But I sometimes like to use the "assessment value" fields of questions (only available when assessment mode is switched on), because it makes the calculations of this type of scores easier, because you don not need to check which answer was given and then give it a value within the expression, but you could just access the assessment value from the given answer and use it in your calculations.
Let's say you have two questions, let's call them Q1 and Q2. Let's keep it simple for now, but let's use your example:
Q1: How often do you sleep 8h or more a night?
1 - Always = 3
2 - Usually = 2
3 - Often = 1
4 - Sometimes = 0
5 - Rarely = 0
6 - Never = 0
Q2: How often do you exercise per week?
1 - 4 or more times = 3
2 - 2-3 times = 2
3 - 1 time = 1
4 - Never = 0
So the first number is the answer code and the number after the answer would be what you put into the assessment field.
Then you create a equation type question to calculate the score (let's call it Q3).
So with my solution using the assessment values you could calculate your score like this.
Code:
{sum(Q1.value,Q2.value)}
This is for single choice questions, for questions with subquestions (multiple choice, array, etc) it is a little bit more complicated, but nothing out of this world.
Now, if you would not use the assessment value the whole thing would be a lot longer.
To make it simpler I would probably create 3 equation questions, because otherwise you would have to use IF statements and it can get quite confusing and it is easy to make mistakes, when your item battery is longer than 3.
So first I would store the score for Q1 into Q3a:
Code:
{if(Q1>3,0, if(Q1==3,1, if(Q1==2,2, if(Q1==1,3,""))))}
Then I would calculate the score for Q2 into Q3b:
Code:
{if(Q2>3,0, if(Q2==3,1, if(Q2==2,2, if(Q2==1,3,""))))}
And then I would sum them up into Q3c:
Of course you could make the same calculation in one question here, but it makes it a lot more difficult to check for errors and the more you have in one equation, the messier it gets.
However, with using the assessment values as base for the calculations you can make things a lot cleaner and simpler, in my opinion. This is why I still like to have the assessment mode there, just for being able to give scores to answers. I am not using the assessment mode for calculating the assessments though. For the calculations themselves I much prefer using equations, they give you so much more flexibility.