Welcome to the LimeSurvey Community Forum

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

Students enroll in clubs/activities with max number of participants

  • magdacorreia
  • magdacorreia's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 5 months ago #175482 by magdacorreia
Hello,

i need to create a form so that the students from a school can enroll in clubs / activities. The clubs have a maximum number of 20 participants.

After the survey received 20 enollments on a club, it would not be possible to select that option anymore and just remain active the other options.

Can i do this on limesurvey?

Regards
Magda Correia
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 5 months ago #175489 by holch
Limesurvey is a survey tool and not a tool for enrollments. That said, LS does not have the feature you are looking for.

You could try to use quota, which allows to limit the number of participants for a given answer option. However, this would lead respondents to a end page (they are screened out) and not in hiding the option from display.

Unfortunately Expression Manager does not allow to access previous answers in the database (the quota count), otherwise we could hide the answer option via expression.

Denis has developed a plugin, which I think allowed access to previous answers. But I don't know exactly if this would help you in your case.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 5 months ago #175537 by DenisChenu

holch wrote: …

Denis has developed a plugin, which I think allowed access to previous answers. But I don't know exactly if this would help you in your case.

Yes, but it's done only via javascript, and use a lot Expression Manager (and not updated today).

gitlab.com/SondagesPro/getStatInSurvey


See the last example on gitlab.com/SondagesPro/getStatInSurvey#documentation

I think it can be great to have a Question template (or a plugin : question template can get quota …) to directly remove uneeded answer from HTML.
If there are some people interested, maybe i can open a liberapay.com/ system.

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.
The topic has been locked.
  • magdacorreia
  • magdacorreia's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 4 months ago #177521 by magdacorreia
Hello Denis,

thanks a lot for your plugin. I've tested your plugin and it works perfectly. But i have on question:
- Is it possible to use this statement
{if(('[P1.nb.A1]')=='0',"9.00-9.15","Horário não disponível")} to populate a multiple choice question?

Congrats for your plugin!
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 4 months ago #177523 by DenisChenu

magdacorreia wrote: thanks a lot for your plugin. I've tested your plugin and it works perfectly. But i have on question:
- Is it possible to use this statement
{if(('[P1.nb.A1]')=='0',"9.00-9.15","Horário não disponível")} to populate a multiple choice question?

It means : if nobody answer A1 to P1 (before current user) : show "9.00-9.15", else "Horário não disponível"

Yes : it's done for this

In a real situation : i use {if('[P1.nb.A1]'=='0',"9.00-9.15","")} and a javascript to hide line without label.

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.
The topic has been locked.
  • magdacorreia
  • magdacorreia's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 3 months ago #177547 by magdacorreia
Hi Denis,
Thanks for your reply.
If the expression is correct then why does it always write the ELSE statement? Even when '[P1.nb.A1]' is 0 the if statement return "Horário não disponível"

I've tryed to make a test and i believe that the value isn't an integer because if i make something like this: sum('[P1.nb.A1]',5) the value returned is always 5 even when the '[P1.nb.A1]' diferent than 0. The expression '[P1.nb.A1]' is counting correctly the number of A1 answers but it dosen't make the calc or compare well.

Is there a way to resolve this issue?

Thanks for your help,

Magda
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 3 months ago #177550 by DenisChenu
Did you try : "[P1.nb.A1]"==0 ?

Else : please : report issue on gitlab with a simple lsa file

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.
The topic has been locked.
  • magdacorreia
  • magdacorreia's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 3 months ago #177640 by magdacorreia
Hello Denis,

i've oppened an issue on Gitlab but can i make a call to [P1.nb.A1] value under a javascript function?

Thanks,
Magda Correia
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 3 months ago - 5 years 3 months ago #177659 by DenisChenu
Ok,

New version allow usage of Expression Manager with value inside question texte and question help in 3.X version.
Since answers are more hard to find : no able to fix it easily.

Alternative solution usage of css
Code:
<span class="numberhide-[P1.nb.A1]">9.00-9.15</span><span class="numbershow-[P1.nb.A1]">Horário não disponível</span>

And in css :
Code:
.numbershow-0{display:none}
.numberhide-1{display:none}

But it's really less cool … and here : you ask only one answer, more easy …

With javascript:
Code:
<span data-current=[P1.nb.A1] data-max=1>9.00-9.15</span>

and something like this
Code:
$("[data-current]").each(function() {
    if($(this).data('current') >= $(this).data('max')) {
        $(this).closest(".answer-item").hide();
    }
});

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 3 months ago by DenisChenu.
The topic has been locked.
  • magdacorreia
  • magdacorreia's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 3 months ago #177688 by magdacorreia
Hello Denis,

thanks so much for you help. Is't working perfectly :)
Regards
Magda Correia
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose