Hey all! After failing to find a fill in the blanks style quiz on the forums I have created one that uses a JSON file to store the text and answer data externally. Its yours to use as you wish!
Hi Stephen -
Thanks so much for this! I really want to use it in a project I’m working on but for some reason it is not functioning properly.
I have not made any edits yet when I preview your original hype document the text fields are displaying the wrong text and the answer field is not excepting the answer.
Can you confirm that everything is set up correctly?
No worries @matt5834 if text appears in the wrong text field it means that the ordering in the json doesn’t match the ordering of the elements (with classes applied) in the scene or that there are more or less layers with class names applied than your json is expecting to see.
Another tip is to have unique class names for different scenes. Hope this helps if you encounter any other problems.
Hi @camenar the structure of the json file should exactly match the layering on your scene. If you share your project I can have a quick look for you to see if it is an easy fix.
Hello, then I share the project. Is to note that I’m new to the interaction between hype, javascript and Json.
Thank you.Quiz_Restas.hype.zip (47.3 KB)
Hello
I am very interessted in this template. But I have the same problem as Matt....the text fields are displaying the wrong text and the answer field is not excepting the answer.
I am new and not a programmer. So I dont know what to do with the json...I do not understand what to do with this hint:
No worries @matt5834 if text appears in the wrong text field it means that the ordering in the json doesn’t match the ordering of the elements (with classes applied) in the scene or that there are more or less layers with class names applied than your json is expecting to see.
The issue is that the original code assumed a specific ordering of the elements. This ordering wasn’t guaranteed (and changed for accessibility improvements in Hype v3.6). I changed the code a little bit so it uses a different class name that corresponds to the keys in the JSON. I’m not sure about all the original code intentions, so it might not be able to be used in the same way…