Welcome, Guest
Username: Password: Remember me

TOPIC: Pre-population of questions.....

Aw: Re: Pre-population of questions..... 2 years 9 months ago #71365

  • Steve
  • Steve's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 494
  • Thank you received: 46
  • Karma: 17
rocksalt wrote:
i tried using the SCGA path...

limesurvey.local/index.php?sid=51679&51679X8X48XQ1=Y

simple yes no radio button choice.....

does not work...

tried with survey active, and is not anonymous...i think there's something else here, but seeing as this is my first attempts with a scga i probably have done something wrong somewhere

If I remember correctly you can't use something like "51679X8X48XQ1" with SGQA for this type of question. You have to use the question "51679X8X48" and set the value with "=Y" so it should be "51679X8X48=Y".
Mit freundlichen Grüßen/Best regards,

Stefan Gohlke
LimeSurvey Team
The administrator has disabled public write access.

Re: Aw: Re: Pre-population of questions..... 2 years 9 months ago #71366

  • rocksalt
  • rocksalt's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 14
  • Karma: 0
tried that... well... again after you mentioned it...

I've been testing the logic of it thus:

limesurvey.local/index.php?sid=51679&51679X8X48XQ1=Y
limesurvey.local/index.php?sid=51679&51679X8X48=Y
limesurvey.local/index.php?sid=51679X8X48XQ1=Y
limesurvey.local/index.php?sid=51679&X8X48XQ1=Y
limesurvey.local/index.php?sid=51679&X8X48=Y

none of these seem to work...

just a thought... this survey has just one question.... would i need another ?

i just added another question to it, as a seperate question group... still nothing.
i've changed it from a yes/no to a short text field.... stopped, started the survey again... re-ran the question url... was expecting "y" to appear in the box.... changed it to "tom" expecting tom to appear in box... nothing.
The administrator has disabled public write access.

Re: Aw: Re: Pre-population of questions..... 2 years 9 months ago #71367

  • rocksalt
  • rocksalt's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 14
  • Karma: 0
i've been basing my testing on this:

Prefilling survey answers using the survey URL

Tested with: 1.80RC3

You can prefill answers to questions in your survey by passing the SGQA Identifier, and the answer, as a parameter of your survey URL. This feature will only work where the survey is commenced immediately upon entering the URL (so it won't work if you use CAPTCHA's to restrict access, or the registration page).

You'll need to ensure that the answer you pass is the correct format for the question you are attempting to prefill - for example - multiple option questions should contain a "Y" to check a box. List type questions need the correct answer code. To be certain which codes to pass, complete a survey manually with the prefilled answer(s) you want, and then export the results as question codes and answer codes(not full text). This will give you both the correct SGQA identifier (the name of the column), and the correct format for the answer.

Example:
http://www.myownd.../index.php?sid=1234&1234X43X123=Y

When the user gets to that question, the "Y" will be prefilled as the answer to question 123 in group 43 in survey 1234.


is this still current ?
The administrator has disabled public write access.

Re: Aw: Re: Pre-population of questions..... 2 years 9 months ago #71368

  • rocksalt
  • rocksalt's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 14
  • Karma: 0
interestingly...

when i set question one as mandatory and then enter the following

index.php?sid=51679&51679X8X48=Tom&51679X8X49=123456

it gives an error that i can't continue as Q1 is mandatory... but doesn't add anything to the question field so the &51679X8X48=Tom portion.... is not being parsed into the field.
The administrator has disabled public write access.

Re: Aw: Re: Pre-population of questions..... 2 years 9 months ago #71369

  • rocksalt
  • rocksalt's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 14
  • Karma: 0
and also this.. which is more current....

Identifier for Array <a href='www.docs.limesurvey.org/tiki-index.php?p...tions+for+LimeSurvey'>question types</a>

Since it is a array question the particular subquestion within the cell must be identified too. Add the subquestion code of the row without an X. For example: Survey has ID 1, Group has ID 6, Question has ID 12. The particular subquestion has code 'ber1'. Your identifier for this "Array" question answer would look like this:

1X6X12ber1


Identifier for Array (Text) or Array (Number) Questions

Since it is a combined array question the particular answer within the cell must be identified too. Add the subquestion code of the row without an X, then append the underscore char and finally add the subquestion code that indentifies the column. For example: Survey has ID 1, Group has ID 6, Question has ID 12. The particular subquestion has code 'ber1', and the column is identified by the subquestion with code 'lab1'
Your identifier for this "Array (Text)" question answer would look like this:

1X6X12ber1_lab1

Uses of the <a href='www.docs.limesurvey.org/tiki-index.php?p...tions+for+LimeSurvey'>SGQA</a> identifier

The <a href='www.docs.limesurvey.org/tiki-index.php?p...tions+for+LimeSurvey'>SGQA</a> identifier can be used to load the answers to previously saved questions into the question text of later questions. (See Adding a Question - Information from previous answers)

It can also be used in the query URL of a survey to "prefill" answers to a survey. eg: for <a href='www.docs.limesurvey.org/tiki-index.php?p...tions+for+LimeSurvey'>SGQA</a> 1X6X121ab1, your query URL could include "&1X6X121ab1=Y" to prefill that answer with a "Y". (See workarounds -> Prefilling survey answers using the survey URL)

The <a href='www.docs.limesurvey.org/tiki-index.php?p...tions+for+LimeSurvey'>SGQA</a> identifier is also the field name where the data for each question is stored in the database survey responses table.

Dynamically reference the SGQ identifier

Some people may find a need to reference a question dynamically. For instance, if you would like to hide the input text field of a short text answer. You can now do this (as of SVN build 9755) by using the {SGQ} identifier. LimeSurvey will replace the {SGQ} with the full Id of that question, ex: 3583X84X249
Contributors to this page: timbee , anonymous and admin .
Page last modified on Thursday 10 of February, 2011 19:44:51 CET by timbee.
Last Edit: 2 years 9 months ago by rocksalt.
The administrator has disabled public write access.

Re: Aw: Re: Pre-population of questions..... 2 years 9 months ago #71371

  • rocksalt
  • rocksalt's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 14
  • Karma: 0
Ok... new tack...

i've deleted survey.
Created new one with single question group and two questions ( name and tel number )

played the url : index.php?sid=88997&lang=en&88997X10X50=Tommy&88997X10X51=1234

and its now populating both fields correctly.

so something in the old survey was not allowing the data to parse through?

i've stopped, started, manually edited, added data etc... generally most things i was doing to the previous survey.... and it still works... most wierd. Now im working on how to interpret the data url link from remedy into a format LS can parse
Last Edit: 2 years 9 months ago by rocksalt.
The administrator has disabled public write access.

Aw: Pre-population of questions..... 2 years 9 months ago #71372

  • Steve
  • Steve's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 494
  • Thank you received: 46
  • Karma: 17
Hello,

I tested the SGQA for the yes/no question with a survey in my LimeSurvey installation 1.91+ Build 11379. It seems
limesurvey.local/index.php?sid=51679&51679X8X48=Y
should be correct. If it doesn't work you may have a look at the source code of your HTML page and check if the SGQA code (look for an element like <input id="answer51679X8X48Y" ... >) and the value (something like value="Y") are correct.
Mit freundlichen Grüßen/Best regards,

Stefan Gohlke
LimeSurvey Team
The administrator has disabled public write access.
The following user(s) said Thank You: rocksalt

Re: Aw: Pre-population of questions..... 2 years 9 months ago #71373

  • rocksalt
  • rocksalt's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 14
  • Karma: 0
thanks vierundzwanzig.

Now i have the url thing working, i'm going to try the java script and embed that in the survey and interpret the url to parse data to the fields.... i feel this gives me the best way forward on this... although java and me were distant friends at best lol
Last Edit: 2 years 9 months ago by rocksalt.
The administrator has disabled public write access.

Re: Aw: Pre-population of questions..... 2 years 9 months ago #71385

  • TMSWhite
  • TMSWhite's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 759
  • Thank you received: 82
  • Karma: 36
rocksalt-

I just tested with 1.92 RC1. It does accept the URL parameters appropriately, with one nuance. Although you can pass in any parameters you want (which could be on any page / in any group), LS will always validate the data before displaying it. So, if you set a value of a variable that is irrelevant, LS will NULL that value before the page is displayed. This ensures that the database is internally consistent.

/Tom
The administrator has disabled public write access.

Re: Aw: Pre-population of questions..... 2 years 9 months ago #71391

  • rocksalt
  • rocksalt's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 14
  • Karma: 0
ahhh... for for the data im trying to parse into the question field, i need to pre validate this?
I left the validation field empty on my questions as the data being entered could be anything ( names, telephone numbers call ref etc. )
but i assume there's some kind of validation check to ensure the name Y. smitth couldn't to taken as a Y answer for yes/no ?
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.142 seconds
Donation Image