How to create a small survey

Hi, is it possible to create a small survey with predefined results?

For Example: 3 Questions with 3 possible anwersbuttons which the user chooses from.
At the end there should show up one of thee possible result screens.

Whats the best way to create this?

thx! best jan

one possible way: HypeConditionLinker: Perform actions based on AND/OR conditions without JavaScript code

several others out there ...

1 Like

Hype Petite Vue… is also an option. Early days but should work fine.

1 Like

I posted an example using Hype Petite Vue here:

Also, there is another idea that revolves around simple layer visibility and custom behavior if you want to avoid getting into Vue programming here:

1 Like

Thanks so much for your hints!

I didn't answer this one right away because I wasn't sure if you wanted to send the results to a server. But if the results are static and predetermined, you could just create a lot of scenes...

Scene 1
Scene 2a, 2b, 2c
Scene 3aa, 3ab, 3ac, 3ba, 3bb, 3bc, 3ca, 3cb, 3cc

13 scenes for each possible question and solution.

But if you want to make it dynamic, there are two templates at that might help...

The "Book" template is very similar to what I just described, except it includes the use of JavaScript and Data Attributes in Hyperlinks to control scoring and scene changing.

The "Capitals" quiz seems very close to what you're trying to do, as it generate questions randomly and dynamically. Basically, it reads data from a local array (somewhat similar a database) and then shows a score result at the end.

So, if you modify the template to match your idea, it seems it could just be a matter of displaying certain text based on what someone chose.

...but if you want to collect this data, I probably wouldn't use Hype. That would involve communicating with a web server, which has lots of potential pitfalls — especially if done wrong. I use Ninja Forms on WordPress for basic contact forms. If I had to build something advanced with conditionals, I'd probably use Webform on Drupal or perhaps one of the many websites that offer such features.

With a little CSS, and an iFrame, an external form could look like it's part of a Hype project.

1 Like

Hi Max, i looked at Petite Vue and its pretty cool. I looked at the code but i cant get it the way i want it ...

What i'm looking for is fe... a questionaire "what kind of hype user are you?" at the end of the questionaire you get the result "starter", "medium", "profi"

  • You have 5 questions with 3 possible answers a, b, c
  • At the end there are 3 possible results
  • Fe. result 1 shows up when the answers were a, a, b, c, a
  • Fe. result 2 shows up when the answers were b, b, a, b, c
  • Fe. result 3 shows up when for all other combinations

Do you have any idea how to manage this? THX!!!

This looks like your comparing an "answer" string and need specific results. So, if your answer is not based on correct or wrong answers, just append each answers to a string and compare the answer in the results screen.

Now you can either work with v-if, v-else etc. or create a function that returns the result you want using a switch/case logic.

1 Like

add a scripttag in the head including:
var resStr = '';

add a scene for each question.

on each answerbutton add a js-behavior:
resStr += 'a'; /// or b or c belongs to you

on the reesultscene add a scriptcall on sceneload:

if(resStr === 'aabca'){
//do sthg
} else if(resStr === 'bbabc'){
//do sthg.
// do sthg.

you should be able to figure this out ... no need to overcomplicate things :slight_smile:

1 Like

cool - i'll manage this :wink: thank you very much!!

If you use the Vue version I would add the variable in HypeDocumentLoad (much like correctAnswers) and the function in Questonaire component like object or as Vue syntax in a rectangle. Depending on your approach.

Viele Wege führen nach Rom :stuck_out_tongue_winking_eye:

1 Like

Here we go... my mini-survey-template if anbody needs it (110.3 KB)


:+1:cool ... pretty easy, wasn't it¿!

1 Like