Check out the LimeSurvey source code on GitHub!
Welcome, Guest
Username: Password:

TOPIC: referencing the SxGxQ in a question

referencing the SxGxQ in a question 5 years 7 months ago #56271

  • timbee
  • timbee's Avatar
  • Offline
  • Junior Lime
  • Posts: 20
  • Thank you received: 1
  • Karma: 1
If you have ever written a question that requires you to do something special with JavaScript, like hiding the question's input field, etc, then you might find this useful..

instead of manually putting the questions ID code, like 4352x53x182, in the JS, you can now simple reference it using the template variable {SGQ} (stands for Survey, question Group, Question).

It was just an additional four lines of code. I used version 1.9.1 RC3 as the base. If you'd like to use it, you can download the file here:

groundless.org/stuff/limesurvey-1.9.1-rc3-timbee-1.tar.gz

cheers
The administrator has disabled public write access.
The following user(s) said Thank You: sig_block

referencing the SxGxQ in a question 5 years 7 months ago #56280

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6009
  • Thank you received: 371
  • Karma: 260
Please open a new ticket at our Bugtracker at "user patches2, submit your files and add some explanation. We can then try to integrate this into the core.

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.

referencing the SxGxQ in a question 5 years 7 months ago #56282

  • timbee
  • timbee's Avatar
  • Offline
  • Junior Lime
  • Posts: 20
  • Thank you received: 1
  • Karma: 1
The administrator has disabled public write access.

referencing the SxGxQ in a question 5 years 7 months ago #56343

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • Moderator Lime
  • Posts: 9352
  • Thank you received: 1340
  • Karma: 386
timbee wrote: Thanks , it can be a good idea.

In general, it's best to have diif files :).

Did you comment your modification with some specific word ?
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.

referencing the SxGxQ in a question 5 years 7 months ago #56348

  • timbee
  • timbee's Avatar
  • Offline
  • Junior Lime
  • Posts: 20
  • Thank you received: 1
  • Karma: 1
Thanks , it can be a good idea.
Sweet!
In general, it's best to have diif files :).
I've never submitted a patch to anything before, haha. So I'll do a little research. thanks for the heads up :)
Did you comment your modification with some specific word ?
Not in the code itself, but in the mantis patch report yes, I mentioned where I added each of the four lines. It didn't seem like it needed commenting, since it was placed with other lines that were very similar (ie: variable assignment)
Last Edit: 5 years 7 months ago by timbee.
The administrator has disabled public write access.

referencing the SxGxQ in a question 5 years 7 months ago #56349

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • Moderator Lime
  • Posts: 9352
  • Thank you received: 1340
  • Karma: 386
timbee wrote:
Thanks , it can be a good idea.
Sweet!
In general, it's best to have diif files :).
I've never submitted a patch to anything before, haha. So I'll do a little research. thanks for the heads up :)
Did you comment your modification with some specific word ?
Not in the code itself, but in the mantis patch report yes, I mentioned where I added each of the four lines. It didn't seem like it needed commenting, since it was placed with other lines that were very similar (ie: variable assignment)
It's to find more eaily the modification :)

For diff in gnu/linux it's very easyr (diff directory1 directory2 > diff.patch).

With windows : maybe with gnuwin32.sourceforge.net/packages/diffutils.htm
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.

referencing the SxGxQ in a question 5 years 7 months ago #56360

  • timbee
  • timbee's Avatar
  • Offline
  • Junior Lime
  • Posts: 20
  • Thank you received: 1
  • Karma: 1
For diff in gnu/linux it's very easyr (diff directory1 directory2 > diff.patch).

That's easy :D thanks for the tip. Patch created based on latest svn build (9742) and uploaded to mantis
The administrator has disabled public write access.

referencing the SxGxQ in a question 5 years 7 months ago #56394

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • Moderator Lime
  • Posts: 9352
  • Thank you received: 1340
  • Karma: 386
Great !

And thanks !
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.

referencing the SxGxQ in a question 5 years 7 months ago #56610

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6009
  • Thank you received: 371
  • Karma: 260
Thanks for your patch, we'll review it.

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.

referencing the SxGxQ in a question 5 years 7 months ago #56749

  • timbee
  • timbee's Avatar
  • Offline
  • Junior Lime
  • Posts: 20
  • Thank you received: 1
  • Karma: 1
Cool, thanks guys! The patch has been included in svn build 9755 :D

Documentation updated:
Dynamically reference the SGQ identifier
Custom javascript code to hide answer elements
Template keywords
The administrator has disabled public write access.

referencing the SxGxQ in a question 5 years 7 months ago #56774

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6009
  • Thank you received: 371
  • Karma: 260
Thanks for all your help. If you develop further features, please let us know :)

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.

referencing the SxGxQ in a question 5 years 7 months ago #56854

  • timbee
  • timbee's Avatar
  • Offline
  • Junior Lime
  • Posts: 20
  • Thank you received: 1
  • Karma: 1
You're welcome, and thank *you* Mazi, you spend so much of your time helping the LimeSurvey project. Hopefully I can contribute more in the near future :)
The administrator has disabled public write access.

referencing the SxGxQ in a question 5 years 7 months ago #56860

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6009
  • Thank you received: 371
  • Karma: 260
We are always willed to implement user patches into the core.

@all: Please have a look at this page before starting to develop features:

docs.limesurvey.org/How+to+contribute+new+features

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.
Time to create page: 0.957 seconds
Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form