/** you can also modify $output to your needs **/ function produceOutput($question, $color, $prime) { $a = rand() % 10; // generates the random number $b = rand() % 10; // generates the random number $code = MathGuard::generateCode($a, $b, $prime); // please don't remove the backlink, thank you $output = '<a href="http://www.codegravity.com/">MathGuard</a> ' . $question . '<table border="0"> <tr> <td> <pre style="font-size:' . SIZE . 'px;font-weight:bold;color:' . $color . ';padding:0px;margin:0px;line-height:' . LINEHEIGHT . 'px;">' . MathGuard::renderExpression($a, $b) . '</pre> </td> <td> <input type="text" style="width:20px;" name="mathguard_answer" maxlength="2"/> <input type="hidden" name="mathguard_code" value="' . $code . '" /> </td> </tr> </table>'; return $output; }