本文整理汇总了PHP中quiz_attempt::print_question方法的典型用法代码示例。如果您正苦于以下问题:PHP quiz_attempt::print_question方法的具体用法?PHP quiz_attempt::print_question怎么用?PHP quiz_attempt::print_question使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类quiz_attempt
的用法示例。
在下文中一共展示了quiz_attempt::print_question方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: s
/// Summary table end ==============================================================================
/// Form for saving flags if necessary.
if ($options->flags == QUESTION_FLAGSEDITABLE) {
echo '<form action="' . s($attemptobj->review_url(0, $page, $showall)) . '" method="post"><div>';
echo '<input type="hidden" name="sesskey" value="' . sesskey() . '" />';
}
/// Print all the questions.
if ($showall) {
$thispage = 'all';
$lastpage = true;
} else {
$thispage = $page;
$lastpage = $attemptobj->is_last_page($page);
}
foreach ($attemptobj->get_question_ids($thispage) as $id) {
$attemptobj->print_question($id, true, $attemptobj->review_url($id, $page, $showall));
}
/// Close form if we opened it.
if ($options->flags == QUESTION_FLAGSEDITABLE) {
echo '<div class="submitbtns">' . "\n" . '<input type="submit" id="savingflagssubmit" name="savingflags" value="' . get_string('saveflags', 'question') . '" />' . "</div>\n" . "\n</div></form>\n";
$PAGE->requires->js_function_call('question_flag_changer.init_flag_save_form', array('savingflagssubmit'));
}
/// Print a link to the next page.
echo '<div class="submitbtns">';
if ($lastpage) {
$accessmanager->print_finish_review_link($attemptobj->is_preview_user());
} else {
echo link_arrow_right(get_string('next'), s($attemptobj->review_url(0, $page + 1)));
}
echo "</div>";
echo $OUTPUT->footer();
示例2: fullname
$rows[] = '<tr><th scope="row" class="cell">' . $picture . '</th><td class="cell"><a href="' . $CFG->wwwroot . '/user/view.php?id=' . $student->id . '&course=' . $attemptobj->get_courseid() . '">' . fullname($student, true) . '</a></td></tr>';
}
/// Quiz name.
$rows[] = '<tr><th scope="row" class="cell">' . get_string('modulename', 'quiz') . '</th><td class="cell">' . format_string($attemptobj->get_quiz_name()) . '</td></tr>';
/// Question name.
$rows[] = '<tr><th scope="row" class="cell">' . get_string('question', 'quiz') . '</th><td class="cell">' . format_string($attemptobj->get_question($questionid)->name) . '</td></tr>';
/// Other attempts at the quiz.
if ($attemptobj->has_capability('mod/quiz:viewreports')) {
$attemptlist = $attemptobj->links_to_other_attempts($baseurl);
if ($attemptlist) {
$rows[] = '<tr><th scope="row" class="cell">' . get_string('attempts', 'quiz') . '</th><td class="cell">' . $attemptlist . '</td></tr>';
}
}
/// Timestamp of this action.
$timestamp = $attemptobj->get_question_state($questionid)->timestamp;
if ($timestamp) {
$rows[] = '<tr><th scope="row" class="cell">' . get_string('completedon', 'quiz') . '</th><td class="cell">' . userdate($timestamp) . '</td></tr>';
}
/// Now output the summary table, if there are any rows to be shown.
if (!empty($rows)) {
echo '<table class="generaltable generalbox quizreviewsummary"><tbody>', "\n";
echo implode("\n", $rows);
echo "\n</tbody></table>\n";
}
/// Print the question in the requested state.
if ($stateid) {
$baseurl .= '&state=' . $stateid;
}
$attemptobj->print_question($questionid, true, $baseurl);
/// Finish the page
print_footer();
示例3: skip_main_destination
color: #000;
text-align: center;
font-weight: bold;
background-image: url(../../count/back2.jpg);
vertical-align: middle;
}
-->
</style>
<?php
//echo "<SCRIPT language='JavaScript' SRC='$CFG->wwwroot/count/countdown.php?countto=1250744400'></SCRIPT>";
print_container_start();
echo skip_main_destination();
/// Print all the questions
foreach ($attemptobj->get_question_ids($page) as $id) {
$actual = $attemptobj->print_question($id, false, $attemptobj->attempt_url($id, $page));
//$actual = $attemptobj->get_actual_id($id, false, $attemptobj->attempt_url($id, $page));
saveQCAQuestions($id, $actual);
}
/// Print a link to the next page.
echo '<div class="submitbtns">';
if ($attemptobj->is_last_page($page)) {
$nextpage = -1;
$nextpageforie = 'gotosummary';
} else {
$nextpage = $page + 1;
$nextpageforie = 'gotopage' . $nextpage;
}
echo '<input type="submit" name="' . $nextpageforie . '" value="' . get_string('next') . '" />';
echo "</div>";
// Some hidden fields to trach what is going on.