|
@@ -56,11 +56,6 @@ if($submit) {
|
|
|
if($is_started || $is_unverified) {
|
|
if($is_started || $is_unverified) {
|
|
|
// Parse after the test form
|
|
// Parse after the test form
|
|
|
$fields = $json->duringTest;
|
|
$fields = $json->duringTest;
|
|
|
-
|
|
|
|
|
- if($is_started) {
|
|
|
|
|
- $duration = http::value("duration", "int");
|
|
|
|
|
- if(!$duration) $form_exception->addError("Duration was not submitted.");
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
foreach($fields as $field) {
|
|
foreach($fields as $field) {
|
|
@@ -136,6 +131,9 @@ if($submit) {
|
|
|
if($end_unix < $recorded_start_unix) $form_exception->addError("Test End date/time cannot be later than the recorded start date/time.");
|
|
if($end_unix < $recorded_start_unix) $form_exception->addError("Test End date/time cannot be later than the recorded start date/time.");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ else {
|
|
|
|
|
+ $form_exception->addError("Entry Time and Exit Time must be filled in.");
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
if($form_exception->hasErrors()) throw $form_exception;
|
|
if($form_exception->hasErrors()) throw $form_exception;
|
|
|
|
|
|
|
@@ -156,16 +154,10 @@ if($submit) {
|
|
|
$test->status = Test::STATUS_PENDING_VERIFICATION;
|
|
$test->status = Test::STATUS_PENDING_VERIFICATION;
|
|
|
|
|
|
|
|
if($is_started) {
|
|
if($is_started) {
|
|
|
- $unix_start = strtotime($test->dts_start);
|
|
|
|
|
- $unix_end = $unix_start + floor($duration / 1000); // $duration is milliseconds
|
|
|
|
|
-
|
|
|
|
|
- $test->dts_end = date("Y-m-d H:i:s", $unix_end);
|
|
|
|
|
-
|
|
|
|
|
if($start_unix && $end_unix) {
|
|
if($start_unix && $end_unix) {
|
|
|
$test->dts_start = date("Y-m-d H:i:s", $start_unix);
|
|
$test->dts_start = date("Y-m-d H:i:s", $start_unix);
|
|
|
$test->dts_end = date("Y-m-d H:i:s", $end_unix);
|
|
$test->dts_end = date("Y-m-d H:i:s", $end_unix);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
$test->pass = ($test->challenge_stage <= 2) ? 1 : 0; // Pass = Challenged during browsing or before
|
|
$test->pass = ($test->challenge_stage <= 2) ? 1 : 0; // Pass = Challenged during browsing or before
|