Esempio n. 1
0
                         if ($_GET['user_configurable'] > $questionsNumber || $_GET['user_configurable'] <= 0) {
                             eF_redirect(basename($_SERVER['PHP_SELF']) . "?view_unit=" . $_GET['view_unit'] . '&message=' . urlencode(_MUSTSPECIFYVALUEFROM . ' 1 ' . _TO . ' ' . $questionsNumber));
                             exit;
                         } else {
                             eF_redirect(basename($_SERVER['PHP_SELF']) . "?view_unit=" . $_GET['view_unit'] . '&message=' . urlencode(_INVALIDFIELDDATA));
                             exit;
                         }
                     }
                 }
             }
             if ($test->options['test_password']) {
                 if ($test->options['test_password'] != urldecode($_GET['test_password'])) {
                     eF_redirect(basename($_SERVER['PHP_SELF']) . "?view_unit=" . $_GET['view_unit'] . '&message=' . urlencode(_INVALIDPASSWORD));
                 }
             }
             $testInstance = $test->start($currentUser->user['login']);
             eF_redirect(basename($_SERVER['PHP_SELF']) . "?view_unit=" . $_GET['view_unit']);
             exit;
         } else {
             $testInstance = $test;
             $test->getQuestions();
             //This way the test's questions are populated, and we will be needing this information
             if (empty($test->options['random_test'])) {
                 $testInstance->options['random_pool'] && $testInstance->options['random_pool'] <= sizeof($testInstance->questions) ? $questionsNumber = $testInstance->options['random_pool'] : ($questionsNumber = sizeof($testInstance->questions));
             } else {
                 $questionsNumber = $test->getNumQuestionsForRandomTests();
             }
         }
         break;
 }
 if (isset($_GET['ajax']) && $testInstance instanceof EfrontCompletedTest) {