Skip to content

Commit

Permalink
redmine-5499: fix code checker
Browse files Browse the repository at this point in the history
  • Loading branch information
univietw committed Jun 21, 2018
1 parent 49b1d9b commit 75f6284
Show file tree
Hide file tree
Showing 48 changed files with 1,070 additions and 1,116 deletions.
10 changes: 5 additions & 5 deletions accessmanager.php
Expand Up @@ -369,11 +369,11 @@ public function is_preflight_check_required($attemptid) {
* otherwise null.
* @return mod_offlinequiz_preflight_check_form the form.
*/
// public function get_preflight_check_form(moodle_url $url, $attemptid) {
// return new mod_offlinequiz_preflight_check_form($url->out_omit_querystring(),
// array('rules' => $this->rules, 'offlinequizobj' => $this->offlinequizobj,
// 'attemptid' => $attemptid, 'hidden' => $url->params()));
// }
// public function get_preflight_check_form(moodle_url $url, $attemptid) {
// return new mod_offlinequiz_preflight_check_form($url->out_omit_querystring(),
// array('rules' => $this->rules, 'offlinequizobj' => $this->offlinequizobj,
// 'attemptid' => $attemptid, 'hidden' => $url->params()));
// }

/**
* The pre-flight check has passed. This is a chance to record that fact in
Expand Down
1 change: 0 additions & 1 deletion addrandomform.php
Expand Up @@ -39,7 +39,6 @@
class offlinequiz_add_random_form extends moodleform {

protected function definition() {
global $CFG, $DB;
$mform =& $this->_form;
$mform->setDisableShortforms();

Expand Down
2 changes: 1 addition & 1 deletion classes/event/docs_created.php
Expand Up @@ -37,7 +37,7 @@
* - int offlinequizid: the id of the offlinequiz.
* - string reportname: the name of the report.
* - string doctype: the document type (PDF or DOCX).
*
*
* }
*
* @package mod_offlinequiz
Expand Down
2 changes: 1 addition & 1 deletion classes/event/docs_deleted.php
Expand Up @@ -37,7 +37,7 @@
* - int offlinequizid: the id of the offlinequiz.
* - string reportname: the name of the report.
* - string doctype: the document type (PDF or DOCX).
*
*
* }
*
* @package mod_offlinequiz
Expand Down
58 changes: 28 additions & 30 deletions classes/output/edit_renderer.php
Expand Up @@ -71,7 +71,6 @@ public function edit_page(\offlinequiz $offlinequizobj, structure $structure,
$output .= $this->maximum_grade_input($offlinequiz, $this->page->url);
$output .= $this->offlinequiz_state_warnings($structure);


$output .= $this->repaginate_button($structure, $pageurl, $offlinequiz);
$output .= $this->total_marks($offlinequiz);

Expand All @@ -82,7 +81,6 @@ public function edit_page(\offlinequiz $offlinequizobj, structure $structure,
$output .= $this->remove_selected_button($structure, $offlinequiz, $pageurl);
$output .= $this->select_all_links($structure);


// Show the questions organised into sections and pages.
$output .= $this->start_section_list();

Expand Down Expand Up @@ -153,8 +151,8 @@ public function edit_grades_page(\offlinequiz $offlinequizobj, structure $struct
get_string('gradingofflinequizx', 'offlinequiz', format_string($offlinequizobj->get_offlinequiz_name())) .
' (' . get_string('group', 'offlinequiz') . ' ' . $groupletters[$offlinequiz->groupnumber] . ') ',
'editingofflinequiz', 'offlinequiz', '', get_string('basicideasofofflinequiz', 'offlinequiz'), 2);
///echo $OUTPUT->heading(get_string('gradingofflinequiz', 'offlinequiz') . ': ' . $offlinequiz->name. ' (' .
// get_string('group', 'offlinequiz') . ' ' . $groupletters[$offlinequiz->groupnumber] . ')');
// echo $OUTPUT->heading(get_string('gradingofflinequiz', 'offlinequiz') . ': ' . $offlinequiz->name. ' (' .
// get_string('group', 'offlinequiz') . ' ' . $groupletters[$offlinequiz->groupnumber] . ')');
// Information at the top.
$output .= $this->offlinequiz_group_selector($offlinequiz, $pageurl);
$output .= $this->offlinequiz_information($structure);
Expand All @@ -173,7 +171,7 @@ public function edit_grades_page(\offlinequiz $offlinequizobj, structure $struct
$questionhtml = '';
foreach ($structure->get_questions_in_section($section->id) as $question) {
if ($question->qtype != 'description') {
$questionhtml .= $this->question_row_for_grading($structure, $question, $contexts, $pagevars, $pageurl);
$questionhtml .= $this->question_row_for_grading($structure, $question, $contexts, $pagevars, $pageurl);
}
}
$output .= html_writer::tag('ul', $questionhtml, array('class' => 'section img-text'));
Expand Down Expand Up @@ -202,7 +200,7 @@ private function add_to_group_button($structure, $offlinequiz, $pageurl) {
$options[0] = get_string('selectagroup', 'offlinequiz');
for ($i = 1; $i <= $offlinequiz->numgroups; $i++) {
if ($i != $offlinequiz->groupnumber) {
$options[$i] = $letterstr[$i-1];
$options[$i] = $letterstr[$i - 1];
}
}

Expand Down Expand Up @@ -264,11 +262,11 @@ public function offlinequiz_group_selector($offlinequiz, \moodle_url $pageurl) {

$selecturl = unserialize(serialize($pageurl));
$selecturl->remove_params('groupnumber');
//$output .= html_writer::empty_tag('br');
// $output .= html_writer::empty_tag('br');
$output .= html_writer::start_div('groupchoice');
$output .= $OUTPUT->single_select($selecturl, 'groupnumber', $groupoptions, $offlinequiz->groupnumber, array(), 'groupmenu123');
$output .= html_writer::end_div();
//$output .= html_writer::empty_tag('br');
// $output .= html_writer::empty_tag('br');
/*---------------------------*/
return $output;
}
Expand Down Expand Up @@ -412,26 +410,26 @@ private function select_all_links($structure) {
$output = '';

if ($structure->can_be_edited()) {
$toolbaroptions = array(
'class' => 'btn-toolbar',
'role' => 'toolbar',
'aria-label' => get_string('selectmultipletoolbar', 'offlinequiz'),
);
// Select all/deselect all questions.
$buttonselectalloptions = array(
'role' => 'button',
'class' => 'btn btn-link selectall'
);
$buttondeselectalloptions = array(
'role' => 'button',
'class' => 'btn btn-link deselectall'
);
$output .= html_writer::tag('div',
html_writer::tag('div',
html_writer::link('#', get_string('selectall', 'quiz'), $buttonselectalloptions) .
html_writer::link('#', get_string('selectnone', 'quiz'), $buttondeselectalloptions),
array('class' => 'btn-group selectmultiplecommandbuttons')),
$toolbaroptions);
$toolbaroptions = array(
'class' => 'btn-toolbar',
'role' => 'toolbar',
'aria-label' => get_string('selectmultipletoolbar', 'offlinequiz'),
);
// Select all/deselect all questions.
$buttonselectalloptions = array(
'role' => 'button',
'class' => 'btn btn-link selectall'
);
$buttondeselectalloptions = array(
'role' => 'button',
'class' => 'btn btn-link deselectall'
);
$output .= html_writer::tag('div',
html_writer::tag('div',
html_writer::link('#', get_string('selectall', 'quiz'), $buttonselectalloptions) .
html_writer::link('#', get_string('selectnone', 'quiz'), $buttondeselectalloptions),
array('class' => 'btn-group selectmultiplecommandbuttons')),
$toolbaroptions);
}
return $output;
}
Expand Down Expand Up @@ -892,9 +890,9 @@ public function question_for_grading(structure $structure, $question, \moodle_ur
'" type="text" value="' . offlinequiz_format_grade($structure->get_offlinequiz(), $question->maxmark) .
'" size="4" tabindex="' . $question->slot . '" name="g' . $question->id . '"/>';
}
$questionicons .= html_writer::span($input,
$questionicons .= html_writer::span($input,
'instancemaxmark decimalplaces_' . offlinequiz_get_grade_format($structure->get_offlinequiz()));
// $questionicons .= $this->marked_out_of_field($structure->get_offlinequiz(), $question);
// $questionicons .= $this->marked_out_of_field($structure->get_offlinequiz(), $question);

$output .= html_writer::span($questionicons, 'actions'); // Required to add js spinner icon.

Expand Down
2 changes: 1 addition & 1 deletion classes/plugininfo/offlinequiz.php
Expand Up @@ -23,7 +23,7 @@
* @copyright 2015 Academic Moodle Cooperation {@link http://www.academic-moodle-cooperation.org}
* @since Moodle 2.8+
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
*/

namespace mod_offlinequiz\plugininfo;

Expand Down

0 comments on commit 75f6284

Please sign in to comment.