Check out the LimeSurvey source code on GitHub!
Welcome, Guest
Username: Password:
  • Page:
  • 1
  • 2

TOPIC: Generating "Score" From 100+ Question Survey

Generating "Score" From 100+ Question Survey 4 years 6 months ago #73704

I am building a 50 question test using LimeSurvey, containing 10 different categories (5 questions each). Each question has 3 possible answers, including the "other" option.

Here's my issue: I am trying to figure out how I can take each answer and give it a "score" that will add up to a final test "score" that users can see. This final score will be a number between 1 and 100. Users start the test with a base score of 50. Some choices will give a (+1), some will give a (-1), and then I have the "other" option which will give a (0). The final score is determined by the adding and subtracting of these point values.

Any easy way to do this sort of logic?
The administrator has disabled public write access.

Generating "Score" From 100+ Question Survey 4 years 6 months ago #73708

  • TMSWhite
  • TMSWhite's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 758
  • Thank you received: 83
  • Karma: 37
See the documentation for Expression Manager and the HowTo examples.

Although you could create a single expression that has all 100 variables, I'd recommend breaking it up. So, since you have 10 categories, you could create a hidden Equation question for each category to create the category-specific score. Say your variables names are named by category (A-J) and question within category (1-3) - so A1-A3, B1-B3, ... J1-J3. Then, scale-scores would be like this (where let's call the category score Xscore where X is the category.). So Ascore would be:
sum(A1.NAOK,A2.NAOK,A3.NAOK)

Then, the total score would be the sum of each of the category scores (plus your starting score of 50).
sum(50,Ascore.NAOK,Bscore.NAOK,...,Jscore.NAOK)

For your reports, you could show the final score (let's call it finalScore) as
Thanks for filling out our survey, {TOKEN:FIRSTNAME}.  Your final score was {finalScore}.

Incidentally, the reason for all the NAOK is in case you have conditions on your questions - the NAOK would let you compute the scores anyway. If conditions hid any of the parts of the sum and you didn't use .NAOK, then {finalScore} would always = 0.
Last Edit: 4 years 6 months ago by TMSWhite.
The administrator has disabled public write access.

Generating "Score" From 100+ Question Survey 4 years 6 months ago #73714

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6214
  • Thank you received: 1376
  • Karma: 539
If using 1.91+ or earlier, you will need to use a little JavaScript to calculate the score. Details of the script would depend on the survey structure how many questions per page, etc.).
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The administrator has disabled public write access.

Generating "Score" From 100+ Question Survey 4 years 6 months ago #73752

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5984
  • Thank you received: 368
  • Karma: 260
At Limesurvey the according scoring feature is called "assessment", see docs.limesurvey.org/Assessments&structur...tions+for+LimeSurvey

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.

Generating "Score" From 100+ Question Survey 4 years 6 months ago #73789

Thanks for the replies, guys.
I'm upgrading to 1.92 right now so I can take advantage of the Expression Manager. I'm excited to see how that will work. I'll keep you updated.
The administrator has disabled public write access.

Generating "Score" From 100+ Question Survey 4 years 6 months ago #73796

Hey TMSWhite- could you possibly elaborate on the steps here? I've never used the EM, and am honestly still figuring out LimeSurvey. Would I put these expressions in questions set to not display? Where do I define, as in your example, "Ascore", etc.? I have all my cats/structure configured the way I want it...I just need to figure out how to apply this code to my categories and questions.
The administrator has disabled public write access.

Generating "Score" From 100+ Question Survey 4 years 6 months ago #73873

Okay, more succinctly, where do I define the value of each answer choice? I.e. If a user answers A for one question, that would add a (+1) and if they chose B, it would add a (-1), and if they chose no answer it would add a (0)?
The administrator has disabled public write access.

Generating "Score" From 100+ Question Survey 4 years 6 months ago #73881

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5984
  • Thank you received: 368
  • Karma: 260
Better use positive numbers only and afterwards do a X=SUM(a+b+c)-50.

Have a look at the assessment feature (not sure if EM accesses the assessment scores) and also set up according answer codes.

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.

Generating "Score" From 100+ Question Survey 4 years 6 months ago #74073

Alright...trying to figure out why this isn't working for me. I have Assessments enabled, and have given all answer choices the correct score (+1, -1, or 0). I have added hidden Equation questions at the end of each Question Group, summing up the scores from the questions. I have a separate group and a hidden question at the end of the quiz, summing up all Group total variables and adding them to 50.
First thing - the final score returned is always 50. The equations seem to be not giving weight to the individual questions...

Second thing - I named the final sum question "finalScore". Calling this in the results page (i.e. Your final score is {finalScore}.) does not return anything. It's blank.

Any insights?
The administrator has disabled public write access.

Generating "Score" From 100+ Question Survey 4 years 6 months ago #74074

  • TMSWhite
  • TMSWhite's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 758
  • Thank you received: 83
  • Karma: 37
If you attach the survey, I can take a look. If the content is proprietary, send me a private message and I can give you contact information to email me a copy.
The administrator has disabled public write access.

Generating "Score" From 100+ Question Survey 4 years 6 months ago #74077

  • TMSWhite
  • TMSWhite's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 758
  • Thank you received: 83
  • Karma: 37
FreedomTrip-

You were very close. Your equations like:
sum(PF1.NAOK, PF2Abortion.NAOK)

should have been this, since you want the assessment value (not the A-C sub-question codes):
sum(PF1.valueNAOK, PF2valueNAOK)

When I make those changes, and un-hide the Equation questions (and switch to all-in-one mode), I see the values of the sums change dynamically as I'd expect. Except for finalScore.

Turns out, there are two issues that keep it from working properly:
(1) The process I used to extract the equation value and populate the database works fine for the default template. However, it does not work for the basic template. I'll open a bug report on that.

(2) The final equation isn't being processed due to a different bug, which I'll also report.

/Tom
Last Edit: 4 years 6 months ago by TMSWhite.
The administrator has disabled public write access.

Generating "Score" From 100+ Question Survey 4 years 6 months ago #74082

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5984
  • Thank you received: 368
  • Karma: 260
TMSWhite wrote:
Turns out, there are two issues that keep it from working properly:
(1) The process I used to extract the equation value and populate the database works fine for the default template. However, it does not work for the basic template. I'll open a bug report on that.
Tom, is there a ticket for this?
If not, can you outline the problem in more detail? Because we have to be sure that EM works for all (also customized) templates. It should not depend on any elements of the templates, because e. g. some use a table based layout while others use DIVs.

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.

Generating "Score" From 100+ Question Survey 4 years 6 months ago #74098

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • Moderator Lime
  • Posts: 9305
  • Thank you received: 1330
  • Karma: 386
Mazi wrote:
TMSWhite wrote:
Because we have to be sure that EM works for all (also customized) templates.
?

Are you sure ?
We already have some issue after put question.pstpl template ({QUESTION_SESSTIAL}).

1.92 are a major version, maybe there can be some customized template incompatibility ?

Denis
Assistance on LimeSurvey forum and LimeSurvey core developpement are on my free time (Say thanks ?).
A bug not reported is a bug not corrected. | Please, read the documentation | La doc en français à besoin de vous
The administrator has disabled public write access.

Generating "Score" From 100+ Question Survey 4 years 6 months ago #74120

  • TMSWhite
  • TMSWhite's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 758
  • Thank you received: 83
  • Karma: 37
Mazi-

I opened two bugs which I hope to tackle today:
(1) bugs.limesurvey.org/view.php?id=5804 - I plan to add something like an .em_equation class to {QUESTION_TEXT} so that I can more easily extract the value. That should ensure that it will work across templates.

(2) bugs.limesurvey.org/view.php?id=5803 - this is not a problem in 1.92 RC3 but relates to some optimizations I recently did. Also easy to fix.

/Tom
The administrator has disabled public write access.

Generating "Score" From 100+ Question Survey 4 years 6 months ago #74121

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5984
  • Thank you received: 368
  • Karma: 260
Shnoulle wrote:
1.92 are a major version, maybe there can be some customized template incompatibility ?
I don't agree. I would say that ~70-80% of our users use a customized template or slightly edited shipped template. We have to focus on compatibility here.

For Limesurvey 2.0 one could say "this is a major release with a completely rewritten code base, customized templates have to be adjusted", though we should try to work around that.

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Moderators: ITEd
Time to create page: 0.390 seconds
Imprint                   Data Protection Statement                  Revocation information and revocation form