View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 05324 | Bug reports | Other | public | 2011-07-07 05:22 | 2011-07-08 17:23 |
| Reporter | TMSWhite | Assigned To | c_schmitz | ||
| Priority | normal | Severity | minor | ||
| Status | closed | Resolution | no change required | ||
| Product Version | 1.91+ | ||||
| Summary | 05324: SGQA name clashes - multiple questions on same page can generate same SGQA name | ||||
| Description | Since the SGQA naming algorithm concatenates A codes after the Q number without a separator character (like another X or an underscore), a single group can end up with two or more questions (or their answers) having the same JavaScript Name and/or ID. I'm flagging this as severity = minor / priority = normal since I'm not seeing abnormal behavior myself. However, I expect this should really be major/high. | ||||
| Steps To Reproduce | Group 3 of the attached survey shows this behavior. Question 61764X3X9 (Type L - List Radio) - has answer codes 61764X3X91-61764X3X96. So, those 4 questions all have names and IDs that clash with question 9. | ||||
| Additional Information | Despite the name clash, I'm not seeing any obvious errors in how the survey functions. However, I'm not trying to show/hide questions on this page, or use INSERTSGQA: to insert values. If I were doing that, I'd expect to see bizarre or inaccurate behavior. Suggestion: Change the SQGA-generating algorithm to insert an underscore between sections. This will also make it easier to parse the SGQA code. | ||||
| Tags | No tags attached. | ||||
| Attached Files | |||||
| Bug heat | 6 | ||||
| Complete LimeSurvey version number (& build) | 10378 | ||||
| I will donate to the project if issue is resolved | No | ||||
| Browser | Firefox | ||||
| Database type & version | Mysql 5 | ||||
| Server OS (if known) | Windows XP | ||||
| Webserver software & version (if known) | Apache 2 | ||||
| PHP Version | 5.2 | ||||
| Git branch / Pull Request URL | |||||
|
Don't know why there isn't a separator for the answer. It's a pain, I know... the problem can only occur when you have the questions in the same group. So if you have qid 1 you could get qid 11 in the same group but for higher numbers it is unlikely to happen as the qid's are too far apart. that's probably why it has never been a problem. Nameclash should occur for the survey table too as they use the same names so I guess that activating the survey would result in an error as it would try to create a table with two idential fields. |
|
|
I did activate the survey, and no errors were thrown. Perhaps the error checking system doesn't ensure that the JavaScript answerSGQA, javaSGQA, tobedispSGQA, etc. objects will all be unique? Also, even though this should rarely happen, it happened on the very first survey I created. |
|
|
As you say, this may be low risk. I just re-imported that survey (so that I could change the order of questions), and since it kept incrementing the qid, I don't have the same problem with the second instance of the survey. So, if someone's survey behaves oddly, they can export and re-import it and have the problem probably go away. I think it would still be safer to expand the on-activate validation steps (to make sure there are no JavaScript name clashes), or provide an FAQ or other notice so people are aware of this potential issue and how to work around it. |
|
|
TMSWhite, on activation it is checked for duplicate fieldnames and any clashes are corrected before activation. |
|
|
Glad to hear it. But, does it check to ensure there won't be any clashes in the JavaScript name and id attributes (e.g. answerSGQA, tbdispSGQA, javaSGQA, javatbdSGQA, etc.)? Also, when it corrects clashes, what are the implications for the developer? Say the author has a lot of INSERTANS:xxxx fields, or embedded JavaScript calls to ${#answerSGQA}, will those references be updated with the new fieldnames? If not, does the activation process alert the developer which fields have changed? (I didn't see any such message myself) so they can be sure to fix all of the affected fieldnames? |
|
|
If the fieldnames don't clash, the oter things don't clash automatically. |
|
|
Anyway, no bug here :-) |
|
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2011-07-07 05:22 | TMSWhite | New Issue | |
| 2011-07-07 05:23 | TMSWhite | File Added: ExpressionManager-plus-all-question-types.lss | |
| 2011-07-07 09:42 | mdekker | Note Added: 15666 | |
| 2011-07-07 12:19 | TMSWhite | Note Added: 15669 | |
| 2011-07-07 19:22 | TMSWhite | Note Added: 15672 | |
| 2011-07-08 14:09 | c_schmitz | Note Added: 15680 | |
| 2011-07-08 14:09 | c_schmitz | Note Edited: 15680 | |
| 2011-07-08 15:24 | TMSWhite | Note Added: 15681 | |
| 2011-07-08 16:59 | c_schmitz | Note Added: 15683 | |
| 2011-07-08 17:23 | c_schmitz | Note Added: 15697 | |
| 2011-07-08 17:23 | c_schmitz | Status | new => closed |
| 2011-07-08 17:23 | c_schmitz | Assigned To | => c_schmitz |
| 2011-07-08 17:23 | c_schmitz | Resolution | open => no change required |