예제 #1
0
     $currentExam .= print_container_end(true);
     $currentExam .= "<div id='info_{$record->id}'></div><br/>";
     $currentExam .= "<hr>";
 } else {
     if ($now >= $starttime && $now <= $endtime) {
         //echo "*Your Exam is has STARTED<br />";
         //echo date($format,$currentTime)." is after ".date($format,$record->starttime). "<br />";
         //echo date($format,$currentTime)." is before ".date($format,$record->endtime). "<br />";
         // Check if Quiz Context exists, if not get Random Context
         checkContext($record, $course);
         echo "TEST";
         // echo date('H:i:s', $starttime+1800);
         // Button are available
         print_container_start(false, '', '', false);
         echo "<b><font color='red'>Your Exam has Started:</font></b><br/><br/>";
         displayExamInfo($record, 30);
         // 30 Minute Diff.
         // If 30 minutes after the Exam Started - make Practical Intructions available (disable Exam)
         // add 30 minutes (7000 seconds) (His)
         if ($now >= $starttime + 1800) {
             print_single_button('', null, 'Exam Instructions', 'get', '', false, '', true);
             echo "<br/>";
             print_single_button('', null, 'Start Exam', 'get', '', false, '', true);
             echo "<font size='2' color='green'>&radic;</font> <font size='2' color='red'>Your exam has been submitted</font><br/>";
             echo "<br/>";
             $opts = array('courseid' => $course->id, 'eid' => $record->id, 'view' => 2);
             print_single_button("{$CFG->wwwroot}/question/view_instructions.php", $opts, 'Practical Instructions', 'get', '', false, '', false);
             echo "<br/>";
         } else {
             // Starttime to + 30 mins
             $opts = array('courseid' => $course->id, 'eid' => $record->id, 'view' => 1);
             $record = updateExamStatus($record, "Graded");
             // Page Structure
             $prevExam .= "<table border='0' cellpadding='5' cellspacing='5'>";
             $prevExam .= "<tr><td valign='top'>";
             $prevExam .= displayInfo($record, $exam_length, true);
             $prevExam .= "</td></tr>";
             $prevExam .= "<tr><td>";
             // Print Status - Checks if the exam was taken, via the quiz grade
             if ($record->status == "Graded" || $record->grade1 != null && $record->status == "Implementation") {
                 $prevExam .= examStatus($record, array(6), "", true);
             } else {
                 $prevExam .= examStatus($record, array(0), "", true);
             }
             $prevExam .= "</td></tr>";
             $prevExam .= "<tr><td>";
             $prevExam .= displayExamInfo($record, $exam_length, true);
             $prevExam .= "</td></tr>";
             $prevExam .= "<tr><td>";
             $prevExam .= showGrades($record, true);
             $prevExam .= "</td></tr>";
             $prevExam .= "</table>";
             // End Structure
             $prevExam .= "<hr/>";
             // -- old
             //$quiz = get_record('quiz', 'id', $record->quizid);
             //$prevExam .= "<div><b>".$quiz->name.": </b>";
             //$prevExam .= $record->grade1."/".$quiz->sumgrades;
             //$prevExam .= " | <a href='$CFG->wwwroot/mod/quiz/review.php?attempt=$record->attemptid'>Summary</a></div>";
         }
     }
 }
예제 #3
0
                    if ($now >= $starttime + $exam_length * 60) {
                        //echo "Exam is Over - Practical Instructions Available <br/>";
                        examStatus(array(5));
                    } else {
                        // Starttime to + 30 mins
                        examStatus(array(4));
                    }
                    displayExamInfo($record, $exam_length);
                } else {
                    //echo "Your Exam is OVER - Practical is Over - View Grades<br />";
                    if ($record->grade1 != null) {
                        examStatus(array(6));
                    } else {
                        examStatus(array(0));
                    }
                    displayExamInfo($record, $exam_length);
                    showGrades($record);
                }
            }
        }
    }
    echo "<hr/>";
}
print_footer('Register');
// Please do not modify this line
?>

<?php 
function displayExamInfo($record, $diff)
{
    // Diff is time in minutes