public static function is_exam_global_enabled($courseid)
 {
     $cache = get_cache_function("unit_elearning", 3600);
     $steamgroup = $cache->call("steam_factory::get_object", $GLOBALS["STEAM"]->get_id(), $courseid);
     $course = new koala_group_course($steamgroup);
     $unit = self::get_elearning_unit($courseid);
     if (is_object($unit)) {
         $exam = new exam($unit, $cache->call(array($unit, "get_attribute"), "ELEARNING_UNIT_ID"), $course);
         return $exam->get_exam()->is_global_enabled();
     }
     return false;
 }
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     //dd($request->all());
     $input = Input::all();
     $examId = $request->examId;
     $courseId = exam::where('id', '=', $examId)->pluck('course_id');
     //dd($courseId);
     foreach ($input as $traineeId => $mark) {
         if ($traineeId == 0 or $mark == 0) {
             continue;
         } else {
             $this->insertMarks($mark, $traineeId, $examId, $courseId);
         }
     }
     return redirect('/marksheet')->with('status', 'Mark Insert successfully');
 }
Example #3
0
<?php

require_once '../logincheck.php';
require_once '../config/config.exam.php';
require_once '../config/config.system.php';
include 'exam.php';
$exam = new exam();
//check timeout
if (!$exam->examBefore($config_system["exam_end_time"])) {
    echo '<script>alert("考试时间已截止!")</script>';
    exit;
}
//生成考试卷子
?>

Example #4
0
 /**
  * Response when updating role succeed.
  *
  * @param  \Orchestra\Model\Role  $role
  *
  * @return mixed
  */
 public function destroySucceed(exam $exam)
 {
     $message = trans('orchestra/control::response.roles.delete', ['name' => $exam->getAttribute('name')]);
     return $this->redirectWithMessage(handles('orchestra::exam'), $message);
 }
Example #5
0
<?php

require_once '../logincheck.php';
require_once '../config/config.exam.php';
require_once '../config/config.system.php';
chdir(dirname(__FILE__));
include './exam.php';
$chapter = $_GET['chapter'];
$exam = new exam();
$examCheck = $exam->examCheckTicke($config_system["exam_end_time"], $userInfo["STU_SCO"], $chapter, $userInfo["EXAM_CHAP"]);
//check status
if ($examCheck) {
    echo $examCheck;
    header("Location: user.php?action=5 ");
    exit;
}
//random select exam
 function handle_path($path, $owner = FALSE, $portal = FALSE)
 {
     $r = "";
     foreach ($path as $s) {
         $r .= $s;
     }
     if (is_string($path)) {
         $path = url_parse_rewrite_path($path);
     }
     //lms_portal::get_instance()->initialize(GUEST_NOT_ALLOWED);
     $steam_unit = "";
     $action = "";
     if (isset($path[0]) && is_numeric($path[0])) {
         $steam_unit = steam_factory::get_object($GLOBALS["STEAM"]->get_id(), (int) $path[0]);
         if (is_object($steam_unit) && $steam_unit->get_attribute("UNIT_TYPE") !== "units_elearning") {
             return;
         }
         //TODO: cool. neues object von sich in sich ? Häh, geil!
         $unit = new units_elearning($owner->get_steam_object());
         $docextern = new koala_object_elearning($steam_unit, $unit);
         if (isset($path[1])) {
             $action = $path[1];
         }
     }
     $portal_user = lms_portal::get_instance()->get_user();
     $user = lms_steam::get_current_user();
     $scg = steam_factory::get_object($GLOBALS["STEAM"]->get_id(), STEAM_COURSES_GROUP, CLASS_GROUP);
     $current_semester = $owner->get_semester();
     $course = $owner;
     $this->set_course($course);
     $backlink = $owner->get_url() . $this->get_path_name() . "/";
     $html_handler = new koala_html_course($owner);
     if (count($path) > 0 && $path[0] == "reporting") {
         $first_unit = $this->get_elearning_unit();
         $exam = new exam($first_unit, $this->cache->call(array($first_unit, "get_attribute"), "ELEARNING_UNIT_ID"), $owner);
         if ($course->is_admin($user)) {
             $exam->render_reporting_html();
         } else {
             header("location:../../");
             exit;
         }
     } else {
         if (count($path) > 0 && $path[0] == "") {
             $first_unit = $this->get_elearning_unit();
             $exam = new exam($first_unit, $this->cache->call(array($first_unit, "get_attribute"), "ELEARNING_UNIT_ID"), $owner);
             if ($exam->get_exam()->is_global_enabled() && elearning_user::get_instance($user->get_name(), $course->get_id())->has_exam_enabled()) {
                 $exam->render_html();
             } else {
                 header("location:../");
                 exit;
             }
         } else {
             if (count($path) > 1 && $path[0] == "report") {
                 $first_unit = $this->get_elearning_unit();
                 $exam = new exam($first_unit, $this->cache->call(array($first_unit, "get_attribute"), "ELEARNING_UNIT_ID"), $owner);
                 $steam_user = $this->cache->call("steam_factory::get_user", $GLOBALS["STEAM"]->get_id(), $path[1]);
                 if ($exam->get_exam()->is_global_enabled() && $course->is_staff($user) && $steam_user instanceof steam_user) {
                     $exam->render_report_html($steam_user);
                 } else {
                     header("location:../");
                     exit;
                 }
             } else {
                 if (count($path) > 1 && $path[0] == "chart") {
                     $first_unit = $this->get_elearning_unit();
                     $exam = new exam($first_unit, $this->cache->call(array($first_unit, "get_attribute"), "ELEARNING_UNIT_ID"), $owner);
                     if ($exam->get_exam()->is_global_enabled() && $course->is_staff($user)) {
                         $exam->render_chart_html();
                     } else {
                         header("location:../");
                         exit;
                     }
                 } else {
                     if (count($path) == 1 || count($path) == 2 && $path[1] == "") {
                         $action = "index";
                         include PATH_EXTENSIONS . 'units_elearning/modules/units_elearning.php';
                     } else {
                         if (count($path) > 2 && $path[1] == "elearning") {
                             $action = "chapter";
                             $chapter = $path[2];
                             if (count($path) > 4 && $path[3] == "media") {
                                 $action = "media";
                                 $media = $path[4];
                             }
                             include PATH_EXTENSIONS . 'units_elearning/modules/units_elearning.php';
                         } else {
                             if (count($path) > 2 && $path[1] == "scripts") {
                                 $action = "scripts";
                                 $scripts = "";
                                 for ($i = 1; $i < count($path); $i++) {
                                     $scripts .= "/" . $path[$i];
                                 }
                                 include PATH_EXTENSIONS . 'units_elearning/modules/units_elearning.php';
                             } else {
                                 if (count($path) > 1 && $path[1] == "directaccess") {
                                     $mediathek = elearning_mediathek::get_instance();
                                     $elearning_course = elearning_mediathek::get_elearning_course_for_unit($steam_unit);
                                     $da = new directaccess($elearning_course->get_id(), $course);
                                     $da->callfunction($_POST["case"]);
                                 } else {
                                     $url = "";
                                     $first = TRUE;
                                     foreach ($path as $s) {
                                         if ($first) {
                                             $first = FALSE;
                                         } else {
                                             $url .= "/" . $s;
                                         }
                                     }
                                     $url = "/packages/elearning_stahl_verkauf" . "/chapters/" . $_SESSION["chapter"] . $url;
                                     $steam_doc = $this->cache->call("steam_factory::get_object_by_name", $GLOBALS["STEAM"]->get_id(), $url);
                                     if ($steam_doc instanceof steam_document) {
                                         echo $this->cache->call(array($steam_doc, "download"));
                                         exit;
                                     } else {
                                         error_log("Could not find: " . $url);
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
     return true;
 }