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

TOPIC: referencing the SxGxQ in a question

referencing the SxGxQ in a question 3 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

Re: referencing the SxGxQ in a question 3 years 7 months ago #56280

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

Re: referencing the SxGxQ in a question 3 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.

Re: referencing the SxGxQ in a question 3 years 7 months ago #56343

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6318
  • Thank you received: 812
  • Karma: 242
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 ?
The administrator has disabled public write access.

Re: referencing the SxGxQ in a question 3 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: 3 years 7 months ago by timbee.
The administrator has disabled public write access.

Re: referencing the SxGxQ in a question 3 years 7 months ago #56349

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6318
  • Thank you received: 812
  • Karma: 242
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
The administrator has disabled public write access.

Re: referencing the SxGxQ in a question 3 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.

Re: referencing the SxGxQ in a question 3 years 7 months ago #56394

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6318
  • Thank you received: 812
  • Karma: 242
Great !

And thanks !
The administrator has disabled public write access.

Re: referencing the SxGxQ in a question 3 years 7 months ago #56610

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

Re: referencing the SxGxQ in a question 3 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.
  • Page:
  • 1
  • 2
Moderators: ITEd
Time to create page: 0.130 seconds
Donation Image