smeder Community Member Posts: 2 ☆ Roadie ☆
Hi, I'm trying to create a module with just survey questions and publish it as HTML so that users can click on the HTML link, then complete and submit the survey. Is this possible and if yes, how do I do it? Also can the result be sent to a server instead of Google Drive and if yes, how do I do it? Thanks so much in advance.

Best Answers

  • timk
    timk Community Member Posts: 1,214 ♦ Idol ♦
    edited October 5, 2021 Accepted Answer
    A survey is very similar to a test, i.e. it is a collection of questions. Each question has a variable that contains the answer a user has entered / selected. To send the data = the variables = the results to a server would mean to send it to a cgi script = custom script, e.g. PHP. PHP can be used to allocate the variables to a database or produce an HTML page that contains the data.

    Lectora can submit the data but it is not involved in the PHP part or other tasks to handle the information.

    To do that check "Custom Results Submission" in the properties of the Survey. Select a method, usually "POST" and enter the URL of your script. When you don't check "Include ALL variable vaues" it will only submit the Survey data. When you check it it will send all other variables in the project along with the survey data.

    The PHP script can get all variables from the POST variable and do whatever you want with it, i.e. from this point on it is not Lectora-specific any more. Sorry, I can't help with the PHP in detail, but it should not require Lectora skills to code it.
  • smeder
    smeder Community Member Posts: 2 ☆ Roadie ☆
    Accepted Answer
    That's brilliant, thanks so much Tim!