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


PHP quiz_attempt::state_name方法代码示例

本文整理汇总了PHP中quiz_attempt::state_name方法的典型用法代码示例。如果您正苦于以下问题:PHP quiz_attempt::state_name方法的具体用法?PHP quiz_attempt::state_name怎么用?PHP quiz_attempt::state_name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在quiz_attempt的用法示例。


在下文中一共展示了quiz_attempt::state_name方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: array

if (!$attemptobj->get_quiz()->showuserpicture && $attemptobj->get_userid() != $USER->id) {
    // If showuserpicture is true, the picture is shown elsewhere, so don't repeat it.
    $student = $DB->get_record('user', array('id' => $attemptobj->get_userid()));
    $usrepicture = new user_picture($student);
    $usrepicture->courseid = $attemptobj->get_courseid();
    $summarydata['user'] = array('title' => $usrepicture, 'content' => new action_link(new moodle_url('/user/view.php', array('id' => $student->id, 'course' => $attemptobj->get_courseid())), fullname($student, true)));
}
if ($attemptobj->has_capability('mod/quiz:viewreports')) {
    $attemptlist = $attemptobj->links_to_other_attempts($attemptobj->review_url(null, $page, $showall));
    if ($attemptlist) {
        $summarydata['attemptlist'] = array('title' => get_string('attempts', 'quiz'), 'content' => $attemptlist);
    }
}
// Timing information.
$summarydata['startedon'] = array('title' => get_string('startedon', 'quiz'), 'content' => userdate($attempt->timestart));
$summarydata['state'] = array('title' => get_string('attemptstate', 'quiz'), 'content' => quiz_attempt::state_name($attempt->state));
if ($attempt->state == quiz_attempt::FINISHED) {
    $summarydata['completedon'] = array('title' => get_string('completedon', 'quiz'), 'content' => userdate($attempt->timefinish));
    $summarydata['timetaken'] = array('title' => get_string('timetaken', 'quiz'), 'content' => $timetaken);
}
if (!empty($overtime)) {
    $summarydata['overdue'] = array('title' => get_string('overdue', 'quiz'), 'content' => $overtime);
}
// Show marks (if the user is allowed to see marks at the moment).
$grade = quiz_rescale_grade($attempt->sumgrades, $quiz, false);
if ($options->marks >= question_display_options::MARK_AND_MAX && quiz_has_grades($quiz)) {
    if ($attempt->state != quiz_attempt::FINISHED) {
        // Cannot display grade.
    } else {
        if (is_null($grade)) {
            $summarydata['grade'] = array('title' => get_string('grade', 'quiz'), 'content' => quiz_format_grade($quiz, $grade));
开发者ID:sumitnegi933,项目名称:Moodle_lms_New,代码行数:31,代码来源:review.php

示例2: array

        $summarydata['attemptlist'] = array(
            'title'   => get_string('attempts', 'quiz'),
            'content' => $attemptlist,
        );
    }
}

// Timing information.
$summarydata['startedon'] = array(
    'title'   => get_string('startedon', 'quiz'),
    'content' => userdate($attempt->timestart),
);

$summarydata['state'] = array(
    'title'   => get_string('attemptstate', 'quiz'),
    'content' => quiz_attempt::state_name($attempt->state),
);

if ($attempt->state == quiz_attempt::FINISHED) {
    $summarydata['completedon'] = array(
        'title'   => get_string('completedon', 'quiz'),
        'content' => userdate($attempt->timefinish),
    );
    $summarydata['timetaken'] = array(
        'title'   => get_string('timetaken', 'quiz'),
        'content' => $timetaken,
    );
}

if (!empty($overtime)) {
    $summarydata['overdue'] = array(
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:31,代码来源:review.php

示例3: col_state

 /**
  * Generate the display of the attempt state column.
  * @param object $attempt the table row being output.
  * @return string HTML content to go inside the td.
  */
 public function col_state($attempt) {
     if (!is_null($attempt->attempt)) {
         return quiz_attempt::state_name($attempt->state);
     } else {
         return  '-';
     }
 }
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:12,代码来源:attemptsreport_table.php

示例4: col_state

 /**
  * Generate the display of the attempt state column.
  * @param object $attempt the table row being output.
  * @return string HTML content to go inside the td.
  */
 public function col_state($attempt) {
     return quiz_attempt::state_name($attempt->state);
 }
开发者ID:nicusX,项目名称:moodle,代码行数:8,代码来源:attemptsreport_table.php


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