Exemplo n.º 1
0
        $res_rand = array();
        $pid_num = count($res_all);
        $temp = array();
        if ($pid_num < $que_of_num) {
            $que_of_num = $pid_num;
        }
        for ($i = 0; $i < $que_of_num; $i++) {
            $rand_num = rand(0, $pid_num - $i - 1);
            $res_rand[$i] = $res_all[$rand_num];
            $temp = $res_all[$rand_num];
            $res_all[$rand_num] = $res_all[$pid_num - $i - 1];
            $res_all[$pid_num - $i - 1] = $temp;
        }
        return $res_rand;
    }
}
$que = new question();
$que->getRandJud(1, 60);
//$que->addMulAns(" #QI'm a ?  #man #Qfengjei #plant", 1);
//$que->addMulJud("#Qfengjiu# Y#Qchenyou# N", 1);
//echo $que->addMulSel("#Qque#A#B#C#D# C#QUE#AA#BB#CC#DD#  E", 1);
//$que->getSel(-1,'凤姐');
//$que->addOneAns("fengjie", "man", 1);
//$que->addOneJud("fengji", " Y ", 1);
//$que->addOneSel("fengjie", "Y", "B", "C", "D"," A ", 1);
?>