mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-19813 Migrated calls to print_heading
This commit is contained in:
parent
f43f1834d3
commit
90cd54cb2a
11 changed files with 47 additions and 46 deletions
|
@ -692,7 +692,7 @@ class securewindow_access_rule extends quiz_access_rule_base {
|
|||
* a JavaScript altert before the button submits.
|
||||
*/
|
||||
public function print_start_attempt_button($buttontext, $strconfirmstartattempt) {
|
||||
global $CFG, $SESSION, $PAGE;
|
||||
global $CFG, $SESSION, $PAGE, $OUTPUT;
|
||||
|
||||
$attempturl = $this->_quizobj->start_attempt_url() . '?cmid=' . $this->_quizobj->get_cmid() .
|
||||
'&sesskey=' . sesskey();
|
||||
|
@ -715,7 +715,7 @@ class securewindow_access_rule extends quiz_access_rule_base {
|
|||
|
||||
/// A noscript tag to explains that this quiz only works with JavaScript enabled.
|
||||
echo '<noscript>';
|
||||
print_heading(get_string('noscript', 'quiz'));
|
||||
echo $OUTPUT->heading(get_string('noscript', 'quiz'));
|
||||
echo "</noscript>\n";
|
||||
}
|
||||
|
||||
|
|
|
@ -78,7 +78,7 @@ if (!$quizname = $DB->get_field($cm->modname, 'name', array('id' => $cm->instanc
|
|||
print_error('invalidcoursemodule');
|
||||
}
|
||||
|
||||
print_heading(get_string('addrandomquestiontoquiz', 'quiz', $quizname), 'left', 2);
|
||||
echo $OUTPUT->heading(get_string('addrandomquestiontoquiz', 'quiz', $quizname), 2, 'mdl-left');
|
||||
|
||||
$addonpage = optional_param('addonpage_form', 0, PARAM_SEQUENCE);
|
||||
$qcobject->display_randomquestion_user_interface($addonpage);
|
||||
|
|
|
@ -103,13 +103,13 @@
|
|||
include('tabs.php');
|
||||
|
||||
/// Heading and tab bar.
|
||||
print_heading(get_string('previewquiz', 'quiz', format_string($quiz->name)));
|
||||
echo $OUTPUT->heading(get_string('previewquiz', 'quiz', format_string($quiz->name)));
|
||||
$attemptobj->print_restart_preview_button();
|
||||
|
||||
/// Inform teachers of any restrictions that would apply to students at this point.
|
||||
if ($messages) {
|
||||
print_box_start('quizaccessnotices');
|
||||
print_heading(get_string('accessnoticesheader', 'quiz'), '', 3);
|
||||
echo $OUTPUT->heading(get_string('accessnoticesheader', 'quiz'), 3);
|
||||
$accessmanager->print_messages($messages);
|
||||
print_box_end();
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
|
||||
/// Print the page header
|
||||
print_header();
|
||||
print_heading(format_string($attemptobj->get_question($questionid)->name));
|
||||
echo $OUTPUT->heading(format_string($attemptobj->get_question($questionid)->name));
|
||||
|
||||
/// Process any data that was submitted.
|
||||
if ($data = data_submitted() and confirm_sesskey()) {
|
||||
|
|
|
@ -518,7 +518,7 @@ if ($quiz_reordertool) {
|
|||
get_string('repaginatecommand', 'quiz').'...</button>';
|
||||
echo '</div>';
|
||||
}
|
||||
print_heading($pagetitle.": ".$quiz->name, '', 2);
|
||||
echo $OUTPUT->heading($pagetitle.": ".$quiz->name, 2);
|
||||
helpbutton('editconcepts', get_string('basicideasofquiz', 'quiz'), 'quiz',
|
||||
true, get_string('basicideasofquiz', 'quiz'));
|
||||
quiz_print_status_bar($quiz);
|
||||
|
|
|
@ -28,7 +28,7 @@ class quiz_grading_report extends quiz_default_report {
|
|||
* Displays the report.
|
||||
*/
|
||||
function display($quiz, $cm, $course) {
|
||||
global $CFG, $QTYPES, $DB;
|
||||
global $CFG, $QTYPES, $DB, $OUTPUT;
|
||||
|
||||
$viewoptions = array('mode'=>'grading', 'q'=>$quiz->id);
|
||||
|
||||
|
@ -74,7 +74,7 @@ class quiz_grading_report extends quiz_default_report {
|
|||
}
|
||||
|
||||
if (empty($gradeableqs)) {
|
||||
print_heading(get_string('noessayquestionsfound', 'quiz'));
|
||||
echo $OUTPUT->heading(get_string('noessayquestionsfound', 'quiz'));
|
||||
return true;
|
||||
} else if (count($gradeableqs)==1){
|
||||
$questionid = array_shift(array_keys($gradeableqs));
|
||||
|
@ -198,7 +198,7 @@ class quiz_grading_report extends quiz_default_report {
|
|||
$a->totalattempts =$qattempts[$question->id]->totalattempts;
|
||||
$a->openspan ='<span class="highlightgraded">';
|
||||
$a->closespan ='</span>';
|
||||
print_heading(get_string('questiontitle', 'quiz_grading', $a));
|
||||
echo $OUTPUT->heading(get_string('questiontitle', 'quiz_grading', $a));
|
||||
|
||||
// our 2 different views
|
||||
|
||||
|
@ -331,7 +331,7 @@ class quiz_grading_report extends quiz_default_report {
|
|||
* @todo Finish documenting this function
|
||||
**/
|
||||
function print_questions_and_form($quiz, $question, $userid, $attemptid, $gradeungraded, $gradenextungraded, $ungraded) {
|
||||
global $CFG, $DB;
|
||||
global $CFG, $DB, $OUTPUT;
|
||||
|
||||
$context = get_context_instance(CONTEXT_MODULE, $this->cm->id);
|
||||
|
||||
|
@ -351,18 +351,18 @@ class quiz_grading_report extends quiz_default_report {
|
|||
$firstattempt = current($attempts);
|
||||
$fullname = fullname($firstattempt);
|
||||
if ($gradeungraded) { // getting all ungraded attempts
|
||||
print_heading(get_string('gradingungraded','quiz_grading', $ungraded), '', 3);
|
||||
echo $OUTPUT->heading(get_string('gradingungraded','quiz_grading', $ungraded), 3);
|
||||
} else if ($gradenextungraded) { // getting next ungraded attempts
|
||||
print_heading(get_string('gradingnextungraded','quiz_grading', QUIZ_REPORT_DEFAULT_GRADING_PAGE_SIZE), '', 3);
|
||||
echo $OUTPUT->heading(get_string('gradingnextungraded','quiz_grading', QUIZ_REPORT_DEFAULT_GRADING_PAGE_SIZE), 3);
|
||||
} else if ($userid){
|
||||
print_heading(get_string('gradinguser','quiz_grading', $fullname), '', 3);
|
||||
echo $OUTPUT->heading(get_string('gradinguser','quiz_grading', $fullname), 3);
|
||||
} else if ($attemptid){
|
||||
$a = new object();
|
||||
$a->fullname = $fullname;
|
||||
$a->attempt = $firstattempt->attempt;
|
||||
print_heading(get_string('gradingattempt','quiz_grading', $a), '', 3);
|
||||
echo $OUTPUT->heading(get_string('gradingattempt','quiz_grading', $a), 3);
|
||||
} else {
|
||||
print_heading(get_string('gradingall','quiz_grading', count($attempts)), '', 3);
|
||||
echo $OUTPUT->heading(get_string('gradingall','quiz_grading', count($attempts)), 3);
|
||||
}
|
||||
|
||||
// Display the form with one part for each selected attempt
|
||||
|
@ -398,7 +398,7 @@ class quiz_grading_report extends quiz_default_report {
|
|||
|
||||
// print the user name, attempt count, the question, and some more hidden fields
|
||||
echo '<div class="boxaligncenter" width="80%" style="clear:left;padding:15px;">';
|
||||
print_heading(get_string('gradingattempt', 'quiz_grading', $a) . $gradedstring, '', 3, $gradedclass);
|
||||
echo $OUTPUT->heading(get_string('gradingattempt', 'quiz_grading', $a) . $gradedstring, 3, $gradedclass);
|
||||
|
||||
// Print the question, without showing any previous comment.
|
||||
$copy = $state->manualcomment;
|
||||
|
|
|
@ -18,7 +18,7 @@ class quiz_overview_report extends quiz_default_report {
|
|||
* Display the report.
|
||||
*/
|
||||
function display($quiz, $cm, $course) {
|
||||
global $CFG, $COURSE, $DB;
|
||||
global $CFG, $COURSE, $DB, $OUTPUT;
|
||||
|
||||
$this->context = get_context_instance(CONTEXT_MODULE, $cm->id);
|
||||
|
||||
|
@ -406,14 +406,14 @@ class quiz_overview_report extends quiz_default_report {
|
|||
if ($DB->record_exists_select('quiz_grades', "userid $usql AND quiz = ?", $params)) {
|
||||
$imageurl = "{$CFG->wwwroot}/mod/quiz/report/overview/overviewgraph.php?id={$quiz->id}&groupid=$currentgroup";
|
||||
$graphname = get_string('overviewreportgraphgroup', 'quiz_overview', groups_get_group_name($currentgroup));
|
||||
print_heading($graphname);
|
||||
echo $OUTPUT->heading($graphname);
|
||||
echo '<div class="mdl-align"><img src="'.$imageurl.'" alt="'.$graphname.'" /></div>';
|
||||
}
|
||||
}
|
||||
if ($DB->record_exists('quiz_grades', array('quiz'=> $quiz->id))){
|
||||
$graphname = get_string('overviewreportgraph', 'quiz_overview');
|
||||
$imageurl = $CFG->wwwroot.'/mod/quiz/report/overview/overviewgraph.php?id='.$quiz->id;
|
||||
print_heading($graphname);
|
||||
echo $OUTPUT->heading($graphname);
|
||||
echo '<div class="mdl-align"><img src="'.$imageurl.'" alt="'.$graphname.'" /></div>';
|
||||
}
|
||||
}
|
||||
|
@ -424,7 +424,7 @@ class quiz_overview_report extends quiz_default_report {
|
|||
* tables.
|
||||
*/
|
||||
function regrade_all($dry, $quiz, $groupstudents){
|
||||
global $DB;
|
||||
global $DB, $OUTPUT;
|
||||
if (!has_capability('mod/quiz:regrade', $this->context)) {
|
||||
notify(get_string('regradenotallowed', 'quiz'));
|
||||
return true;
|
||||
|
@ -440,7 +440,7 @@ class quiz_overview_report extends quiz_default_report {
|
|||
$select .= "quiz = ? AND preview = 0";
|
||||
$params[] = $quiz->id;
|
||||
if (!$attempts = $DB->get_records_select('quiz_attempts', $select, $params)) {
|
||||
print_heading(get_string('noattempts', 'quiz'));
|
||||
echo $OUTPUT->heading(get_string('noattempts', 'quiz'));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -451,7 +451,7 @@ class quiz_overview_report extends quiz_default_report {
|
|||
'{quiz_question_instances} qqi ON qqi.quiz = ' . $quiz->id . ' AND q.id = qqi.question');
|
||||
|
||||
// Print heading
|
||||
print_heading(get_string('regradingquiz', 'quiz', format_string($quiz->name)));
|
||||
echo $OUTPUT->heading(get_string('regradingquiz', 'quiz', format_string($quiz->name)));
|
||||
$qstodo = count($questions);
|
||||
$qsdone = 0;
|
||||
if ($qstodo > 1){
|
||||
|
@ -507,7 +507,7 @@ class quiz_overview_report extends quiz_default_report {
|
|||
return $DB->get_field_sql('SELECT COUNT(1) FROM {quiz_attempts} qa, {quiz_question_regrade} qqr WHERE '. $where, $params);
|
||||
}
|
||||
function regrade_all_needed($quiz, $groupstudents){
|
||||
global $DB;
|
||||
global $DB, $OUTPUT;
|
||||
if (!has_capability('mod/quiz:regrade', $this->context)) {
|
||||
notify(get_string('regradenotallowed', 'quiz'));
|
||||
return;
|
||||
|
@ -523,7 +523,7 @@ class quiz_overview_report extends quiz_default_report {
|
|||
$where .= "qa.quiz = ? AND qa.preview = 0 AND qa.uniqueid = qqr.attemptid AND qqr.regraded = 0";
|
||||
$params[] = $quiz->id;
|
||||
if (!$attempts = $DB->get_records_sql('SELECT qa.*, qqr.questionid FROM {quiz_attempts} qa, {quiz_question_regrade} qqr WHERE '. $where, $params)) {
|
||||
print_heading(get_string('noattemptstoregrade', 'quiz_overview'));
|
||||
echo $OUTPUT->heading(get_string('noattemptstoregrade', 'quiz_overview'));
|
||||
return true;
|
||||
}
|
||||
$this->clear_regrade_table($quiz, $groupstudents);
|
||||
|
@ -532,7 +532,7 @@ class quiz_overview_report extends quiz_default_report {
|
|||
'{quiz_question_instances} qqi ON qqi.quiz = ' . $quiz->id . ' AND q.id = qqi.question');
|
||||
|
||||
// Print heading
|
||||
print_heading(get_string('regradingquiz', 'quiz', format_string($quiz->name)));
|
||||
echo $OUTPUT->heading(get_string('regradingquiz', 'quiz', format_string($quiz->name)));
|
||||
|
||||
$apb = new progress_bar('aregradingbar', 500, true);
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ class quiz_statistics_report extends quiz_default_report {
|
|||
* Display the report.
|
||||
*/
|
||||
function display($quiz, $cm, $course) {
|
||||
global $CFG, $DB, $QTYPES;
|
||||
global $CFG, $DB, $QTYPES, $OUTPUT;
|
||||
|
||||
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
|
||||
|
||||
|
@ -120,7 +120,7 @@ class quiz_statistics_report extends quiz_default_report {
|
|||
|
||||
if (!$this->table->is_downloading()){
|
||||
if ($s==0){
|
||||
print_heading(get_string('noattempts','quiz'));
|
||||
echo $OUTPUT->heading(get_string('noattempts','quiz'));
|
||||
}
|
||||
}
|
||||
if ($s){
|
||||
|
@ -133,7 +133,7 @@ class quiz_statistics_report extends quiz_default_report {
|
|||
if (!$this->table->is_downloading() || ($everything && $this->table->is_downloading() == 'xhtml')){
|
||||
if ($s > 1){
|
||||
$imageurl = $CFG->wwwroot.'/mod/quiz/report/statistics/statistics_graph.php?id='.$quizstats->id;
|
||||
print_heading(get_string('statisticsreportgraph', 'quiz_statistics'));
|
||||
echo $OUTPUT->heading(get_string('statisticsreportgraph', 'quiz_statistics'));
|
||||
echo '<div class="mdl-align"><img src="'.$imageurl.'" alt="'.get_string('statisticsreportgraph', 'quiz_statistics').'" /></div>';
|
||||
}
|
||||
}
|
||||
|
@ -225,12 +225,12 @@ class quiz_statistics_report extends quiz_default_report {
|
|||
foreach ($datumfromtable as $item => $value){
|
||||
$questionstatstable->data[] = array($labels[$item], $value);
|
||||
}
|
||||
print_heading(get_string('questioninformation', 'quiz_statistics'));
|
||||
echo $OUTPUT->heading(get_string('questioninformation', 'quiz_statistics'));
|
||||
print_table($questioninfotable);
|
||||
|
||||
print_box(format_text($question->questiontext, $question->questiontextformat).$actions, 'boxaligncenter generalbox boxwidthnormal mdl-align');
|
||||
|
||||
print_heading(get_string('questionstatistics', 'quiz_statistics'));
|
||||
echo $OUTPUT->heading(get_string('questionstatistics', 'quiz_statistics'));
|
||||
print_table($questionstatstable);
|
||||
|
||||
} else {
|
||||
|
@ -246,7 +246,7 @@ class quiz_statistics_report extends quiz_default_report {
|
|||
}
|
||||
if ($QTYPES[$question->qtype]->show_analysis_of_responses()){
|
||||
if (!$this->table->is_downloading()){
|
||||
print_heading(get_string('analysisofresponses', 'quiz_statistics'));
|
||||
echo $OUTPUT->heading(get_string('analysisofresponses', 'quiz_statistics'));
|
||||
}
|
||||
$teacherresponses = $QTYPES[$question->qtype]->get_possible_responses($question);
|
||||
$this->qtable->setup($reporturl, $question, count($teacherresponses)>1);
|
||||
|
@ -324,9 +324,10 @@ class quiz_statistics_report extends quiz_default_report {
|
|||
}
|
||||
|
||||
function output_quiz_structure_analysis_table($s, $questions, $subquestions){
|
||||
global $OUTPUT;
|
||||
if ($s){
|
||||
if (!$this->table->is_downloading()){
|
||||
print_heading(get_string('quizstructureanalysis', 'quiz_statistics'));
|
||||
echo $OUTPUT->heading(get_string('quizstructureanalysis', 'quiz_statistics'));
|
||||
}
|
||||
foreach ($questions as $question){
|
||||
$this->table->add_data_keyed($this->table->format_row($question));
|
||||
|
@ -345,9 +346,9 @@ class quiz_statistics_report extends quiz_default_report {
|
|||
|
||||
function output_quiz_info_table($course, $cm, $quiz, $quizstats, $usingattemptsstring,
|
||||
$currentgroup, $groupstudents, $useallattempts, $download, $reporturl, $everything){
|
||||
global $DB;
|
||||
global $DB, $OUTPUT;
|
||||
// Print information on the number of existing attempts
|
||||
$quizinformationtablehtml = print_heading(get_string('quizinformation', 'quiz_statistics'), '', 2, 'main', true);
|
||||
$quizinformationtablehtml = $OUTPUT->heading(get_string('quizinformation', 'quiz_statistics'), 2, 'main');
|
||||
$quizinformationtable = new object();
|
||||
$quizinformationtable->align = array('center', 'center');
|
||||
$quizinformationtable->width = '60%';
|
||||
|
|
|
@ -101,7 +101,7 @@
|
|||
if ($attemptobj->is_preview_user() && $attemptobj->is_own_attempt()) {
|
||||
$attemptobj->print_restart_preview_button();
|
||||
}
|
||||
print_heading($strreviewtitle);
|
||||
echo $OUTPUT->heading($strreviewtitle);
|
||||
|
||||
/// Summary table start ============================================================================
|
||||
|
||||
|
|
|
@ -61,11 +61,11 @@ if ($attemptobj->is_preview_user()) {
|
|||
}
|
||||
|
||||
/// Print heading.
|
||||
print_heading(format_string($attemptobj->get_quiz_name()));
|
||||
echo $OUTPUT->heading(format_string($attemptobj->get_quiz_name()));
|
||||
if ($attemptobj->is_preview_user()) {
|
||||
$attemptobj->print_restart_preview_button();
|
||||
}
|
||||
print_heading($title);
|
||||
echo $OUTPUT->heading($title);
|
||||
|
||||
/// Prepare the summary table header
|
||||
$table->class = 'generaltable quizsummaryofattempt boxaligncenter';
|
||||
|
|
|
@ -91,7 +91,7 @@
|
|||
include('tabs.php');
|
||||
|
||||
/// Print quiz name and description
|
||||
print_heading(format_string($quiz->name));
|
||||
echo $OUTPUT->heading(format_string($quiz->name));
|
||||
if (trim(strip_tags($quiz->intro))) {
|
||||
print_box(format_module_intro('quiz', $quiz, $cm->id), 'generalbox', 'intro');
|
||||
}
|
||||
|
@ -164,7 +164,7 @@
|
|||
/// Print table with existing attempts
|
||||
if ($attempts) {
|
||||
|
||||
print_heading(get_string('summaryofattempts', 'quiz'));
|
||||
echo $OUTPUT->heading(get_string('summaryofattempts', 'quiz'));
|
||||
|
||||
// Work out which columns we need, taking account what data is available in each attempt.
|
||||
list($someoptions, $alloptions) = quiz_get_combined_reviewoptions($quiz, $attempts, $context);
|
||||
|
@ -301,7 +301,7 @@
|
|||
/// Print information about the student's best score for this quiz if possible.
|
||||
$moreattempts = $unfinished || !$accessmanager->is_finished($numattempts, $lastfinishedattempt);
|
||||
if (!$moreattempts) {
|
||||
print_heading(get_string("nomoreattempts", "quiz"));
|
||||
echo $OUTPUT->heading(get_string("nomoreattempts", "quiz"));
|
||||
}
|
||||
|
||||
if ($numattempts && $gradecolumn && !is_null($mygrade)) {
|
||||
|
@ -313,10 +313,10 @@
|
|||
$a->method = quiz_get_grading_option_name($quiz->grademethod);
|
||||
$a->mygrade = quiz_format_grade($quiz, $mygrade);
|
||||
$a->quizgrade = quiz_format_grade($quiz, $quiz->grade);
|
||||
$resultinfo .= print_heading(get_string('gradesofar', 'quiz', $a), '', 2, 'main', true);
|
||||
$resultinfo .= $OUTPUT->heading(get_string('gradesofar', 'quiz', $a), 2, 'main');
|
||||
} else {
|
||||
$a = quiz_format_grade($quiz, $mygrade) . '/' . quiz_format_grade($quiz, $quiz->grade);
|
||||
$resultinfo .= print_heading(get_string('yourfinalgradeis', 'quiz', $a), '', 2, 'main', true);
|
||||
$resultinfo .= $OUTPUT->heading(get_string('yourfinalgradeis', 'quiz', $a), 2, 'main');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -324,11 +324,11 @@
|
|||
$resultinfo .= '<p class="overriddennotice">'.get_string('overriddennotice', 'grades')."</p>\n";
|
||||
}
|
||||
if ($gradebookfeedback) {
|
||||
$resultinfo .= print_heading(get_string('comment', 'quiz'), '', 3, 'main', true);
|
||||
$resultinfo .= $OUTPUT->heading(get_string('comment', 'quiz'), 3, 'main');
|
||||
$resultinfo .= '<p class="quizteacherfeedback">'.$gradebookfeedback."</p>\n";
|
||||
}
|
||||
if ($feedbackcolumn) {
|
||||
$resultinfo .= print_heading(get_string('overallfeedback', 'quiz'), '', 3, 'main', true);
|
||||
$resultinfo .= $OUTPUT->heading(get_string('overallfeedback', 'quiz'), 3, 'main');
|
||||
$resultinfo .= '<p class="quizgradefeedback">'.quiz_feedback_for_grade($mygrade, $quiz->id)."</p>\n";
|
||||
}
|
||||
|
||||
|
@ -342,7 +342,7 @@
|
|||
print_box_start('quizattempt');
|
||||
$buttontext = ''; // This will be set something if as start/continue attempt button should appear.
|
||||
if (!$quiz->questions) {
|
||||
print_heading(get_string("noquestions", "quiz"));
|
||||
echo $OUTPUT->heading(get_string("noquestions", "quiz"));
|
||||
} else {
|
||||
if ($unfinished) {
|
||||
if ($canattempt) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue