Skip to content

Commit

Permalink
MDL-56824 mod_lesson: Style fixes for theme_boost
Browse files Browse the repository at this point in the history
  • Loading branch information
Damyon Wiese committed Nov 14, 2016
1 parent 0b8e0c3 commit 0f76052
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 10 deletions.
4 changes: 3 additions & 1 deletion mod/lesson/pagetypes/branchtable.php
Expand Up @@ -251,7 +251,9 @@ public function report_answers($answerpage, $answerdata, $useranswer, $pagestats
$formattextdefoptions->context = $answerpage->context;

foreach ($answers as $answer) {
$data = "<input type=\"button\" name=\"$answer->id\" value=\"".s(strip_tags(format_text($answer->answer, FORMAT_MOODLE,$formattextdefoptions)))."\" disabled=\"disabled\"> ";
$data = "<input type=\"button\" class=\"btn btn-secondary\" name=\"$answer->id\" " .
"value=\"".s(strip_tags(format_text($answer->answer, FORMAT_MOODLE, $formattextdefoptions)))."\" " .
"disabled=\"disabled\"> ";
$data .= get_string('jumpsto', 'lesson', $this->get_jump_name($answer->jumpto));
$answerdata->answers[] = array($data, "");
$answerpage->answerdata = $answerdata;
Expand Down
6 changes: 4 additions & 2 deletions mod/lesson/pagetypes/matching.php
Expand Up @@ -443,14 +443,16 @@ public function report_answers($answerpage, $answerdata, $useranswer, $pagestats
if ($useranswer != null) {
$userresponse = explode(",", $useranswer->useranswer);
$data .= '<label class="accesshide" for="stu_answer_response_' . $n . '">' . get_string('matchesanswer', 'lesson') . '</label>';
$data .= "<select id=\"stu_answer_response_" . $n . "\" disabled=\"disabled\"><option selected=\"selected\">";
$data .= "<select class=\"custom-select\" id=\"stu_answer_response_" . $n . "\" " .
"disabled=\"disabled\"><option selected=\"selected\">";
if (array_key_exists($i, $userresponse)) {
$data .= $userresponse[$i];
}
$data .= "</option></select>";
} else {
$data .= '<label class="accesshide" for="answer_response_' . $n . '">' . get_string('matchesanswer', 'lesson') . '</label>';
$data .= "<select id=\"answer_response_" . $n . "\" disabled=\"disabled\"><option selected=\"selected\">".strip_tags(format_string($answer->response))."</option></select>";
$data .= "<select class=\"custom-select\" id=\"answer_response_" . $n . "\" " .
"disabled=\"disabled\"><option selected=\"selected\">".strip_tags(format_string($answer->response))."</option></select>";
}

if ($n == 2) {
Expand Down
6 changes: 4 additions & 2 deletions mod/lesson/pagetypes/numerical.php
Expand Up @@ -204,7 +204,8 @@ public function report_answers($answerpage, $answerdata, $useranswer, $pagestats
$total = $stats["total"];
unset($stats["total"]);
foreach ($stats as $valentered => $ntimes) {
$data = '<input type="text" size="50" disabled="disabled" readonly="readonly" value="'.s($valentered).'" />';
$data = '<input class="form-control" type="text" size="50" ' .
'disabled="disabled" readonly="readonly" value="'.s($valentered).'" />';
$percent = $ntimes / $total * 100;
$percent = round($percent, 2);
$percent .= "% ".get_string("enteredthis", "lesson");
Expand All @@ -216,7 +217,8 @@ public function report_answers($answerpage, $answerdata, $useranswer, $pagestats
$i++;
} else if ($useranswer != null && ($answer->id == $useranswer->answerid || ($answer == end($answers) && empty($answerdata)))) {
// get in here when what the user entered is not one of the answers
$data = '<input type="text" size="50" disabled="disabled" readonly="readonly" value="'.s($useranswer->useranswer).'">';
$data = '<input class="form-control" type="text" size="50" ' .
'disabled="disabled" readonly="readonly" value="'.s($useranswer->useranswer).'">';
if (isset($pagestats[$this->properties->id][$useranswer->useranswer])) {
$percent = $pagestats[$this->properties->id][$useranswer->useranswer] / $pagestats[$this->properties->id]["total"] * 100;
$percent = round($percent, 2);
Expand Down
6 changes: 4 additions & 2 deletions mod/lesson/pagetypes/shortanswer.php
Expand Up @@ -267,7 +267,8 @@ public function report_answers($answerpage, $answerdata, $useranswer, $pagestats
$total = $stats["total"];
unset($stats["total"]);
foreach ($stats as $valentered => $ntimes) {
$data = '<input type="text" size="50" disabled="disabled" readonly="readonly" value="'.s($valentered).'" />';
$data = '<input type="text" size="50" disabled="disabled" class="form-control" ' .
'readonly="readonly" value="'.s($valentered).'" />';
$percent = $ntimes / $total * 100;
$percent = round($percent, 2);
$percent .= "% ".get_string("enteredthis", "lesson");
Expand All @@ -279,7 +280,8 @@ public function report_answers($answerpage, $answerdata, $useranswer, $pagestats
$i++;
} else if ($useranswer != null && ($answer->id == $useranswer->answerid || $answer == end($answers))) {
// get in here when what the user entered is not one of the answers
$data = '<input type="text" size="50" disabled="disabled" readonly="readonly" value="'.s($useranswer->useranswer).'">';
$data = '<input type="text" size="50" disabled="disabled" class="form-control" ' .
'readonly="readonly" value="'.s($useranswer->useranswer).'">';
if (isset($pagestats[$this->properties->id][$useranswer->useranswer])) {
$percent = $pagestats[$this->properties->id][$useranswer->useranswer] / $pagestats[$this->properties->id]["total"] * 100;
$percent = round($percent, 2);
Expand Down
8 changes: 5 additions & 3 deletions mod/lesson/report.php
Expand Up @@ -451,7 +451,9 @@
$checklinks = '<a href="javascript: checkall();">'.get_string('selectall').'</a> / ';
$checklinks .= '<a href="javascript: checknone();">'.get_string('deselectall').'</a>';
$checklinks .= html_writer::label('action', 'menuaction', false, array('class' => 'accesshide'));
$checklinks .= html_writer::select(array('delete' => get_string('deleteselected')), 'action', 0, array(''=>'choosedots'), array('id'=>'actionid', 'class' => 'autosubmit'));
$options = array('delete' => get_string('deleteselected'));
$attributes = array('id' => 'actionid', 'class' => 'custom-select m-l-1 autosubmit');
$checklinks .= html_writer::select($options, 'action', 0, array('' => 'choosedots'), $attributes);
$PAGE->requires->yui_module('moodle-core-formautosubmit',
'M.core.init_formautosubmit',
array(array('selectid' => 'actionid', 'nothing' => false))
Expand Down Expand Up @@ -664,7 +666,7 @@

$table->head = array();
$table->align = array('right', 'left');
$table->attributes['class'] = 'compacttable generaltable';
$table->attributes['class'] = 'compacttable generaltable form-inline';

$params = array("lessonid"=>$lesson->id, "userid"=>$userid);
if (!$grades = $DB->get_records_select("lesson_grades", "lessonid = :lessonid and userid = :userid", $params, "completed", "*", $try, 1)) {
Expand Down Expand Up @@ -706,7 +708,7 @@

$table->align = array('left', 'left');
$table->size = array('70%', null);
$table->attributes['class'] = 'compacttable generaltable';
$table->attributes['class'] = 'compacttable generaltable form-inline';

foreach ($answerpages as $page) {
unset($table->data);
Expand Down

0 comments on commit 0f76052

Please sign in to comment.