From 9a74e2d9713555451f10ae343b093189f4fff21e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Storhaug?= Date: Wed, 2 Jan 2019 23:51:29 +0100 Subject: [PATCH 01/30] Add documentation section --- README.md | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index ea07b5f..2f795bf 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # ShortMath -A simple question for mathematical expressions using MathQuill. - [![Build Status](https://travis-ci.org/KQMATH/moodle-qtype_shortmath.svg?branch=master)](https://travis-ci.org/KQMATH/moodle-qtype_shortmath) +A simple question for mathematical expressions using MathQuill. + ## What is it? The plugin is based on the short answer question type, but the students enter their response in a maths editor. The student interface is WYSIWYG @@ -22,19 +22,8 @@ LaTeX code is supported. + [JazzQuiz at github](https://github.com/KQMATH/moodle-mod_jazzquiz) + [JazzQuiz in the Moodle plugin repository](https://moodle.org/plugins/mod_jazzquiz) -## Installation: -### Moodle plugins directory -Click on **Install now** within the plugins directory, and then select your site from the list of "My sites" - -### Manually -Unzip all the files into a temporary directory. -Rename the **moodle-qtype_shortmath** folder to **shortmath**, and move it into **moodle/question/type**. -The system administrator should then log in to moodle and click on the **Notifications** link in the Site administration -block. - - -## Uninstalling: -Delete the module from the **Activities** module list in the admin section. +## Documentation +Documentation is available [here](https://github.com/KQMATH/moodle-qtype_shortmath/wiki), including [installation instructions](https://github.com/KQMATH/moodle-qtype_shortmath/wiki/Installation-instructions). ## Feedback: **Project lead:** Hans Georg Schaathun From bfba9a2bdac32aa0d74e2f9359b1562451cd8004 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Storhaug?= Date: Thu, 3 Jan 2019 02:08:12 +0100 Subject: [PATCH 02/30] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2f795bf..7c2c16c 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # ShortMath [![Build Status](https://travis-ci.org/KQMATH/moodle-qtype_shortmath.svg?branch=master)](https://travis-ci.org/KQMATH/moodle-qtype_shortmath) -A simple question for mathematical expressions using MathQuill. +A simple question type for mathematical expressions using MathQuill. ## What is it? The plugin is based on the short answer question type, but the students From e0bc40fac0a15415f46cf78b68987b8cf820f56b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andre=CC=81=20Storhaug?= Date: Fri, 4 Jan 2019 03:20:30 +0100 Subject: [PATCH 03/30] Add code coverage support with Coveralls --- .travis.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 55633d6..dfb3df5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -47,5 +47,8 @@ script: - moodle-plugin-ci savepoints - moodle-plugin-ci mustache - moodle-plugin-ci grunt -t eslint:amd - - moodle-plugin-ci phpunit - - moodle-plugin-ci behat \ No newline at end of file + - moodle-plugin-ci phpunit --coverage-clover + - moodle-plugin-ci behat + +after_success: + - moodle-plugin-ci coveralls-upload \ No newline at end of file From ce7c46522c232ff31725e1d59077726de4c022ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andre=CC=81=20Storhaug?= Date: Sat, 5 Jan 2019 23:43:32 +0100 Subject: [PATCH 04/30] Add PHPUnit unit test --- tests/fixtures/testquestion.moodle.xml | 48 +++++++ tests/helper.php | 185 +++++++++++++++++++++++++ tests/question_test.php | 148 ++++++++++++++++++++ tests/questiontype_test.php | 164 ++++++++++++++++++++++ 4 files changed, 545 insertions(+) create mode 100644 tests/fixtures/testquestion.moodle.xml create mode 100644 tests/helper.php create mode 100644 tests/question_test.php create mode 100644 tests/questiontype_test.php diff --git a/tests/fixtures/testquestion.moodle.xml b/tests/fixtures/testquestion.moodle.xml new file mode 100644 index 0000000..973ffca --- /dev/null +++ b/tests/fixtures/testquestion.moodle.xml @@ -0,0 +1,48 @@ + + + + + + $course$/Test questions + + + + + + + + + + Integrate + + + + + + + + 1.0000000 + 0.3333333 + 0 + 0 + + \frac{1}{2}\left(\cos(1)-\cos(4)\right) + + + + + + 0.597 + + + + + + * + + + + + + + \ No newline at end of file diff --git a/tests/helper.php b/tests/helper.php new file mode 100644 index 0000000..a0a404e --- /dev/null +++ b/tests/helper.php @@ -0,0 +1,185 @@ +. + +/** + * Test helpers for the ShortMath question type. + * + * @package qtype_shortmath + * @author André Storhaug + * @copyright 2018 NTNU + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + + +defined('MOODLE_INTERNAL') || die(); + + +/** + * Test helper class for the ShortMath question type. + * + * @author André Storhaug + * @copyright 2018 NTNU + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +class qtype_shortmath_test_helper extends question_test_helper { + public function get_test_questions() { + return array( + 'integration', + 'integration_exact', + 'escapedwildcards' + ); + } + + /** + * Makes a ShortMath question with correct ansewer 'frog', partially + * correct answer 'toad' and defaultmark 1. This question also has a + * '*' match anything answer. + * @return qtype_shortmath_question + */ + public function make_shortmath_question_integration() { + question_bank::load_question_definition_classes('shortmath'); + $q = new qtype_shortmath_question(); + test_question_maker::initialise_a_question($q); + $q->name = 'Integration'; + $q->questiontext = 'Evaluate the integral \( \int _1^2x\sin \left(x^2\right)dx \)'; + $q->generalfeedback = 'Generalfeedback: \frac{1}{2}\left(\cos(1)-\cos(4)\right) or 0.597 would have been OK.'; + $q->usecase = false; + $q->answers = array( + 13 => new question_answer(13, '\frac{1}{2}\left(\cos(1)-\cos(4)\right)', 1.0, '\frac{1}{2}\left(\cos(1)-\cos(4)\right) is a very good answer.', FORMAT_HTML), + 14 => new question_answer(14, '0.597', 0.8, 'Answer in three decimals is an OK approximation.', FORMAT_HTML), + 15 => new question_answer(15, '*', 0.0, 'That is a bad answer.', FORMAT_HTML), + ); + $q->qtype = question_bank::get_qtype('shortmath'); + + return $q; + } + + /** + * Gets the question data for a shortmath question with with correct + * ansewer 'frog', partially correct answer 'toad' and defaultmark 1. + * This question also has a '*' match anything answer. + * @return stdClass + */ + public function get_shortmath_question_data_integration() { + $qdata = new stdClass(); + test_question_maker::initialise_question_data($qdata); + + $qdata->qtype = 'shortmath'; + $qdata->name = 'Integration'; + $qdata->questiontext = 'Evaluate the integral \( \int _1^2x\sin \left(x^2\right)dx \)'; + $qdata->generalfeedback = 'Generalfeedback: \frac{1}{2}\left(\cos(1)-\cos(4)\right) or 0.597 would have been OK.'; + + $qdata->options = new stdClass(); + $qdata->options->usecase = 0; + $qdata->options->answers = array( + 13 => new question_answer(13, '\frac{1}{2}\left(\cos(1)-\cos(4)\right)', 1.0, '\frac{1}{2}\left(\cos(1)-\cos(4)\right) is a very good answer.', FORMAT_HTML), + 14 => new question_answer(14, '0.597', 0.8, 'Answer in three decimals is an OK approximation.', FORMAT_HTML), + 15 => new question_answer(15, '*', 0.0, 'That is a bad answer.', FORMAT_HTML), + ); + + return $qdata; + } + + /** + * Gets the question form data for a shortmath question with with correct + * answer 'frog', partially correct answer 'toad' and defaultmark 1. + * This question also has a '*' match anything answer. + * @return stdClass + */ + public function get_shortmath_question_form_data_integration() { + $form = new stdClass(); + + $form->name = 'Integration'; + $form->questiontext = array('text' => 'Evaluate the integral \( \int _1^2x\sin \left(x^2\right)dx \)', 'format' => FORMAT_HTML); + $form->defaultmark = 1.0; + $form->generalfeedback = array('text' => 'Generalfeedback: \frac{1}{2}\left(\cos(1)-\cos(4)\right) or 0.597 would have been OK.', 'format' => FORMAT_HTML); + $form->usecase = false; + $form->answer = array('integration', 'integration_exact', '*'); + $form->fraction = array('1.0', '0.8', '0.0'); + $form->feedback = array( + array('text' => '\frac{1}{2}\left(\cos(1)-\cos(4)\right) is a very good answer.', 'format' => FORMAT_HTML), + array('text' => 'Answer in three decimals is an OK approximation.', 'format' => FORMAT_HTML), + array('text' => 'That is a bad answer.', 'format' => FORMAT_HTML), + ); + + return $form; + } + + /** + * Makes a shortmath question with just the correct ansewer 'frog', and + * no other answer matching. + * @return qtype_shortmath_question + */ + public function make_shortmath_question_integration_exact() { + question_bank::load_question_definition_classes('shortmath'); + $q = new qtype_shortmath_question(); + test_question_maker::initialise_a_question($q); + $q->name = 'Integration exact'; + $q->questiontext = 'Evaluate the integral \( \int _1^2x\sin \left(x^2\right)dx \)'; + $q->generalfeedback = 'Generalfeedback: You should have said \frac{1}{2}\left(\cos(1)-\cos(4)\right).'; + $q->usecase = false; + $q->answers = array( + 13 => new question_answer(13, '\frac{1}{2}\left(\cos(1)-\cos(4)\right)', 1.0, '\frac{1}{2}\left(\cos(1)-\cos(4)\right) is correct.', FORMAT_HTML), + ); + $q->qtype = question_bank::get_qtype('shortmath'); + + return $q; + } + + /** + * Gets the question data for a shortmath questionwith just the correct + * ansewer 'frog', and no other answer matching. + * @return stdClass + */ + public function get_shortmath_question_data_integration_exact() { + $qdata = new stdClass(); + test_question_maker::initialise_question_data($qdata); + + $qdata->qtype = 'shortmath'; + $qdata->name = 'Integration exact'; + $qdata->questiontext = 'Evaluate the integral \( \int _1^2x\sin \left(x^2\right)dx \)'; + $qdata->generalfeedback = 'Generalfeedback: You should have said \frac{1}{2}\left(\cos(1)-\cos(4)\right).'; + + $qdata->options = new stdClass(); + $qdata->options->usecase = false; + $qdata->options->answers = array( + 13 => new question_answer(13, '\frac{1}{2}\left(\cos(1)-\cos(4)\right)', 1.0, '\frac{1}{2}\left(\cos(1)-\cos(4)\right) is correct.', FORMAT_HTML), + ); + + return $qdata; + } + + /** + * Makes a shortmath question with just the correct ansewer 'frog', and + * no other answer matching. + * @return qtype_shortmath_question + */ + public function make_shortmath_question_escapedwildcards() { + question_bank::load_question_definition_classes('shortmath'); + $q = new qtype_shortmath_question(); + test_question_maker::initialise_a_question($q); + $q->name = 'Question with escaped * in the answer.'; + $q->questiontext = 'How to you write x times y in C? __________'; + $q->generalfeedback = 'In C, this expression is written x * y.'; + $q->usecase = false; + $q->answers = array( + 13 => new question_answer(13, '*x\*y*', 1.0, 'Well done.', FORMAT_HTML), + ); + $q->qtype = question_bank::get_qtype('shortmath'); + + return $q; + } +} diff --git a/tests/question_test.php b/tests/question_test.php new file mode 100644 index 0000000..8e67a9b --- /dev/null +++ b/tests/question_test.php @@ -0,0 +1,148 @@ +. + +/** + * Unit tests for the ShortMath question definition class. + * + * @package qtype_shortmath + * @author André Storhaug + * @copyright 2018 NTNU + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + + +defined('MOODLE_INTERNAL') || die(); + +global $CFG; +require_once($CFG->dirroot . '/question/engine/tests/helpers.php'); +require_once($CFG->dirroot . '/question/type/shortmath/question.php'); + + +/** + * Unit tests for the shortmath question definition class. + * + * @author André Storhaug + * @copyright 2018 NTNU + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +class qtype_shortmath_question_test extends advanced_testcase { + public function test_compare_0_with_wildcard() { + // Test the classic PHP problem case with '0'. + $this->assertTrue((bool)qtype_shortmath_question::compare_string_with_wildcard( + '0', '0', false)); + $this->assertTrue((bool)qtype_shortmath_question::compare_string_with_wildcard( + '0', '0*', false)); + $this->assertTrue((bool)qtype_shortmath_question::compare_string_with_wildcard( + '0', '*0', false)); + $this->assertTrue((bool)qtype_shortmath_question::compare_string_with_wildcard( + '0', '*0*', false)); + } + + public function test_compare_string_with_wildcard_many_stars() { + // Test the classic PHP problem case with '0'. + $this->assertTrue((bool)qtype_shortmath_question::compare_string_with_wildcard( + '', '**********************************************************************', false)); + } + + public function test_is_complete_response() { + $question = test_question_maker::make_question('shortmath'); + + $this->assertFalse($question->is_complete_response(array())); + $this->assertFalse($question->is_complete_response(array('answer' => ''))); + $this->assertTrue($question->is_complete_response(array('answer' => '0'))); + $this->assertTrue($question->is_complete_response(array('answer' => '0.0'))); + $this->assertTrue($question->is_complete_response(array('answer' => 'x'))); + } + + public function test_is_gradable_response() { + $question = test_question_maker::make_question('shortmath'); + + $this->assertFalse($question->is_gradable_response(array())); + $this->assertFalse($question->is_gradable_response(array('answer' => ''))); + $this->assertTrue($question->is_gradable_response(array('answer' => '0'))); + $this->assertTrue($question->is_gradable_response(array('answer' => '0.0'))); + $this->assertTrue($question->is_gradable_response(array('answer' => 'x'))); + } + + public function test_grading() { + $question = test_question_maker::make_question('shortmath'); + + $this->assertEquals(array(0, question_state::$gradedwrong), + $question->grade_response(array('answer' => 'x'))); + $this->assertEquals(array(1, question_state::$gradedright), + $question->grade_response(array('answer' => '\frac{1}{2}\left(\cos(1)-\cos(4)\right)'))); + $this->assertEquals(array(0.8, question_state::$gradedpartial), + $question->grade_response(array('answer' => '0.597'))); + } + + public function test_get_correct_response() { + $question = test_question_maker::make_question('shortmath'); + + $this->assertEquals(array('answer' => '\frac{1}{2}\left(\cos(1)-\cos(4)\right)'), + $question->get_correct_response()); + } + + public function test_get_correct_response_escapedwildcards() { + $question = test_question_maker::make_question('shortmath', 'escapedwildcards'); + + $this->assertEquals(array('answer' => 'x*y'), $question->get_correct_response()); + } + + public function test_get_question_summary() { + $q = test_question_maker::make_question('shortmath'); + $qsummary = $q->get_question_summary(); + $this->assertEquals('Evaluate the integral \( \int _1^2x\sin \left(x^2\right)dx \)', $qsummary); + } + + public function test_summarise_response() { + $q = test_question_maker::make_question('shortmath'); + $summary = $q->summarise_response(array('answer' => '\frac{1}{2}\left(\cos(1)-\cos(4)\right)')); + $this->assertEquals('\[\frac{1}{2}\left(\cos(1)-\cos(4)\right)\]', $summary); + } + + public function test_classify_response() { + $q = test_question_maker::make_question('shortmath'); + $q->start_attempt(new question_attempt_step(), 1); + + $this->assertEquals(array( + new question_classified_response(13, '\frac{1}{2}\left(\cos(1)-\cos(4)\right)', 1.0)), + $q->classify_response(array('answer' => '\frac{1}{2}\left(\cos(1)-\cos(4)\right)'))); + $this->assertEquals(array( + new question_classified_response(14, '0.597', 0.8)), + $q->classify_response(array('answer' => '0.597'))); + $this->assertEquals(array( + new question_classified_response(15, '2x', 0.0)), + $q->classify_response(array('answer' => '2x'))); + $this->assertEquals(array( + question_classified_response::no_response()), + $q->classify_response(array('answer' => ''))); + } + + public function test_classify_response_no_star() { + $q = test_question_maker::make_question('shortmath', 'integration_exact'); + $q->start_attempt(new question_attempt_step(), 1); + + $this->assertEquals(array( + new question_classified_response(13, '\frac{1}{2}\left(\cos(1)-\cos(4)\right)', 1.0)), + $q->classify_response(array('answer' => '\frac{1}{2}\left(\cos(1)-\cos(4)\right)'))); + $this->assertEquals(array( + new question_classified_response(0, '0.597', 0.0)), + $q->classify_response(array('answer' => '0.597'))); + $this->assertEquals(array( + question_classified_response::no_response()), + $q->classify_response(array('answer' => ''))); + } +} diff --git a/tests/questiontype_test.php b/tests/questiontype_test.php new file mode 100644 index 0000000..da9319c --- /dev/null +++ b/tests/questiontype_test.php @@ -0,0 +1,164 @@ +. + +/** + * Unit tests for the ShortMath question type class. + * + * @package qtype_shortmath + * @author André Storhaug + * @copyright 2018 NTNU + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + + +defined('MOODLE_INTERNAL') || die(); + +global $CFG; +require_once($CFG->dirroot . '/question/type/shortmath/questiontype.php'); +require_once($CFG->dirroot . '/question/engine/tests/helpers.php'); +require_once($CFG->dirroot . '/question/type/edit_question_form.php'); +require_once($CFG->dirroot . '/question/type/shortmath/edit_shortmath_form.php'); + +/** + * Unit tests for the ShortMath question type class. + * + * @author André Storhaug + * @copyright 2018 NTNU + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +class qtype_shortmath_test extends advanced_testcase { + public static $includecoverage = array( + 'question/type/questiontypebase.php', + 'question/type/shortmath/questiontype.php', + ); + + protected $qtype; + + protected function setUp() { + $this->qtype = new qtype_shortmath(); + } + + protected function tearDown() { + $this->qtype = null; + } + + protected function get_test_question_data() { + return test_question_maker::get_question_data('shortmath'); + } + + public function test_name() { + $this->assertEquals($this->qtype->name(), 'shortmath'); + } + + public function test_can_analyse_responses() { + $this->assertTrue($this->qtype->can_analyse_responses()); + } + + public function test_get_random_guess_score() { + $q = test_question_maker::get_question_data('shortmath'); + $q->options->answers[15]->fraction = 0.1; + $this->assertEquals(0.1, $this->qtype->get_random_guess_score($q)); + } + + public function test_get_possible_responses() { + $q = test_question_maker::get_question_data('shortmath'); + + $this->assertEquals(array( + $q->id => array( + 13 => new question_possible_response('\frac{1}{2}\left(\cos(1)-\cos(4)\right)', 1), + 14 => new question_possible_response('0.597', 0.8), + 15 => new question_possible_response('*', 0), + null => question_possible_response::no_response() + ), + ), $this->qtype->get_possible_responses($q)); + } + + public function test_get_possible_responses_no_star() { + $q = test_question_maker::get_question_data('shortmath', 'integration_exact'); + + $this->assertEquals(array( + $q->id => array( + 13 => new question_possible_response('\frac{1}{2}\left(\cos(1)-\cos(4)\right)', 1), + 0 => new question_possible_response(get_string('didnotmatchanyanswer', 'question'), 0), + null => question_possible_response::no_response() + ), + ), $this->qtype->get_possible_responses($q)); + } + + public function test_question_saving_integration_exact() { + $this->resetAfterTest(true); + $this->setAdminUser(); + + $questiondata = test_question_maker::get_question_data('shortmath'); + $formdata = test_question_maker::get_question_form_data('shortmath'); + + $generator = $this->getDataGenerator()->get_plugin_generator('core_question'); + $cat = $generator->create_question_category(array()); + + $formdata->category = "{$cat->id},{$cat->contextid}"; + qtype_shortmath_edit_form::mock_submit((array)$formdata); + + $form = qtype_shortmath_test_helper::get_question_editing_form($cat, $questiondata); + + $this->assertTrue($form->is_validated()); + + $fromform = $form->get_data(); + + $returnedfromsave = $this->qtype->save_question($questiondata, $fromform); + $actualquestionsdata = question_load_questions(array($returnedfromsave->id)); + $actualquestiondata = end($actualquestionsdata); + + foreach ($questiondata as $property => $value) { + if (!in_array($property, array('id', 'version', 'timemodified', 'timecreated', 'options'))) { + $this->assertAttributeEquals($value, $property, $actualquestiondata); + } + } + + foreach ($questiondata->options as $optionname => $value) { + if ($optionname != 'answers') { + $this->assertAttributeEquals($value, $optionname, $actualquestiondata->options); + } + } + } + + public function test_question_saving_trims_answers() { + $this->resetAfterTest(true); + $this->setAdminUser(); + + $questiondata = test_question_maker::get_question_data('shortmath'); + $formdata = test_question_maker::get_question_form_data('shortmath'); + + $generator = $this->getDataGenerator()->get_plugin_generator('core_question'); + $cat = $generator->create_question_category(array()); + + $formdata->category = "{$cat->id},{$cat->contextid}"; + $formdata->answer[0] = ' \frac{1}{2}\left(\cos(1)-\cos(4)\right) '; + qtype_shortmath_edit_form::mock_submit((array)$formdata); + + $form = qtype_shortmath_test_helper::get_question_editing_form($cat, $questiondata); + + $this->assertTrue($form->is_validated()); + + $fromform = $form->get_data(); + + $returnedfromsave = $this->qtype->save_question($questiondata, $fromform); + $actualquestionsdata = question_load_questions(array($returnedfromsave->id)); + $actualquestiondata = end($actualquestionsdata); + + $firstsavedanswer = reset($questiondata->options->answers); + $this->assertEquals('\frac{1}{2}\left(\cos(1)-\cos(4)\right)', $firstsavedanswer->answer); + } +} From 9599cee683e0e05bef62bafe2413ca4c72052fc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andre=CC=81=20Storhaug?= Date: Sat, 5 Jan 2019 23:53:47 +0100 Subject: [PATCH 05/30] Add coverage badge from Coveralls --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7c2c16c..c8b257a 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # ShortMath [![Build Status](https://travis-ci.org/KQMATH/moodle-qtype_shortmath.svg?branch=master)](https://travis-ci.org/KQMATH/moodle-qtype_shortmath) +[![Coverage Status](https://coveralls.io/repos/github/KQMATH/moodle-qtype_shortmath/badge.svg?branch=develop)](https://coveralls.io/github/KQMATH/moodle-qtype_shortmath?branch=develop) A simple question type for mathematical expressions using MathQuill. From cde7672d9154cda59a8404145cc56bdaacbc74c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andre=CC=81=20Storhaug?= Date: Sun, 6 Jan 2019 03:16:50 +0100 Subject: [PATCH 06/30] Add global $CFG for inclusion of Moodle library files See https://docs.moodle.org/dev/Writing_PHPUnit_tests#Inclusion_of_Moodle_library_files --- edit_shortmath_form.php | 1 + question.php | 1 + questiontype.php | 1 + renderer.php | 2 +- 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/edit_shortmath_form.php b/edit_shortmath_form.php index fd3afd8..03cdeb9 100755 --- a/edit_shortmath_form.php +++ b/edit_shortmath_form.php @@ -26,6 +26,7 @@ defined('MOODLE_INTERNAL') || die(); +global $CFG; require_once($CFG->dirroot . '/question/type/shortanswer/edit_shortanswer_form.php'); /** diff --git a/question.php b/question.php index 280f886..5254acb 100755 --- a/question.php +++ b/question.php @@ -25,6 +25,7 @@ defined('MOODLE_INTERNAL') || die(); +global $CFG; require_once($CFG->dirroot . '/question/type/shortanswer/question.php'); /** diff --git a/questiontype.php b/questiontype.php index eecd29f..f5ce521 100755 --- a/questiontype.php +++ b/questiontype.php @@ -26,6 +26,7 @@ defined('MOODLE_INTERNAL') || die(); +global $CFG; require_once($CFG->dirroot . '/question/type/shortanswer/questiontype.php'); /** diff --git a/renderer.php b/renderer.php index b3065fa..f962b13 100755 --- a/renderer.php +++ b/renderer.php @@ -26,7 +26,7 @@ defined('MOODLE_INTERNAL') || die(); - +global $CFG; require_once($CFG->dirroot . '/question/type/shortanswer/renderer.php'); /** From 010fc84568e5a3428237ca2fda2ecfddd22ae1c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andre=CC=81=20Storhaug?= Date: Sun, 6 Jan 2019 03:36:23 +0100 Subject: [PATCH 07/30] Correct PHPDoc in test files --- tests/helper.php | 23 +++++++++++++++-------- tests/question_test.php | 2 +- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/tests/helper.php b/tests/helper.php index a0a404e..fb0c974 100644 --- a/tests/helper.php +++ b/tests/helper.php @@ -44,8 +44,9 @@ public function get_test_questions() { } /** - * Makes a ShortMath question with correct ansewer 'frog', partially - * correct answer 'toad' and defaultmark 1. This question also has a + * Makes a ShortMath question with correct answer + * '\frac{1}{2}\left(\cos(1)-\cos(4)\right)', partially + * correct answer '0.597' and defaultmark 1. This question also has a * '*' match anything answer. * @return qtype_shortmath_question */ @@ -69,7 +70,8 @@ public function make_shortmath_question_integration() { /** * Gets the question data for a shortmath question with with correct - * ansewer 'frog', partially correct answer 'toad' and defaultmark 1. + * ansewer '\frac{1}{2}\left(\cos(1)-\cos(4)\right)', partially + * correct answer '0.597' and defaultmark 1. * This question also has a '*' match anything answer. * @return stdClass */ @@ -95,7 +97,8 @@ public function get_shortmath_question_data_integration() { /** * Gets the question form data for a shortmath question with with correct - * answer 'frog', partially correct answer 'toad' and defaultmark 1. + * answer '\frac{1}{2}\left(\cos(1)-\cos(4)\right)', partially + * correct answer '0.597' and defaultmark 1. * This question also has a '*' match anything answer. * @return stdClass */ @@ -119,7 +122,8 @@ public function get_shortmath_question_form_data_integration() { } /** - * Makes a shortmath question with just the correct ansewer 'frog', and + * Makes a shortmath question with just the correct answer + * '\frac{1}{2}\left(\cos(1)-\cos(4)\right)', and * no other answer matching. * @return qtype_shortmath_question */ @@ -140,8 +144,10 @@ public function make_shortmath_question_integration_exact() { } /** - * Gets the question data for a shortmath questionwith just the correct - * ansewer 'frog', and no other answer matching. + * Gets the question data for a shortmath question + * with just the correct answer + * '\frac{1}{2}\left(\cos(1)-\cos(4)\right)', and + * no other answer matching. * @return stdClass */ public function get_shortmath_question_data_integration_exact() { @@ -163,7 +169,8 @@ public function get_shortmath_question_data_integration_exact() { } /** - * Makes a shortmath question with just the correct ansewer 'frog', and + * Makes a shortmath question with just the correct answer + * '\frac{1}{2}\left(\cos(1)-\cos(4)\right)', and * no other answer matching. * @return qtype_shortmath_question */ diff --git a/tests/question_test.php b/tests/question_test.php index 8e67a9b..171246a 100644 --- a/tests/question_test.php +++ b/tests/question_test.php @@ -32,7 +32,7 @@ /** - * Unit tests for the shortmath question definition class. + * Unit tests for the ShortMath question definition class. * * @author André Storhaug * @copyright 2018 NTNU From 6d5901b895187421a1d1ec374fc219891425b5c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andre=CC=81=20Storhaug?= Date: Sun, 6 Jan 2019 19:44:15 +0100 Subject: [PATCH 08/30] Fix copyright notice year --- tests/helper.php | 6 ++---- tests/question_test.php | 5 ++--- tests/questiontype_test.php | 5 ++--- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/tests/helper.php b/tests/helper.php index fb0c974..eaadc2a 100644 --- a/tests/helper.php +++ b/tests/helper.php @@ -19,19 +19,17 @@ * * @package qtype_shortmath * @author André Storhaug - * @copyright 2018 NTNU + * @copyright 2019 NTNU * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ - defined('MOODLE_INTERNAL') || die(); - /** * Test helper class for the ShortMath question type. * * @author André Storhaug - * @copyright 2018 NTNU + * @copyright 2019 NTNU * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class qtype_shortmath_test_helper extends question_test_helper { diff --git a/tests/question_test.php b/tests/question_test.php index 171246a..c088b34 100644 --- a/tests/question_test.php +++ b/tests/question_test.php @@ -19,11 +19,10 @@ * * @package qtype_shortmath * @author André Storhaug - * @copyright 2018 NTNU + * @copyright 2019 NTNU * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ - defined('MOODLE_INTERNAL') || die(); global $CFG; @@ -35,7 +34,7 @@ * Unit tests for the ShortMath question definition class. * * @author André Storhaug - * @copyright 2018 NTNU + * @copyright 2019 NTNU * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class qtype_shortmath_question_test extends advanced_testcase { diff --git a/tests/questiontype_test.php b/tests/questiontype_test.php index da9319c..c6ef6ff 100644 --- a/tests/questiontype_test.php +++ b/tests/questiontype_test.php @@ -19,11 +19,10 @@ * * @package qtype_shortmath * @author André Storhaug - * @copyright 2018 NTNU + * @copyright 2019 NTNU * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ - defined('MOODLE_INTERNAL') || die(); global $CFG; @@ -36,7 +35,7 @@ * Unit tests for the ShortMath question type class. * * @author André Storhaug - * @copyright 2018 NTNU + * @copyright 2019 NTNU * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class qtype_shortmath_test extends advanced_testcase { From 79a16614fb840884fd2a6e90ef4c9b3e7205a4c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andre=CC=81=20Storhaug?= Date: Sun, 6 Jan 2019 19:45:58 +0100 Subject: [PATCH 09/30] Add privacy unit test for privatcy implementation --- tests/privacy_provider_test.php | 50 +++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 tests/privacy_provider_test.php diff --git a/tests/privacy_provider_test.php b/tests/privacy_provider_test.php new file mode 100644 index 0000000..9b37409 --- /dev/null +++ b/tests/privacy_provider_test.php @@ -0,0 +1,50 @@ +. + +/** + * Privacy tests for shortmath question type. + * + * @package qtype_shortmath + * @author André Storhaug + * @copyright 2019 NTNU + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +use core_privacy\tests\provider_testcase; +use qtype_shortmath\privacy\provider; + +/** + * Test case for privacy implementation. + * + * @author André Storhaug + * @copyright 2019 NTNU + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +class qtype_shortmath_privacy_testcase extends provider_testcase { + /** + * Test returning metadata. + */ + public function test_get_metadata() { + $this->resetAfterTest(true); + $collection = new \core_privacy\local\metadata\collection('qtype_shortmath'); + $reason = provider::get_reason($collection); + $this->assertEquals($reason, 'privacy:metadata'); + $str = 'The ShortMath question type plugin does not store any personal data.'; + $this->assertEquals($str, get_string($reason, 'qtype_shortmath')); + } +} \ No newline at end of file From 2458be642424b430a1381b736ade59c23adb8eb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andre=CC=81=20Storhaug?= Date: Mon, 7 Jan 2019 18:03:12 +0100 Subject: [PATCH 10/30] Update travis file --- .travis.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index dfb3df5..7020f26 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,13 +19,13 @@ php: - 7.1 - 7.2 -env: - global: - - MOODLE_BRANCH=MOODLE_35_STABLE - - MOODLE_BRANCH=MOODLE_36_STABLE - matrix: - - DB=pgsql - - DB=mysqli +matrix: + include: + - env: MOODLE_BRANCH=MOODLE_35_STABLE DB=pgsql + - env: MOODLE_BRANCH=MOODLE_35_STABLE DB=mysqli + + - env: MOODLE_BRANCH=MOODLE_36_STABLE DB=pgsql + - env: MOODLE_BRANCH=MOODLE_36_STABLE DB=mysqli before_install: - phpenv config-rm xdebug.ini From e7dc15b67bc92305ab32d89aea60536712ff0403 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andre=CC=81=20Storhaug?= Date: Mon, 7 Jan 2019 18:15:28 +0100 Subject: [PATCH 11/30] Update travis file --- .travis.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7020f26..8988df9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,13 +19,17 @@ php: - 7.1 - 7.2 -matrix: - include: - - env: MOODLE_BRANCH=MOODLE_35_STABLE DB=pgsql - - env: MOODLE_BRANCH=MOODLE_35_STABLE DB=mysqli +env: + matrix: + - MOODLE_BRANCH=MOODLE_35_STABLE DB=pgsql + - MOODLE_BRANCH=MOODLE_35_STABLE DB=mysqli - - env: MOODLE_BRANCH=MOODLE_36_STABLE DB=pgsql - - env: MOODLE_BRANCH=MOODLE_36_STABLE DB=mysqli + - MOODLE_BRANCH=MOODLE_36_STABLE DB=pgsql + - MOODLE_BRANCH=MOODLE_36_STABLE DB=mysqli + + allow_failures: + - MOODLE_BRANCH=master DB=pgsql + - MOODLE_BRANCH=master DB=mysqli before_install: - phpenv config-rm xdebug.ini From 8dee6d410acaa9685cef5f62ba3f01f96afd49a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andre=CC=81=20Storhaug?= Date: Mon, 7 Jan 2019 18:52:22 +0100 Subject: [PATCH 12/30] Change coverage badge to branch master --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c8b257a..509d251 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # ShortMath [![Build Status](https://travis-ci.org/KQMATH/moodle-qtype_shortmath.svg?branch=master)](https://travis-ci.org/KQMATH/moodle-qtype_shortmath) -[![Coverage Status](https://coveralls.io/repos/github/KQMATH/moodle-qtype_shortmath/badge.svg?branch=develop)](https://coveralls.io/github/KQMATH/moodle-qtype_shortmath?branch=develop) +[![Coverage Status](https://coveralls.io/repos/github/KQMATH/moodle-qtype_shortmath/badge.svg?branch=master)](https://coveralls.io/github/KQMATH/moodle-qtype_shortmath?branch=master) A simple question type for mathematical expressions using MathQuill. From dfd9cf968b66672caa60de387f8eb00c19bc43a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andre=CC=81=20Storhaug?= Date: Mon, 7 Jan 2019 19:03:50 +0100 Subject: [PATCH 13/30] Fix codechecker warning 'Line exceeds 132 characters' --- tests/helper.php | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/tests/helper.php b/tests/helper.php index eaadc2a..42c572d 100644 --- a/tests/helper.php +++ b/tests/helper.php @@ -57,9 +57,12 @@ public function make_shortmath_question_integration() { $q->generalfeedback = 'Generalfeedback: \frac{1}{2}\left(\cos(1)-\cos(4)\right) or 0.597 would have been OK.'; $q->usecase = false; $q->answers = array( - 13 => new question_answer(13, '\frac{1}{2}\left(\cos(1)-\cos(4)\right)', 1.0, '\frac{1}{2}\left(\cos(1)-\cos(4)\right) is a very good answer.', FORMAT_HTML), - 14 => new question_answer(14, '0.597', 0.8, 'Answer in three decimals is an OK approximation.', FORMAT_HTML), - 15 => new question_answer(15, '*', 0.0, 'That is a bad answer.', FORMAT_HTML), + 13 => new question_answer(13, '\frac{1}{2}\left(\cos(1)-\cos(4)\right)', + 1.0, '\frac{1}{2}\left(\cos(1)-\cos(4)\right) is a very good answer.', FORMAT_HTML), + 14 => new question_answer(14, '0.597', + 0.8, 'Answer in three decimals is an OK approximation.', FORMAT_HTML), + 15 => new question_answer(15, '*', + 0.0, 'That is a bad answer.', FORMAT_HTML), ); $q->qtype = question_bank::get_qtype('shortmath'); @@ -85,9 +88,12 @@ public function get_shortmath_question_data_integration() { $qdata->options = new stdClass(); $qdata->options->usecase = 0; $qdata->options->answers = array( - 13 => new question_answer(13, '\frac{1}{2}\left(\cos(1)-\cos(4)\right)', 1.0, '\frac{1}{2}\left(\cos(1)-\cos(4)\right) is a very good answer.', FORMAT_HTML), - 14 => new question_answer(14, '0.597', 0.8, 'Answer in three decimals is an OK approximation.', FORMAT_HTML), - 15 => new question_answer(15, '*', 0.0, 'That is a bad answer.', FORMAT_HTML), + 13 => new question_answer(13, '\frac{1}{2}\left(\cos(1)-\cos(4)\right)', + 1.0, '\frac{1}{2}\left(\cos(1)-\cos(4)\right) is a very good answer.', FORMAT_HTML), + 14 => new question_answer(14, '0.597', + 0.8,'Answer in three decimals is an OK approximation.', FORMAT_HTML), + 15 => new question_answer(15, '*', + 0.0, 'That is a bad answer.', FORMAT_HTML), ); return $qdata; @@ -104,9 +110,11 @@ public function get_shortmath_question_form_data_integration() { $form = new stdClass(); $form->name = 'Integration'; - $form->questiontext = array('text' => 'Evaluate the integral \( \int _1^2x\sin \left(x^2\right)dx \)', 'format' => FORMAT_HTML); + $form->questiontext = array('text' => 'Evaluate the integral \( \int _1^2x\sin \left(x^2\right)dx \)', + 'format' => FORMAT_HTML); $form->defaultmark = 1.0; - $form->generalfeedback = array('text' => 'Generalfeedback: \frac{1}{2}\left(\cos(1)-\cos(4)\right) or 0.597 would have been OK.', 'format' => FORMAT_HTML); + $form->generalfeedback = array('text' => 'Generalfeedback: \frac{1}{2}\left(\cos(1)-\cos(4)\right) or 0.597 would have been OK.', + 'format' => FORMAT_HTML); $form->usecase = false; $form->answer = array('integration', 'integration_exact', '*'); $form->fraction = array('1.0', '0.8', '0.0'); @@ -134,7 +142,8 @@ public function make_shortmath_question_integration_exact() { $q->generalfeedback = 'Generalfeedback: You should have said \frac{1}{2}\left(\cos(1)-\cos(4)\right).'; $q->usecase = false; $q->answers = array( - 13 => new question_answer(13, '\frac{1}{2}\left(\cos(1)-\cos(4)\right)', 1.0, '\frac{1}{2}\left(\cos(1)-\cos(4)\right) is correct.', FORMAT_HTML), + 13 => new question_answer(13, '\frac{1}{2}\left(\cos(1)-\cos(4)\right)', + 1.0, '\frac{1}{2}\left(\cos(1)-\cos(4)\right) is correct.', FORMAT_HTML), ); $q->qtype = question_bank::get_qtype('shortmath'); @@ -160,7 +169,8 @@ public function get_shortmath_question_data_integration_exact() { $qdata->options = new stdClass(); $qdata->options->usecase = false; $qdata->options->answers = array( - 13 => new question_answer(13, '\frac{1}{2}\left(\cos(1)-\cos(4)\right)', 1.0, '\frac{1}{2}\left(\cos(1)-\cos(4)\right) is correct.', FORMAT_HTML), + 13 => new question_answer(13, '\frac{1}{2}\left(\cos(1)-\cos(4)\right)', + 1.0, '\frac{1}{2}\left(\cos(1)-\cos(4)\right) is correct.', FORMAT_HTML), ); return $qdata; From 7d930064514cdb01a0c4ab5d9afb0c690fa07330 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andre=CC=81=20Storhaug?= Date: Mon, 7 Jan 2019 19:17:15 +0100 Subject: [PATCH 14/30] Fix space error in .travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 8988df9..90652dd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,7 +20,7 @@ php: - 7.2 env: - matrix: + matrix: - MOODLE_BRANCH=MOODLE_35_STABLE DB=pgsql - MOODLE_BRANCH=MOODLE_35_STABLE DB=mysqli From 2b9a0f7bfb8aad03af0f9f7c349f4851ff3a20a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andre=CC=81=20Storhaug?= Date: Mon, 7 Jan 2019 19:38:43 +0100 Subject: [PATCH 15/30] Fix codechecker warning - space after comma --- tests/helper.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/helper.php b/tests/helper.php index 42c572d..f8060e6 100644 --- a/tests/helper.php +++ b/tests/helper.php @@ -91,7 +91,7 @@ public function get_shortmath_question_data_integration() { 13 => new question_answer(13, '\frac{1}{2}\left(\cos(1)-\cos(4)\right)', 1.0, '\frac{1}{2}\left(\cos(1)-\cos(4)\right) is a very good answer.', FORMAT_HTML), 14 => new question_answer(14, '0.597', - 0.8,'Answer in three decimals is an OK approximation.', FORMAT_HTML), + 0.8, 'Answer in three decimals is an OK approximation.', FORMAT_HTML), 15 => new question_answer(15, '*', 0.0, 'That is a bad answer.', FORMAT_HTML), ); @@ -113,7 +113,8 @@ public function get_shortmath_question_form_data_integration() { $form->questiontext = array('text' => 'Evaluate the integral \( \int _1^2x\sin \left(x^2\right)dx \)', 'format' => FORMAT_HTML); $form->defaultmark = 1.0; - $form->generalfeedback = array('text' => 'Generalfeedback: \frac{1}{2}\left(\cos(1)-\cos(4)\right) or 0.597 would have been OK.', + $form->generalfeedback = array( + 'text' => 'Generalfeedback: \frac{1}{2}\left(\cos(1)-\cos(4)\right) or 0.597 would have been OK.', 'format' => FORMAT_HTML); $form->usecase = false; $form->answer = array('integration', 'integration_exact', '*'); From 53070a06c98d151c6392437c667207a49dac911c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andre=CC=81=20Storhaug?= Date: Mon, 7 Jan 2019 22:00:05 +0100 Subject: [PATCH 16/30] Add MOODLE_BRANCH=master to travis --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 90652dd..221e4da 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,6 +27,9 @@ env: - MOODLE_BRANCH=MOODLE_36_STABLE DB=pgsql - MOODLE_BRANCH=MOODLE_36_STABLE DB=mysqli + - MOODLE_BRANCH=master DB=pgsql + - MOODLE_BRANCH=master DB=mysqli + allow_failures: - MOODLE_BRANCH=master DB=pgsql - MOODLE_BRANCH=master DB=mysqli From 11e615df960c5e85213cfe330db855328dd4bbe3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andre=CC=81=20Storhaug?= Date: Tue, 8 Jan 2019 00:14:31 +0100 Subject: [PATCH 17/30] Add conditional travis builds --- .travis.yml | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 221e4da..2169d79 100644 --- a/.travis.yml +++ b/.travis.yml @@ -42,9 +42,32 @@ before_install: - composer create-project -n --no-dev --prefer-dist blackboard-open-source/moodle-plugin-ci ci ^2 - export PATH="$(cd ci/bin; pwd):$(cd ci/vendor/bin; pwd):$PATH" +jobs: + include: + # Prechecks against latest Moodle stable only. + - stage: develop + php: + - 7.0 + - 7.1 + - 7.2 + env: DB=mysqli MOODLE_BRANCH=MOODLE_36_STABLE + install: + - moodle-plugin-ci install + script: + - moodle-plugin-ci phplint + - moodle-plugin-ci phpcpd + - moodle-plugin-ci phpmd + - moodle-plugin-ci codechecker + - moodle-plugin-ci validate + - moodle-plugin-ci savepoints + - moodle-plugin-ci mustache + - moodle-plugin-ci grunt -t eslint:amd + - moodle-plugin-ci phpunit --coverage-clover + - moodle-plugin-ci behat + +# Default 'test' stage: All tests against full matrix. install: - moodle-plugin-ci install - script: - moodle-plugin-ci phplint - moodle-plugin-ci phpcpd @@ -58,4 +81,10 @@ script: - moodle-plugin-ci behat after_success: - - moodle-plugin-ci coveralls-upload \ No newline at end of file + - moodle-plugin-ci coveralls-upload + +stages: + - name: develop + if: branch != master + - name: test + if: branch = master \ No newline at end of file From d1f946446c512acb7da600b15667c2849e8da6ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andre=CC=81=20Storhaug?= Date: Wed, 9 Jan 2019 16:53:47 +0100 Subject: [PATCH 18/30] Moved common commands to separate bash script --- .travis.yml | 96 +++++++++++++++++++++++++++++------------------ .travis/script.sh | 12 ++++++ 2 files changed, 71 insertions(+), 37 deletions(-) create mode 100755 .travis/script.sh diff --git a/.travis.yml b/.travis.yml index 2169d79..a3ec505 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,24 +15,25 @@ cache: - $HOME/.npm php: - - 7.0 - - 7.1 - - 7.2 + - 7.0 + - 7.1 + - 7.2 env: + fast_finish: true matrix: - - MOODLE_BRANCH=MOODLE_35_STABLE DB=pgsql - - MOODLE_BRANCH=MOODLE_35_STABLE DB=mysqli + - DB=pgsql MOODLE_BRANCH=MOODLE_35_STABLE + - DB=mysqli MOODLE_BRANCH=MOODLE_35_STABLE - - MOODLE_BRANCH=MOODLE_36_STABLE DB=pgsql - - MOODLE_BRANCH=MOODLE_36_STABLE DB=mysqli + - DB=pgsql MOODLE_BRANCH=MOODLE_36_STABLE + - DB=mysqli MOODLE_BRANCH=MOODLE_36_STABLE - - MOODLE_BRANCH=master DB=pgsql - - MOODLE_BRANCH=master DB=mysqli + - DB=pgsql MOODLE_BRANCH=master + - DB=mysqli MOODLE_BRANCH=master allow_failures: - - MOODLE_BRANCH=master DB=pgsql - - MOODLE_BRANCH=master DB=mysqli + - DB=pgsql MOODLE_BRANCH=master + - DB=mysqli MOODLE_BRANCH=master before_install: - phpenv config-rm xdebug.ini @@ -44,41 +45,62 @@ before_install: jobs: include: - # Prechecks against latest Moodle stable only. + # Prechecks against latest Moodle stable only. Testing against PHP 7.0, 7.1 and 7.2. + # pgsql - stage: develop - php: - - 7.0 - - 7.1 - - 7.2 - env: DB=mysqli MOODLE_BRANCH=MOODLE_36_STABLE + php: 7.0 + env: DB=pgsql MOODLE_BRANCH=MOODLE_36_STABLE install: - moodle-plugin-ci install script: - - moodle-plugin-ci phplint - - moodle-plugin-ci phpcpd - - moodle-plugin-ci phpmd - - moodle-plugin-ci codechecker - - moodle-plugin-ci validate - - moodle-plugin-ci savepoints - - moodle-plugin-ci mustache - - moodle-plugin-ci grunt -t eslint:amd - - moodle-plugin-ci phpunit --coverage-clover - - moodle-plugin-ci behat + - bash .travis/script.sh + + - stage: develop + php: 7.1 + env: DB=pgsql MOODLE_BRANCH=MOODLE_36_STABLE + install: + - moodle-plugin-ci install + script: + - bash .travis/script.sh + + - stage: develop + php: 7.2 + env: DB=pgsql MOODLE_BRANCH=MOODLE_36_STABLE + install: + - moodle-plugin-ci install + script: + - bash .travis/script.sh + + # mysql + - stage: develop + php: 7.0 + env: DB=mysqli MOODLE_BRANCH=MOODLE_36_STABLE + install: + - moodle-plugin-ci install + script: + - bash .travis/script.sh + + - stage: develop + php: 7.1 + env: DB=mysqli MOODLE_BRANCH=MOODLE_36_STABLE + install: + - moodle-plugin-ci install + script: + - bash .travis/script.sh + + - stage: develop + php: 7.2 + env: DB=mysqli MOODLE_BRANCH=MOODLE_36_STABLE + install: + - moodle-plugin-ci install + script: + - bash .travis/script.sh # Default 'test' stage: All tests against full matrix. install: - moodle-plugin-ci install script: - - moodle-plugin-ci phplint - - moodle-plugin-ci phpcpd - - moodle-plugin-ci phpmd - - moodle-plugin-ci codechecker - - moodle-plugin-ci validate - - moodle-plugin-ci savepoints - - moodle-plugin-ci mustache - - moodle-plugin-ci grunt -t eslint:amd - - moodle-plugin-ci phpunit --coverage-clover - - moodle-plugin-ci behat + - bash .travis/script.sh after_success: - moodle-plugin-ci coveralls-upload diff --git a/.travis/script.sh b/.travis/script.sh new file mode 100755 index 0000000..6994b0f --- /dev/null +++ b/.travis/script.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +moodle-plugin-ci phplint +moodle-plugin-ci phpcpd +moodle-plugin-ci phpmd +moodle-plugin-ci codechecker +moodle-plugin-ci validate +moodle-plugin-ci savepoints +moodle-plugin-ci mustache +moodle-plugin-ci grunt -t eslint:amd +moodle-plugin-ci phpunit --coverage-clover +moodle-plugin-ci behat \ No newline at end of file From 3c09ca0962dbbd06a55e26ad944de33bc4658026 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andre=CC=81=20Storhaug?= Date: Wed, 9 Jan 2019 18:48:27 +0100 Subject: [PATCH 19/30] Fix travis script locations --- .travis.yml | 14 +++++++------- .travis/script.sh | 24 ++++++++++++++---------- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/.travis.yml b/.travis.yml index a3ec505..c2c5dc9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -53,7 +53,7 @@ jobs: install: - moodle-plugin-ci install script: - - bash .travis/script.sh + - bash $TRAVIS_BUILD_DIR/.travis/script.sh - stage: develop php: 7.1 @@ -61,7 +61,7 @@ jobs: install: - moodle-plugin-ci install script: - - bash .travis/script.sh + - bash $TRAVIS_BUILD_DIR/.travis/script.sh - stage: develop php: 7.2 @@ -69,7 +69,7 @@ jobs: install: - moodle-plugin-ci install script: - - bash .travis/script.sh + - bash $TRAVIS_BUILD_DIR/.travis/script.sh # mysql - stage: develop @@ -78,7 +78,7 @@ jobs: install: - moodle-plugin-ci install script: - - bash .travis/script.sh + - bash $TRAVIS_BUILD_DIR/.travis/script.sh - stage: develop php: 7.1 @@ -86,7 +86,7 @@ jobs: install: - moodle-plugin-ci install script: - - bash .travis/script.sh + - bash $TRAVIS_BUILD_DIR/.travis/script.sh - stage: develop php: 7.2 @@ -94,13 +94,13 @@ jobs: install: - moodle-plugin-ci install script: - - bash .travis/script.sh + - bash $TRAVIS_BUILD_DIR/.travis/script.sh # Default 'test' stage: All tests against full matrix. install: - moodle-plugin-ci install script: - - bash .travis/script.sh + - bash $TRAVIS_BUILD_DIR/.travis/script.sh after_success: - moodle-plugin-ci coveralls-upload diff --git a/.travis/script.sh b/.travis/script.sh index 6994b0f..6e0d06f 100755 --- a/.travis/script.sh +++ b/.travis/script.sh @@ -1,12 +1,16 @@ #!/usr/bin/env bash -moodle-plugin-ci phplint -moodle-plugin-ci phpcpd -moodle-plugin-ci phpmd -moodle-plugin-ci codechecker -moodle-plugin-ci validate -moodle-plugin-ci savepoints -moodle-plugin-ci mustache -moodle-plugin-ci grunt -t eslint:amd -moodle-plugin-ci phpunit --coverage-clover -moodle-plugin-ci behat \ No newline at end of file +EXIT=0 + +moodle-plugin-ci phplint || EXIT=$? +moodle-plugin-ci phpcpd || EXIT=$? +moodle-plugin-ci phpmd || EXIT=$? +moodle-plugin-ci codechecker || EXIT=$? +moodle-plugin-ci validate || EXIT=$? +moodle-plugin-ci savepoints || EXIT=$? +moodle-plugin-ci mustache || EXIT=$? +moodle-plugin-ci grunt -t eslint:amd || EXIT=$? +moodle-plugin-ci phpunit --coverage-clover || EXIT=$? +moodle-plugin-ci behat || EXIT=$? + +exit ${EXIT} \ No newline at end of file From 1a568a95ab37d657654cbaffb29fd0ba64242c51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Storhaug?= Date: Fri, 11 Jan 2019 21:54:27 +0100 Subject: [PATCH 20/30] Add issue templates --- .github/ISSUE_TEMPLATE/bug-report.md | 38 +++++++++++++++++++++++ .github/ISSUE_TEMPLATE/bug_report.md | 38 +++++++++++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 20 ++++++++++++ 3 files changed, 96 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug-report.md create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md new file mode 100644 index 0000000..f3d5c41 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug-report.md @@ -0,0 +1,38 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: bug +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Desktop (please complete the following information):** + - OS: [e.g. iOS] + - Browser [e.g. chrome, safari] + - Version [e.g. 22] + +**Smartphone (please complete the following information):** + - Device: [e.g. iPhone6] + - OS: [e.g. iOS8.1] + - Browser [e.g. stock browser, safari] + - Version [e.g. 22] + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..f3d5c41 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,38 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: bug +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Desktop (please complete the following information):** + - OS: [e.g. iOS] + - Browser [e.g. chrome, safari] + - Version [e.g. 22] + +**Smartphone (please complete the following information):** + - Device: [e.g. iPhone6] + - OS: [e.g. iOS8.1] + - Browser [e.g. stock browser, safari] + - Version [e.g. 22] + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..11fc491 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: enhancement +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. From f7f07cfcfe2c42108fe1418248f580524e7e3371 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Storhaug?= Date: Fri, 11 Jan 2019 21:55:54 +0100 Subject: [PATCH 21/30] Delete bug-report.md --- .github/ISSUE_TEMPLATE/bug-report.md | 38 ---------------------------- 1 file changed, 38 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/bug-report.md diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md deleted file mode 100644 index f3d5c41..0000000 --- a/.github/ISSUE_TEMPLATE/bug-report.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve -title: '' -labels: bug -assignees: '' - ---- - -**Describe the bug** -A clear and concise description of what the bug is. - -**To Reproduce** -Steps to reproduce the behavior: -1. Go to '...' -2. Click on '....' -3. Scroll down to '....' -4. See error - -**Expected behavior** -A clear and concise description of what you expected to happen. - -**Screenshots** -If applicable, add screenshots to help explain your problem. - -**Desktop (please complete the following information):** - - OS: [e.g. iOS] - - Browser [e.g. chrome, safari] - - Version [e.g. 22] - -**Smartphone (please complete the following information):** - - Device: [e.g. iPhone6] - - OS: [e.g. iOS8.1] - - Browser [e.g. stock browser, safari] - - Version [e.g. 22] - -**Additional context** -Add any other context about the problem here. From eab906603a5211a5f716bf70f800833c3f72e8c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Storhaug?= Date: Sat, 12 Jan 2019 13:29:32 +0100 Subject: [PATCH 22/30] Create CODE_OF_CONDUCT.md --- CODE_OF_CONDUCT.md | 76 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 CODE_OF_CONDUCT.md diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..5582eb6 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,76 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at hasc@ntnu.no. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see +https://www.contributor-covenant.org/faq From a357df30cfebb48443f59ddda146b6b6aff4ea34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Storhaug?= Date: Sat, 12 Jan 2019 14:30:53 +0100 Subject: [PATCH 23/30] Create CONTRIBUTING.md --- CONTRIBUTING.md | 69 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..92e1e69 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,69 @@ +# How to contribute + +Thank you for your interest in contributing to the ShortMath project. + +## How can you help? + +* Report issues +* Fix typos and grammar +* Add new rules +* Improve existing rules and workflow + +## Best practices + +- Bugfixes should only contain changes that are related to the purpose of the bug. +- Description should contain an explanation for the proposed changes. +- It's recommended to consult feature requests with the team before starting implementation +- Send us an email if you need assistance with any work. + +## Making changes + +* Fork this repository on GitHub +* All development work should follow the [GitFlow](https://nvie.com/posts/a-successful-git-branching-model/) branching model. +* Make sure you have added the necessary tests for your changes. +* If applicable, include a link to the issue in the commit message body. + +## Submitting changes + +* Push your changes to a topic branch in your fork of the repository. +* Submit a pull request to the repository in the [KQMATH GitHub organization](https://github.com/KQMATH) +and choose branch you want to patch (usually master). +* Add detail about the change to the pull request including screenshots + if the change affects the UI. + +## Reviewing changes + +* After submitting a pull request, one of ShortMath team members will review it. +* Changes may be requested to conform to our style guide and internal + requirements. +* When the changes are approved and all tests are passing, a ShortMath team + member will merge them. +* Note: if you have write access to the repository, do not directly merge pull + requests. Let another team member review your pull request and approve it. + +## Style guide + +* This repository uses [Markdown](https://daringfireball.net/projects/markdown/) + syntax and follows + [cirosantilli/markdown-style-guide](http://www.cirosantilli.com/markdown-style-guide/) + style guide. +* The preferred spelling of English words is the [American + English](https://en.wikipedia.org/wiki/American_English) (e.g. behavior, not + behaviour). +* The required coding style is the [Moodle cooding style](https://docs.moodle.org/dev/Coding_style). + + +## License + +By contributing to this repository you agree that all contributions are subject to the +GNU General Public License v3.0 under thepublic domain. +See [LICENSE](https://github.com/KQMATH/moodle-qtype_shortmath/blob/master/LICENSE) +file for more information. + +## Review and release process + +* Each addition and rule change is discussed and reviewed internally by ShortMath + core team. +* When contents are updated, [CHANGELOG.md](/CHANGELOG.md) file is updated and a + new tag is released. Repository follows [semantic versioning](http://semver.org/). +* The [official release](https://moodle.org/plugins/qtype_shortmath) at Moodle must be manually updated accordingly. From a8489c33a1282e544fb3db5adcc246b2f070d5ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Storhaug?= Date: Sat, 12 Jan 2019 14:32:25 +0100 Subject: [PATCH 24/30] Update CONTRIBUTING.md --- CONTRIBUTING.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 92e1e69..2844921 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -43,10 +43,7 @@ and choose branch you want to patch (usually master). ## Style guide -* This repository uses [Markdown](https://daringfireball.net/projects/markdown/) - syntax and follows - [cirosantilli/markdown-style-guide](http://www.cirosantilli.com/markdown-style-guide/) - style guide. +* This repository uses [Markdown](https://daringfireball.net/projects/markdown/) syntax. * The preferred spelling of English words is the [American English](https://en.wikipedia.org/wiki/American_English) (e.g. behavior, not behaviour). From a03ad5b0e3d55784bd19993b83c5a2bf683795d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Storhaug?= Date: Wed, 16 Jan 2019 22:52:59 +0100 Subject: [PATCH 25/30] Add "CHANGELOG.md" file --- CHANGELOG.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..ac65d58 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,30 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org). + +## [Unreleased] +### Changed +- + +## [0.3.1] - 2018-12-30 +### Added +- + +## [0.3.0] - 2018-12-30 +### Added +- + +## [0.2.0] - 2018-12-12 +### Added +- + +## 0.1.0 - 2018-09-27 +### Added +- + +[Unreleased]: https://github.com/KQMATH/moodle-qtype_shortmath/compare/v0.3.1...HEAD +[0.3.1]: https://github.com/KQMATH/moodle-qtype_shortmath/compare/v0.3.0...v0.3.1 +[0.3.0]: https://github.com/KQMATH/moodle-qtype_shortmath/compare/v0.2.0...v0.3.0 +[0.2.0]: https://github.com/KQMATH/moodle-qtype_shortmath/compare/v0.1.0...v0.2.0 From 94ebf3d32d4f157a7015b619f9f6ba07b5ed1417 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Storhaug?= Date: Wed, 16 Jan 2019 23:11:34 +0100 Subject: [PATCH 26/30] Update CONTRIBUTING.md --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2844921..210c56c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -18,7 +18,7 @@ Thank you for your interest in contributing to the ShortMath project. ## Making changes -* Fork this repository on GitHub +* Fork this repository on [GitHub](https://github.com/KQMATH/moodle-qtype_shortmath) * All development work should follow the [GitFlow](https://nvie.com/posts/a-successful-git-branching-model/) branching model. * Make sure you have added the necessary tests for your changes. * If applicable, include a link to the issue in the commit message body. @@ -27,7 +27,7 @@ Thank you for your interest in contributing to the ShortMath project. * Push your changes to a topic branch in your fork of the repository. * Submit a pull request to the repository in the [KQMATH GitHub organization](https://github.com/KQMATH) -and choose branch you want to patch (usually master). +and choose branch you want to patch (usually develop). * Add detail about the change to the pull request including screenshots if the change affects the UI. From cb4e89cb25c86aedb71ea41f245304d888b639eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Storhaug?= Date: Thu, 17 Jan 2019 00:21:48 +0100 Subject: [PATCH 27/30] Add "pull_request.md" template file --- .github/PULL_REQUEST_TEMPLATE/pull_request.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/PULL_REQUEST_TEMPLATE/pull_request.md diff --git a/.github/PULL_REQUEST_TEMPLATE/pull_request.md b/.github/PULL_REQUEST_TEMPLATE/pull_request.md new file mode 100644 index 0000000..6ab83ca --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE/pull_request.md @@ -0,0 +1,18 @@ +## Description +A few sentences describing the overall goals of `pull request` + +## List of General Components affected + +## Status +- [ ] Ready for Review + +## Types of changes +- [ ] Bug fix (non-breaking change which fixes an issue) +- [ ] New feature (non-breaking change which adds functionality) +- [ ] Breaking change (fix or feature that would cause existing functionality to change) + +## Non Functional Requirement +- [ ] Follows the code style of this project. +- [ ] Tests Cover Changes +- [ ] All new and existing tests passed. +- [ ] Documentation From 55e10b27f479b8e1f43a07f35179b6c4c6de5829 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andre=CC=81=20Storhaug?= Date: Tue, 22 Jan 2019 00:00:24 +0100 Subject: [PATCH 28/30] Add travis stylelint:css test --- .travis/script.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis/script.sh b/.travis/script.sh index 6e0d06f..3cea470 100755 --- a/.travis/script.sh +++ b/.travis/script.sh @@ -9,7 +9,7 @@ moodle-plugin-ci codechecker || EXIT=$? moodle-plugin-ci validate || EXIT=$? moodle-plugin-ci savepoints || EXIT=$? moodle-plugin-ci mustache || EXIT=$? -moodle-plugin-ci grunt -t eslint:amd || EXIT=$? +moodle-plugin-ci grunt -t eslint:amd -t stylelint:css || EXIT=$? moodle-plugin-ci phpunit --coverage-clover || EXIT=$? moodle-plugin-ci behat || EXIT=$? From 5f181e894264d7ee4aa9dd5db6f3279e31761e2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andre=CC=81=20Storhaug?= Date: Tue, 22 Jan 2019 01:00:04 +0100 Subject: [PATCH 29/30] Update "package.json" file --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 579c431..4f16ecc 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,8 @@ { + "private": true, "name": "moodle-qtype_shortmath", "version": "0.3.1", - "description": "A simple question for mathematical expressions using MathQuill", + "description": "Moodle question type for writing mathematical expressions using MathQuill", "main": "index.js", "dependencies": { "eslint": "^5.11.0" From 995e36b8cf4817f004ae12c51f9d6257e2d161ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andre=CC=81=20Storhaug?= Date: Tue, 22 Jan 2019 01:00:58 +0100 Subject: [PATCH 30/30] Update version number to 0.4.0 --- package-lock.json | 2 +- package.json | 2 +- version.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index cc202b7..237951f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "moodle-qtype_shortmath", - "version": "0.3.1", + "version": "0.4.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 4f16ecc..9344bb5 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "moodle-qtype_shortmath", - "version": "0.3.1", + "version": "0.4.0", "description": "Moodle question type for writing mathematical expressions using MathQuill", "main": "index.js", "dependencies": { diff --git a/version.php b/version.php index 109cca8..95a8459 100755 --- a/version.php +++ b/version.php @@ -26,8 +26,8 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2018123001; +$plugin->version = 2019012200; $plugin->requires = 2018051700; // Moodle version 3.5. $plugin->component = 'qtype_shortmath'; $plugin->maturity = MATURITY_STABLE; -$plugin->release = '0.3.1'; +$plugin->release = '0.4.0';