Skip to content

Commit d764378

Browse files
authored
Block ** and give better feedback about disabled ops
1 parent 790058f commit d764378

File tree

1 file changed

+7
-1
lines changed
  • OpenProblemLibrary/Rochester/setAlgebra11ComplexNumbers

1 file changed

+7
-1
lines changed

OpenProblemLibrary/Rochester/setAlgebra11ComplexNumbers/Sqrt.pg

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,13 @@ $showPartialCorrectAnswers = 1;
2525

2626
Context("Complex");
2727
Context()->functions->disable('sqrt');
28-
Context()->operators->undefine('^');
28+
Context()->operators->undefine('^', '**');
29+
Context()->{error}{msg}{"Can't use '^' in this context"}
30+
= "Exponents are disabled for this problem. Compute the result for yourself and resubmit your answer.";
31+
Context()->{error}{msg}{"Can't use '**' in this context"}
32+
= "Exponents are disabled for this problem. Compute the result for yourself and resubmit your answer.";
33+
Context()->{error}{msg}{"Function 'sqrt' is not allowed in this context"}
34+
= "Square roots are disabled for this problem. Compute the result for yourself and resubmit your answer.";
2935

3036
do {
3137
$z = non_zero_random(-5,5,1) + non_zero_random(-5,5,1)*i;

0 commit comments

Comments
 (0)