Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 include_once("classes/class.ilObjectAccess.php");
00025
00035 class ilObjExerciseAccess extends ilObjectAccess
00036 {
00037
00050 function _getCommands()
00051 {
00052 $commands = array
00053 (
00054 array("permission" => "read", "cmd" => "infoScreen", "lang_var" => "show",
00055 "default" => true),
00056 array("permission" => "write", "cmd" => "edit", "lang_var" => "edit")
00057 );
00058
00059 return $commands;
00060 }
00061
00062 function _lookupRemainingWorkingTimeString($a_obj_id)
00063 {
00064 global $ilDB, $lng;
00065
00066 $q = "SELECT time_stamp FROM exc_data WHERE obj_id = ".
00067 $ilDB->quote($a_obj_id);
00068 $set = $ilDB->query($q);
00069 $rec = $set->fetchRow(DB_FETCHMODE_ASSOC);
00070
00071 if ($rec["time_stamp"] - time() <= 0)
00072 {
00073 $time_str = $lng->txt("exc_time_over_short");
00074 }
00075 else
00076 {
00077 $time_diff = ilUtil::int2array($rec["time_stamp"] - time(), null);
00078 $time_str = ilUtil::timearray2string($time_diff);
00079 }
00080 return $time_str;
00081 }
00082
00086 function _checkGoto($a_target)
00087 {
00088 global $ilAccess;
00089
00090 $t_arr = explode("_", $a_target);
00091
00092 if ($t_arr[0] != "exc" || ((int) $t_arr[1]) <= 0)
00093 {
00094 return false;
00095 }
00096
00097 if ($ilAccess->checkAccess("read", "", $t_arr[1]))
00098 {
00099 return true;
00100 }
00101 return false;
00102 }
00103 }
00104
00105 ?>