View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 07252 | Bug reports | Other | public | 2013-01-30 15:59 | 2013-01-31 14:15 |
| Reporter | Anaben11 | Assigned To | c_schmitz | ||
| Priority | high | Severity | minor | ||
| Status | closed | Resolution | fixed | ||
| Product Version | 2.00+ | ||||
| Summary | 07252: using rand() and mandatory simultaneously | ||||
| Description | The survey is supposed to show one randomly chosen question from a pool of 31 questions. This random question needs to be set on "mandatory". In the random question I use rand(1,31), the relevance equations for the other questions are set to randnumber.NAOK==x. Thank you for your help. | ||||
| Tags | No tags attached. | ||||
| Attached Files | |||||
| Bug heat | 10 | ||||
| Complete LimeSurvey version number (& build) | 130129 | ||||
| I will donate to the project if issue is resolved | No | ||||
| Browser | |||||
| Database type & version | mysqlnd 5.0.8-dev - 20102224 | ||||
| Server OS (if known) | Linux web102 3.0.51-0.7.9 | ||||
| Webserver software & version (if known) | didn't manage to find out | ||||
| PHP Version | 5.3.14 | ||||
| Git branch / Pull Request URL | |||||
|
In the advanced question settings of the equation question type you can set that numbers are returned only - otherwise the comparison will be against strings and that's why it does not work. |
|
|
Hi Carsten, thanks for the hint. I have imported the attached survey, set the related question attribute to numbers only as suggested and then activated and tested the survey (using latest Limesurvey 2 version). At some of my tests I wasn't able to proceed after having answered the first question. Though an answer was given, the mandatory warning shows up. So there seems to be some problem with the mandatory validation. Can you have another look?! |
|
|
I did not have that problem. It is also completely unrelated to this issue. |
|
|
Confirmed:
The 2 question have different number 99 time for 100. Upload test survey Alternative: |
|
|
This is not a bug. See http://www.limesurvey.org/en/forum/design-issues/82187-problems-randomising-survey-using-rand and http://docs.limesurvey.org/Expression+Manager+Sample+Surveys#Randomly_Ask_One_Question_Per_Group The reason is that the rand() function is called each time the page is visited AND each time it is validated, so you get different values with each call unless you use a syntax like this which ensures that rand() is called only once: {if(val>0,val,rand(x,y))} |
|
|
ok, it doesn't seem to be a bug. Sorry for bringing this topic up then. Like this it seems to work pretty well so far. Thank you for your help! |
|
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2013-01-30 15:59 | Anaben11 | New Issue | |
| 2013-01-30 15:59 | Anaben11 | File Added: 445519_30_01_1600.lss.xml | |
| 2013-01-30 20:07 | c_schmitz | Note Added: 23903 | |
| 2013-01-30 20:07 | c_schmitz | Status | new => closed |
| 2013-01-30 20:07 | c_schmitz | Assigned To | => c_schmitz |
| 2013-01-30 20:07 | c_schmitz | Resolution | open => no change required |
| 2013-01-31 11:44 | Mazi | Note Added: 23910 | |
| 2013-01-31 11:44 | Mazi | Status | closed => feedback |
| 2013-01-31 11:44 | Mazi | Resolution | no change required => reopened |
| 2013-01-31 11:45 | Mazi | Status | feedback => assigned |
| 2013-01-31 11:46 | Mazi | File Added: mand_error.PNG | |
| 2013-01-31 11:47 | Mazi | File Added: limesurvey_survey_137956_Mazi.lss | |
| 2013-01-31 12:04 | c_schmitz | Note Added: 23912 | |
| 2013-01-31 12:04 | c_schmitz | Status | assigned => closed |
| 2013-01-31 12:04 | c_schmitz | Resolution | reopened => fixed |
| 2013-01-31 13:29 | DenisChenu | Assigned To | c_schmitz => |
| 2013-01-31 13:29 | DenisChenu | Note Added: 23917 | |
| 2013-01-31 13:29 | DenisChenu | Status | closed => feedback |
| 2013-01-31 13:29 | DenisChenu | Resolution | fixed => reopened |
| 2013-01-31 13:30 | DenisChenu | File Added: limesurvey_survey_rand.lss | |
| 2013-01-31 13:31 | DenisChenu | Note Edited: 23917 | |
| 2013-01-31 13:31 | DenisChenu | Note Edited: 23917 | |
| 2013-01-31 13:37 | TMSWhite | Note Added: 23918 | |
| 2013-01-31 13:47 | Anaben11 | Note Added: 23919 | |
| 2013-01-31 13:47 | Anaben11 | Status | feedback => new |
| 2013-01-31 14:15 | c_schmitz | Status | new => closed |
| 2013-01-31 14:15 | c_schmitz | Assigned To | => c_schmitz |
| 2013-01-31 14:15 | c_schmitz | Resolution | reopened => fixed |