Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Calculate a score based on correctly selected answers

  • blocka
  • blocka's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
5 years 2 months ago #179573 by blocka
I have a survey that I'm using for a quiz -- at first I thought I could use Assessments, but then I started adding some multiple choice questions, and discovered that I can't assign assessment values at the answer level -- only at the question level (which then seems to multiple my that assessment value by the number of checked off responses) -- not what -- I want to have a score just for the right answers -- not any selected answer.

So, I figure what I need to do is use an equation type question, and write a formula to assign a score based on what I determine are correctly answers.

Question I have is how do I write that formula?

I'm thinking it would be something like:

{sum(if(Q1.NAOK == "A1",1,0),if(Q2.NAOK == "A5",1,0),if((Q3_SQ004.NAOK == "Y" or Q3_SQ008.NAOK == "Y"),1,0)) }


Will this work? if not, what would work?
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 2 months ago - 5 years 2 months ago #179588 by DenisChenu
Yes, it work,

See www.limesurvey.org/community/forums/can-...-participants#179507 too for example (where you need unchecked/checked control on whole question)

And if point is 1 : you can do :
Code:
{sum(
intval(Q1.NAOK == "A1"),
intval(Q2.NAOK == "A5"),
intval(Q3_SQ004.NAOK == "Y" or Q3_SQ008.NAOK == "Y"),
0)}

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Last edit: 5 years 2 months ago by DenisChenu.
The topic has been locked.
More
5 years 2 months ago #179752 by iosman
Nice blog with genuine information. Thanks alot.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose