Commit 0f760528 authored by Damyon Wiese's avatar Damyon Wiese
Browse files

MDL-56824 mod_lesson: Style fixes for theme_boost

parent 0b8e0c37
......@@ -251,7 +251,9 @@ class lesson_page_type_branchtable extends lesson_page {
$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;
......
......@@ -443,14 +443,16 @@ class lesson_page_type_matching extends lesson_page {
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) {
......
......@@ -204,7 +204,8 @@ class lesson_page_type_numerical extends lesson_page {
$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");
......@@ -216,7 +217,8 @@ class lesson_page_type_numerical extends lesson_page {
$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);
......
......@@ -267,7 +267,8 @@ class lesson_page_type_shortanswer extends lesson_page {
$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");
......@@ -279,7 +280,8 @@ class lesson_page_type_shortanswer extends lesson_page {
$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);
......
......@@ -451,7 +451,9 @@ if ($action === 'delete') {
$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))
......@@ -664,7 +666,7 @@ if ($action === 'delete') {
$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)) {
......@@ -706,7 +708,7 @@ if ($action === 'delete') {
$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);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment