View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
19155 | Bug reports | Question editor | public | 2023-10-06 19:23 | 2023-10-09 18:45 |
Reporter | qualiquan | Assigned To | gabrieljenik | ||
Priority | none | Severity | block | ||
Status | closed | Resolution | no change required | ||
Product Version | 6.2.x | ||||
Summary | 19155: error when trying retrieving {QID} in a default response field | ||||
Description | I have defined answer default values in a question but when I assign the variable regarding the question number I get an error. When we test the logic of the question, if we hover the mouse over the variable {QID} we can clearly see that the question number is displayed and yet when we test the question in the browser we have the following error: In a previous question, I've set in the html window the {QID} and i obtain the relevant information (see attached file "Question and survey ID"). So why doesn't it work when we put the {QID} variable in a default response field (see also attached file "error in browser")? Limesurvey details : | ||||
Steps To Reproduce | Steps to reproduce(Replace this text with detailed step-by-step instructions on how to reproduce the issue) Expected result(Write here what you expected to happen) Actual result(Write here what happened instead) | ||||
Tags | No tags attached. | ||||
Attached Files | |||||
Bug heat | 8 | ||||
Complete LimeSurvey version number (& build) | LimeSurvey Community Edition Version 6.2.10+231004 | ||||
I will donate to the project if issue is resolved | No | ||||
Browser | chrome | ||||
Database type & version | 5.7.42-log | ||||
Server OS (if known) | |||||
Webserver software & version (if known) | |||||
PHP Version | 8.0 | ||||
Try this: {G2Q00001_question.qid} |
|
Thanks for your answer, but how ro retrieve current question id ? I need to add this variable in this field and also in a Java script associated with a question ? |
|
Set the default answer for question "G2Q00001", subquestion "question" to be {G2Q00001_question.qid} and check if that works. (Instead of {QID} in your screenshot "QID error .png") |
|
Thanks again, and I apologize for asking again: my precedent answer wasn't clear enough : you're right, the solution you've proposed works perfectly. Where ids and ids2 are previous questions codes, and survey, gid, etc are multiple answers codes. But I'd like to adapt this script in order to access directly to variable, and would looks like : |
|
What type of question is record? If it has subquestions, you need to do something like record_SQ001.qid and record_SQ001.gid instead (it doesn't matter which subquestion code you use) |
|
Hi mfavetti, thanks for your reply. |
|
As per the comments, I think all is good and will be closing the ticket. |
|
Date Modified | Username | Field | Change |
---|---|---|---|
2023-10-06 19:23 | qualiquan | New Issue | |
2023-10-06 19:23 | qualiquan | File Added: QID error .png | |
2023-10-06 19:23 | qualiquan | File Added: Question and survey ID.png | |
2023-10-06 19:23 | qualiquan | File Added: error in browser.png | |
2023-10-07 00:24 | mfavetti | Note Added: 77552 | |
2023-10-07 00:24 | mfavetti | Bug heat | 0 => 2 |
2023-10-07 00:25 | mfavetti | Issue Monitored: mfavetti | |
2023-10-07 00:25 | mfavetti | Bug heat | 2 => 4 |
2023-10-08 07:35 | qualiquan | Note Added: 77559 | |
2023-10-08 07:35 | qualiquan | Bug heat | 4 => 6 |
2023-10-08 09:09 | mfavetti | Note Added: 77560 | |
2023-10-08 15:40 | qualiquan | Note Added: 77561 | |
2023-10-08 15:40 | qualiquan | File Added: how to get QID and GID of curent question.png | |
2023-10-09 09:36 | mfavetti | Note Added: 77562 | |
2023-10-09 11:05 | qualiquan | Note Added: 77563 | |
2023-10-09 18:45 | gabrieljenik | Assigned To | => gabrieljenik |
2023-10-09 18:45 | gabrieljenik | Status | new => closed |
2023-10-09 18:45 | gabrieljenik | Resolution | open => no change required |
2023-10-09 18:45 | gabrieljenik | Note Added: 77586 | |
2023-10-09 18:45 | gabrieljenik | Bug heat | 6 => 8 |