Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: Star Ratings Workaround not working in question groups

Star Ratings Workaround not working in question groups 2 years 4 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.

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

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5331
  • Thank you received: 296
  • Karma: 249
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.

Re: Star Ratings Workaround not working in question groups 2 years 4 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.

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

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5331
  • Thank you received: 296
  • Karma: 249
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.

Re: Star Ratings Workaround not working in question groups 2 years 4 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.

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

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4272
  • Thank you received: 806
  • Karma: 369
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.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

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

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4272
  • Thank you received: 806
  • Karma: 369
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.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

Re: Star Ratings Workaround not working in question groups 2 years 4 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.

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

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4272
  • Thank you received: 806
  • Karma: 369
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.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

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

  • DenisChenu
  • DenisChenu's Avatar
  • NOW ONLINE
  • Moderator Lime
  • Posts: 6451
  • Thank you received: 844
  • Karma: 249
Hello,

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

See the 5 point choice advanced settings.

Denis
The administrator has disabled public write access.
The following user(s) said Thank You: IMPACTprogram
  • Page:
  • 1
  • 2
Moderators: ITEd
Time to create page: 0.139 seconds
Donation Image