- Posts: 10230
- Thank you received: 3551
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
array with stars
9 years 10 months ago - 9 years 10 months ago #98450
by tpartner
Assuming your larger background images are named star_x32.gif and delete_x32.gif, these changes to jquery.rating.css should do the trick:
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic array with stars
Can you assist in what needs to be changed to have the area that could, for example, accomodate «a star» with 32x32px?
Assuming your larger background images are named star_x32.gif and delete_x32.gif, these changes to jquery.rating.css should do the trick:
Code:
/* jQuery.Rating Plugin CSS - http://www.fyneworks.com/jquery/star-rating/ */ div.rating-cancel,div.star-rating{float:left;width:33px;height:31px;text-indent:-999em;cursor:pointer;display:block;background:transparent;overflow:hidden} div.rating-cancel,div.rating-cancel a{background:url(delete_x32.gif) no-repeat 0 -32px} div.star-rating,div.star-rating a{background:url(star_x32.gif) no-repeat 0 0px} div.rating-cancel a,div.star-rating a{display:block;width:32px;height:100%;background-position:0 0px;border:0} div.star-rating-on a{background-position:0 -32px!important} div.star-rating-hover a{background-position:0 -64px} /* Read Only CSS */ div.star-rating-readonly a{cursor:default !important} /* Partial Star CSS */ div.star-rating{background:transparent!important;overflow:hidden!important} /* END jQuery.Rating Plugin CSS */
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 9 years 10 months ago by tpartner.
The topic has been locked.
9 years 10 months ago #98451
by tpartner
You can just remove the { split:2 } metadata, so the inputs inserted into the question source would look like:
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic array with stars
I would really like a 10 point star option...
You can just remove the { split:2 } metadata, so the inputs inserted into the question source would look like:
Code:
<div id="starContainer"> <input type="radio" class="arrayStar" title="1" value="1" name="q1Rate" /> <input type="radio" class="arrayStar" title="2" value="2" name="q1Rate" /> <input type="radio" class="arrayStar" title="3" value="3" name="q1Rate" /> <input type="radio" class="arrayStar" title="4" value="4" name="q1Rate" /> <input type="radio" class="arrayStar" title="5" value="5" name="q1Rate" /> <input type="radio" class="arrayStar" title="6" value="6" name="q1Rate" /> <input type="radio" class="arrayStar" title="7" value="7" name="q1Rate" /> <input type="radio" class="arrayStar" title="8" value="8" name="q1Rate" /> <input type="radio" class="arrayStar" title="9" value="9" name="q1Rate" /> <input type="radio" class="arrayStar" title="10" value="10" name="q1Rate" /> </div>
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
9 years 5 months ago #103075
by dweisser
Replied by dweisser on topic array with stars
TPartner,
I'm trying to implement half-stars, following the workaround in the manual, but all I still get 10. All is well otherwise, all formatting is right so I know the CSS is linked), and the two JS files are in the same place. It's as though the {split:2} is not being recognized. Any thoughts?
I put up a test survey in case you had a moment to look-see. here
As always, thank you.
David
I'm trying to implement half-stars, following the workaround in the manual, but all I still get 10. All is well otherwise, all formatting is right so I know the CSS is linked), and the two JS files are in the same place. It's as though the {split:2} is not being recognized. Any thoughts?
I put up a test survey in case you had a moment to look-see. here
As always, thank you.
David
The topic has been locked.
9 years 5 months ago - 9 years 5 months ago #103076
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic array with stars
I'm not sure what the problem is there but here's a working survey and template(install the template before the survey).
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Attachments:
Last edit: 9 years 5 months ago by tpartner.
The topic has been locked.
7 years 11 months ago #121500
by surveyman
Replied by surveyman on topic array with stars
*Bump*
Does somebody still uses this workaround on Limesurvey 2.0 (not necessarily in an array)?
I installed the examples, but for some unknown reason they won't work (radio buttons are displayed instead of stars).
Does somebody still uses this workaround on Limesurvey 2.0 (not necessarily in an array)?
I installed the examples, but for some unknown reason they won't work (radio buttons are displayed instead of stars).
The topic has been locked.
7 years 11 months ago #121526
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic array with stars
What exact version of LimeSurvey are you using? Can you activate a test survey for us to see?
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
7 years 11 months ago #121567
by surveyman
Replied by surveyman on topic array with stars
I am using Version 2.05+ Build 141020
I cannot activate a test survey, but I tried several examples from the forum. For example your survey in post #103076. I attached a screenshot of how it looks like.
I cannot activate a test survey, but I tried several examples from the forum. For example your survey in post #103076. I attached a screenshot of how it looks like.
Attachments:
The topic has been locked.
7 years 11 months ago - 7 years 11 months ago #121569
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic array with stars
In jquery.rating.js of that template, remove these lines (we don't care about IE6 anymore):
New template attached:
Code:
// IE6 Background Image Fix if ($.browser.msie) try { document.execCommand("BackgroundImageCache", false, true)} catch(e) { }; // Thanks to http://www.visualjquery.com/rating/rating_redux.html
New template attached:
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Attachments:
Last edit: 7 years 11 months ago by tpartner.
The topic has been locked.
7 years 11 months ago #121578
by surveyman
Replied by surveyman on topic array with stars
Thanks, I did. The problem I described is visible in Internet Explorer (a newer version) as well as in Google Chrome (I didn't test other browsers).
The topic has been locked.
7 years 11 months ago #121581
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic array with stars
Sorry, it works for me in all browsers and without seeing a live example it's impossible to debug.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
7 years 11 months ago #121591
by surveyman
Replied by surveyman on topic array with stars
I understand. Maybe I should update Limesurvey. Do you use another version/build?
The topic has been locked.
7 years 11 months ago #121599
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic array with stars
I tested on build 150520.
Do you have any JavaScript errors in the console?
Do you have any JavaScript errors in the console?
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: surveyman
The topic has been locked.