Type in quiz , help finishing


(Shmuel) #1

Continuing the discussion from Best way to create interactive text:

Continuing the discussion from Type-in/Written Quiz:


#2

Maybe this will help… Play timeline after pressing onsubmit button using Javascript


#3

@shmuel1994

It’s not really clear as to what you want here!

Do you need help for a particular thing or do you need someone to do it for you?

If it’s the latter then unless someone is feeling particularly kind then I’m afraid you won’t get much response.

Do you need help with something specific?

If it’s to check against an inputted text then referring to your second example (test typing in .hype)
you have several mistakes. Here is a document showing you how to take an inputted text and check it against an already established variable and if it’s correct, execute some code and if it’s incorrect, execute different code.

textQuiz.zip (224.6 KB)


(Shmuel) #4

OMG , Thank You very much … thats what i wanted exactly .
The idea is that i would have to just create a function for each click .
Thanks a lot , the support is amazing here !!!


#5

I am looking to do something very similar to Dbear’s great example above, but how would this be expanded to cover a number of questions with different answers? Is this something that could be done simply?


#6

Hi @Jim

If you use a different scene for each question then it’s simply a case of creating a new function for each mouse click and changing the ID’s so that they are unique (you cannot have the same ID for different elements)

This way you would use the same technique for each scene to check against an answer you provide:

textQuizv2.zip (288.8 KB)

*Note I believe this is the most straightforward (and perhaps the easiest) way of expanding the above example however there are many ways to achieve a similar or even more complex system. It depends on how good your Hype + Javascript skills are :wink:


#7

Many thanks for this. It is very much appreciated. Is it essential that each question is in a new scene? Or could they appear as a list in one scene? Further, and this is a big ask… would it be straightforward to create a score at the end of the set of questions? I am pretty good with Hype and very bad with JS.

Cheers

Jim


#8

It is not essential. There are many ways to achieve a quiz type example but some are easy some are hard. The more you want in the same scene the more it will become complicated.

Have a look here for options on how to keep score. There should be some examples here.

think of perhaps localStorage to store the score.

I’m afraid I don’t have much time to work on examples as you can appreciate but there are probably a few ideas here in the forums you can pick up on.

So in summary I suggest working on something and if you really stuck on something come back to the forums with what you’ve done and someone I’m sure will be able to help.


#9

Thanks again. That’s working well.


#10

Building on the example you gave here testQuizv2 can you tell me how I would prevent the iPad from doing its usual spelling suggestions / autocorrect stuff when stuff is being typed into the text input field. I ask because I am developing a spelling quiz and it kind of ruins the activity. Thanks.


#11

Here’s how to do that: https://davidwalsh.name/disable-autocorrect

<input autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" />

<textarea autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"></textarea>