Skip to content

Commit

Permalink
3.58.1 stable version
Browse files Browse the repository at this point in the history
  • Loading branch information
mcagigas-at-wiris authored Nov 23, 2017
1 parent ee2f632 commit ff0488c
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 51 deletions.
65 changes: 25 additions & 40 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,68 +2,53 @@ language: php

sudo: false

addons:
firefox: "47.0.1"
postgresql: "9.3"
apt:
packages:
- oracle-java8-installer
- oracle-java8-set-default

cache:
directories:
- $HOME/.composer/cache
- $HOME/.npm

php:
- 5.6
- 7.0
- 7.1

env:
- MOODLE_BRANCH=MOODLE_31_STABLE DB=mysqli
- MOODLE_BRANCH=MOODLE_30_STABLE DB=pgsql
- MOODLE_BRANCH=MOODLE_29_STABLE DB=mysqli
- MOODLE_BRANCH=MOODLE_28_STABLE DB=pgsql
- MOODLE_BRANCH=MOODLE_27_STABLE DB=mysqli

matrix:
exclude:
- php: 7.0
env: MOODLE_BRANCH=MOODLE_29_STABLE DB=mysqli
- php: 7.0
env: MOODLE_BRANCH=MOODLE_28_STABLE DB=pgsql
- php: 7.0
env: MOODLE_BRANCH=MOODLE_27_STABLE DB=mysqli
- php: 5.6
env: MOODLE_BRANCH=MOODLE_31_STABLE DB=mysqli
- php: 5.6
env: MOODLE_BRANCH=MOODLE_30_STABLE DB=pgsql
- php: 5.6
env: MOODLE_BRANCH=MOODLE_29_STABLE DB=mysqli
- php: 5.6
env: MOODLE_BRANCH=MOODLE_28_STABLE DB=pgsql
- php: 5.6
env: MOODLE_BRANCH=MOODLE_27_STABLE DB=mysqli
include:
- php: 5.4
env: MOODLE_BRANCH=MOODLE_31_STABLE DB=mysqli
- php: 5.4
env: MOODLE_BRANCH=MOODLE_30_STABLE DB=pgsql
- php: 5.4
env: MOODLE_BRANCH=MOODLE_29_STABLE DB=mysqli
- php: 5.4
env: MOODLE_BRANCH=MOODLE_28_STABLE DB=pgsql
- php: 5.4
env: MOODLE_BRANCH=MOODLE_27_STABLE DB=mysqli
global:
- MOODLE_BRANCH=MOODLE_32_STABLE IGNORE_PATHS=quizzes,lang
- MOODLE_BRANCH=MOODLE_33_STABLE IGNORE_PATHS=quizzes,lang
matrix:
- DB=pgsql
- DB=mysqli

before_install:
- phpenv config-rm xdebug.ini
- nvm install 8.9
- nvm use 8.9
- cd ../..
- composer selfupdate
- composer create-project -n --no-dev --prefer-dist moodlerooms/moodle-plugin-ci ci ^1
- composer create-project -n --no-dev --prefer-dist moodlerooms/moodle-plugin-ci ci ^2
- export PATH="$(cd ci/bin; pwd):$(cd ci/vendor/bin; pwd):$PATH"

install:
- moodle-plugin-ci add-plugin wiris/moodle-filter_wiris
- moodle-plugin-ci add-plugin wiris/moodle-qtype_wq
- moodle-plugin-ci add-plugin --branch development wiris/moodle-filter_wiris
- moodle-plugin-ci add-plugin --branch development wiris/moodle-qtype_wq
- moodle-plugin-ci install

script:
- moodle-plugin-ci phplint
- moodle-plugin-ci phpcpd
- moodle-plugin-ci phpmd
- moodle-plugin-ci codechecker
- moodle-plugin-ci shifter
- moodle-plugin-ci validate
- moodle-plugin-ci savepoints
- moodle-plugin-ci mustache
- moodle-plugin-ci grunt -t css
- moodle-plugin-ci phpunit
- moodle-plugin-ci behat
3 changes: 1 addition & 2 deletions question.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ private function set_shortanswer_matching_answers(array $response) {
$needsgrade = true;
}
}

}
}

Expand All @@ -123,7 +122,7 @@ private function set_shortanswer_matching_answers(array $response) {
if (empty($qimpl->assertions)) {
$qimpl->setAssertion("equivalent_symbolic", 0, 0);
}

// Remove all non-syntactic assertions from question and save to $assertions array.
for ($i = $qimpl->assertions->length - 1; $i >= 0; $i--) {
$assertion = $qimpl->assertions[$i];
Expand Down
14 changes: 7 additions & 7 deletions renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function __construct($subq) {
}
// Shortanswerwiris grading.
public function get_matching_answer(array $response) {
if (isset($response['answer'])) {
if (isset($response['answer']) || $response['answer'] == null) {
if (!empty($response['correct_response'])) {
// This is called to produce de feedback popup "The correct response is ...".
return $this->subq->base->get_matching_answer($this->subq->base->get_correct_response());
Expand Down Expand Up @@ -128,11 +128,11 @@ public function subquestion(question_attempt $qa, question_display_options $opti
$size = 1;
if (class_exists('core_text')) {
if ($response != null) {
// Plain response, the size of the input is the same that the size of the response.
if (substr($response, 0, 5) != "<math"){
// Plain response, the size of the input is the same that the size of the response.
if (substr($response, 0, 5) != "<math") {
$size = max(1, core_text::strlen(trim($response)) + 1);
} else {
$size = $qa->get_question()->expand_variables_text($response) +1;
$size = $qa->get_question()->expand_variables_text($response) + 1;

}
} else {
Expand All @@ -142,11 +142,11 @@ public function subquestion(question_attempt $qa, question_display_options $opti
}
} else {
if ($response != null) {
// Plain response, the size of the input is the same that the size of the response.
if (substr($response, 0, 5) != "<math"){
// Plain response, the size of the input is the same that the size of the response.
if (substr($response, 0, 5) != "<math") {
$size = max(1, textlib::strlen(trim($response)) + 1);
} else {
$size = $qa->get_question()->expand_variables_text($response) +1;
$size = $qa->get_question()->expand_variables_text($response) + 1;

}
} else {
Expand Down
4 changes: 2 additions & 2 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@

defined('MOODLE_INTERNAL') || die();

$plugin->version = 2017110600;
$plugin->version = 2017112300;
$plugin->release = '3.58.0.1029';
$plugin->requires = 2011060313;
$plugin->maturity = MATURITY_STABLE;
$plugin->component = 'qtype_multianswerwiris';
$plugin->dependencies = array (
'qtype_wq' => 2017110600
'qtype_wq' => 2017112300
);

0 comments on commit ff0488c

Please sign in to comment.