本文整理汇总了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));
示例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(
示例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 '-';
}
}
示例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);
}