ANS(Matrix([[1,2]])->cmp( showDimensionHints => 0, checker=>sub { ($correct,$student,$ans) = @_; my $isSquare = $student->isSquare; $ans->{ans_message} = "Your matrix has a determinant" if $isSquare && !$ans->{isPreview}; return !$isSquare; } ));

This forum has a limit to the number of forum postings you can make in a given time period - this is currently set at 10 posting(s) in 1 day

Here is a version that sets the error message that you requested.

ANS(Matrix([[1,2]])->cmp( showDimensionHints => 0, checker=>sub { ($correct,$student,$ans) = @_; my $isSquare = $student->isSquare; $ans->{ans_message} = "Your matrix has a determinant" if $isSquare && !$ans->{isPreview}; return !$isSquare; } ));

You are currently using guest access (Log in)