11-19-2012 08:46 AM
Hi all,
I'm actually doing a project regrading e-learning. And i'm suppose to create a set of questions for each topics using labview. So Is there any way that i can match certain word in the string to make sure that answer is correct? Cause i'm sure that every user that input answer will be different. Thus, I want to pick out main point as an answer. Is there anyway i can do it??
Really appreciate your help!!!
Thank you!!
Solved! Go to Solution.
11-19-2012 08:53 AM
You could use the Match Pattern inside of a FOR loop. Iterate on your important points (which is an array of strings) and search in the given answer. The index output of the Match Pattern will be -1 if it was not found. So do a test of Greater or Equal to 0 on it for a pass. If all pass (AND Array Elements), then the answer is correct.
11-19-2012 09:05 AM
Sorry, but how do i (AND an array element)?
11-19-2012 09:10 AM - edited 11-19-2012 09:11 AM
You can also look at the regular expression thread:
http://forums.ni.com/t5/BreakPoint/Regular-Expressions-Board/td-p/1187799
To AND array elements, go the the functions palette, inside the Programming > Boolean palette, you will find "AND Array Elements", it looks like a triangle with an upside down 'A' in it. Simply wire the array to the function and it will AND every element within the array.
To learn more about LabVIEW, I suggest you try looking at some of these tutorials.
11-19-2012 09:19 AM
@joseleen wrote:
Sorry, but how do i (AND an array element)?
11-19-2012 09:35 AM
Sorry, i really still don't understand the AND array element. Can you please show me some examples or help me edit my program?
Really appreciate your help 🙂 Thanks alot:)
11-19-2012 09:55 AM
11-19-2012 10:00 AM
11-19-2012 10:09 AM
Thank you!:)
11-19-2012 10:47 AM - edited 11-19-2012 10:48 AM
Here's another option (building on Jeff's code). Turn on the Conditional Terminal on the FOR loop and change it to "Continue if TRUE". This way, the loop will exit as soon as a failure is found. Just pass the result straight out of the loop. If none fail, then the FOR loop will exit on its own (from the auto-indexing) and a pass is passed out.