LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help me create a maths quizz

Solved!
Go to solution

Hello,

 

I am a student and for a final exam I have to a "maths quizz" programm on Labview. It's a very open subject where I can do what I want. I decided to make a programm where the user can choose a type a calcul (additions, subtractions...), then the programm associate two random numbers with a + or * for example, Then the user type his answer and programm count his score : +1 or -1 whether it's the good answer or not.

 

Here is the diagramm I'm trying to make, but the score count doesn't work.

How can I fix it ?

 

 

PS : my last post has been deleted, I understand this forum is to help people learn Labview, not to ask someone to do my homework. That's why I started myself this programm, but I need help to fix it.

Message 1 of 26
(307 Views)

Thank you for providing pictures since you program is saved in LV2024 and I only have 2021.

One problem I see is that you have to connect the shift register in the "Ask a question" case. This will keep the accumulated count when the "Ask a question" case is run. Without that connection the shift register value will be reset to 0. You can see that happen if you turn debugging Highlight Execution on then run your program.

Hope that helps you.

 

ooth_0-1713461369302.png

 

0 Kudos
Message 2 of 26
(284 Views)

Thank you very much, it works now.

To get a better grade, I must use a graph and a table with multiple lines in my programm. I will try and keep you updated when I will be stuck again.

0 Kudos
Message 3 of 26
(270 Views)

One other thing to fix. Connect the shift register in the "Validate answer" case. This will keep the total value for the comparison instead of resetting it to 0. This way if you type in the wrong answer and then typing the right answer it will be comparing it to the total not 0.

 

ooth_0-1713462867433.png

 

Also I can't see the False case in the "Validate answer" case since I can't open the VI but make sure to wire the count through or it will also be reset to 0 if you type in the wrong answer.

ooth_0-1713463512358.png

 

 

0 Kudos
Message 4 of 26
(266 Views)

Yes, it's better, But now the user can use the validate button as much as he wants with the same question to get a high score. How can I link the validate button to the event "ask a question" so it automatically restart after validation without the need to click the "ask a question" button again ?

0 Kudos
Message 5 of 26
(256 Views)

If you want the user to only get 1 answer per question, you could disable the Validate button after they press it. Then enable it again once the user presses the Ask a question button. This way the user will only be able to press the Validate once. You disable/enable controls with property nodes.

0 Kudos
Message 6 of 26
(242 Views)

It works, I used the "visible" property node so the "validation" button appears only after the "ask a question" button. 

 

Now I'm trying to make an array that shows the number of good and wrong answers, but it doesn't work and I have no error, how can I fix it ?

 

I'm also tring to add a graph with a dot that go up or down whether the answer is correct or not, and go right at each validation.

It goes up and down as I want, but the dot do not go right at each validation, how can I fix it ?

 

Thank you for your help

0 Kudos
Message 7 of 26
(194 Views)

It would be easier for me to run your VI if you "Save for previous version" and select 21, for LV2021.

But from your picture I can see that the inputs to the Build XY Graph are only single numbers instead of arrays. You need to build arrays in the loop using the build array function and shift registers. I couldn't find a good LV example in the help so here a simple example. Remember to wire the shift register all the way through in the other event cases or arrays will get reset with an empty values when you trigger the "Ask A question" event.

 

 

0 Kudos
Message 8 of 26
(185 Views)

Okay, thank you, I will try that. Here is a 2021 version.

0 Kudos
Message 9 of 26
(176 Views)

@ElixirDaSueños wrote:

PS : my last post has been deleted, I understand this forum is to help people learn Labview, not to ask someone to do my homework. That's why I started myself this programm, but I need help to fix it.


A kudo from me for that...

 

Welcome to the community!

0 Kudos
Message 10 of 26
(167 Views)