Willkommen, Gast
Benutzername: Passwort: Angemeldet bleiben:
  • Seite:
  • 1
  • 2

THEMA: Find 3 highest or lowest rated options in Array (Numbers) question?

Find 3 highest or lowest rated options in Array (Numbers) question? 1 Jahr 3 Monate her #99066

  • tpartner
  • tpartners Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 4369
  • Dank erhalten: 828
  • Karma: 381
Oh, one other note - I set the Array (numbers) question to display answers in random order.
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.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Find 3 highest or lowest rated options in Array (Numbers) question? 1 Jahr 2 Monate her #99411

  • cberghoff
  • cberghoffs Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 12
  • Karma: 0
Hey Tony,

Thanks for all your help. Of course, my dissertation committee requested a change, but I was able to modify your code (I only ended up needing the bottom 3).

The js works perfectly, as long as both the number array and checkbox questions are visible. I tried putting the js in an equation question and that worked when hidden, but not if I hid either of the other two items. Indeed, the source code does not include the non-equation-type questions that are set to always hide from users, so obviously the script won't run if included in, or find the items it is looking for, when items are hidden.

I'm working on hiding the questions using CSS (so far unsuccessfully), but this really seems to be an oversight in LS. Shouldn't 'always hide from users' just set the style to display: hidden and perhaps modify the 'required' property, rather than remove the item from the source? Seems that others are expecting a different behavior as well (www.limesurvey.org/en/forum/design-issue...ding-questions#99067) and your comments here lead me to believe you expected something different too.

Any suggestions?

Thanks,
Chris
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Find 3 highest or lowest rated options in Array (Numbers) question? 1 Jahr 2 Monate her #99412

  • tpartner
  • tpartners Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 4369
  • Dank erhalten: 828
  • Karma: 381
Yeah, I really never understood the thinking behind the "always hide" setting either.

You can hide the multiple-options question(s) with JavaScript.

After this line:
var bottomQID = $(bottomQ).attr('id').split('question')[1];


Add this:
		// Hide the multiple-options questions
		$(topQ).hide();
		$(bottomQ).hide();
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.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Find 3 highest or lowest rated options in Array (Numbers) question? 1 Jahr 2 Monate her #99414

  • cberghoff
  • cberghoffs Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 12
  • Karma: 0
I have the question id, so I'm using ...

$('#question10426').hide();

etc., in a hidden equation question at the beginning of the group, but now I need to click the next button at the end because an empty group is showing to the user :(

Do you know a quick way to do this?

Chris
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Find 3 highest or lowest rated options in Array (Numbers) question? 1 Jahr 2 Monate her #99417

  • cberghoff
  • cberghoffs Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 12
  • Karma: 0
Never mind, I got it from one of your earlier posts. I'll also post a copy of the group with a description so others can use in the future.

Thanks again Tony. You've really been a lifesaver on this!!

Chris
Der Administrator hat öffentliche Schreibrechte deaktiviert.
  • Seite:
  • 1
  • 2
Moderatoren: ITEd
Ladezeit der Seite: 0.132 Sekunden
Donation Image