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


PHP quiz_attempt::processattempt_url方法代码示例

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


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

示例1: summary_page_controls

    /**
     * Creates any controls a the page should have.
     *
     * @param quiz_attempt $attemptobj
     */
    public function summary_page_controls($attemptobj) {
        $output = '';

        // Return to place button.
        if ($attemptobj->get_state() == quiz_attempt::IN_PROGRESS) {
            $button = new single_button(
                    new moodle_url($attemptobj->attempt_url(null, $attemptobj->get_currentpage())),
                    get_string('returnattempt', 'quiz'));
            $output .= $this->container($this->container($this->render($button),
                    'controls'), 'submitbtns mdl-align');
        }

        // Finish attempt button.
        $options = array(
            'attempt' => $attemptobj->get_attemptid(),
            'finishattempt' => 1,
            'timeup' => 0,
            'slots' => '',
            'sesskey' => sesskey(),
        );

        $button = new single_button(
                new moodle_url($attemptobj->processattempt_url(), $options),
                get_string('submitallandfinish', 'quiz'));
        $button->id = 'responseform';
        if ($attemptobj->get_state() == quiz_attempt::IN_PROGRESS) {
            $button->add_action(new confirm_action(get_string('confirmclose', 'quiz'), null,
                    get_string('submitallandfinish', 'quiz')));
        }

        $duedate = $attemptobj->get_due_date();
        $message = '';
        if ($attemptobj->get_state() == quiz_attempt::OVERDUE) {
            $message = get_string('overduemustbesubmittedby', 'quiz', userdate($duedate));

        } else if ($duedate) {
            $message = get_string('mustbesubmittedby', 'quiz', userdate($duedate));
        }

        $output .= $this->countdown_timer($attemptobj, time());
        $output .= $this->container($message . $this->container(
                $this->render($button), 'controls'), 'submitbtns mdl-align');

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

示例2: summary_page_controls

    /**
     * Creates any controls a the page should have.
     *
     * @param quiz_attempt $attemptobj
     */
    public function summary_page_controls($attemptobj) {
        $output = '';
        // countdown timer
        $output .= $this->countdown_timer();

        // Finish attempt button.
        $options = array(
            'attempt' => $attemptobj->get_attemptid(),
            'finishattempt' => 1,
            'timeup' => 0,
            'slots' => '',
            'sesskey' => sesskey(),
        );

        $button = new single_button(
                new moodle_url($attemptobj->processattempt_url(), $options),
                get_string('submitallandfinish', 'quiz'));
        $button->id = 'responseform';
        $button->add_action(new confirm_action(get_string('confirmclose', 'quiz'), null,
                get_string('submitallandfinish', 'quiz')));

        $output .= $this->container($this->container($this->render($button),
                'controls'), 'submitbtns mdl-align');

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

示例3:

    if ($messages) {
        print_box_start('quizaccessnotices');
        print_heading(get_string('accessnoticesheader', 'quiz'), '', 3);
        $accessmanager->print_messages($messages);
        print_box_end();
    }
} else {
    /// Just a heading.
    if ($attemptobj->get_num_attempts_allowed() != 1) {
        print_heading(format_string($attemptobj->get_quiz_name()) . ' - ' . $title);
    } else {
        print_heading(format_string($attemptobj->get_quiz_name()));
    }
}
// Start the form
echo '<form id="responseform" method="post" action="', $attemptobj->processattempt_url(), '" enctype="multipart/form-data" accept-charset="utf-8">', "\n";
echo '<div>';
print_js_call('init_quiz_form');
/// Print the navigation panel in a left column.
print_container_start();
echo '<div id="left-column">';
$attemptobj->print_navigation_panel('quiz_attempt_nav_panel', $page);
echo '</div>';
print_container_end();
/// Start the main column.
echo '<div id="middle-column">';
?>
    <style type="text/css">
<!--  
#cd {
	margin: auto;
开发者ID:arshanam,项目名称:Moodle-ITScholars-LMS,代码行数:31,代码来源:_attempt.php

示例4: array

$questionids = $attemptobj->get_question_ids();
foreach ($attemptobj->get_question_iterator() as $number => $question) {
    if ($question->length == 0) {
        continue;
    }
    $flag = '';
    if ($attemptobj->is_question_flagged($question->id)) {
        $flag = ' <img src="' . $CFG->pixpath . '/i/flagged.png" alt="' . get_string('flagged', 'question') . '" class="questionflag" />';
    }
    $row = array('<a href="' . $attemptobj->attempt_url($question->id) . '">' . $number . $flag . '</a>', get_string($attemptobj->get_question_status($question->id), 'quiz'));
    if ($scorescolumn) {
        $row[] = $attemptobj->get_question_score($question->id);
    }
    $table->data[] = $row;
}
/// Print the summary table.
print_table($table);
/// countdown timer
echo $attemptobj->get_timer_html();
/// Finish attempt button.
echo "<div class=\"submitbtns mdl-align\">\n";
$options = array('attempt' => $attemptobj->get_attemptid(), 'finishattempt' => 1, 'timeup' => 0, 'questionids' => '', 'sesskey' => sesskey());
print_single_button($attemptobj->processattempt_url(), $options, get_string('finishattempt', 'quiz'), 'post', '', false, '', false, get_string('confirmclose', 'quiz'), 'responseform');
echo "</div>\n";
/// Finish the page
$accessmanager->show_attempt_timer_if_needed($attemptobj->get_attempt(), time());
if ($accessmanager->securewindow_required($attemptobj->is_preview_user())) {
    print_footer('empty');
} else {
    print_footer($attemptobj->get_course());
}
开发者ID:nicolasconnault,项目名称:moodle2.0,代码行数:31,代码来源:summary.php

示例5: array

/// Get the summary info for each question.
$questionids = $attemptobj->get_question_ids();
foreach ($attemptobj->get_question_iterator() as $number => $question) {
    if ($question->length == 0) {
        continue;
    }
    $flag = '';
    if ($attemptobj->is_question_flagged($question->id)) {
        $flag = ' <img src="' . $OUTPUT->old_icon_url('i/flagged') . '" alt="' . get_string('flagged', 'question') . '" class="questionflag" />';
    }
    $row = array('<a href="' . s($attemptobj->attempt_url($question->id)) . '">' . $number . $flag . '</a>', get_string($attemptobj->get_question_status($question->id), 'quiz'));
    if ($scorescolumn) {
        $row[] = $attemptobj->get_question_score($question->id);
    }
    $table->data[] = $row;
}
/// Print the summary table.
echo $OUTPUT->table($table);
/// countdown timer
echo $attemptobj->get_timer_html();
/// Finish attempt button.
echo $OUTPUT->container_start('submitbtns mdl-align');
$options = array('attempt' => $attemptobj->get_attemptid(), 'finishattempt' => 1, 'timeup' => 0, 'questionids' => '', 'sesskey' => sesskey());
$form = html_form::make_button($attemptobj->processattempt_url(), $options, get_string('finishattempt', 'quiz'));
$form->id = 'responseform';
$form->button->add_confirm_action(get_string('confirmclose', 'quiz'));
echo $OUTPUT->button($form);
echo $OUTPUT->container_end();
/// Finish the page
$accessmanager->show_attempt_timer_if_needed($attemptobj->get_attempt(), time());
echo $OUTPUT->footer();
开发者ID:ajv,项目名称:Offline-Caching,代码行数:31,代码来源:summary.php


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