本文整理汇总了PHP中Exercise::getStatTrackExerciseInfoByExeId方法的典型用法代码示例。如果您正苦于以下问题:PHP Exercise::getStatTrackExerciseInfoByExeId方法的具体用法?PHP Exercise::getStatTrackExerciseInfoByExeId怎么用?PHP Exercise::getStatTrackExerciseInfoByExeId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Exercise
的用法示例。
在下文中一共展示了Exercise::getStatTrackExerciseInfoByExeId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: export
/**
* {@inheritdoc}
*/
public function export()
{
if (empty($this->item_id)) {
throw new TransactionExportException('Undefined item_id');
}
$attempt_id = $this->item_id;
$attempt = get_exercise_results_by_attempt($attempt_id);
if (empty($attempt)) {
throw new TransactionExportException(sprintf('There is no exercise attempt information associated with exe_id "%d" in the database.', $attempt_id));
}
$exercise = new Exercise();
$exercise_stat_info = $exercise->getStatTrackExerciseInfoByExeId($attempt_id);
if (empty($exercise_stat_info)) {
throw new TransactionExportException(sprintf('There is no exercise stat information associated with exe_id "%d" in the database.', $attempt_id));
}
// Exercise read expects course id set.
$exercise->course_id = $exercise_stat_info['c_id'];
if (!$exercise->read($exercise_stat_info['exe_exo_id'])) {
throw new TransactionExportException(sprintf('The associated exercise id "%d" does not currently exist in the database.', $exercise_stat_info['exe_exo_id']));
}
// Prepare the export.
$this->data['stat_info'] = $exercise_stat_info;
$this->data['attempt_info'] = $attempt;
$content = (array) $this;
return json_encode($content);
}
示例2: isset
// general parameters passed via POST/GET
if (empty($origin)) {
$origin = Security::remove_XSS($_REQUEST['origin']);
}
if (empty($objExercise)) {
$objExercise = $_SESSION['objExercise'];
}
if (empty($remind_list)) {
$remind_list = isset($_REQUEST['remind_list']) ? $_REQUEST['remind_list'] : null;
}
$exe_id = isset($_REQUEST['exe_id']) ? intval($_REQUEST['exe_id']) : 0;
if (empty($objExercise)) {
// Redirect to the exercise overview
// Check if the exe_id exists
$objExercise = new Exercise();
$exercise_stat_info = $objExercise->getStatTrackExerciseInfoByExeId($exe_id);
if (!empty($exercise_stat_info) && isset($exercise_stat_info['exe_exo_id'])) {
if ($exercise_stat_info['status'] == 'incomplete') {
$objExercise->read($exercise_stat_info['exe_exo_id']);
} else {
header("Location: overview.php?exerciseId=" . $exercise_stat_info['exe_exo_id']);
exit;
}
} else {
api_not_allowed(true);
}
}
$gradebook = '';
if (isset($_SESSION['gradebook'])) {
$gradebook = $_SESSION['gradebook'];
}