2

I'm a mathematician (not a developer) trying to make a website using Squarespace. The only coding language I know is Python.

One desired feature of the website is a kind of "personality quiz". The idea is that the user fills in a form - then their answers are fed into a Python script, which does some analysis to determine what the result should be. Then finally I would like the website to display an automatic response to the user, providing them with their result.

I can easily create a Form using either Squarespace Forms or Google Forms.

I can also easily write the Python code which takes in a dictionary of {Question:Answer} (or some similar format) and returns the result.

What I am really struggling with is how to put these together and make the whole thing seamless.

I've spent a few hours trying to research how to pass data from the Form into Python and then pass the result from Python back into the website. I would like the result to be displayed on the website automatically - I don't particularly want to go down the route of sending an email to the user. It's possible that my Googling has been thus far insufficient, but I'm surprised that it's not an obvious use-case.

[edit: I have seen a few references to Google Apps Script in combination with Google Forms, but I am not at all familiar with the language, and I haven't seen any examples of code that do exactly what I'm looking for.]

Any help that anyone could give would be so greatly appreciated. Thank you.

numberwang
  • 39
  • 5
  • Use javascript? Then you can handle all the processing and results on the form page. – jfox Nov 29 '16 at 17:56
  • Yes, I agree that's the easiest way. I have had to resort to asking a friend to do it for me in JavaScript. Though this is frustrating because I would have liked to be able to do it myself. I don't really understand why a problem like this can only be solved in one particular language. – numberwang Dec 02 '16 at 11:58
  • Javascript is already built into all major browsers, whereas other languages require processing that just isn't available client-side. You could look into Django/Pyramid if you really wanted to develop with python. – jfox Dec 02 '16 at 23:17

0 Answers0