Commit 5a9a2c61 authored by David Monllaó's avatar David Monllaó Committed by Dan Poltawski
Browse files

Merge branch 'MDL-56824-master' of git://github.com/damyon/moodle

parents 39e7d46d 0f760528
...@@ -251,7 +251,9 @@ class lesson_page_type_branchtable extends lesson_page { ...@@ -251,7 +251,9 @@ class lesson_page_type_branchtable extends lesson_page {
$formattextdefoptions->context = $answerpage->context; $formattextdefoptions->context = $answerpage->context;
foreach ($answers as $answer) { 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)); $data .= get_string('jumpsto', 'lesson', $this->get_jump_name($answer->jumpto));
$answerdata->answers[] = array($data, ""); $answerdata->answers[] = array($data, "");
$answerpage->answerdata = $answerdata; $answerpage->answerdata = $answerdata;
......
...@@ -443,14 +443,16 @@ class lesson_page_type_matching extends lesson_page { ...@@ -443,14 +443,16 @@ class lesson_page_type_matching extends lesson_page {
if ($useranswer != null) { if ($useranswer != null) {
$userresponse = explode(",", $useranswer->useranswer); $userresponse = explode(",", $useranswer->useranswer);
$data .= '<label class="accesshide" for="stu_answer_response_' . $n . '">' . get_string('matchesanswer', 'lesson') . '</label>'; $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)) { if (array_key_exists($i, $userresponse)) {
$data .= $userresponse[$i]; $data .= $userresponse[$i];
} }
$data .= "</option></select>"; $data .= "</option></select>";
} else { } else {
$data .= '<label class="accesshide" for="answer_response_' . $n . '">' . get_string('matchesanswer', 'lesson') . '</label>'; $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) { if ($n == 2) {
......
...@@ -204,7 +204,8 @@ class lesson_page_type_numerical extends lesson_page { ...@@ -204,7 +204,8 @@ class lesson_page_type_numerical extends lesson_page {
$total = $stats["total"]; $total = $stats["total"];
unset($stats["total"]); unset($stats["total"]);
foreach ($stats as $valentered => $ntimes) { 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 = $ntimes / $total * 100;
$percent = round($percent, 2); $percent = round($percent, 2);
$percent .= "% ".get_string("enteredthis", "lesson"); $percent .= "% ".get_string("enteredthis", "lesson");
...@@ -216,7 +217,8 @@ class lesson_page_type_numerical extends lesson_page { ...@@ -216,7 +217,8 @@ class lesson_page_type_numerical extends lesson_page {
$i++; $i++;
} else if ($useranswer != null && ($answer->id == $useranswer->answerid || ($answer == end($answers) && empty($answerdata)))) { } 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 // 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])) { if (isset($pagestats[$this->properties->id][$useranswer->useranswer])) {
$percent = $pagestats[$this->properties->id][$useranswer->useranswer] / $pagestats[$this->properties->id]["total"] * 100; $percent = $pagestats[$this->properties->id][$useranswer->useranswer] / $pagestats[$this->properties->id]["total"] * 100;
$percent = round($percent, 2); $percent = round($percent, 2);
......
...@@ -267,7 +267,8 @@ class lesson_page_type_shortanswer extends lesson_page { ...@@ -267,7 +267,8 @@ class lesson_page_type_shortanswer extends lesson_page {
$total = $stats["total"]; $total = $stats["total"];
unset($stats["total"]); unset($stats["total"]);
foreach ($stats as $valentered => $ntimes) { 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 = $ntimes / $total * 100;
$percent = round($percent, 2); $percent = round($percent, 2);
$percent .= "% ".get_string("enteredthis", "lesson"); $percent .= "% ".get_string("enteredthis", "lesson");
...@@ -279,7 +280,8 @@ class lesson_page_type_shortanswer extends lesson_page { ...@@ -279,7 +280,8 @@ class lesson_page_type_shortanswer extends lesson_page {
$i++; $i++;
} else if ($useranswer != null && ($answer->id == $useranswer->answerid || $answer == end($answers))) { } 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 // 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])) { if (isset($pagestats[$this->properties->id][$useranswer->useranswer])) {
$percent = $pagestats[$this->properties->id][$useranswer->useranswer] / $pagestats[$this->properties->id]["total"] * 100; $percent = $pagestats[$this->properties->id][$useranswer->useranswer] / $pagestats[$this->properties->id]["total"] * 100;
$percent = round($percent, 2); $percent = round($percent, 2);
......
...@@ -451,7 +451,9 @@ if ($action === 'delete') { ...@@ -451,7 +451,9 @@ if ($action === 'delete') {
$checklinks = '<a href="javascript: checkall();">'.get_string('selectall').'</a> / '; $checklinks = '<a href="javascript: checkall();">'.get_string('selectall').'</a> / ';
$checklinks .= '<a href="javascript: checknone();">'.get_string('deselectall').'</a>'; $checklinks .= '<a href="javascript: checknone();">'.get_string('deselectall').'</a>';
$checklinks .= html_writer::label('action', 'menuaction', false, array('class' => 'accesshide')); $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', $PAGE->requires->yui_module('moodle-core-formautosubmit',
'M.core.init_formautosubmit', 'M.core.init_formautosubmit',
array(array('selectid' => 'actionid', 'nothing' => false)) array(array('selectid' => 'actionid', 'nothing' => false))
...@@ -664,7 +666,7 @@ if ($action === 'delete') { ...@@ -664,7 +666,7 @@ if ($action === 'delete') {
$table->head = array(); $table->head = array();
$table->align = array('right', 'left'); $table->align = array('right', 'left');
$table->attributes['class'] = 'compacttable generaltable'; $table->attributes['class'] = 'compacttable generaltable form-inline';
$params = array("lessonid"=>$lesson->id, "userid"=>$userid); $params = array("lessonid"=>$lesson->id, "userid"=>$userid);
if (!$grades = $DB->get_records_select("lesson_grades", "lessonid = :lessonid and userid = :userid", $params, "completed", "*", $try, 1)) { if (!$grades = $DB->get_records_select("lesson_grades", "lessonid = :lessonid and userid = :userid", $params, "completed", "*", $try, 1)) {
...@@ -706,7 +708,7 @@ if ($action === 'delete') { ...@@ -706,7 +708,7 @@ if ($action === 'delete') {
$table->align = array('left', 'left'); $table->align = array('left', 'left');
$table->size = array('70%', null); $table->size = array('70%', null);
$table->attributes['class'] = 'compacttable generaltable'; $table->attributes['class'] = 'compacttable generaltable form-inline';
foreach ($answerpages as $page) { foreach ($answerpages as $page) {
unset($table->data); 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