HOME ➔ SUPPORT ➔ Community ➔ General CourseLab issues ... if else
if else
  View type:
how do you define an if else statement?
It's easier to demonstrate than to explain Sam so I've built a small module that shows using an IF ELSE control loop.
I just want to add a little more info before I post it so it's clear what's going on.
I'll add a link here later today or tomorrow so you can get the source files and a compiled module.
Sam have a look at the last item on http://www.friendsofcourselab.info/inter/inter_base.html
Download the ready to run IF ELSE.zip hopefully it's what you're after
I have a test wherein I set pass at 70%. If pass goto congrats. If fail goto fail. When I run the entire test it always goes to fail. If I set pass at 5 and run only the last five questions, it works fine - goto's are correct. What am I missing?
Might be a couple of things Sam but probably is in the values you are using. The values have to be the same kind of object so they can be compaired.
If you are checking '70%' you probably want to use the actual score as a number.
The % is calculated from the actual score so if you say 'if {total score} => {70 pass needed} then goto pass' it will always fail as the first value will not be a % and way smaller than your 70.
The % score is only calculated when it's used so use a number instead

Message options
No additional options