View Issue Details

This bug affects 1 person(s).
 8
IDProjectCategoryView StatusLast Update
06014Bug reportsOtherpublic2012-04-18 22:59
Reportermr2jswe Assigned ToTMSWhite  
PrioritynormalSeverityminor 
Status closedResolutionno change required 
Product Version1.92+ 
Fixed in Version1.92+ 
Summary06014: When randomizing questions, the data-tables didnt register the right randomized numbers, or the right answers.
Description

See the link under how to reproduce. The randomized numbers (1-6) registered as other numbers (1-6) and a lot of the answers never got registered, just NULL.

I had three groups with three questions in each, naming the questions G1Q1 for Group1 Question 1 and so on. When comparing which questions got randomized, with what got registered in the data table, there was a severe mismatch. I also compared the questions answered with what got registered in the data-tables, and maybe just 1/3 registered. I uploaded a version of my survey in the forum post.

However Thomas White came up with a workaround for it, see end of the post on forum.

Steps To Reproduce

http://www.limesurvey.org/en/forum/can-i-do-this-with-limesurvey/78437-just-show-one-question-from-randomized-group-hide-the-others

TagsNo tags attached.
Attached Files
Bug heat8
Complete LimeSurvey version number (& build)120405
I will donate to the project if issue is resolvedNo
Browser
Database type & versionMySQL mysqlnd 5.0.8-dev - 20102224 - $Revision: 310735 $
Server OS (if known)PC WAMP Server
Webserver software & version (if known)Apache/2.2.21 (Win64) PHP/5.3.8
PHP VersionPHP Version 5.3.8

Users monitoring this issue

mr2jswe

Activities

TMSWhite

TMSWhite

2012-04-15 23:14

reporter   ~18357

Please attach the actual survey demonstrating the problem.

For this bug, I believe that Mazi wants to see why the JavaScript solution, e.g. the one referenced in your post (http://www.limesurvey.org/forum/can-i-do-this-with-limesurvey/78437-just-show-one-question-from-randomized-group-hide-the-others?lang=en#78686), did not work.

mr2jswe

mr2jswe

2012-04-16 12:44

reporter   ~18366

Ok, thanks for clarifying. I have attached the survey gone bad with the Java script solution to the same problem. It contains 4 questions in one group.

First question randomizes a number, and it seems to output fine in the short text window. The same number however cant seem to be referenced through Relevance field (on the subsequent questions). Its like it was never there, and the data-tables dont register it either - NULL.

So, it pops up, visible to see (just run the survey) but I dont seem to be able to use it somehow.

TMSWhite

TMSWhite

2012-04-16 16:08

reporter   ~18378

This isn't a bug in LS, but perhaps highlights a need to clarify how best to use custom JavaScript with Expression Manager.

Your custom JavaScript should have been:

<script type="text/javascript">
<!--
$(document).ready(function()
{
// Find a random number between 1 and 4
var randNumber = Math.floor(Math.random()*3 + 1);
$('input#answer12739X218X3728').val(randNumber);
checkconditions(randNumber,'12739X218X3728','text');
})
//-->
</script>

Checkconditions() must be called in order for EM to process the new value you set for the variable (e.g. to ensure that the new value is stored within the hidden variables that are submitted, and call the relevance equations to change which questions are visible).

c_schmitz

c_schmitz

2012-04-18 22:59

administrator   ~18425

1.92+ Build 120418 released

Issue History

Date Modified Username Field Change
2012-04-15 23:06 mr2jswe New Issue
2012-04-15 23:14 TMSWhite Note Added: 18357
2012-04-15 23:14 TMSWhite Status new => feedback
2012-04-16 12:34 mr2jswe Issue Monitored: mr2jswe
2012-04-16 12:35 mr2jswe File Added: limesurvey_survey_12739.lss
2012-04-16 12:44 mr2jswe Note Added: 18366
2012-04-16 12:44 mr2jswe Status feedback => new
2012-04-16 13:45 Mazi Assigned To => TMSWhite
2012-04-16 13:45 Mazi Status new => assigned
2012-04-16 16:08 TMSWhite Note Added: 18378
2012-04-16 16:08 TMSWhite Status assigned => resolved
2012-04-16 16:08 TMSWhite Resolution open => no change required
2012-04-16 16:08 TMSWhite File Added: limesurvey_survey_12739-v2.lss
2012-04-18 22:58 c_schmitz Fixed in Version => 1.92+
2012-04-18 22:59 c_schmitz Note Added: 18425
2012-04-18 22:59 c_schmitz Status resolved => closed