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

TOPIC: Star Ratings Workaround not working in question groups

Star Ratings Workaround not working in question groups 4 years 2 months ago #81802

Hi all! I'm very new to LimeSurvey and I'm trying to workout the star rating workaround using the codes found here: docs.limesurvey.org/Workarounds%3A+Quest...meric_Input_Question
(Numeric Input Question)

It works when I preview each question individually by entering the star rating code and the javascript onload function within the source code of each question. However, when I preview or test the question group, it changes the first question somehow to a 10 point star (instead of the 5 I've entered) and removed the star ratings for each following question in the group?? Please help. I would like to group questions.

I've tried to enter the <script> onload with each question referenced:
// Call the function for the numeric question
handleRatingNumeric (SSSSS, GG, 1); handleRatingNumeric (SSSSS, GG, 2); handleRatingNumeric (SSSSS, GG, 3);

Still, I get the same thing. I really appreciate if someone could direct me where to specifically add the script onload to get around the grouping error.

Many thanks,
Farrin
The administrator has disabled public write access.

Star Ratings Workaround not working in question groups 4 years 2 months ago #81821

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5984
  • Thank you received: 368
  • Karma: 260
1. Which Limesurvey version do you use?

2. What happens if you start the survey in group by group mode, does that match the group preview and does it show the same problems?

3. Please attach a link to an activated test survey.

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.

Star Ratings Workaround not working in question groups 4 years 2 months ago #81886

Hi Mazi, Thanks.

1. Using: Version 1.92+ Build 120608

2. I started the survey in Group by Group mode, the preview still has the funky star rating, as does the active survey.

3. Here's a link to the activated survey test:
www.lgbtstudy.org/limesurvey/index.php?sid=88863&lang=en
The administrator has disabled public write access.

Star Ratings Workaround not working in question groups 4 years 2 months ago #81887

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5984
  • Thank you received: 368
  • Karma: 260
There seems to be something wrong with the way you add the JavaScript. It seems that JS code is added at group level for three questions:
// Call the function for the numeric question
handleRatingNumeric (47926, 1, 1); handleRatingNumeric (47926, 1, 2); handleRatingNumeric (47926, 1, 3);

...and there seems to be JS code added at every question as well.

Also check if the IDs are correct.

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.

Star Ratings Workaround not working in question groups 4 years 2 months ago #81893

Sorry, I had tried adding the JS at Group level too, but it doesn't change the outcome, even when I remove. Is it correct to have the <div> call for the star ratings in each question as well as the JS code in each question with the specific IDs for each question or should the JS code only be in the first question with the multiple handleRatingNumeric call (including IDs for each question within that group)?
The administrator has disabled public write access.

Star Ratings Workaround not working in question groups 4 years 2 months ago #81908

  • tpartner
  • tpartner's Avatar
  • Online
  • LimeSurvey Team
  • Posts: 6221
  • Thank you received: 1378
  • Karma: 539
You only need to put in the code once for each page - you can call all questions on a page in the same piece of code.

Did you give unique names for the radio inputs for each question? In other words, all radios in Q1 should be named something like "q1Rate" and all in Q2 should be "q2Rate"...
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.

Star Ratings Workaround not working in question groups 4 years 2 months ago #81926

  • tpartner
  • tpartner's Avatar
  • Online
  • LimeSurvey Team
  • Posts: 6221
  • Thank you received: 1378
  • Karma: 539
Oh, and Expression Manager is screwing up your code. You now need a space after all opening curly braces and before all closing curly braces.

So this:
<input type="radio" class="star {split:2}" title="1" value="1" name="q1Rate" />

needs to be this:
<input type="radio" class="star { split:2 }" title="1" value="1" name="q1Rate" />

I've updated the workaround - docs.limesurvey.org/Workarounds%3A+Quest...meric_Input_Question
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.

Star Ratings Workaround not working in question groups 4 years 2 months ago #81983

Perfect! It worked! Thanks so much for your consistent help! I think adding a note on the workaround about adding the JS call function only on the first question within a group might be helpful for other newbs like me. And a note about changing the rate name with each question (seems obvious...now). Thanks again!! :cheer:
The administrator has disabled public write access.

Star Ratings Workaround not working in question groups 4 years 2 months ago #81985

  • tpartner
  • tpartner's Avatar
  • Online
  • LimeSurvey Team
  • Posts: 6221
  • Thank you received: 1378
  • Karma: 539
You're welcome. The workarounds are a wiki, you can add anything you feel appropriate.
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.

Star Ratings Workaround not working in question groups 4 years 2 months ago #82016

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • Moderator Lime
  • Posts: 9305
  • Thank you received: 1330
  • Karma: 386
Hello,

Too late, but there are already an advanced setting for Star rating system in LS.

See the 5 point choice advanced settings.

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.
The following user(s) said Thank You: IMPACTprogram

Star Ratings Workaround not working in question groups 4 years 2 months ago #82017

  • tpartner
  • tpartner's Avatar
  • Online
  • LimeSurvey Team
  • Posts: 6221
  • Thank you received: 1378
  • Karma: 539
In 1.92?

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.

Star Ratings Workaround not working in question groups 4 years 2 months ago #82019

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • Moderator Lime
  • Posts: 9305
  • Thank you received: 1330
  • Karma: 386
Look at use slider layout.

Think it's best to rework on this (and on another system) nut existing.

:)

PS: master : limesurvey.sondages.pro/index.php?sid=46854&newtest=Y&lang=en
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
Last Edit: 4 years 2 months ago by DenisChenu.
The administrator has disabled public write access.

Star Ratings Workaround not working in question groups 4 years 2 months ago #82041

  • tpartner
  • tpartner's Avatar
  • Online
  • LimeSurvey Team
  • Posts: 6221
  • Thank you received: 1378
  • Karma: 539
Okay, now I see it but why would it be called "Use slider layout" when it has nothing to do with sliders but refers to stars?

And, of course, it doesn't help if you want 1/2 stars or 10 stars...

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.

Star Ratings Workaround not working in question groups 4 years 2 months ago #82074

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5984
  • Thank you received: 368
  • Karma: 260
I think we should rename that, maybe to "Use different layout".

What do you think?

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.

Star Ratings Workaround not working in question groups 4 years 2 months ago #82082

  • tpartner
  • tpartner's Avatar
  • Online
  • LimeSurvey Team
  • Posts: 6221
  • Thank you received: 1378
  • Karma: 539
"Alternate layouts"
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.
  • Page:
  • 1
  • 2
Moderators: ITEd
Time to create page: 0.472 seconds
Imprint                   Data Protection Statement                  Revocation information and revocation form