secqaa_calc.php
741 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
/**
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: secqaa_calc.php 10395 2010-05-11 04:48:31Z monkey $
*/
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
class secqaa_calc {
var $version = '1.0';
var $name = 'calc_name';
var $description = 'calc_desc';
var $copyright = '<a href="http://www.comsenz.com" target="_blank">Comsenz Inc.</a>';
var $customname = '';
function make(&$question) {
$a = rand(1, 90);
$b = rand(1, 10);
if(rand(0, 1)) {
$question = $a.' + '.$b.' = ?';
$answer = $a + $b;
} else {
$question = $a.' - '.$b.' = ?';
$answer = $a - $b;
}
return $answer;
}
}
?>