MDL-40732 choice: improve heading levels and styling

This commit is contained in:
Rossiani Wijaya 2013-08-20 16:05:01 +08:00
parent 838d78a9ff
commit 8f0767f10c
4 changed files with 7 additions and 4 deletions

View file

@ -374,7 +374,7 @@ function prepare_choice_show_results($choice, $course, $cm, $allresponses, $forc
$display->fullnamecapability = has_capability('moodle/site:viewfullnames', $context); $display->fullnamecapability = has_capability('moodle/site:viewfullnames', $context);
if (empty($allresponses)) { if (empty($allresponses)) {
echo $OUTPUT->heading(get_string("nousersyet")); echo $OUTPUT->heading(get_string("nousersyet"), 3, null);
return false; return false;
} }

View file

@ -123,7 +123,7 @@ class mod_choice_renderer extends plugin_renderer_base {
public function display_publish_name_vertical($choices) { public function display_publish_name_vertical($choices) {
global $PAGE; global $PAGE;
$html =''; $html ='';
$html .= html_writer::tag('h2',format_string(get_string("responses", "choice")), array('class'=>'main')); $html .= html_writer::tag('h3',format_string(get_string("responses", "choice")));
$attributes = array('method'=>'POST'); $attributes = array('method'=>'POST');
$attributes['action'] = new moodle_url($PAGE->url); $attributes['action'] = new moodle_url($PAGE->url);
@ -364,7 +364,7 @@ class mod_choice_renderer extends plugin_renderer_base {
$truserpercentage = new html_table_row($rows['userpercentage']); $truserpercentage = new html_table_row($rows['userpercentage']);
$table->data = array($trgraph, $trusernumber, $truserpercentage); $table->data = array($trgraph, $trusernumber, $truserpercentage);
$header = html_writer::tag('h2',format_string(get_string("responses", "choice"))); $header = html_writer::tag('h3',format_string(get_string("responses", "choice")));
$html .= html_writer::tag('div', $header, array('class'=>'responseheader')); $html .= html_writer::tag('div', $header, array('class'=>'responseheader'));
$html .= html_writer::tag('a', get_string('skipresultgraph', 'choice'), array('href'=>'#skipresultgraph', 'class'=>'skip-block')); $html .= html_writer::tag('a', get_string('skipresultgraph', 'choice'), array('href'=>'#skipresultgraph', 'class'=>'skip-block'));
$html .= html_writer::tag('div', html_writer::table($table), array('class'=>'response')); $html .= html_writer::tag('div', html_writer::table($table), array('class'=>'response'));
@ -460,7 +460,7 @@ class mod_choice_renderer extends plugin_renderer_base {
$table->data = $rows; $table->data = $rows;
$html = ''; $html = '';
$header = html_writer::tag('h2',format_string(get_string("responses", "choice"))); $header = html_writer::tag('h3',format_string(get_string("responses", "choice")));
$html .= html_writer::tag('div', $header, array('class'=>'responseheader')); $html .= html_writer::tag('div', $header, array('class'=>'responseheader'));
$html .= html_writer::table($table); $html .= html_writer::table($table);

View file

@ -55,6 +55,7 @@
$PAGE->set_title(format_string($choice->name).": $strresponses"); $PAGE->set_title(format_string($choice->name).": $strresponses");
$PAGE->set_heading($course->fullname); $PAGE->set_heading($course->fullname);
echo $OUTPUT->header(); echo $OUTPUT->header();
echo $OUTPUT->heading($choice->name, 2, null);
/// Check to see if groups are being used in this choice /// Check to see if groups are being used in this choice
$groupmode = groups_get_activity_groupmode($cm); $groupmode = groups_get_activity_groupmode($cm);
if ($groupmode) { if ($groupmode) {

View file

@ -69,9 +69,11 @@
choice_user_submit_response($answer, $choice, $USER->id, $course, $cm); choice_user_submit_response($answer, $choice, $USER->id, $course, $cm);
} }
echo $OUTPUT->header(); echo $OUTPUT->header();
echo $OUTPUT->heading($choice->name, 2, null);
echo $OUTPUT->notification(get_string('choicesaved', 'choice'),'notifysuccess'); echo $OUTPUT->notification(get_string('choicesaved', 'choice'),'notifysuccess');
} else { } else {
echo $OUTPUT->header(); echo $OUTPUT->header();
echo $OUTPUT->heading($choice->name, 2, null);
} }