mirror of
https://github.com/moodle/moodle.git
synced 2025-08-09 10:56:56 +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
|
@ -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%';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue