Conditionals for checking students work?

I am trying to code the CL to mark the questions : List 2 factors of 36. This is fine so far but I cannot work out how to mark it wrong if they repeat factors. I assume there is someway of using an if statement but am not sure what the syntax should be:

eg : If cellNumericValue(1,2)=cellNumericValue(1,3) cellContent(1,4):“N”

then the code for checking the factors are correct?

CL doesn’t use if-then. It uses when-otherwise. Also, instead of using “else if” as many coding languages do, you can just continue using when until the final otherwise.

...when condition result
   when condition result
   when condition result
   otherwise result

You may find not( ) useful here.

when cellNumericValue(1,2)=2 or cellNumericValue(1,2)=3 or ... 
  and not(cellNumericValue(1,2)=cellNumericValue(1,3))...
1 Like

Thanks Daniel. Yes the not() was the best way of solving this, thanks for the explanation about when-otherwise