Last modified: 2010-10-29 19:31:57 UTC
It is hard to tell hyphen-minus from multiplication dot. I would recommend using − instead for presentation. function SimpleCaptcha.getCaptcha() { $a = mt_rand(0, 100); $b = mt_rand(0, 10); $op = mt_rand(0, 1) ? '+' : '−'; $test = "$a $op $b"; $answer = ($op == '+') ? ($a + $b) : ($a - $b); return array('question' => $test, 'answer' => $answer); } Alternatively, the equation should be typeset in a monospaced font style.
Please provide a patch.
I do not have a development environment for MediaWiki (in particular, I do not have Subversion). I hope replacing that '-' with '−' is simple enough for any developer. Do not take it as a refusal. I just doubt I will be able to set things up quickly.
76c76 < $op = mt_rand(0, 1) ? '+' : '-'; --- > $op = mt_rand(0, 1) ? '+' : '−'; (Untested.)
Please *do* test.
Index: extensions/ConfirmEdit/ConfirmEdit_body.php =================================================================== --- extensions/ConfirmEdit/ConfirmEdit_body.php (revision 47356) +++ extensions/ConfirmEdit/ConfirmEdit_body.php (working copy) @@ -73,7 +73,7 @@ function getCaptcha() { $a = mt_rand(0, 100); $b = mt_rand(0, 10); - $op = mt_rand(0, 1) ? '+' : '-'; + $op = mt_rand(0, 1) ? '+' : '−'; $test = "$a $op $b"; $answer = ($op == '+') ? ($a + $b) : ($a - $b); (This is subversion diff this time, still struggling with how to test it)
Test done, result positive.
Fixed in r75667.