View Issue Details

This bug affects 1 person(s).
 4
IDProjectCategoryView StatusLast Update
05375Bug reportsData Entry (non public)public2011-09-21 17:12
Reporterwabrit Assigned Toc_schmitz  
PrioritynormalSeveritypartial_block 
Status closedResolutionwon't fix 
Product Version1.91+ 
Summary05375: Script not running for hidden questions
Description

If you hide a question (by setting "Always hide this question" to Yes), then any script embedded in the question text is not executed.

This is important for surveys where hidden questions are used to store calculated answers (e.g. assessment scores), but it is desired not to show the answer to the user.

Although a similar effect can be achieved without setting "Always hide this question" to Yes (by having the script dynamically set the display style on the question to none), this is much less satisfactory as the indication that the question should be hidden is lost to other tools.

Steps To Reproduce
  1. Create an assessment survey.
  2. Create a question Q1 with some associated script to store {ASSESSMENT_CURRENT_TOTAL} as the answer.

If the question Q1 is not hidden, then the response record in the database stores the assessment total.

If the question Q1 then has "Always hide this question" set to Yes, then NULL is stored for the answer in the database response r

TagsNo tags attached.
Bug heat4
Complete LimeSurvey version number (& build)10604
I will donate to the project if issue is resolvedNo
Browser Chrome/IE/Firefox
Database type & versionMS SQL Server 2008 R2
Server OS (if known)Windows 7
Webserver software & version (if known)Tomcat 6.0.32
PHP Version5.3.6

Users monitoring this issue

There are no users monitoring this issue.

Activities

c_schmitz

c_schmitz

2011-08-02 17:20

administrator   ~15941

Sorry, this is the intended behaviour for this setting.

Mazi

Mazi

2011-09-21 16:35

updater   ~16315

Last edited: 2011-09-21 16:53

To hide a question using Javascript you first have to disable the internal XSS filter at the admin section (global settings -> security -> "Filter HTML for XSS = 'no'").
Then you have to edit the according question. Edit the question text in source code mode (see http://docs.limesurvey.org/First+login+-+Your+user+preferences#X._Source_code_mode:) and add this snippet at the end of the text:
[code]

<script>
$(document).ready(function()
{
$('#question4444').hide();
});
</script>

[/code]
You have to replace the question ID ("4444") with the ID of the current question (see http://docs.limesurvey.org/SGQA+identifier&amp;structure=English+Instructions+for+LimeSurvey#General_Description).

Issue History

Date Modified Username Field Change
2011-08-02 16:10 wabrit New Issue
2011-08-02 17:20 c_schmitz Note Added: 15941
2011-08-02 17:20 c_schmitz Status new => closed
2011-08-02 17:20 c_schmitz Assigned To => c_schmitz
2011-08-02 17:20 c_schmitz Resolution open => won't fix
2011-09-21 16:35 Mazi Note Added: 16315
2011-09-21 16:35 Mazi Status closed => feedback
2011-09-21 16:35 Mazi Resolution won't fix => reopened
2011-09-21 16:35 Mazi Status feedback => closed
2011-09-21 16:35 Mazi Resolution reopened => won't fix
2011-09-21 16:53 Mazi Status closed => feedback
2011-09-21 16:53 Mazi Resolution won't fix => reopened
2011-09-21 16:53 Mazi Note Edited: 16315
2011-09-21 17:12 Mazi Status feedback => closed
2011-09-21 17:12 Mazi Resolution reopened => won't fix