Example #1
0
}
$res = mysqli_fetch_array($res);
$notyet = false;
$time_left = 0;
$time_msg = '';
$notanymore = false;
$testname = $res['testname'];
$visiblefrom = $res['visiblefrom'];
$visibletill = $res['visibletill'];
$secondsleft_start = $res['secondsleft_start'];
$secondsleft_end = $res['secondsleft_end'];
//echo "$secondsleft_start $secondsleft_end";
include './scripts/isstudentauthorised_test.php';
if ($_SESSION['type'] == "student") {
    $rollno = $_SESSION['username'];
    $res = isstudentauthorised($db, $rollno, $testid);
    if ($res == 2) {
        $notyet = true;
    } else {
        if ($res == 3) {
            $notanymore = true;
        } else {
            if ($res == 1) {
                //allowed
            } else {
                $status = false;
                $errorstr = $res;
                goto next;
            }
        }
    }
Example #2
0
         $show = true;
     } else {
         $errorstr = "Problem not available for viewing";
     }
 } else {
     if (isset($_POST['attempt'])) {
         $istest = true;
         if (isset($_POST['problem_code'])) {
             $probcode = strip_tags(mysqli_real_escape_string($db, $_POST['problem_code']));
         }
         if (isset($_POST['testid'])) {
             $testid = strip_tags(mysqli_real_escape_string($db, $_POST['testid']));
         }
         if ($_SESSION['type'] == "student") {
             include './scripts/isstudentauthorised_test.php';
             $res = isstudentauthorised($db, $username, $testid);
             if ($res == 2 || $res == 3) {
                 //echo "not allowed";
                 header("Location: ./test.php?testid={$testid}");
                 goto end;
             } else {
                 if ($res == 1) {
                     if (isproblemintest($db, $probcode, $testid) == 1) {
                         $show = true;
                     } else {
                         $show = false;
                     }
                 } else {
                     echo $res;
                     goto end;
                 }
Example #3
0
        return false;
    }
    for ($i = 0; $i < $oparrsize; $i++) {
        if ($lineuseroparr[$i] != $lineoparr[$i]) {
            return false;
        }
    }
    return true;
}
require './determineidentityfunc.php';
if (!(isloggedin("any") == true)) {
    header('Location: ./../home.php');
} else {
    include './../includes/mysql_login_test.php';
    require './isstudentauthorised_test.php';
    if (isset($_POST['testid']) && $_SESSION['type'] != "admin" && $_SESSION['type'] != "faculty" && isstudentauthorised($db, $_SESSION['username'], $_POST['testid']) != 1) {
        mysqli_close($db);
        $testid = $_POST['testid'];
        echo "here";
        //	header("Location: ./../test.php?testid=$testid");
    } else {
        mysqli_close($db);
        ini_set('display_errors', 1);
        ini_set('display_startup_errors', 1);
        error_reporting(-1);
        if (isset($_FILES['solution']) && $_FILES['solution']['size'] > 0 && isset($_POST['language']) && isset($_SESSION['username']) && isset($_POST['username']) && $_POST['username'] == $_SESSION['username']) {
            $errorstr = '';
            $status = true;
            include_once './../includes/listoflanguages.php';
            $filename = $_FILES['solution']['name'];
            $filetype = $_FILES['solution']['type'];