Skip to content

Commit 3f2d19c

Browse files
authored
Prepare release 5.1.1 (#68)
1 parent 9af98b8 commit 3f2d19c

File tree

6 files changed

+34
-23
lines changed

6 files changed

+34
-23
lines changed

CHANGES.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
### 5.1.1 (2023-01-30)
4+
- bugfix: fmod() now works like in other scientific calculators
5+
- bugfix: sort() now uses natural sorting and does not lose values anymore
6+
- bugfix: instantiation check could fail in certain cases
7+
- internal: some cleanup, update of package.json
8+
9+
Please note: future releases will no longer support Internet Explorer.
10+
311
### 5.1.0 (2022-11-23)
412
- added support for Moodle 4.1
513
- new functions for number conversion (decimal <-> octal/binary)

classes/output/mobile.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
1616

1717
/**
18-
* Mobile output class for qtype_gapfill
18+
* Mobile output class for qtype_formulas
1919
*
2020
* @package qtype_formulas
2121
* @copyright 2022 Jakob Heinemann
@@ -24,8 +24,6 @@
2424

2525
namespace qtype_formulas\output;
2626

27-
28-
2927
defined('MOODLE_INTERNAL') || die();
3028

3129
/**
@@ -37,7 +35,7 @@
3735
*/
3836
class mobile {
3937
/**
40-
* Returns the gapfill question type for the quiz in the mobile app.
38+
* Returns the Formulas question type for the quiz in the mobile app.
4139
*
4240
* @return void
4341
*/
@@ -53,4 +51,4 @@ public static function mobile_get_formulas($args) {
5351
'javascript' => file_get_contents($CFG->dirroot . '/question/type/formulas/mobile/mobile.js')
5452
];
5553
}
56-
}
54+
}

mobile/mobile.js

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,39 +14,38 @@
1414
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
1515

1616
/**
17-
* support for the mdl35+ mobile app. PHP calls this from within
17+
* support for the Moodle mobile app >= 3.9.5. PHP calls this from within
1818
* classes/output/mobile.php
1919
*/
20-
/* jshint esversion: 6 */
21-
/* eslint-disable no-console */
2220

2321
var that = this;
2422
var result = {
2523
componentInit: function() {
2624
var div = document.createElement('div');
2725
div.innerHTML = this.question.html;
28-
this.question.text = this.CoreDomUtilsProvider.getContentsOfElement(div, '.qtext');
26+
this.question.text = div.querySelector('.qtext').innerHTML;
2927

3028
// Replace Moodle's correct/incorrect and feedback classes with our own.
31-
this.CoreQuestionHelperProvider.replaceCorrectnessClasses(div);
32-
this.CoreQuestionHelperProvider.replaceFeedbackClasses(div);
29+
that.CoreQuestionHelperProvider.replaceCorrectnessClasses(div);
30+
that.CoreQuestionHelperProvider.replaceFeedbackClasses(div);
31+
that.CoreQuestionHelperProvider.treatCorrectnessIcons(div);
3332

34-
// Treat the correct/incorrect icons.
35-
this.CoreQuestionHelperProvider.treatCorrectnessIcons(div);
33+
if (typeof this.question.text === 'undefined') {
34+
return that.CoreQuestionHelperProvider.showComponentError(this.onAbort);
35+
}
3636

3737
if (div.querySelector('.readonly') !== null) {
3838
this.question.readOnly = true;
3939
}
40+
4041
if (div.querySelector('.feedback') !== null) {
4142
this.question.feedback = div.querySelector('.feedback');
4243
this.question.feedbackHTML = true;
4344
}
4445

45-
if (typeof this.question.text == 'undefined') {
46-
this.logger.warn('Aborting because of an error parsing question.', this.question.name);
47-
return this.CoreQuestionHelperProvider.showComponentError(this.onAbort);
48-
}
4946
return true;
5047
}
5148
};
49+
50+
/* eslint-disable-next-line */
5251
result;

package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
{
22
"name": "moodle-qtype_formulas",
33
"devDependencies": {
4-
"grunt": "^1.0.1",
5-
"grunt-contrib-less": "^1.4.1",
6-
"grunt-contrib-watch": "^1.0.0",
7-
"grunt-load-gruntfile": "0.0.2"
4+
"grunt": "^1.5.3",
5+
"grunt-cli": "^1.4.3",
6+
"grunt-contrib-watch": "^1.1.0"
87
},
98
"repository": {
109
"type": "git",
11-
"url": "git://github.com/dbauer-ets/moodle-qtype_formulas.git"
10+
"url": "git://github.com/FormulasQuestion/moodle-qtype_formulas.git"
1211
},
1312
"license" : "GPL-3.0"
1413
}

thirdpartylibs.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,11 @@
77
<license>MIT</license>
88
<licenseversion></licenseversion>
99
</library>
10+
<library>
11+
<location>tabulator.css</location>
12+
<name>Tabulator</name>
13+
<version>5.4</version>
14+
<license>MIT</license>
15+
<licenseversion></licenseversion>
16+
</library>
1017
</libraries>

version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
defined('MOODLE_INTERNAL') || die();
2626

2727
$plugin->component = 'qtype_formulas';
28-
$plugin->version = 2023010800;
28+
$plugin->version = 2023012900;
2929

3030
$plugin->cron = 0;
3131
$plugin->requires = 2017111300;

0 commit comments

Comments
 (0)