Log in

View Full Version : Quiz count number of correct answers


rody
23rd April 2004, 12:42
Hello,

I am new to DVD-authoring. I'm working with Scenarist.

What I want is a quiz with 50 questions.
I have 50 menu's with 2 buttons: yes and no.
And ofcourse either 1 of them is correct.
Now I want to have the score at the end of the test.

I saw something on this forum about GPRM and bitcoding or so, where can I find some info about that?
Could anybody help me with this at least tell me of this is possible or not.

Thanks.

Kedirekin
24th April 2004, 14:25
I've never done this myself, but it doesn't sound too difficult. You'd just need to dedicate a register to holding the number of correct choices, then have each button link tail PGC and increment the register (or not) based on the highlighted button.

This assumes of course that each question is in it's own PGC, but with only 50 questions that shouldn't pose a problem.

I don't know if there is a way to do it if all the questions are in one PGC. If I understand correctly, a button can only have one command, so I don't see how you could have it increment the register (or not) and link to the next cell.

DaRat
24th April 2004, 19:13
Originally posted by Kedirekin
...I don't see how you could have it increment the register (or not) and link to the next cell.

Type3 Command: Compare-Set&Link

Compares values, then sets gprm depending on the compare, then links to wherever you want to.

Kedirekin
25th April 2004, 14:48
Actually, if you can do it all in the button command (and I think you're right - you can), you don't need the compare.

On the 'right' button(s)
Add GPRM##,1 - LinkNextC

On the 'wrong' button(s), just
LinkNextC

rody
27th April 2004, 22:22
Well, thanks for the reply's

Because I'm a newbee I hope you could help me started.

Well I want to have random questions.
Can I have all the "menu's" in 1 VTS and than pick randomly 50
menu's/questions out of it?

Or do I have to divide it over 50 VTS's and pick out one of each?
And ofcourse 1 extra VTS with 51 menu's that show the score(0-50)

And shall I make the menu's in scenarist and do the programming in IFOedit?

Experts! Please help me out.

Dimmer
28th April 2004, 04:19
@rody
No offense, but it would really help if you learned some DVD basics, such as what GPRM and VTS are. The guides (http://www.doom9.org/dvd-basics.htm) is a good place to start. You need to know the basics before getting on with advanced stuff such as Scenarist. The guys above are giving you great advice, and you will see it as soon as you understand what they're talking about.

Good luck.

Kedirekin
28th April 2004, 12:47
'Read the Manual' is always good advice. Here is another, IMO, excellent resource The Unofficial DVD Specifications Guide - VM Virtual Machine Command Set (http://www.dvd-replica.com/DVD/vmcmdset.php).

About randomly selecting questions, I don't see a way, at least not for 50. If you had 500 questions, you might be able to bounce around randomly 50 times with a small chance of hitting a duplicate. Or if you just had a few, you could dedicate a few of the general purpose registers to order the questions, but there are only 16 GPRMs.

Presenting exactly 50 questions in random order may be beyond the capabilities of the DVD virtual machine. I could be wrong though; there may be a creative way that just isn't occurring to me.

rody
28th April 2004, 16:03
I've read the basics already several times.
And these guides are more ripper-guides
And I am no ripper I more of a maker.

But I learned already a lot. I now know what is possible,
I only don't know how it must be done (yet).

I'm not rich, but I'm willing to pay lets say 50,- €/$ to the one who would help me getting started and make the basic code.
You won't have to make the complete code. I understand that, that
will be a shitload of work.

I will now try to explain exactly what I want.

I want to have a quiz of 50 questions.
At the end of the quiz I want to have the score.
The questions must be randomly chosen.
The 50 questions consist out of 3 types.

45 yes/no questions (2 buttons)
3 A,B or C questions (3 buttons)
2 bonus questions where they have to give age up to 3 digits(I'm affraid this will have to be multiple menu's)
[/list=a]
[list]
The 3 types of questions should also be in a random order.
-Let say there are 500 different yes/no questions
-100, A,B or C questions
-and 20 bonus questions

If it is not very clear to you, you can always send a me a PM.

DaRat
28th April 2004, 17:48
First of all: I don't really think it's a good thing to offer money for anything on this board. It has the potential to became some kinda "paying unofficial customer support" thing and while I'm sure that none of the current visitors of this board would go that far, the frequent "money-prize" would attract other elements. Besides it would generate rivalisation between forum members, what is not a bad thing unless they do it for money or "some higher reason". :devil: In my experience if you ask here you'd get an answer or at least someone would show you where and how to start. (Well, mostly. :D ;)) But that's only my $.02. :D Feel free to slap me if I'm wrong. :D


So, about your problem. It's not a very hard thing to do, here's a sample code, think you'll be able to make your own out of this one.


GPRM3 - temporaly storage for the # of tries to generate a random number
GPRM4-8 - temp variables for various tasks
GPRM9 - generated random number
GPRM10-12 - storage for used question #'s
GPRM13 - current score
GPRM14 - used qty of questions

Random_pg - Random number generator
Fooked_up_random_generators_pg - If a player is uanble to generate a correct random number
Eval_Score_pg - Jump here after each question, check # of q's displayed, etc


[Random_pg]
1: Set GPRM3, 0
2: Set GPRM5, 1 // begin the "random-loop" here
3: Set GPRM4, 1
4: Add GPRM3, 1
5: If (GRPM3>3) LinkPGC [Fooked_up_random_generators_pg]
6: Random (GPRM9, 47)
7: Set GPRM6, GPRM9 // check if this q was used before, if it was
8: Set GPRM7, GPRM9 //then generate a new random number or if it
9: Div GPRM6, 16 //was not then set it "used"
10: Mod GPRM7, 16
11: If (GPRM7==1) GoTo 15
12: Mul GPRM5, 2
13: Add GPRM4, 1
14: If (GPRM4!=GPRM7) GoTo 12
15: If (GPRM6==0) GoTo 19
16: If (GPRM6==1) GoTo 21
17: If (GPRM5&GPRM12) GoTo 2
18: Add GPRM12, GPRM5
19: GoTo 25
20: If (GPRM5&GPRM10) GoTo 2
21: Add GPRM10, GPRM5
22: GoTo 25
23: If (GPRM5&GPRM11) GoTo 2
24: Add GPRM11, GPRM5
25: If (GPRM9==1) LinkPGCN [Question_YesNo_1_pg]
26: If (GPRM9==2) LinkPGCN [Question_YesNo_2_pg]
.
.
.
70: If (GPRM9==47) LinkPGCN [Question_YesNo_45_pg]


[Fooked_up_random_generators_pg] //if ther player is unable to generate a random number
1: Set GPRM4, 1
2: Set GPRM5, 0
3: If (GPRM4&GPRM10) GoTo 10
4: Set GPRM5, 1
5: If (GPRM4&GPRM11) GoTo 10
6: Set GPRM5, 2
7: If (GPRM4&GPRM12) GoTo 10
8: Mul GPRM4, 2
9: GoTo 2
10: If (GPRM5==2), GoTo 46
11: If (GPRM5==1), GoTo 29
12: Add GPRM12, GPRM4
13: If (GPRM4==1) LinkPGCN [Question_YesNo_1_pg]
14: If (GPRM4==2) LinkPGCN [Question_YesNo_2_pg]
15: If (GPRM4==4) LinkPGCN [Question_YesNo_3_pg]
.
.
.
28: If (GPRM4==32768) LinkPGCN [Question_YesNo_16_pg]
29: Add GPRM11, GPRM4
30: If (GPRM4==1) LinkPGCN [Question_YesNo_17_pg]
31: If (GPRM4==2) LinkPGCN [Question_YesNo_18_pg]
32: If (GPRM4==4) LinkPGCN [Question_YesNo_19_pg]
.
.
.
45: If (GPRM4==32768) LinkPGCN [Question_YesNo_32_pg]
46: Add GPRM10, GPRM4
47: If (GPRM4==1) LinkPGCN [Question_YesNo_33_pg]
48: If (GPRM4==2) LinkPGCN [Question_YesNo_34_pg]
49: If (GPRM4==4) LinkPGCN [Question_YesNo_35_pg]
.
.
.
60: If (GPRM4==4096) LinkPGCN [Question_YesNo_45_pg]


[Eval_Score_pg]
1: Add GPRM14, 1
2: If (GPRM14==47) GoTo 4
3: LinkPGCN [Random_pg]
4: Set GPRM14, 0
5: LinkPGCN [ABC_Random_Generator_pg]


[Button Commands, each Question_YesNo]
Correct Answer: Add GPRM13, 1, LinkPGCN [Eval_Score_pg]
Wrong Answer: LinkPGCN [Eval_Score_pg]


I'm sure this is not the best (and simple) code to solve this and it may be bogus (never tested it) but it's a start. Basicly you generate a random number, compare it to gprm's 10, 11 and 12 to see if the question was used before, if not, jump to the question, if it was then go back to random generation, generate a new number. After 3 unsuccessful generation jump to "fooked_up_blahgblahblah_pg" to check the first available question and jump to it. The code also sets the question "used" before it makes the jump. After each question it jumps to a another dummy, check if all our questions were used (this could be solved by simply checking their status, but I used a separate counter for simplicity), if we did 45 questions then jump to a different section (abc questions).

Since I always use gprms 0, 1 and 2 to keep track various attribs of the main movie and the disc thoose were not used. :D Hope you find this useful and hope I haven't f*cked up the code. :D And buy your g/f (or b/f or mum or whoever you want to) something nice. :D