Piping Ticked item from "Multiple question types in array" to ranking

More
4 years 11 months ago #86272 by isme_tze
isme_tze created the topic: Piping Ticked item from "Multiple question types in array" to ranking
Hi LS expert,

I am a LS newbie. I have no problem following "Multiple question types in array" code show here and create questions like follow. I have 2 different question groups for 2 different categories.



However, my questions is I want to use the "Ticked" items from both question groups into ranking system (only rank top 5 from x ticked items from both groups). Now I am stuck.

Can someone please help?

Your help is much appreciated.

Regards
Tze
Attachments:

Please Log in to join the conversation.

More
4 years 11 months ago - 4 years 11 months ago #86289 by TMSWhite
TMSWhite replied the topic: Piping Ticked item from "Multiple question types in array" to ranking
In version 2.0, you can use the array_filter advanced question option to pipe your checked products to rankings. The attached survey (also found in the /docs/demosurveys directory of your installation) shows many permutations of using various source question types to filter other question types, including ranking.


ls2_array_filter_tests.lss


Version 1.92 supports the same degree of filtering with one exception - ranking questions. Because of the way the JavaScript is implemented in 1.92 for ranking, it is not possible to filter it consistently across all browsers, so using array_filter within ranking questions is disabled in 1.92.
Last Edit: 4 years 11 months ago by TMSWhite.

Please Log in to join the conversation.

More
4 years 11 months ago #86299 by isme_tze
isme_tze replied the topic: Piping Ticked item from "Multiple question types in array" to ranking
HI TMSWhite,

Thanks for you prompt reply. sorry i forgot to mention that i am using LS Version 1.92+ Build 120405. I dont have admin right on LS. Furthermore, EM is disable due to unknown reason.

Can you please re-attach the Array Filter test .lss file again?

Regards
Tze

Please Log in to join the conversation.

More
4 years 11 months ago #86361 by isme_tze
isme_tze replied the topic: Piping Ticked item from "Multiple question types in array" to ranking
Any one? any idea? please help.


Attachments:

Please Log in to join the conversation.

More
4 years 11 months ago #86362 by TMSWhite
TMSWhite replied the topic: Piping Ticked item from "Multiple question types in array" to ranking
You can't do this in 1.92 - that feature has been disabled due to cross-browser incompatibilities (if memory serves, it works for Firefox or Chrome, but not for IE).

However, it does work "out of the box" in version 2.0 using array_filter.

If you want to patch your 1.92installation to have it work there (for the few supported browsers), un-comment line 1102 in /classes/expressions/LimeExpressionManger.php. It is the line:
//   case 'R': //Ranking

within this block of code:
  case 'P': //Multiple choice with comments checkbox + text
  case 'K': //MULTIPLE NUMERICAL QUESTION
  case 'Q': //MULTIPLE SHORT TEXT
//   case 'R': //Ranking
//      if ($this->sgqaNaming)
//      {
          foreach ($cascadedAF as $_caf)
          {

Please Log in to join the conversation.

More
4 years 11 months ago #86410 by tpartner
tpartner replied the topic: Piping Ticked item from "Multiple question types in array" to ranking
With a little tweaking you may be able to use this workaround - docs.limesurvey.org/Workarounds%3A+Manip...ith_Multiple-Options

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

More
4 years 11 months ago #86428 by isme_tze
isme_tze replied the topic: Piping Ticked item from "Multiple question types in array" to ranking
Thank for pointing out the workaround, tpartner. Will that work on my situation since all answer items show in the Demo is in the same question, whereby for mine, each item is a separate question.

I have not performed any programming for a long long time, since basic lauguage (and I don’t know how to program in LS). However, based on the javascript syntax display in all workarounds, in logical thinking, I come up with this conceptual logic as follow. conceptually I believe it should work. However, I need help with this, can you please help?




Regards
Tze
Attachments:

Please Log in to join the conversation.

More
4 years 11 months ago #86431 by tpartner
tpartner replied the topic: Piping Ticked item from "Multiple question types in array" to ranking
I think if you use the "FOR FILTER AND RANKING QUESTIONS ON SEPARATE PAGES" method of the workaround you can filter the multiple-choice question on page 2 by all of the multiple-choice questions on page 1. The "Array filter" setting allows for several question codes.

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: isme_tze

Please Log in to join the conversation.

More
4 years 11 months ago - 4 years 11 months ago #86433 by isme_tze
isme_tze replied the topic: Piping Ticked item from "Multiple question types in array" to ranking
Hi tpartner,

Thank you very much for you help. Do you have the Demo code (lss "FOR FILTER AND RANKING QUESTIONS ON SEPARATE PAGES") that i can try?

Another thing that I would highlight is that I am NOT the LS admin and I cant change any setting on LS. I cant even use LS EM due to unknown reason.

Regards
Tze
Last Edit: 4 years 11 months ago by isme_tze.

Please Log in to join the conversation.

More
4 years 11 months ago #86442 by tpartner
tpartner replied the topic: Piping Ticked item from "Multiple question types in array" to ranking

Do you have the Demo code

You can find the code in the workaround - docs.limesurvey.org/Workarounds%3A+Manip...ith_Multiple-Options

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

More
4 years 11 months ago #86446 by isme_tze
isme_tze replied the topic: Piping Ticked item from "Multiple question types in array" to ranking
Dear tpartner,

Once again, thank you very much for your prompt reply. I did have a close inspection on the code that you have suggested, however, it seems that this workaround only work on one question group (whereby I will need to pipe and combine two question groups). How do I combine ticked items from both Question Groups into the same ranking question?

By the way, do you have the LS exported structure file (.lss) for "FOR FILTER AND RANKING QUESTIONS ON SEPARATE PAGES"? I might be able tweak it if I can have a bigger picture.

Regards
Tze

Please Log in to join the conversation.

More
4 years 11 months ago #86447 by tpartner
tpartner replied the topic: Piping Ticked item from "Multiple question types in array" to ranking

How do I combine ticked items from both Question Groups into the same ranking question?

Please see my previous comments about using several question codes in the array filter setting.

Attached are the Demo survey and template.

File Attachment:

File Name: limesurvey...0-04.lss
File Size:43 KB


File Attachment:

File Name: default_ra...lter.zip
File Size:48 KB

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Attachments:

Please Log in to join the conversation.

More
4 years 11 months ago #86450 by isme_tze
isme_tze replied the topic: Piping Ticked item from "Multiple question types in array" to ranking
i really dont think it work for me as i cant edit the template.js file. without editing the template.js file, this is what i got from the lss file.










looks like i am hitting a brick wall.

anyway, i still appreciate your help, tpartner.

wish me good luck and hope to come up with a workaround......
Attachments:

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now