From a403a97b84bcd6f838d34b9d091202ba3788c442 Mon Sep 17 00:00:00 2001 From: Pol Torrent Date: Fri, 15 Jan 2021 12:37:43 +0100 Subject: [PATCH 1/4] #taskid 7578 - fixes auxiliary text field with WQ4 api --- renderer.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/renderer.php b/renderer.php index 2009644..26b64d9 100644 --- a/renderer.php +++ b/renderer.php @@ -28,8 +28,12 @@ public function formulation_and_controls(question_attempt $qa, question_display_ $result = $this->base->formulation_and_controls($qa, $options); // Auxiliar text. - $showauxiliartextinput = $qa->get_question()->wirisquestion->question->getProperty( - com_wiris_quizzes_api_QuizzesConstants::$PROPERTY_SHOW_AUXILIAR_TEXT_INPUT); // @codingStandardsIgnoreLine + if (isset($qa->get_question()->wirisquestion->question->getSlots()[0])) { + $showauxiliartextinput = $qa->get_question()->wirisquestion->question->getSlots()[0]->getProperty(com_wiris_quizzes_api_PropertyName::$SHOW_AUXILIARY_TEXT_INPUT); // @codingStandardsIgnoreLine + } else { + $showauxiliartextinput = $qa->get_question()->wirisquestion->question->getProperty(com_wiris_quizzes_api_PropertyName::$SHOW_AUXILIARY_TEXT_INPUT); // @codingStandardsIgnoreLine + } + if ($showauxiliartextinput) { $result .= $this->auxiliar_text($qa, $options); } From 4c6f036a5dd0c649052b9a8addd9edff1b4fe1b6 Mon Sep 17 00:00:00 2001 From: Daniel Canet Date: Mon, 1 Mar 2021 14:58:25 +0100 Subject: [PATCH 2/4] Migrate to TravisCI.com --- .travis.yml | 118 ++++++++++++++++++++++++++++++++++++---------------- README.md | 12 ++++-- 2 files changed, 89 insertions(+), 41 deletions(-) diff --git a/.travis.yml b/.travis.yml index 50273fa..ab361d7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,18 +1,21 @@ +notifications: + email: false + language: php sudo: required -dist: trusty - -#branches: -# only: -# - master addons: - firefox: "47.0.1" - postgresql: "9.4" - apt: - packages: - - chromium-chromedriver + postgresql: "9.6" + +services: + - postgresql + +jobs: + # Enable fast finish. + # This will fail the build if a single job fails (except those in allow_failures). + # It will not stop the jobs from running. + fast_finish: true cache: directories: @@ -20,49 +23,68 @@ cache: - $HOME/.npm php: - - 7.0 + # - 7.0 - 7.1 - - 7.2 + # - 7.2 + # - 7.3 + - 7.4 env: global: + - IGNORE_PATHS=classes/privacy,ignore,node_modules,quizzes,lang + # - IGNORE_NAMES=ignore_name.php + # - MUSTACHE_IGNORE_NAMES=broken.mustache + # - PROFILE=chrome - COVERAGE=false + - PHPUNIT_IGNORE_PATHS=classes/privacy,ignore,node_modules,quizzes,lang + - DB=pgsql + matrix: - - MOODLE_BRANCH=MOODLE_35_STABLE DB=mysqli IGNORE_PATHS=integration,filtersettings.php,quizzes,lang - - MOODLE_BRANCH=MOODLE_35_STABLE DB=pgsql IGNORE_PATHS=integration,filtersettings.php,quizzes,lang - - MOODLE_BRANCH=MOODLE_36_STABLE DB=mysqli IGNORE_PATHS=integration,filtersettings.php,quizzes,lang - - MOODLE_BRANCH=MOODLE_36_STABLE DB=pgsql IGNORE_PATHS=integration,filtersettings.php,quizzes,lang - - MOODLE_BRANCH=MOODLE_37_STABLE DB=mysqli IGNORE_PATHS=integration,filtersettings.php,quizzes,lang - - MOODLE_BRANCH=MOODLE_37_STABLE DB=pgsql IGNORE_PATHS=integration,filtersettings.php,quizzes,lang + - MOODLE_BRANCH=MOODLE_311_STABLE + - MOODLE_BRANCH=MOODLE_310_STABLE + - MOODLE_BRANCH=MOODLE_39_STABLE + - MOODLE_BRANCH=MOODLE_38_STABLE + - MOODLE_BRANCH=MOODLE_37_STABLE + - MOODLE_BRANCH=MOODLE_36_STABLE + - MOODLE_BRANCH=MOODLE_35_STABLE matrix: exclude: - - php: 7.0 - env: MOODLE_BRANCH=MOODLE_37_STABLE DB=mysqli IGNORE_PATHS=integration,filtersettings.php,quizzes,lang - - php: 7.0 - env: MOODLE_BRANCH=MOODLE_37_STABLE DB=pgsql IGNORE_PATHS=integration,filtersettings.php,quizzes,lang - - php: 7.2 - env: MOODLE_BRANCH=MOODLE_32_STABLE DB=mysqli IGNORE_PATHS=integration,filtersettings.php,quizzes,lang - - php: 7.2 - env: MOODLE_BRANCH=MOODLE_32_STABLE DB=pgsql IGNORE_PATHS=integration,filtersettings.php,quizzes,lang - - php: 7.2 - env: MOODLE_BRANCH=MOODLE_33_STABLE DB=mysqli IGNORE_PATHS=integration,filtersettings.php,quizzes,lang - - php: 7.2 - env: MOODLE_BRANCH=MOODLE_33_STABLE DB=pgsql IGNORE_PATHS=integration,filtersettings.php,quizzes,lang + - php: 7.1 + env: MOODLE_BRANCH=MOODLE_38_STABLE + - php: 7.1 + env: MOODLE_BRANCH=MOODLE_39_STABLE + - php: 7.1 + env: MOODLE_BRANCH=MOODLE_310_STABLE + - php: 7.1 + env: MOODLE_BRANCH=MOODLE_311_STABLE + - php: 7.1 + env: MOODLE_BRANCH=MOODLE_39_STABLE + - php: 7.1 + env: MOODLE_BRANCH=MOODLE_310_STABLE + - php: 7.1 + env: MOODLE_BRANCH=MOODLE_311_STABLE + - php: 7.4 + env: MOODLE_BRANCH=MOODLE_35_STABLE + - php: 7.4 + env: MOODLE_BRANCH=MOODLE_36_STABLE + - php: 7.4 + env: MOODLE_BRANCH=MOODLE_37_STABLE + before_install: + - nvm install 14.15.0; + - nvm use 14.15.0; - phpenv config-rm xdebug.ini - cd ../.. - composer selfupdate - - composer create-project -n --no-dev --prefer-dist blackboard-open-source/moodle-plugin-ci ci ^2 + - composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^3 - export PATH="$(cd ci/bin; pwd):$(cd ci/vendor/bin; pwd):$PATH" install: - - nvm install 14.0.0 - - nvm use 14.0.0 - moodle-plugin-ci add-plugin wiris/moodle-atto_wiris - - moodle-plugin-ci add-plugin --branch master wiris/moodle-filter_wiris - - moodle-plugin-ci add-plugin wiris/moodle-qtype_wq + - moodle-plugin-ci add-plugin wiris/moodle-filter_wiris + - moodle-plugin-ci add-plugin --branch $TRAVIS_BRANCH wiris/moodle-qtype_wq - moodle-plugin-ci install script: @@ -71,8 +93,30 @@ script: - moodle-plugin-ci phpmd - moodle-plugin-ci codechecker - moodle-plugin-ci validate - - moodle-plugin-ci phpunit - moodle-plugin-ci savepoints - moodle-plugin-ci mustache - moodle-plugin-ci grunt - - moodle-plugin-ci behat --profile chrome \ No newline at end of file + # - if [ "$MOODLE_BRANCH" = MOODLE_35_STABLE ]; then + # moodle-plugin-ci grunt; + # fi + # - if [ "$MOODLE_BRANCH" = MOODLE_36_STABLE ]; then + # moodle-plugin-ci grunt; + # fi + # - if [ "$MOODLE_BRANCH" = MOODLE_37_STABLE ]; then + # moodle-plugin-ci grunt; + # fi + # - if [ "$MOODLE_BRANCH" = MOODLE_38_STABLE ]; then + # moodle-plugin-ci grunt -t eslint; + # fi + # - if [ "$MOODLE_BRANCH" = MOODLE_39_STABLE ]; then + # moodle-plugin-ci grunt -t eslint; + # fi + # - if [ "$MOODLE_BRANCH" = MOODLE_310_STABLE ]; then + # moodle-plugin-ci grunt -t eslint; + # fi + # - if [ "$MOODLE_BRANCH" = MOODLE_311_STABLE ]; then + # moodle-plugin-ci grunt -t eslint; + # fi + - moodle-plugin-ci phpunit + - moodle-plugin-ci behat + # - moodle-plugin-ci behat --profile $PROFILE diff --git a/README.md b/README.md index 0ee97eb..1024829 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,6 @@ # Wiris Quizzes Essay question type ### Master Build Status -[![Build Status](https://travis-ci.org/wiris/moodle-qtype_essaywiris.svg?branch=master)](https://travis-ci.org/wiris/moodle-qtype_essaywiris) -### Development Build Status -[![Build Status](https://travis-ci.org/wiris/moodle-qtype_essaywiris.svg?branch=development)](https://travis-ci.org/wiris/moodle-qtype_essaywiris) +[![Build Status](https://travis-ci.com/wiris/moodle-qtype_essaywiris.svg)](https://travis-ci.com/wiris/moodle-qtype_essaywiris) The Wiris Essay question type extends the Moodle Essay type, adding mathematical functionality to it. @@ -21,8 +19,14 @@ Then add /question/type/essaywiris to your git ignore. Alternatively, download the zip from it into the question/type folder, and then rename the new folder to "essaywiris". +## Technical Support -## License +If you have questions or need help integrating MathType, please contact us (support@wiris.com) instead of opening an issue. + +## Privacy policy +The [MathType Privacy Policy](https://www.wiris.com/mathtype/privacy-policy) covers the data processing operations for the MathType users. It is an addendum of the company’s general Privacy Policy and the [general Privacy Policy](https://wiris.com/en/privacy-policy) still applies to MathType users. + +## License Wiris Essay question type is Licensed under the [GNU General Public, License Version 3](https://www.gnu.org/licenses/gpl-3.0.en.html). From 23db84882af144afb4a1f677bc9d817f2be3f052 Mon Sep 17 00:00:00 2001 From: Pol Torrent Date: Thu, 22 Apr 2021 16:18:49 +0200 Subject: [PATCH 3/4] rolls back wrong commit --- renderer.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/renderer.php b/renderer.php index 26b64d9..22e227f 100644 --- a/renderer.php +++ b/renderer.php @@ -28,12 +28,7 @@ public function formulation_and_controls(question_attempt $qa, question_display_ $result = $this->base->formulation_and_controls($qa, $options); // Auxiliar text. - if (isset($qa->get_question()->wirisquestion->question->getSlots()[0])) { - $showauxiliartextinput = $qa->get_question()->wirisquestion->question->getSlots()[0]->getProperty(com_wiris_quizzes_api_PropertyName::$SHOW_AUXILIARY_TEXT_INPUT); // @codingStandardsIgnoreLine - } else { - $showauxiliartextinput = $qa->get_question()->wirisquestion->question->getProperty(com_wiris_quizzes_api_PropertyName::$SHOW_AUXILIARY_TEXT_INPUT); // @codingStandardsIgnoreLine - } - + $showauxiliartextinput = $qa->get_question()->wirisquestion->question->getProperty(com_wiris_quizzes_api_QuizzesConstants::$PROPERTY_SHOW_AUXILIAR_TEXT_INPUT); // @codingStandardsIgnoreLine if ($showauxiliartextinput) { $result .= $this->auxiliar_text($qa, $options); } From 34a561af0ae9ec1f02ef42f13a46b03ef2474906 Mon Sep 17 00:00:00 2001 From: Pol Torrent Date: Tue, 27 Apr 2021 17:06:41 +0200 Subject: [PATCH 4/4] Compatibility with Moodle 3.11 --- question.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/question.php b/question.php index 9a56815..c6b0f0f 100644 --- a/question.php +++ b/question.php @@ -30,6 +30,8 @@ class qtype_essaywiris_question extends qtype_wq_question implements question_ma public $graderinfoformat; public $responsetemplate; public $responsetemplateformat; + public $maxbytes; + public $filetypeslist; public function join_all_text() { $text = parent::join_all_text(); @@ -69,4 +71,10 @@ public function is_complete_response(array $response) { } return $complete; } + + public function get_word_count_message_for_review(array $response): string { + return $this->base->get_word_count_message_for_review($response); + } + + }