Skip to content
Snippets Groups Projects
Commit 17b2a1ed authored by Chris Sangwin's avatar Chris Sangwin
Browse files

Code tidy, and ignore 3rd party libraries on code checker.

parent 63ff2ef2
Branches
No related tags found
No related merge requests found
Showing with 77 additions and 28 deletions
...@@ -48,6 +48,8 @@ $PAGE->set_context($context); ...@@ -48,6 +48,8 @@ $PAGE->set_context($context);
$title = stack_string('bulktesttitle', $context->get_context_name()); $title = stack_string('bulktesttitle', $context->get_context_name());
$PAGE->set_title($title); $PAGE->set_title($title);
require_login();
// Create the helper class. // Create the helper class.
$bulktester = new stack_bulk_tester(); $bulktester = new stack_bulk_tester();
$allpassed = true; $allpassed = true;
......
...@@ -40,6 +40,8 @@ $PAGE->set_url('/question/type/stack/bulktestindex.php'); ...@@ -40,6 +40,8 @@ $PAGE->set_url('/question/type/stack/bulktestindex.php');
$PAGE->set_context($context); $PAGE->set_context($context);
$PAGE->set_title(stack_string('bulktestindextitle')); $PAGE->set_title(stack_string('bulktestindextitle'));
require_login();
// Create the helper class. // Create the helper class.
$bulktester = new stack_bulk_tester(); $bulktester = new stack_bulk_tester();
......
...@@ -46,6 +46,8 @@ $PAGE->set_url($nexturl); // Since this script always ends in a redirect. ...@@ -46,6 +46,8 @@ $PAGE->set_url($nexturl); // Since this script always ends in a redirect.
$PAGE->set_heading($COURSE->fullname); $PAGE->set_heading($COURSE->fullname);
$PAGE->set_pagelayout('admin'); $PAGE->set_pagelayout('admin');
require_login();
// Process deploy if applicable. // Process deploy if applicable.
$deploy = optional_param('deploy', null, PARAM_INT); $deploy = optional_param('deploy', null, PARAM_INT);
if (!is_null($deploy)) { if (!is_null($deploy)) {
......
...@@ -61,6 +61,8 @@ $PAGE->set_url('/question/type/stack/equivdemo.php', $urlparams); ...@@ -61,6 +61,8 @@ $PAGE->set_url('/question/type/stack/equivdemo.php', $urlparams);
$title = "Equivalence reasoning test cases"; $title = "Equivalence reasoning test cases";
$PAGE->set_title($title); $PAGE->set_title($title);
require_login();
echo $OUTPUT->header(); echo $OUTPUT->header();
echo $OUTPUT->heading($title); echo $OUTPUT->heading($title);
......
...@@ -50,6 +50,8 @@ $PAGE->set_url($nexturl); // Since this script always ends in a redirect. ...@@ -50,6 +50,8 @@ $PAGE->set_url($nexturl); // Since this script always ends in a redirect.
$PAGE->set_heading($COURSE->fullname); $PAGE->set_heading($COURSE->fullname);
$PAGE->set_pagelayout('admin'); $PAGE->set_pagelayout('admin');
require_login();
// Set up the export format. // Set up the export format.
$qformat = new qformat_xml(); $qformat = new qformat_xml();
$filename = question_default_export_filename($COURSE, $questiondata) . $filename = question_default_export_filename($COURSE, $questiondata) .
......
...@@ -702,6 +702,7 @@ $string['stackOptions_AnsTest_values_NumRelative'] = "NumRelative"; ...@@ -702,6 +702,7 @@ $string['stackOptions_AnsTest_values_NumRelative'] = "NumRelative";
$string['stackOptions_AnsTest_values_NumAbsolute'] = "NumAbsolute"; $string['stackOptions_AnsTest_values_NumAbsolute'] = "NumAbsolute";
$string['stackOptions_AnsTest_values_NumSigFigs'] = "NumSigFigs"; $string['stackOptions_AnsTest_values_NumSigFigs'] = "NumSigFigs";
$string['stackOptions_AnsTest_values_NumDecPlaces'] = "NumDecPlaces"; $string['stackOptions_AnsTest_values_NumDecPlaces'] = "NumDecPlaces";
$string['stackOptions_AnsTest_values_NumDecPlacesWrong'] = "NumDecPlacesWrong";
$string['stackOptions_AnsTest_values_UnitsSigFigs'] = "UnitsSigFigs"; $string['stackOptions_AnsTest_values_UnitsSigFigs'] = "UnitsSigFigs";
$string['stackOptions_AnsTest_values_UnitsStrictSigFigs'] = "UnitsStrictSigFigs"; $string['stackOptions_AnsTest_values_UnitsStrictSigFigs'] = "UnitsStrictSigFigs";
$string['stackOptions_AnsTest_values_UnitsRelative'] = "UnitsRelative"; $string['stackOptions_AnsTest_values_UnitsRelative'] = "UnitsRelative";
......
...@@ -52,6 +52,8 @@ $PAGE->set_url('/question/type/stack/questiontestdelete.php', $urlparams); ...@@ -52,6 +52,8 @@ $PAGE->set_url('/question/type/stack/questiontestdelete.php', $urlparams);
$title = stack_string('deletetestcase', $title = stack_string('deletetestcase',
array('no' => $testcase, 'question' => format_string($question->name))); array('no' => $testcase, 'question' => format_string($question->name)));
require_login();
if (data_submitted() && confirm_sesskey()) { if (data_submitted() && confirm_sesskey()) {
// User has confirmed. Actually delete the test case. // User has confirmed. Actually delete the test case.
question_bank::get_qtype('stack')->delete_question_test($questionid, $testcase); question_bank::get_qtype('stack')->delete_question_test($questionid, $testcase);
......
...@@ -65,6 +65,9 @@ $PAGE->set_url('/question/type/stack/questiontestedit.php', $urlparams); ...@@ -65,6 +65,9 @@ $PAGE->set_url('/question/type/stack/questiontestedit.php', $urlparams);
$PAGE->set_title($title); $PAGE->set_title($title);
$PAGE->set_heading($title); $PAGE->set_heading($title);
$PAGE->set_pagelayout('popup'); $PAGE->set_pagelayout('popup');
require_login();
// Create the question usage we will use. // Create the question usage we will use.
$quba = question_engine::make_questions_usage_by_activity('qtype_stack', $context); $quba = question_engine::make_questions_usage_by_activity('qtype_stack', $context);
$quba->set_preferred_behaviour('adaptive'); $quba->set_preferred_behaviour('adaptive');
......
...@@ -62,6 +62,8 @@ $PAGE->set_title($title); ...@@ -62,6 +62,8 @@ $PAGE->set_title($title);
$PAGE->set_heading($title); $PAGE->set_heading($title);
$PAGE->set_pagelayout('popup'); $PAGE->set_pagelayout('popup');
require_login();
// Create some other useful links. // Create some other useful links.
$qbankparams = $urlparams; $qbankparams = $urlparams;
unset($qbankparams['questionid']); unset($qbankparams['questionid']);
......
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
// @copyright 2015 The Open University. // @copyright 2015 The Open University.
// @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later. // @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later.
defined('MOODLE_INTERNAL') || die();
class stack_bulk_tester { class stack_bulk_tester {
/** /**
......
...@@ -16,9 +16,7 @@ ...@@ -16,9 +16,7 @@
defined('MOODLE_INTERNAL') || die(); defined('MOODLE_INTERNAL') || die();
// The file provides helper code for creating the files needed to connect to the CAS. // This provides helper code for creating the files needed to connect to the CAS.
require_once(__DIR__.'/../../../../../config.php');
require_once(__DIR__ . '/../../locallib.php'); require_once(__DIR__ . '/../../locallib.php');
require_once(__DIR__ . '/../utils.class.php'); require_once(__DIR__ . '/../utils.class.php');
......
...@@ -46,7 +46,7 @@ class behat_qtype_stack extends behat_base { ...@@ -46,7 +46,7 @@ class behat_qtype_stack extends behat_base {
* *
* @When /^I set up STACK using the PHPUnit configuration$/ * @When /^I set up STACK using the PHPUnit configuration$/
*/ */
public function iSetUpStackUsingThePhpunitConfiguration() { public function isetupstackusingthephpunitconfiguration() {
// The require_once is here, this file may be required by behat before including /config.php. // The require_once is here, this file may be required by behat before including /config.php.
require_once(__DIR__ . '/../fixtures/test_maxima_configuration.php'); require_once(__DIR__ . '/../fixtures/test_maxima_configuration.php');
......
...@@ -179,6 +179,7 @@ class stack_textarea_input_test extends qtype_stack_testcase { ...@@ -179,6 +179,7 @@ class stack_textarea_input_test extends qtype_stack_testcase {
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/ */
class testable_stack_textarea_input extends stack_textarea_input { class testable_stack_textarea_input extends stack_textarea_input {
// @codingStandardsIgnoreLine
public function tokenize_list($in) { public function tokenize_list($in) {
return parent::tokenize_list($in); return parent::tokenize_list($in);
} }
......
...@@ -21,8 +21,8 @@ require_once(__DIR__ . '/../lang/multilang.php'); ...@@ -21,8 +21,8 @@ require_once(__DIR__ . '/../lang/multilang.php');
// Unit tests for stack_multilang. // Unit tests for stack_multilang.
// //
// @copyright 2018 The University of Edinburgh // @copyright 2018 The University of Edinburgh.
// @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later // @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later.
/** /**
* @group qtype_stack * @group qtype_stack
......
...@@ -14,6 +14,8 @@ ...@@ -14,6 +14,8 @@
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with Stack. If not, see <http://www.gnu.org/licenses/>. // along with Stack. If not, see <http://www.gnu.org/licenses/>.
defined('MOODLE_INTERNAL') || die();
require_once(__DIR__ . '/../locallib.php'); require_once(__DIR__ . '/../locallib.php');
require_once(__DIR__ . '/fixtures/test_base.php'); require_once(__DIR__ . '/fixtures/test_base.php');
require_once(__DIR__ . '/../stack/cas/castext/castextparser.class.php'); require_once(__DIR__ . '/../stack/cas/castext/castextparser.class.php');
......
...@@ -65,6 +65,7 @@ class testable_restore_qtype_stack_plugin extends restore_qtype_stack_plugin { ...@@ -65,6 +65,7 @@ class testable_restore_qtype_stack_plugin extends restore_qtype_stack_plugin {
return $this->log; return $this->log;
} }
// @codingStandardsIgnoreLine
public function after_execute_question() { public function after_execute_question() {
// Make method public. // Make method public.
parent::after_execute_question(); parent::after_execute_question();
......
<?xml version="1.0"?>
<libraries>
<library>
<location>amd</location>
<name>JSXGraph</name>
<version>?</version>
<license>GNU LGPL or MIT License</license>
</library>
<library>
<location>thirdparty/php-peg</location>
<name>PHP-PEG</name>
<version>2.0.0</version>
<license>MIT, BSD, and GPL</license>
</library>
<library>
<location>stack/cas/castext/</location>
<name>PHP-PEG autogenerated PHP files</name>
<version>As for STACK</version>
<license>GPL</license>
</library>
</libraries>
...@@ -49,6 +49,8 @@ $PAGE->set_title($title); ...@@ -49,6 +49,8 @@ $PAGE->set_title($title);
$PAGE->set_heading($COURSE->fullname); $PAGE->set_heading($COURSE->fullname);
$PAGE->set_pagelayout('admin'); $PAGE->set_pagelayout('admin');
require_login();
// The URL back to the preview page. // The URL back to the preview page.
$returnurl = question_preview_url($questionid, null, null, null, null, $context); $returnurl = question_preview_url($questionid, null, null, null, null, $context);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment