Commit 9c197f44 authored by Tim Hunt's avatar Tim Hunt
Browse files

MDL-20636 Fix some more codechecker issues.

parent bee82469
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
......
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
......
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
......
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
......
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
......
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
......
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
......
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
......
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
......
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
......
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
......
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
......
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
......
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
......
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
......
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
......
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
......
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
......
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
......@@ -231,7 +230,8 @@ abstract class question_bank {
* Load a question definition from the database. The object returned
* will actually be of an appropriate {@link question_definition} subclass.
* @param int $questionid the id of the question to load.
* @param bool $allowshuffle if false, then any shuffle option on the selected quetsion is disabled.
* @param bool $allowshuffle if false, then any shuffle option on the selected
* quetsion is disabled.
* @return question_definition loaded from the database.
*/
public static function load_question($questionid, $allowshuffle = true) {
......@@ -304,7 +304,8 @@ abstract class question_bank {
*/
public static function load_test_question_data(question_definition $question) {
if (!self::$testmode) {
throw new coding_exception('question_bank::load_test_data called when not in test mode.');
throw new coding_exception('question_bank::load_test_data called when ' .
'not in test mode.');
}
self::$testdata[$question->id] = $question;
}
......@@ -327,7 +328,8 @@ class question_finder {
* @param array $extraparams any parameters used by $extraconditions.
* @return array questionid => questionid.
*/
public function get_questions_from_categories($categoryids, $extraconditions, $extraparams = array()) {
public function get_questions_from_categories($categoryids, $extraconditions,
$extraparams = array()) {
global $DB;
list($qcsql, $qcparams) = $DB->get_in_or_equal($categoryids, SQL_PARAMS_NAMED, 'qc');
......
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
......@@ -330,7 +329,8 @@ WHERE
* fields $slot, $questionid, $inprogress, $name, $needsgrading, $autograded,
* $manuallygraded and $all.
*/
public function load_questions_usages_question_state_summary(qubaid_condition $qubaids, $slots) {
public function load_questions_usages_question_state_summary(
qubaid_condition $qubaids, $slots) {
list($slottest, $params) = $this->db->get_in_or_equal($slots, SQL_PARAMS_NAMED, 'slot');
$rs = $this->db->get_recordset_sql("
......@@ -486,7 +486,8 @@ $sqlorderby
*/
public function load_average_marks(qubaid_condition $qubaids, $slots = null) {
if (!empty($slots)) {
list($slottest, $slotsparams) = $this->db->get_in_or_equal($slots, SQL_PARAMS_NAMED, 'slot');
list($slottest, $slotsparams) = $this->db->get_in_or_equal(
$slots, SQL_PARAMS_NAMED, 'slot');
$slotwhere = " AND qa.slot $slottest";
} else {
$slotwhere = '';
......@@ -689,7 +690,8 @@ ORDER BY
SELECT qas.id
FROM {question_attempt_steps} qas
WHERE questionattemptid $test)", $params);
$this->db->delete_records_select('question_attempt_steps', 'questionattemptid ' . $test, $params);
$this->db->delete_records_select('question_attempt_steps',
'questionattemptid ' . $test, $params);
}
/**
......@@ -803,7 +805,10 @@ ORDER BY
WHERE summarks_qas.questionattemptid = qa.id
)
WHERE qa.questionusageid = $qubaid
HAVING COUNT(CASE WHEN qas.state = 'needsgrading' AND qa.maxmark > 0 THEN 1 ELSE NULL END) = 0";
HAVING COUNT(CASE
WHEN qas.state = 'needsgrading' AND qa.maxmark > 0 THEN 1
ELSE NULL
END) = 0";
}
public function question_attempt_latest_state_view($alias) {
......@@ -1148,7 +1153,8 @@ class qubaid_list extends qubaid_condition {
$this->params = array();
return '1 = 0';
}
list($where, $this->params) = $DB->get_in_or_equal($this->qubaids, SQL_PARAMS_NAMED, 'qubaid');
list($where, $this->params) = $DB->get_in_or_equal(
$this->qubaids, SQL_PARAMS_NAMED, 'qubaid');
return $this->columntotest . ' ' . $this->usage_id_in();
}
......@@ -1163,7 +1169,8 @@ class qubaid_list extends qubaid_condition {
if (empty($this->qubaids)) {
return '= 0';
}
list($where, $this->params) = $DB->get_in_or_equal($this->qubaids, SQL_PARAMS_NAMED, 'qubaid');
list($where, $this->params) = $DB->get_in_or_equal(
$this->qubaids, SQL_PARAMS_NAMED, 'qubaid');
return $where;
}
......
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