本文整理汇总了PHP中quiz::get_course方法的典型用法代码示例。如果您正苦于以下问题:PHP quiz::get_course方法的具体用法?PHP quiz::get_course怎么用?PHP quiz::get_course使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类quiz
的用法示例。
在下文中一共展示了quiz::get_course方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: edit_page
/**
* Render the edit page
*
* @param \quiz $quizobj object containing all the quiz settings information.
* @param structure $structure object containing the structure of the quiz.
* @param \question_edit_contexts $contexts the relevant question bank contexts.
* @param \moodle_url $pageurl the canonical URL of this page.
* @param array $pagevars the variables from {@link question_edit_setup()}.
* @return string HTML to output.
*/
public function edit_page(\quiz $quizobj, structure $structure,
\question_edit_contexts $contexts, \moodle_url $pageurl, array $pagevars) {
$output = '';
// Page title.
$output .= $this->heading_with_help(get_string('editingquizx', 'quiz',
format_string($quizobj->get_quiz_name())), 'editingquiz', 'quiz', '',
get_string('basicideasofquiz', 'quiz'), 2);
// Information at the top.
$output .= $this->quiz_state_warnings($structure);
$output .= $this->quiz_information($structure);
$output .= $this->maximum_grade_input($quizobj->get_quiz(), $this->page->url);
$output .= $this->repaginate_button($structure, $pageurl);
$output .= $this->total_marks($quizobj->get_quiz());
// Show the questions organised into sections and pages.
$output .= $this->start_section_list();
$sections = $structure->get_quiz_sections();
$lastsection = end($sections);
foreach ($sections as $section) {
$output .= $this->start_section($section);
$output .= $this->questions_in_section($structure, $section, $contexts, $pagevars, $pageurl);
if ($section === $lastsection) {
$output .= \html_writer::start_div('last-add-menu');
$output .= html_writer::tag('span', $this->add_menu_actions($structure, 0,
$pageurl, $contexts, $pagevars), array('class' => 'add-menu-outer'));
$output .= \html_writer::end_div();
}
$output .= $this->end_section();
}
$output .= $this->end_section_list();
// Inialise the JavaScript.
$this->initialise_editing_javascript($quizobj->get_course(), $quizobj->get_quiz());
// Include the contents of any other popups required.
if ($structure->can_be_edited()) {
$popups = '';
$popups .= $this->question_bank_loading();
$this->page->requires->yui_module('moodle-mod_quiz-quizquestionbank',
'M.mod_quiz.quizquestionbank.init',
array('class' => 'questionbank', 'cmid' => $structure->get_cmid()));
$popups .= $this->random_question_form($pageurl, $contexts, $pagevars);
$this->page->requires->yui_module('moodle-mod_quiz-randomquestion',
'M.mod_quiz.randomquestion.init');
$output .= html_writer::div($popups, 'mod_quiz_edit_forms');
// Include the question chooser.
$output .= $this->question_chooser();
$this->page->requires->yui_module('moodle-mod_quiz-questionchooser', 'M.mod_quiz.init_questionchooser');
}
return $output;
}