phptest-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phptest-users] To Randomize or not to Randomize


From: TW-2
Subject: [Phptest-users] To Randomize or not to Randomize
Date: Sun, 19 Jan 2003 04:05:59 -0700

If you do not want random questions, comment out the old function (do not
delete it in case this doesn't work for you!!) and change the function in
ctest.inc.php


    function randomize($required)
    {
        global $db, $user, $questions;
        $result = $db->query("SELECT question_id FROM questions WHERE
required = $required AND subject_id = {$this->info['subject_id']}");
        // get number of questions in skill level
        if (!$numrows = $db->num_rows($result)) {
            return FALSE;
        }

        $count = 0;

  while ($row = $db->fetch_object($result)) {
                $this->questions[$count++] = $row->question_id;
            }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]