Home arrow Support arrow Forums
LimeSurvey Forums
Welcome, Guest
Please Login or Register.    Lost Password?
[done] Emdedded flash and autofilling of questions (1 viewing) (1) Guest
Go to bottom Favoured: 0
TOPIC: [done] Emdedded flash and autofilling of questions
#17617
megalomaniac (User)
Fresh Lemon
Posts: 15
graphgraph
User Offline Click here to see the profile of this user
[done] Emdedded flash and autofilling of questions 4 Months, 3 Weeks ago Karma: 0  
Hi,
I'm using Version 1.71+ of LimeSurvey and was wondering if it is possible to autofill answers with the results from a flash game?

Basically we have a Flash game that allows several attempts and then displays the users best time. Ideally we would like this to be the last question of our survey and for the "best time" to feed back into LimeSurvey in a form that the user cannot edit (to prevent cheating).

Is that possible? If so any ideas how?

Thanks

EDIT: p.s. I know how to feed results out from Flash normally, just havn't got a clue where to start when it comes to getting them into LimeSurvey.
 
Logged Logged  
 
Last Edit: 2008/09/12 16:56 By Mazi.
  The administrator has disabled public write access.
#17619
Mazi (Moderator)
Moderator Lime
Posts: 3503
graph
User Online Now Click here to see the profile of this user
Re:Emdedded flash and autofilling of questions 4 Months, 3 Weeks ago Karma: 28  
If you just want to store the best time in the database I recommend the following approach.

1. Create a simple text question as last question.
2. Use conditions so that this question is never shown to the user.
3. Let the user fill out the survey and then play the game.
4. When the user has finished the game and the survey you can auto-redirect him to a certain URL (see survey settings).
5. Auto-redirect the user to a script which gets the best time from flash and writes this time into the table of the question which was nit shown to the user but was created to store exactly this information.

I think there is no way to put data from flash into a limesurvey form which can't be edited by the user. That's the reason for my different approach.
 
Logged Logged  
 
Best regards,
Mazi
______________________
Need help? I can: set up Limesurvey for you / create your survey / implement additional features / design your template / offer premium support -> Contact.
  The administrator has disabled public write access.
#17627
megalomaniac (User)
Fresh Lemon
Posts: 15
graphgraph
User Offline Click here to see the profile of this user
Re:Emdedded flash and autofilling of questions 4 Months, 3 Weeks ago Karma: 0  
Sounds like a good idea, thanks. Although how can I make sure the right time data goes into the right row of the database? The id column perhaps? Is there a way to append that to the re-directing URL?
 
Logged Logged  
  The administrator has disabled public write access.
#17629
Mazi (Moderator)
Moderator Lime
Posts: 3503
graph
User Online Now Click here to see the profile of this user
Re:Emdedded flash and autofilling of questions 4 Months, 3 Weeks ago Karma: 28  
Check out manual -> SGQA identifier. The fields for each question is marked similiar.
Normally you can easily write the time data into the last row of lime_survey_12345 when calling the script.
 
Logged Logged  
 
Best regards,
Mazi
______________________
Need help? I can: set up Limesurvey for you / create your survey / implement additional features / design your template / offer premium support -> Contact.
  The administrator has disabled public write access.
#17649
megalomaniac (User)
Fresh Lemon
Posts: 15
graphgraph
User Offline Click here to see the profile of this user
Re:Emdedded flash and autofilling of questions 4 Months, 3 Weeks ago Karma: 0  
Maybe I'm reading it incorrectly, but does the SGQA not simply identify the questions etc. within the survey while it's still active?

If I'm using the auto-redirect (End URL) facility then the survey's already been completed, so I need some mechanism to link the appropriate row in the database table with the time data to make sure the correct time data goes with the correct survey data (i.e. Franks time data gets appended to Franks survey data). Does such a thing exist within LimeSurvey? Any number of people could be completing at around the same time, therefore it’s not enough to rely on it being the last entry as that could be really bad for data integrity.

Thanks again for the help.
 
Logged Logged  
  The administrator has disabled public write access.
#17680
Mazi (Moderator)
Moderator Lime
Posts: 3503
graph
User Online Now Click here to see the profile of this user
Re:Emdedded flash and autofilling of questions 4 Months, 3 Weeks ago Karma: 28  
There are two informations which are stored somewhere inside limesurvey when running a survey: the user id and the answers. Answers are saved when the user goes to the next page or clicks submit.
You have to find out where exactly this data is stored (I'm no developer, I can't tell you), put the data into a session and then use the data from the session in your own script.
It's probably best to join oir IRC ( see www.limesurvey.org/content/view/39/85/lang,en/) and get in contact with one of our developers.
 
Logged Logged  
 
Best regards,
Mazi
______________________
Need help? I can: set up Limesurvey for you / create your survey / implement additional features / design your template / offer premium support -> Contact.
  The administrator has disabled public write access.
#17685
megalomaniac (User)
Fresh Lemon
Posts: 15
graphgraph
User Offline Click here to see the profile of this user
Re:Emdedded flash and autofilling of questions 4 Months, 3 Weeks ago Karma: 0  
Thanks, much appreciated.
 
Logged Logged  
  The administrator has disabled public write access.
#17689
megalomaniac (User)
Fresh Lemon
Posts: 15
graphgraph
User Offline Click here to see the profile of this user
Re:Emdedded flash and autofilling of questions 4 Months, 3 Weeks ago Karma: 0  
Thinking about it could the combination of a boilerplate and a hidden question solve this?

Use a boilerplate (as I understand it they accept HTML, php and JavaScript) for the game including some code to write the result to a hidden question (hidden by conditions as per your suggestion) via the SGQA?
 
Logged Logged  
  The administrator has disabled public write access.
#18049
megalomaniac (User)
Fresh Lemon
Posts: 15
graphgraph
User Offline Click here to see the profile of this user
Re:Emdedded flash and autofilling of questions 4 Months, 1 Week ago Karma: 0  
Problem solved, I just used a text question with a custom onLoad function to make it read only. Then used a button to launch the game in a separate window and javascript to feed back the results into the read only question. window.opener is officially my new favourite JavaScript property.

Simple really .

I do still have one issue though, in IE I keep getting:
"document.limesurvey.move is null or not an object"
when trying to submit. But everything works fine in Firefox, any ideas?
 
Logged Logged  
 
Last Edit: 2008/08/27 18:12 By megalomaniac.
  The administrator has disabled public write access.
#18339
Mazi (Moderator)
Moderator Lime
Posts: 3503
graph
User Online Now Click here to see the profile of this user
Re:Emdedded flash and autofilling of questions 4 Months ago Karma: 28  
Hi,
is there a possibility to seer your adaption "in action"?

Regarding IE and JS: Please check if IE supports the used JS functions.
 
Logged Logged  
 
Best regards,
Mazi
______________________
Need help? I can: set up Limesurvey for you / create your survey / implement additional features / design your template / offer premium support -> Contact.
  The administrator has disabled public write access.
Go to top