Welcome, Guest
Username: Password: Remember me

TOPIC: Display Hidden Fields in Survey during Testing Phase

Display Hidden Fields in Survey during Testing Phase 1 year 8 months ago #83826

  • utsi
  • utsi's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 25
  • Thank you received: 1
  • Karma: -2
I'm assuming whenever array filter or array filter exclusion is used a hidden field is created to pass the value between pages. If that is the case, may I know in which function are those hidden fields created so that I can change their 'type' attribute?

What I'm looking for is to show those fields in the question page during the testing phase (i.e. inactive surveys).

Thanks,
Safdar
The administrator has disabled public write access.

Re: Display Hidden Fields in Survey during Testing Phase 1 year 8 months ago #83839

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 5838
  • Thank you received: 714
  • Karma: 222
Hello,

It's in $_SESSION, not in hidden field.

For hidden input, some for "javascript" access, all in qanda.php i think.

Denis
The administrator has disabled public write access.

Re: Display Hidden Fields in Survey during Testing Phase 1 year 8 months ago #83847

  • utsi
  • utsi's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 25
  • Thank you received: 1
  • Karma: -2
Thanks for replying. So if I want to echo those $_SESSION variables, I'll have to look for them in the index.php file?

Also could you please tell the format of the session variable used? For ex: $_SESSION[survey_id - group_id - question_id]
Last Edit: 1 year 8 months ago by utsi.
The administrator has disabled public write access.

Re: Display Hidden Fields in Survey during Testing Phase 1 year 8 months ago #83850

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 5838
  • Thank you received: 714
  • Karma: 222
Hello,

Test first with:
[code type=php-brief]echo "<pre>".var_export ($_SESSION,true)."</pre>";[/code]

But you can search for:
[code type=php-brief]<input type='hidden'[/code] in classes/expressions/LimeExpressionManager

For debug purpose, you can use some javascript to remove the type='hidden' .

Something like that
$("input[type='hidden']").each(function(){
  var name = $(this).attr('name'); // grab name of original
  var value = $(this).attr('value'); // grab value of original
  /* create new visible input */
  var html = 'hidden'+name+' <input type="text" name="'+name+'" value="'+value+'" />';
  $(this).after(html).remove(); // add new, then remove original input
});

Denis
Last Edit: 1 year 8 months ago by DenisChenu. Reason: code type
The administrator has disabled public write access.
The following user(s) said Thank You: utsi

Re: Display Hidden Fields in Survey during Testing Phase 1 year 8 months ago #83866

  • TMSWhite
  • TMSWhite's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 759
  • Thank you received: 81
  • Karma: 36
utsi wrote:
I'm assuming whenever array filter or array filter exclusion is used a hidden field is created to pass the value between pages. If that is the case, may I know in which function are those hidden fields created so that I can change their 'type' attribute?

What I'm looking for is to show those fields in the question page during the testing phase (i.e. inactive surveys).

Another option is to use templates for this. For example, if you copy the default template, you can replace this section:
<td class="survey-question-help">
	{QUESTIONHELP}
</td>

with this:
<td class="survey-question-help">
	{QUESTIONHELP}
	{if(ACTIVE,"",
		implode("","<table border='1'><tr><th>SGQA</th><th>",implode("</th><th>",self.sgqa),"</th></tr>",
		"<tr><td>RelevanceStatus</td><td>",implode("</td><td>",self.relevanceStatus),"</td></tr>",
		"<tr><td>Value</td><td>",implode("</td><td>",self),"</td></tr></table>"))}
</td>

That will auto-format a table within the Help section that shows (for only inactive surveys), the variable names, relevance status, and current value; and those values will update automatically as you enter data. Since it is using the self variable, it auto-expands for every possible question type so you don't need to hard-code any SGQA values and you can make this a general part of your templates.

Here is what that looks like for the default template:
Attachments:
The administrator has disabled public write access.
The following user(s) said Thank You: utsi

Re: Display Hidden Fields in Survey during Testing Phase 1 year 8 months ago #83936

  • TMSWhite
  • TMSWhite's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 759
  • Thank you received: 81
  • Karma: 36
utsi-

Looks like {ACTIVE} didn't make it into the 120725 release. 'self' was available as of 120711. So, you may need to wait a week for the next 1.92+ release.

Also, self.SGQA should be all lowercase, not uppercase for SGQA as it displays in these posts.

/Tom
The administrator has disabled public write access.
The following user(s) said Thank You: utsi

Re: Display Hidden Fields in Survey during Testing Phase 1 year 8 months ago #83958

  • utsi
  • utsi's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 25
  • Thank you received: 1
  • Karma: -2
Oh..no worries. Thanks for taking out time to reply back.
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.252 seconds
Donation Image