Skip to content

Commit

Permalink
redmine-4100: different UI-Fixes for upgrade to moodle 3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
univietw committed Jul 19, 2017
1 parent 972b1ac commit 045ba5e
Show file tree
Hide file tree
Showing 17 changed files with 40 additions and 43 deletions.
6 changes: 2 additions & 4 deletions classes/output/edit_renderer.php
Expand Up @@ -420,13 +420,11 @@ private function select_all_links($structure) {
// Select all/deselect all questions.
$buttonselectalloptions = array(
'role' => 'button',
'id' => 'questionselectall',
'class' => 'btn btn-link'
'class' => 'btn btn-link selectall'
);
$buttondeselectalloptions = array(
'role' => 'button',
'id' => 'questiondeselectall',
'class' => 'btn btn-link'
'class' => 'btn btn-link deselectall'
);
$output .= html_writer::tag('div',
html_writer::tag('div',
Expand Down
1 change: 1 addition & 0 deletions classes/question/bank/custom_view.php
Expand Up @@ -181,6 +181,7 @@ protected function display_bottom_controls($totalnumber, $recurse, $category, \c
'type' => 'submit',
'name' => 'add',
'value' => get_string('addtoofflinequiz', 'offlinequiz'),
'class' => 'btn btn-secondary'
);
if ($cmoptions->hasattempts) {
$params['disabled'] = 'disabled';
Expand Down
2 changes: 1 addition & 1 deletion comment.php
Expand Up @@ -137,7 +137,7 @@
</div>
</div>
<fieldset class="felement fgroup">
<input id="id_submitbutton" type="submit" name="submit"
<input class="btn btn-secondary" id="id_submitbutton" type="submit" name="submit"
value="<?php
print_string('save', 'offlinequiz'); ?>" />
</fieldset>
Expand Down
2 changes: 1 addition & 1 deletion mod_form.php
Expand Up @@ -217,7 +217,7 @@ protected function definition() {

$language = current_language();

$mform->addElement('html', '<input id="showviewbutton" type="button" value="'.
$mform->addElement('html', '<input id="showviewbutton" type="button" class="btn btn-secondary" value="'.
get_string('showstudentview', 'offlinequiz') . '" onClick="showStudentView(); return false;">');
$mform->addElement('html', '<div class="Popup"><center><input type="button" class="closePopup"' .
' onClick="closePopup(); return false;" value="' . get_string('closestudentview', 'offlinequiz') .
Expand Down
6 changes: 3 additions & 3 deletions report/overview/results_table.php
Expand Up @@ -68,10 +68,10 @@ public function wrap_html_finish() {

echo '<table id="commands">';
echo ' <tr><td>';
echo ' <a href="javascript:select_all_in(\'FORM\',null, \'reportform\');">'. $strselectall . '</a> / ';
echo ' <a href="javascript:deselect_all_in(\'FORM\',null,\'reportform\');">' . $strselectnone . '</a> ';
echo ' <a href="#" class="selectall">'. $strselectall . '</a> / ';
echo ' <a href="#" class="deselectall">' . $strselectnone . '</a> ';
echo ' &nbsp;&nbsp;';
echo ' <input type="submit" value="'.get_string('deleteselectedresults', 'offlinequiz').'"/>';
echo ' <input class="btn btn-secondary" type="submit" value="'.get_string('deleteselectedresults', 'offlinequiz').'"/>';
echo ' </td></tr></table>';
echo ' </center>';
// Close form.
Expand Down
23 changes: 10 additions & 13 deletions report/statistics/report.php
Expand Up @@ -259,23 +259,20 @@ public function display($offlinequiz, $cm, $course) {

if (!$questionid) {
$this->print_offlinequiz_group_selector($cm, $groups, $groupnumber, $pageoptions);
if ($statmode == 'statsoverview') {
$resultmessage = '';
if ($offlinequiz->sumgrades == -1 || $differentquestions) {
echo $OUTPUT->box_start();
echo $OUTPUT->notification(get_string('remarks', 'offlinequiz_statistics') . ':', 'notifynote');
}
if ($statmode == 'statsoverview' && ($offlinequiz->sumgrades == -1 || $differentquestions)) {
echo $OUTPUT->box_start();
$notificationmessage = get_string('remarks', 'offlinequiz_statistics') . ":<br />";
if ($offlinequiz->sumgrades == -1) {
echo $OUTPUT->notification('- ' . get_string('differentsumgrades', 'offlinequiz_statistics',
implode(', ', $sumgrades)), 'notifynote');
$notificationmessage .= '- ' . get_string('differentsumgrades', 'offlinequiz_statistics',
implode(', ', $sumgrades)) . "<br />";
}
if ($differentquestions) {
echo $OUTPUT->notification('- ' . get_string('differentquestions', 'offlinequiz_statistics',
implode(', ', $sumgrades)), 'notifynote');
}
if ($offlinequiz->sumgrades == -1 || $differentquestions) {
echo $OUTPUT->box_end();
$notificationmessage .= '- ' . get_string('differentquestions', 'offlinequiz_statistics',
implode(', ', $sumgrades));
}
echo $OUTPUT->notification($notificationmessage, 'notifynote');
echo $OUTPUT->box_end();

}
}

Expand Down
3 changes: 2 additions & 1 deletion styles.css
Expand Up @@ -38,7 +38,8 @@
color: #000000;
margin-top: 15px;
}

#page-mod-offlinequiz-review div.correct i.icon,
#page-mod-offlinequiz-review div.incorrect i.icon {margin-left: 0.5em;}

body.jsenabled .questionflagcheckbox {display: none;}

Expand Down
4 changes: 2 additions & 2 deletions tutorial/en/page-1.html
Expand Up @@ -9,11 +9,11 @@ <h3>1. Question sheets and answer forms</h3>
<div>This image shows:&nbsp;&nbsp;&nbsp;<form action="index.php" method="get" id="page1" class="popupform"><div>
<input type="hidden" name="id" value="<?php echo $id ?>">
<input type="hidden" name="page" value="2">
<select name="answer">
<select class="form-control" name="answer">
<option value="0">Choose...</option>
<option value="1">An answer form</option>
<option value="2">A question sheet</option>
</select>&nbsp;&nbsp;&nbsp;<input type="submit" value="Continue &gt;"></form>
</select>&nbsp;&nbsp;&nbsp;<input class="btn btn-secondary" type="submit" value="Continue &gt;"></form>
</div>

<p>&nbsp;</p><p>&nbsp;</p>
2 changes: 1 addition & 1 deletion tutorial/en/page-2.html
Expand Up @@ -24,4 +24,4 @@ <h3>2. Crosses and corrections</h3>
<p style="margin: 2em">e)&nbsp;&nbsp;&nbsp;<input type="radio" name="answer" value="5">
&nbsp;&nbsp;&nbsp;<img src="voll.jpg" style="position:relative; top:6px;" border="1"></p>

<p style="margin-left: 4em"><input type="submit" value="Continue &gt;"></p></form><p>&nbsp;</p>
<p style="margin-left: 4em"><input class="btn btn-primary" type="submit" value="Continue &gt;"></p></form><p>&nbsp;</p>
2 changes: 1 addition & 1 deletion tutorial/en/page-3.html
Expand Up @@ -23,6 +23,6 @@ <h3>3. The answer form</h3>
&nbsp;&nbsp;&nbsp;</td><td>Only the crosses in the boxes under your matriculation number are interpreted.</td></tr>
<tr><td width=70px valign=top>d)&nbsp;&nbsp;&nbsp;<input type="radio" name="answer" value="4">
&nbsp;&nbsp;&nbsp;</td><td>The system reads your matriculation number using optical character recognition software.</td></tr>
<tr><td width=70px valign=top></td><td><input type="submit" value="Continue &gt;"></td></tr>
<tr><td width=70px valign=top></td><td><input class="btn btn-primary" type="submit" value="Continue &gt;"></td></tr>
</table>
<p style="margin-left: 4em"></p></form>&nbsp;</p>
2 changes: 1 addition & 1 deletion tutorial/en/page-4.html
Expand Up @@ -91,6 +91,6 @@ <h3>4. Marking your matriculation number</h3>
<input type="hidden" name="id" value="<?php echo $id ?>">
<input type="hidden" name="page" value="5">

<p style="margin-left: 6em"><input type="submit" value="Continue &gt;" onClick="load_number();"></p>
<p style="margin-left: 6em"><input class="btn btn-primary" type="submit" value="Continue &gt;" onClick="load_number();"></p>
</form>
<p>&nbsp;</p><p>&nbsp;</p>
2 changes: 1 addition & 1 deletion version.php
Expand Up @@ -25,7 +25,7 @@

defined('MOODLE_INTERNAL') || die();

$plugin->version = 2017071403;
$plugin->version = 2017071900;
$plugin->requires = 2017051500;
$plugin->component = 'mod_offlinequiz';
$plugin->maturity = MATURITY_ALPHA;
Expand Down
Expand Up @@ -46,7 +46,7 @@ YUI.add('moodle-mod_offlinequiz-toolboxes', function (Y, NAME) {
COMMANDSPAN : '.commands',
CONTENTAFTERLINK : 'div.contentafterlink',
CONTENTWITHOUTLINK : 'div.contentwithoutlink',
DESELECTALL: '#questiondeselectall',
DESELECTALL: '.deselectall',
EDITMAXMARK: 'a.editing_maxmark',
HIDE : 'a.editing_hide',
HIGHLIGHT : 'a.editing_highlight',
Expand All @@ -59,7 +59,7 @@ YUI.add('moodle-mod_offlinequiz-toolboxes', function (Y, NAME) {
PAGELI : 'li.page',
SECTIONUL : 'ul.section',
SELECTMULTIPLECHECKBOX : '.offlinequizbulkcopyform input[type^=checkbox]',
SELECTALL: '#questionselectall',
SELECTALL: '.selectall',
SHOW : 'a.' + CSS.SHOW,
SHOWHIDE : 'a.editing_showhide',
SLOTLI : 'li.slot',
Expand Down Expand Up @@ -302,13 +302,13 @@ Y.extend(RESOURCETOOLBOX, TOOLBOX, {
*/
initialise_select_multiple: function() {
// Click select all link to check all the checkboxes.
Y.one(SELECTOR.SELECTALL).on('click', function(e) {
Y.all(SELECTOR.SELECTALL).on('click', function(e) {
e.preventDefault();
Y.all(SELECTOR.SELECTMULTIPLECHECKBOX).set('checked', 'checked');
});

// Click deselect all link to show the select all checkboxes.
Y.one(SELECTOR.DESELECTALL).on('click', function(e) {
Y.all(SELECTOR.DESELECTALL).on('click', function(e) {
e.preventDefault();
Y.all(SELECTOR.SELECTMULTIPLECHECKBOX).set('checked', '');
});
Expand Down

Large diffs are not rendered by default.

Expand Up @@ -46,7 +46,7 @@ YUI.add('moodle-mod_offlinequiz-toolboxes', function (Y, NAME) {
COMMANDSPAN : '.commands',
CONTENTAFTERLINK : 'div.contentafterlink',
CONTENTWITHOUTLINK : 'div.contentwithoutlink',
DESELECTALL: '#questiondeselectall',
DESELECTALL: '.deselectall',
EDITMAXMARK: 'a.editing_maxmark',
HIDE : 'a.editing_hide',
HIGHLIGHT : 'a.editing_highlight',
Expand All @@ -59,7 +59,7 @@ YUI.add('moodle-mod_offlinequiz-toolboxes', function (Y, NAME) {
PAGELI : 'li.page',
SECTIONUL : 'ul.section',
SELECTMULTIPLECHECKBOX : '.offlinequizbulkcopyform input[type^=checkbox]',
SELECTALL: '#questionselectall',
SELECTALL: '.selectall',
SHOW : 'a.' + CSS.SHOW,
SHOWHIDE : 'a.editing_showhide',
SLOTLI : 'li.slot',
Expand Down Expand Up @@ -302,13 +302,13 @@ Y.extend(RESOURCETOOLBOX, TOOLBOX, {
*/
initialise_select_multiple: function() {
// Click select all link to check all the checkboxes.
Y.one(SELECTOR.SELECTALL).on('click', function(e) {
Y.all(SELECTOR.SELECTALL).on('click', function(e) {
e.preventDefault();
Y.all(SELECTOR.SELECTMULTIPLECHECKBOX).set('checked', 'checked');
});

// Click deselect all link to show the select all checkboxes.
Y.one(SELECTOR.DESELECTALL).on('click', function(e) {
Y.all(SELECTOR.DESELECTALL).on('click', function(e) {
e.preventDefault();
Y.all(SELECTOR.SELECTMULTIPLECHECKBOX).set('checked', '');
});
Expand Down
4 changes: 2 additions & 2 deletions yui/src/toolboxes/js/resource.js
Expand Up @@ -74,13 +74,13 @@ Y.extend(RESOURCETOOLBOX, TOOLBOX, {
*/
initialise_select_multiple: function() {
// Click select all link to check all the checkboxes.
Y.one(SELECTOR.SELECTALL).on('click', function(e) {
Y.all(SELECTOR.SELECTALL).on('click', function(e) {
e.preventDefault();
Y.all(SELECTOR.SELECTMULTIPLECHECKBOX).set('checked', 'checked');
});

// Click deselect all link to show the select all checkboxes.
Y.one(SELECTOR.DESELECTALL).on('click', function(e) {
Y.all(SELECTOR.DESELECTALL).on('click', function(e) {
e.preventDefault();
Y.all(SELECTOR.SELECTMULTIPLECHECKBOX).set('checked', '');
});
Expand Down
4 changes: 2 additions & 2 deletions yui/src/toolboxes/js/toolbox.js
Expand Up @@ -44,7 +44,7 @@
COMMANDSPAN : '.commands',
CONTENTAFTERLINK : 'div.contentafterlink',
CONTENTWITHOUTLINK : 'div.contentwithoutlink',
DESELECTALL: '#questiondeselectall',
DESELECTALL: '.deselectall',
EDITMAXMARK: 'a.editing_maxmark',
HIDE : 'a.editing_hide',
HIGHLIGHT : 'a.editing_highlight',
Expand All @@ -57,7 +57,7 @@
PAGELI : 'li.page',
SECTIONUL : 'ul.section',
SELECTMULTIPLECHECKBOX : '.offlinequizbulkcopyform input[type^=checkbox]',
SELECTALL: '#questionselectall',
SELECTALL: '.selectall',
SHOW : 'a.' + CSS.SHOW,
SHOWHIDE : 'a.editing_showhide',
SLOTLI : 'li.slot',
Expand Down

0 comments on commit 045ba5e

Please sign in to comment.