From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple Choice Quiz

Solved!
Go to solution
I'm very new to LabView, so forgive me if my question seems overly simple. I'm trying to incorporate what basically ammounts to a multiple choice quiz into my front panel VI. I want the user to choose one of the answers provided, and then have it move onto the next question, and repeat the same process. I also need the ability to log which answers are chosen for which questions. I think I have a basis to do this, but I am just not familiar enough with this program yet to grasp the finer points. So far I have four buttons, each linked to a local varriable. I have a while loop, and the counter i is linked to another local variable that keeps track of which question the user is on. I know that I will need to use the "Write Labview measurement file" to save the data, but I'm not sure how to work it to do what I want. The "Build Text" function looked like it might do what I want in terms of interpreting data, but again, I must be doing something wrong. Also, I'm not sure how to make it so that after the user answers one question the text that asks the question is changed. Any help or hints in any of these area's would be greatly appreciated.
0 Kudos
Message 1 of 16
(9,316 Views)
Attached is a quick vi that shows one way to accomplish what you're trying to do. There is an input array of questions and an output array which are the answers given. This will step through all of the questions sequentially. I have also graded the test by comparing to a list of correct answers.

All of this information can be stored to file at the completion of the test. You may also log the data during the test, one line at a time.
0 Kudos
Message 2 of 16
(9,298 Views)
Thanks, I'm sure that will help, but I only have version 7.0 and it won't let me open the VI
0 Kudos
Message 3 of 16
(9,294 Views)
Solution
Accepted by wiebe@CARYA
Here it is in version 7.0.
0 Kudos
Message 4 of 16
(9,291 Views)
Solution
Accepted by wiebe@CARYA
Here is a anothe rexample



Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 5 of 16
(9,286 Views)

Excuse me, i've opened multiple choice.vi but the there are no question ( empty box )

should i write my own question or the question are already exist ?

Thanks 

0 Kudos
Message 6 of 16
(6,751 Views)

in the first vi (i didn't open the 7.0 version though) there are questions,

the questions field gets populated in each iteration of the for loop from the auto indexed "Array of Questions"

the event structure inside the for loop listens on "mouse up" events on each answer button


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
0 Kudos
Message 7 of 16
(6,737 Views)

@Dominj wrote:
So far I have four buttons, each linked to a local varriable.

I'd use either a cluster with four buttons or a radio button with 4 buttons (set to allow no selection).

 

Typically, you'd use the event structure to detect value changes (regardless what's used: 4 buttons, a cluster or a radio button). No need for local variables.

 


@Dominj wrote:
I know that I will need to use the "Write Labview measurement file" to save the data

I would not use that. Don't think I ever used it.

 

This kind of information would be ASCII, and I'd want the resulting files to be readable in e.g. Notepad.

 

I'd use the Config File VIs library (under File I\O). Although a bit primitive, that library takes a lot of work out of your hands...

 


@Dominj wrote:
Also, I'm not sure how to make it so that after the user answers one question the text that asks the question is changed. Any help or hints in any of these area's would be greatly appreciated.

That's an architecture problem. I'd make a loop with an event structure in it. For this problem that would be enough. You might also look into state machines and\or producer\consumer architectures.

 

If you post what you have, we can help you better.

0 Kudos
Message 8 of 16
(6,728 Views)

Oh, and consider upgrading. LV7 is 11 LabVIEW versions old.

0 Kudos
Message 9 of 16
(6,727 Views)

i want make quiz like " who wants to be a millionaire " where each answer button has text, and one of them is correct answer, when the question changes, text on the question button change as well.

 

anyone can help me ? 

0 Kudos
Message 10 of 16
(6,724 Views)