Page 1 of 1

Two correct entries required

PostPosted: Wed Jan 08, 2014 7:46 pm
by seanie
Hello again, and Happy New Year!

I'm making a practice test for my students that is 'self-correcting' i.e. if they enter the correct answer in the text entry box, a tick is shown:

If "[TextEntry1]" "=" "correct answer" ShowObject "Picture1" "None" "0" (Picture 1 is the tick .. or 'check mark' for the Americans :-))

My problem is with sentences that have two text entry boxes. I can't seem to write a working command for BOTH text boxes to have correct answers before the tick is displayed, so I've been resorting to using two smaller ticks (one for each text entry box). This is kind of unsatisfactory.

I need something along the lines of If "[TextEntry1]" "=" "correct answer1" AND "[TextEntry2]" "=" "correct answer2" ShowObject "Picture1"

In other words, the tick will only be displayed if BOTH fields are filled correctly. How do I write the command for that? Please pardon my ignorance :-)

Re: Two correct entries required

PostPosted: Thu Jan 09, 2014 12:04 am
by Odd
Please see the IfEx statement for this purpose.

Another solution is to use nested If statements
If a = b
If c = d
(your code here)
EndIf
EndIf

Two correct entries required

PostPosted: Thu Jan 09, 2014 7:49 am
by virger
The simplest way
...[ans1] === correct
...[ans2] === correct
ifex "[ans1]-[ans2]=correct-correct OR [ans1]=correct OR [ans2]=correct"
bla bla bla
endif

From Costa Rica
Pura Vida

Re: Two correct entries required

PostPosted: Thu Jan 09, 2014 4:24 pm
by seanie
Odd wrote:Please see the IfEx statement for this purpose.

Another solution is to use nested If statements
If a = b
If c = d
(your code here)
EndIf
EndIf


Thanks Odd. Worked like a charm :-)

Re: Two correct entries required

PostPosted: Thu Jan 09, 2014 4:26 pm
by seanie
virger wrote:The simplest way
...[ans1] === correct
...[ans2] === correct
ifex "[ans1]-[ans2]=correct-correct OR [ans1]=correct OR [ans2]=correct"
bla bla bla
endif

From Costa Rica
Pura Vida


Muchas gacacias y Pura Vida :-)

Re: Two correct entries required

PostPosted: Thu Jan 09, 2014 6:04 pm
by David de Argentina
Hi,

Code: Select all
IfEX "[TextEntry1]=correct_answer1 AND [TextEntry2]=correct_answer2"
  . Both answers are correct. display de image.
Endif


Using AND operator, if true, both answers are correct.
Using OR operator, if true, ONE answer are correct

My 0.01