本文整理汇总了PHP中Exercise::selectStartDate方法的典型用法代码示例。如果您正苦于以下问题:PHP Exercise::selectStartDate方法的具体用法?PHP Exercise::selectStartDate怎么用?PHP Exercise::selectStartDate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Exercise
的用法示例。
在下文中一共展示了Exercise::selectStartDate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: time
redirect_to_home_page('modules/exercise/index.php?course='.$course_code);
}
load_js('tools.js');
$exerciseTitle = $objExercise->selectTitle();
$exerciseDescription = $objExercise->selectDescription();
$randomQuestions = $objExercise->isRandom();
$exerciseType = $objExercise->selectType();
$exerciseTempSave = $objExercise->selectTempSave();
$exerciseTimeConstraint = (int) $objExercise->selectTimeConstraint();
$exerciseAllowedAttempts = $objExercise->selectAttemptsAllowed();
$exercisetotalweight = $objExercise->selectTotalWeighting();
$temp_CurrentDate = $recordStartDate = time();
$exercise_StartDate = new DateTime($objExercise->selectStartDate());
$exercise_EndDate = $objExercise->selectEndDate();
$exercise_EndDate = isset($exercise_EndDate) ? new DateTime($objExercise->selectEndDate()) : $exercise_EndDate;
//exercise has ended or hasn't been enabled yet due to declared dates
if (($temp_CurrentDate < $exercise_StartDate->getTimestamp()) || isset($exercise_EndDate) && ($temp_CurrentDate >= $exercise_EndDate->getTimestamp())) {
//if that happens during an active attempt
if(isset($_SESSION['exerciseUserRecordID'][$exerciseId][$attempt_value])) {
$eurid = $_SESSION['exerciseUserRecordID'][$exerciseId][$attempt_value];
$record_end_date = date('Y-m-d H:i:s', time());
$totalScore = Database::get()->querySingle("SELECT SUM(weight) AS weight FROM exercise_answer_record WHERE eurid = ?d", $eurid)->weight;
if ($objExercise->isRandom()) {
$totalWeighting = Database::get()->querySingle("SELECT SUM(weight) AS weight FROM exercise_question WHERE id IN (
SELECT question_id FROM exercise_answer_record WHERE eurid = ?d)", $eurid)->weight;
} else {
$totalWeighting = $objExercise->selectTotalWeighting();
}
示例2: draw
draw($tool_content, 2);
exit;
}
// saves the object into the session
$_SESSION['objExercise'][$exerciseId] = $objExercise;
}
$exerciseTitle = $objExercise->selectTitle();
$exerciseDescription = $objExercise->selectDescription();
$randomQuestions = $objExercise->isRandom();
$exerciseType = $objExercise->selectType();
$exerciseTimeConstraint = $objExercise->selectTimeConstraint();
$exerciseAllowedAttempts = $objExercise->selectAttemptsAllowed();
$eid_temp = $objExercise->selectId();
$recordStartDate = date("Y-m-d H:i:s", time());
$temp_CurrentDate = date("Y-m-d H:i");
$temp_StartDate = $objExercise->selectStartDate();
$temp_EndDate = $objExercise->selectEndDate();
$temp_StartDate = mktime(substr($temp_StartDate, 11, 2), substr($temp_StartDate, 14, 2), 0, substr($temp_StartDate, 5, 2), substr($temp_StartDate, 8, 2), substr($temp_StartDate, 0, 4));
$temp_EndDate = mktime(substr($temp_EndDate, 11, 2), substr($temp_EndDate, 14, 2), 0, substr($temp_EndDate, 5, 2), substr($temp_EndDate, 8, 2), substr($temp_EndDate, 0, 4));
$temp_CurrentDate = mktime(substr($temp_CurrentDate, 11, 2), substr($temp_CurrentDate, 14, 2), 0, substr($temp_CurrentDate, 5, 2), substr($temp_CurrentDate, 8, 2), substr($temp_CurrentDate, 0, 4));
if (!$is_editor) {
$error = FALSE;
// check if exercise has expired or is active
$currentAttempt = Database::get()->querySingle("SELECT COUNT(*) AS count FROM exercise_user_record\n WHERE eid = ?d AND uid = ?d", $eid_temp, $uid)->count;
++$currentAttempt;
if ($exerciseAllowedAttempts > 0 and $currentAttempt > $exerciseAllowedAttempts) {
$message = $langExerciseMaxAttemptsReached;
$error = TRUE;
}
if ($temp_CurrentDate < $temp_StartDate || $temp_CurrentDate >= $temp_EndDate) {
$message = $langExerciseExpired;
示例3: setcookie
// he will be redirected to the exercises page (index.php)
if (isset($_COOKIE['inExercise'])) {
setcookie("inExercise", "", time() - 3600);
redirect_to_home_page('modules/exercise/index.php?course=' . $course_code);
}
load_js('tools.js');
$exerciseTitle = $objExercise->selectTitle();
$exerciseDescription = $objExercise->selectDescription();
$randomQuestions = $objExercise->isRandom();
$exerciseType = $objExercise->selectType();
$exerciseTempSave = $objExercise->selectTempSave();
$exerciseTimeConstraint = (int) $objExercise->selectTimeConstraint();
$exerciseAllowedAttempts = $objExercise->selectAttemptsAllowed();
$exercisetotalweight = $objExercise->selectTotalWeighting();
$temp_CurrentDate = $recordStartDate = time();
$exercise_StartDate = strtotime($objExercise->selectStartDate());
$exercise_EndDate = strtotime($objExercise->selectEndDate());
//exercise has ended or hasn't been enabled yet due to declared dates
if ($temp_CurrentDate < $exercise_StartDate || $temp_CurrentDate >= $exercise_EndDate) {
//if that happens during an active attempt
if (isset($_SESSION['exerciseUserRecordID'][$exerciseId])) {
$eurid = $_SESSION['exerciseUserRecordID'][$exerciseId];
$record_end_date = date('Y-m-d H:i:s', time());
$totalScore = Database::get()->querySingle("SELECT SUM(weight) FROM exercise_answer_record WHERE eurid = ?d", $eurid);
$totalWeighting = $objExercise->selectTotalWeighting();
$objExercise->save_unanswered();
$unmarked_free_text_nbr = Database::get()->querySingle("SELECT count(*) AS count FROM exercise_answer_record WHERE weight IS NULL AND eurid = ?d", $eurid)->count;
$attempt_status = $unmarked_free_text_nbr > 0 ? ATTEMPT_PENDING : ATTEMPT_COMPLETED;
Database::get()->query("UPDATE exercise_user_record SET record_end_date = ?t, total_score = ?f, attempt_status = ?d,\n total_weighting = ?f WHERE eurid = ?d", $record_end_date, $totalScore, $attempt_status, $totalWeighting, $eurid);
unset_exercise_var($exerciseId);
Session::Messages($langExerciseExpiredTime);