Browse Source

Fix #264 improve radio button spacing on self-marking page

MOODLE_31_STABLE
Dan Marsden 8 years ago
parent
commit
50addfda9d
  1. 6
      student_attendance_form.php
  2. 3
      styles.css

6
student_attendance_form.php

@ -52,10 +52,12 @@ class mod_attendance_student_attendance_form extends moodleform {
// Create radio buttons for setting the attendance status. // Create radio buttons for setting the attendance status.
$radioarray = array(); $radioarray = array();
foreach ($statuses as $status) { foreach ($statuses as $status) {
$radioarray[] =& $mform->createElement('radio', 'status', '', $status->description, $status->id, array()); $name = html_writer::span($status->description, 'statusdesc');
$radioarray[] =& $mform->createElement('radio', 'status', '', $name, $status->id, array());
} }
// Add the radio buttons as a control with the user's name in front. // Add the radio buttons as a control with the user's name in front.
$mform->addGroup($radioarray, 'statusarray', $USER->firstname.' '.$USER->lastname.':', array(''), false); $radiogroup = $mform->addGroup($radioarray, 'statusarray', $USER->firstname.' '.$USER->lastname.':', array(''), false);
$radiogroup->setAttributes(array('class' => 'statusgroup'));
$mform->addRule('statusarray', get_string('attendancenotset', 'attendance'), 'required', '', 'client', false, false); $mform->addRule('statusarray', get_string('attendancenotset', 'attendance'), 'required', '', 'client', false, false);
$this->add_action_buttons(); $this->add_action_buttons();

3
styles.css

@ -177,3 +177,6 @@
.path-mod-attendance .summaryreport .c7 { .path-mod-attendance .summaryreport .c7 {
background-color: #EAEAEA; background-color: #EAEAEA;
} }
#page-mod-attendance-sessions .statusgroup .statusdesc {
margin-right: 12px;
}

Loading…
Cancel
Save