当前位置: 首页>>代码示例>>PHP>>正文


PHP Exercise::getStatTrackExerciseInfoByExeId方法代码示例

本文整理汇总了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);
 }
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:29,代码来源:ExerciseAttemptTransactionLog.php

示例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'];
}
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:31,代码来源:exercise_result.php


注:本文中的Exercise::getStatTrackExerciseInfoByExeId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。