Keywords and Quizzes

onyxsunrise
06 May 2014, 14:43
Seeing as I'm studying to be a teacher, as much as I appreciate Quest's capacity for entertainment (and indeed use it for that purpose), I'm also very intrigued by the possibilities for technological integration in the classroom, using Quest as a study aid. Engines like Quizlet are useful but less flexible than Quest.

On the note of flexibility, what I'm trying to do is have Quest search input for certain keywords, and react to those keywords. So, example:

If the user is prompted with the question:
Why was blood such an important fluid among the early peoples of the Americas?

And the answer is:
They believed that the god's blood, which came in the form of rain, allowed the crops to grow. They also used blood in sacrifices. It was shed to feed and repay the gods and save the world from destruction.

Then what I want is for them to type that, and for Quest to pick up on the keywords "rain" and "sacrifice"/"sacrifices". That way they do not need a word-for-word identical answer, but still must make sure to have the right information.

So, how can I do this? Would I be able to do this with the simple tools of Quest or will I have to delve into some more complicated coding? I'd prefer the first, but am willing to learn the second - just understand I am totally ignorant of anything it involves.

jaynabonne
06 May 2014, 19:14
From the "how can this be done" point of view, you can:

1) Set up each question to have a list of keywords associated with it which are the ones to look for in the answer.
2) Use "get input" to read a line of text for the answer.
3) For each keyword, if the keyword exists in the answer, add to a score of some kind. (I assume you're going for existence as opposed to counting them. You would not want someone to simply type in "rain rain rain rain rain" and get a high score.)

You will need to use some simple scripting to do this - Quest does not provide this functionality out of the box. The reason for that is...

The "should this be done" elephant in the corner. I'm just going to throw out my thoughts. You can do with them what you wish. This is just something to think about.

Using keyword matching, the following answer would be a "pass":

Blood was important because it's important to all of us to keep us alive. We need it to go out in the world and get a job and raise our kids, often at great sacrifice. And now I'm going to go take a walk in the rain.


And the following would be a miss:

They beleved that the gods blood, which came in the form of rane, allowed the crops to grow. They also used blood in sacrifises. It was shed to feed and repay the gods and save the world from distruction.



There's no replacing the human element in essay type questions. :) An alternative is (sadly) multiple choice, which is undeniably easier (but error-free). There may be other alternatives as well, where a more immersive experience is provided for the students to interact with, where their actions indirectly show their understanding. (I'm not saying I would know how to design such a thing, but it might be fun to try!)

HegemonKhan
06 May 2014, 23:41
quest doesn't lend itself too well to users typing out whole sentences~paragraphs as their inputs (the text bar for them to type within is only 1 line in size, so it'd be hard~annoying for them to correct any typoes they might make during their typing of it), so it instead works better for single key~buzz words. If you don't mind multiple choice, quest can definately do this, though coding or implementing it in quest won't be easy for someone who is new to quest and~or to coding. If you really want a student's response to be checked if they include within it your key~buzz words, as a way for the computer~quest to check how close on-topic they're in their answer~response, quest can do this (though for the students as I already mentioned it'll be annoying for them to try to type in their sentences~paragraphs~answers~responses), but the coding will be very difficult, as it's pretty much a "parser" coding if I understand what a "parser" is myself, lol. You'll need someone good in coding to do this for you, which there are some good coders here, Jay and others, but not me, laughs.

the easiest method would be doing multiple choice, and I or others, can help you with that (well, when I got the time... sighs, we never have enough time to do everything we got to do when as adults), as it's not too difficult for people who can do basic coding, like me.

jaynabonne
07 May 2014, 06:46
if you do want to use block (multi-line) style of input, I'd eschew the standard input bar and take advantage of Quest's ability to show arbitrary HTML and put a more standard input field on the page. That is diverging even more from what's built into Quest, but it is doable, and I'm sure we could make it work.

onyxsunrise
07 May 2014, 21:54
Thanks guys!

I'm pretty sure I know how to execute a multiple-choice setup, but the information about keywords (and the recommendations about typos/command bar space) is very helpful! I'll poke around a bit more and see if I can fine-tune the keyword setup and fix up the input bar. May come back with more questions later, but for now I'm off to implement, thanks!

m4u
08 May 2014, 17:19
I think it's possible because I did something similar. I used this function, "text" is the player input and "game.keywords" is the list of keywords that can be changed to "question1.keywords":

  <function name="GetWord" parameters="text">
inputlist = Split(text, " ")
foreach (word, inputlist) {
foreach (keyword, game.keywords) {
if (word = keyword) {
firsttime {
IncreaseScore (5)
CreateDescription (text)
msg ("(Your score have increased for 5 points)")
}
}
}
}
</function>

jaynabonne
08 May 2014, 17:50
I can't see what comes next, but for that small snippet, I don't think you want the "firsttime" in there. :) (The only thing I could see is if you change the text somehow later on but do the same for non-firsttime.)

m4u
08 May 2014, 17:59
Well, no. That's the whole code. The "first time" is for preventing the "rain rain rain" answer and score high. Is there another way to do it?

It would be nice be able to match more than one word like "secret door". I don't know how.

jaynabonne
08 May 2014, 18:09
You prevent multiple hits on a keyword by inverting your loop and checking each game keyword for what's in the input. So maybe something like:


<function name="ScoreKeywords" parameters="text">
inputlist = Split(text, " ")
foreach (keyword, game.keywords) {
if (ListContains(inputlist, keyword)) {
IncreaseScore (5)
CreateDescription (text)
msg ("(Your score have increased for 5 points)")
}
}
</function>

m4u
08 May 2014, 18:23
Cool, i forgot to remove the CreateDescription function there, that's for other purposes. What about more than two words? is it possible to code it in there?

jaynabonne
08 May 2014, 18:31
I'm not sure what you mean by more than two words. If you mean more than two sets of words (like for different questions), then you would just have a separate keyword list associated with each question, and you'd just look in that word list.

<object name="Question 1">
<question>Some yada yada question text</question>
<keywords type="simplestringlist">foo;bar;blah</keywords>
</object>

<object name="Question 2">
<question>Some different yada yada question text</question>
<keywords type="simplestringlist">red;green;asparagus</keywords>
</object>

m4u
08 May 2014, 18:53
No, I mean a specific phrase like "rain forest"...

jaynabonne
08 May 2014, 19:09
Hmm... If you wanted to do that, then the split along spaces wouldn't work as space could now be part of a "keyword" as well (keyword phrase). You could look for each word in the phrase separately, but what you really want is for them to be in sequence.

You could use "instr" to see if each phrase is in the entered text.

<function name="ScoreKeywords" parameters="text" type="int">
score = 0
foreach (keyword, game.keywords) {
if (Instr(text, keyword) <> 0) {
score = score + 1
}
}
return(score)
</function>


(I didn't put the <[CDATA[... ]]> in there needed for the <>. You would have to add that if you use the code.)

m4u
22 May 2014, 16:42
Great! What if I want to identify a word or phrase and then print the words if any that come after the keyword or keywords matched?

jaynabonne
22 May 2014, 17:40
Could you give an example of that (as in something that would be a real-life sort of example)? I want to sure I understand what you're asking before I answer.

m4u
23 May 2014, 21:38
For example, "the apple is red", so I look for the word "apple" with the function and then use the "is red" to ask, "Why is red?"

jaynabonne
24 May 2014, 16:05
First, I hope you can appreciate that you wouldn't want to transform it to "Why is red?", because that's not properly formed English. The correct way would be "Why is it red?" I'm just mentioning that because generating language-correct text is much tougher than just echoing back (unaltered) parts of a sentence, at least for English. :)

Having said that, would it be searching for just a single keyword, or would you want it to match just the first keyword in a list that it finds and return all text even if it has other keywords, or...?

I mean, if the person types "The apple is red, and an apple is good for you," what should it do?