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


PHP quiz_attempt::is_last_page方法代码示例

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


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

示例1: implode

    echo implode("\n", $rows);
    echo "\n</tbody></table>\n";
}
/// 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)));
开发者ID:ajv,项目名称:Offline-Caching,代码行数:31,代码来源:review.php

示例2: attempt_form

    /**
     * Ouputs the form for making an attempt
     *
     * @param quiz_attempt $attemptobj
     * @param int $page Current page number
     * @param array $slots Array of integers relating to questions
     * @param int $id ID of the attempt
     * @param int $nextpage Next page number
     */
    public function attempt_form($attemptobj, $page, $slots, $id, $nextpage) {
        $output = '';

        // Start the form.
        $output .= html_writer::start_tag('form',
                array('action' => $attemptobj->processattempt_url(), 'method' => 'post',
                'enctype' => 'multipart/form-data', 'accept-charset' => 'utf-8',
                'id' => 'responseform'));
        $output .= html_writer::start_tag('div');

        // Print all the questions.
        foreach ($slots as $slot) {
            $output .= $attemptobj->render_question($slot, false, $this,
                    $attemptobj->attempt_url($slot, $page), $this);
        }

        $navmethod = $attemptobj->get_quiz()->navmethod;
        $output .= $this->attempt_navigation_buttons($page, $attemptobj->is_last_page($page), $navmethod);

        // Some hidden fields to trach what is going on.
        $output .= html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'attempt',
                'value' => $attemptobj->get_attemptid()));
        $output .= html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'thispage',
                'value' => $page, 'id' => 'followingpage'));
        $output .= html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'nextpage',
                'value' => $nextpage));
        $output .= html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'timeup',
                'value' => '0', 'id' => 'timeup'));
        $output .= html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'sesskey',
                'value' => sesskey()));
        $output .= html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'scrollpos',
                'value' => '', 'id' => 'scrollpos'));

        // Add a hidden field with questionids. Do this at the end of the form, so
        // if you navigate before the form has finished loading, it does not wipe all
        // the student's answers.
        $output .= html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'slots',
                'value' => implode(',', $attemptobj->get_active_slots($page))));

        // Finish the form.
        $output .= html_writer::end_tag('div');
        $output .= html_writer::end_tag('form');

        $output .= $this->connection_warning();

        return $output;
    }
开发者ID:rezaies,项目名称:moodle,代码行数:56,代码来源:renderer.php

示例3: skip_main_destination

-->
</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.
echo '<input type="hidden" name="attempt" value="' . $attemptobj->get_attemptid() . '" />';
echo '<input type="hidden" name="nextpage" value="' . $nextpage . '" />';
echo '<input type="hidden" name="timeup" id="timeup" value="0" />';
echo '<input type="hidden" name="sesskey" value="' . sesskey() . '" />';
// Add a hidden field with questionids. Do this at the end of the form, so
// if you navigate before the form has finished loading, it does not wipe all
开发者ID:arshanam,项目名称:Moodle-ITScholars-LMS,代码行数:31,代码来源:_attempt.php


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