Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.55.0 Stable version #8

Merged
merged 29 commits into from
Aug 10, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
ff2beb4
2017071000 development version
mcagigas-at-wiris Jul 10, 2017
e3b1b0f
2017071100 development version
mcagigas-at-wiris Jul 11, 2017
7ad4408
2017071200 development version
mcagigas-at-wiris Jul 12, 2017
31ca652
2017071300 development version
mcagigas-at-wiris Jul 13, 2017
3b93263
2017071400 development version
mcagigas-at-wiris Jul 14, 2017
65ab9f3
2017071500 development version
mcagigas-at-wiris Jul 15, 2017
5a6b95b
2017071600 development version
mcagigas-at-wiris Jul 16, 2017
2e918c7
2017071700 development version
mcagigas-at-wiris Jul 17, 2017
a6d54ba
2017071800 development version
mcagigas-at-wiris Jul 18, 2017
39f14be
2017071900 development version
mcagigas-at-wiris Jul 19, 2017
99db15b
2017072000 development version
mcagigas-at-wiris Jul 20, 2017
dd547f8
2017072100 development version
mcagigas-at-wiris Jul 21, 2017
c49894e
2017072200 development version
mcagigas-at-wiris Jul 22, 2017
b2bad4e
2017072300 development version
mcagigas-at-wiris Jul 23, 2017
7f3c072
2017072400 development version
mcagigas-at-wiris Jul 24, 2017
3d5df0a
2017072500 development version
mcagigas-at-wiris Jul 25, 2017
4c1157b
2017072800 development version
mcagigas-at-wiris Jul 28, 2017
ba0cd94
2017072900 development version
mcagigas-at-wiris Jul 29, 2017
750bb77
2017073000 development version
mcagigas-at-wiris Jul 30, 2017
d82e3b7
2017073100 development version
mcagigas-at-wiris Jul 31, 2017
7575a05
2017080100 development version
mcagigas-at-wiris Aug 1, 2017
d958338
2017080200 development version
mcagigas-at-wiris Aug 2, 2017
7fada7c
2017080300 development version
mcagigas-at-wiris Aug 3, 2017
fb19b83
2017080400 development version
mcagigas-at-wiris Aug 4, 2017
4a960a0
2017080500 development version
mcagigas-at-wiris Aug 5, 2017
793ff20
2017080700 development version
mcagigas-at-wiris Aug 6, 2017
17a01c6
2017080900 development version
mcagigas-at-wiris Aug 8, 2017
3e9e9f1
2017081000 development version
mcagigas-at-wiris Aug 10, 2017
3cc4e34
2017081000 Stable version
mcagigas-at-wiris Aug 10, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions info.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ function wrs_createtablerow($testname, $reporttext, $solutionlink, $condition) {

$plugin = new stdClass();
require_once($CFG->dirroot . '/question/type/wq/version.php');
if (isset($plugin->release)) {
$version = $plugin->release;
if (isset($plugin->version)) {
$version = $plugin->version;
$reporttext = get_string('info_test1_rt1', 'qtype_wq') . $version;
$condition = true;
} else {
Expand All @@ -112,8 +112,8 @@ function wrs_createtablerow($testname, $reporttext, $solutionlink, $condition) {

require_once($CFG->dirroot . '/filter/wiris/version.php');
$plugininfo = get_string('info_test2_info', 'qtype_wq') . '<a href="../../../filter/wiris/info.php" target="_blank">' . get_string('info_test2_infopage', 'qtype_wq') . '</a>';
if (isset($plugin->release)) {
$version = $plugin->release;
if (isset($plugin->version)) {
$version = $plugin->version;
if ($version >= '3.17.20') {
$reporttext = get_string('info_test2_rt1', 'qtype_wq') . ' ' . $plugininfo;
$condition = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ public function __construct() { if(!php_Boot::$skip_constructor) {
parent::__construct();
}}
public function newInstance() {
return new com_wiris_quizzes_impl_ProcessGetCheckAssertions();
return new com_wiris_quizzes_impl_ProcessStoreQuestion();
}
public function onSerialize($s) {
$s->beginTag(com_wiris_quizzes_impl_ProcessStoreQuestion::$TAGNAME);
Expand Down
31 changes: 22 additions & 9 deletions quizzes/lib/com/wiris/quizzes/impl/QuestionImpl.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ public function __construct() {
com_wiris_quizzes_impl_QuestionImpl::$defaultOptions = com_wiris_quizzes_impl_QuestionImpl::getDefaultOptions();
}
}}
public function getAssertion($i) {
return $this->assertions[$i];
}
public function getAssertionsLength() {
return com_wiris_quizzes_impl_QuestionImpl_0($this);
}
public function addAssertionOfSubquestion($sub, $name, $correctAnswer, $studentAnswer, $parameters) {
if($this->subquestions !== null && $sub < $this->subquestions->length) {
_hx_array_get($this->subquestions, $sub)->addAssertion($name, $correctAnswer, $studentAnswer, $parameters);
Expand Down Expand Up @@ -52,7 +58,7 @@ public function addSubquestion($index) {
}
}
public function getNumberOfSubquestions() {
return com_wiris_quizzes_impl_QuestionImpl_0($this);
return com_wiris_quizzes_impl_QuestionImpl_1($this);
}
public function getProperty($name) {
return $this->getLocalData($name);
Expand Down Expand Up @@ -524,7 +530,7 @@ public function getAssertionIndex($name, $correctAnswer, $userAnswer) {
return -1;
}
public function getCorrectAnswersLength() {
return com_wiris_quizzes_impl_QuestionImpl_1($this);
return com_wiris_quizzes_impl_QuestionImpl_2($this);
}
public function getCorrectAnswer($index) {
if($this->correctAnswers !== null && $this->correctAnswers->length > $index) {
Expand Down Expand Up @@ -657,7 +663,7 @@ public function setParametrizedAssertion($name, $correctAnswer, $userAnswer, $pa
$names = com_wiris_quizzes_impl_Assertion::getParameterNames($name);
if($parameters !== null && $names !== null) {
$a->parameters = new _hx_array(array());
$n = com_wiris_quizzes_impl_QuestionImpl_2($this, $a, $correctAnswer, $name, $names, $parameters, $userAnswer);
$n = com_wiris_quizzes_impl_QuestionImpl_3($this, $a, $correctAnswer, $name, $names, $parameters, $userAnswer);
$i = null;
{
$_g = 0;
Expand Down Expand Up @@ -740,10 +746,10 @@ static function getDefaultOptions() {
$dopt->set(com_wiris_quizzes_api_QuizzesConstants::$OPTION_EXPONENTIAL_E, "e");
$dopt->set(com_wiris_quizzes_api_QuizzesConstants::$OPTION_IMAGINARY_UNIT, "i");
$dopt->set(com_wiris_quizzes_api_QuizzesConstants::$OPTION_IMPLICIT_TIMES_OPERATOR, "false");
$dopt->set(com_wiris_quizzes_api_QuizzesConstants::$OPTION_NUMBER_PI, com_wiris_quizzes_impl_QuestionImpl_3($dopt));
$dopt->set(com_wiris_quizzes_api_QuizzesConstants::$OPTION_NUMBER_PI, com_wiris_quizzes_impl_QuestionImpl_4($dopt));
$dopt->set(com_wiris_quizzes_api_QuizzesConstants::$OPTION_PRECISION, "4");
$dopt->set(com_wiris_quizzes_api_QuizzesConstants::$OPTION_RELATIVE_TOLERANCE, "true");
$dopt->set(com_wiris_quizzes_api_QuizzesConstants::$OPTION_TIMES_OPERATOR, com_wiris_quizzes_impl_QuestionImpl_4($dopt));
$dopt->set(com_wiris_quizzes_api_QuizzesConstants::$OPTION_TIMES_OPERATOR, com_wiris_quizzes_impl_QuestionImpl_5($dopt));
$dopt->set(com_wiris_quizzes_api_QuizzesConstants::$OPTION_TOLERANCE, "10^(-3)");
$dopt->set(com_wiris_quizzes_api_QuizzesConstants::$OPTION_FLOAT_FORMAT, "mg");
$dopt->set(com_wiris_quizzes_api_QuizzesConstants::$OPTION_DECIMAL_SEPARATOR, ".");
Expand Down Expand Up @@ -792,34 +798,41 @@ static function syntacticAssertionToURL($a) {
function __toString() { return 'com.wiris.quizzes.impl.QuestionImpl'; }
}
function com_wiris_quizzes_impl_QuestionImpl_0(&$�this) {
if($�this->assertions === null) {
return 0;
} else {
return $�this->assertions->length;
}
}
function com_wiris_quizzes_impl_QuestionImpl_1(&$�this) {
if($�this->subquestions === null) {
return 0;
} else {
return $�this->subquestions->length;
}
}
function com_wiris_quizzes_impl_QuestionImpl_1(&$�this) {
function com_wiris_quizzes_impl_QuestionImpl_2(&$�this) {
if($�this->correctAnswers === null) {
return 0;
} else {
return $�this->correctAnswers->length;
}
}
function com_wiris_quizzes_impl_QuestionImpl_2(&$�this, &$a, &$correctAnswer, &$name, &$names, &$parameters, &$userAnswer) {
function com_wiris_quizzes_impl_QuestionImpl_3(&$�this, &$a, &$correctAnswer, &$name, &$names, &$parameters, &$userAnswer) {
if($parameters->length < $names->length) {
return $parameters->length;
} else {
return $names->length;
}
}
function com_wiris_quizzes_impl_QuestionImpl_3(&$dopt) {
function com_wiris_quizzes_impl_QuestionImpl_4(&$dopt) {
{
$s = new haxe_Utf8(null);
$s->addChar(960);
return $s->toString();
}
}
function com_wiris_quizzes_impl_QuestionImpl_4(&$dopt) {
function com_wiris_quizzes_impl_QuestionImpl_5(&$dopt) {
{
$s = new haxe_Utf8(null);
$s->addChar(183);
Expand Down
33 changes: 33 additions & 0 deletions quizzes/lib/com/wiris/util/type/Arrays.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ static function clear($a) {
$i--;
}
}
static function sort($elements, $comparator) {
com_wiris_util_type_Arrays::quicksort($elements, 0, $elements->length - 1, $comparator);
}
static function insertSorted($a, $e) {
com_wiris_util_type_Arrays::insertSortedImpl($a, $e, false);
}
Expand Down Expand Up @@ -133,5 +136,35 @@ static function addAll($baseArray, $additionArray) {
$baseArray->push($i->next());
}
}
static function quicksort($elements, $lower, $higher, $comparator) {
if($lower < $higher) {
$p = com_wiris_util_type_Arrays::partition($elements, $lower, $higher, $comparator);
com_wiris_util_type_Arrays::quicksort($elements, $lower, $p - 1, $comparator);
com_wiris_util_type_Arrays::quicksort($elements, $p + 1, $higher, $comparator);
}
}
static function partition($elements, $lower, $higher, $comparator) {
$pivot = $elements[$higher];
$i = $lower - 1;
$j = $lower;
while($j < $higher) {
if($comparator->compare($pivot, $elements[$j]) === 1) {
$i++;
if($i !== $j) {
$swapper = $elements[$i];
$elements[$i] = $elements[$j];
$elements[$j] = $swapper;
unset($swapper);
}
}
$j++;
}
if($comparator->compare($elements[$i + 1], $elements[$higher]) === 1) {
$finalSwap = $elements[$i + 1];
$elements[$i + 1] = $elements[$higher];
$elements[$higher] = $finalSwap;
}
return $i + 1;
}
function __toString() { return 'com.wiris.util.type.Arrays'; }
}
5 changes: 5 additions & 0 deletions quizzes/lib/com/wiris/util/type/Comparator.interface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php

interface com_wiris_util_type_Comparator {
function compare($a, $b);
}
48 changes: 46 additions & 2 deletions quizzes/lib/quizzes.js
Original file line number Diff line number Diff line change
Expand Up @@ -11687,7 +11687,7 @@ com.wiris.quizzes.impl.ProcessStoreQuestion.__name__ = ["com","wiris","quizzes",
com.wiris.quizzes.impl.ProcessStoreQuestion.__super__ = com.wiris.quizzes.impl.Process;
com.wiris.quizzes.impl.ProcessStoreQuestion.prototype = $extend(com.wiris.quizzes.impl.Process.prototype,{
newInstance: function() {
return new com.wiris.quizzes.impl.ProcessGetCheckAssertions();
return new com.wiris.quizzes.impl.ProcessStoreQuestion();
}
,onSerialize: function(s) {
s.beginTag(com.wiris.quizzes.impl.ProcessStoreQuestion.TAGNAME);
Expand Down Expand Up @@ -11801,7 +11801,13 @@ com.wiris.quizzes.impl.QuestionImpl.syntacticAssertionToURL = function(a) {
}
com.wiris.quizzes.impl.QuestionImpl.__super__ = com.wiris.quizzes.impl.QuestionInternal;
com.wiris.quizzes.impl.QuestionImpl.prototype = $extend(com.wiris.quizzes.impl.QuestionInternal.prototype,{
addAssertionOfSubquestion: function(sub,name,correctAnswer,studentAnswer,parameters) {
getAssertion: function(i) {
return this.assertions[i];
}
,getAssertionsLength: function() {
return this.assertions == null?0:this.assertions.length;
}
,addAssertionOfSubquestion: function(sub,name,correctAnswer,studentAnswer,parameters) {
if(this.subquestions != null && sub < this.subquestions.length) this.subquestions[sub].addAssertion(name,correctAnswer,studentAnswer,parameters);
}
,setPropertyOfSubquestion: function(sub,name,value) {
Expand Down Expand Up @@ -15279,6 +15285,9 @@ com.wiris.util.type.Arrays.clear = function(a) {
i--;
}
}
com.wiris.util.type.Arrays.sort = function(elements,comparator) {
com.wiris.util.type.Arrays.quicksort(elements,0,elements.length - 1,comparator);
}
com.wiris.util.type.Arrays.insertSorted = function(a,e) {
com.wiris.util.type.Arrays.insertSortedImpl(a,e,false);
}
Expand Down Expand Up @@ -15310,9 +15319,44 @@ com.wiris.util.type.Arrays.addAll = function(baseArray,additionArray) {
var i = HxOverrides.iter(additionArray);
while(i.hasNext()) baseArray.push(i.next());
}
com.wiris.util.type.Arrays.quicksort = function(elements,lower,higher,comparator) {
if(lower < higher) {
var p = com.wiris.util.type.Arrays.partition(elements,lower,higher,comparator);
com.wiris.util.type.Arrays.quicksort(elements,lower,p - 1,comparator);
com.wiris.util.type.Arrays.quicksort(elements,p + 1,higher,comparator);
}
}
com.wiris.util.type.Arrays.partition = function(elements,lower,higher,comparator) {
var pivot = elements[higher];
var i = lower - 1;
var j = lower;
while(j < higher) {
if(comparator.compare(pivot,elements[j]) == 1) {
i++;
if(i != j) {
var swapper = elements[i];
elements[i] = elements[j];
elements[j] = swapper;
}
}
j++;
}
if(comparator.compare(elements[i + 1],elements[higher]) == 1) {
var finalSwap = elements[i + 1];
elements[i + 1] = elements[higher];
elements[higher] = finalSwap;
}
return i + 1;
}
com.wiris.util.type.Arrays.prototype = {
__class__: com.wiris.util.type.Arrays
}
com.wiris.util.type.Comparator = $hxClasses["com.wiris.util.type.Comparator"] = function() { }
com.wiris.util.type.Comparator.__name__ = ["com","wiris","util","type","Comparator"];
com.wiris.util.type.Comparator.prototype = {
compare: null
,__class__: com.wiris.util.type.Comparator
}
com.wiris.util.type.IntegerTools = $hxClasses["com.wiris.util.type.IntegerTools"] = function() { }
com.wiris.util.type.IntegerTools.__name__ = ["com","wiris","util","type","IntegerTools"];
com.wiris.util.type.IntegerTools.max = function(x,y) {
Expand Down
2 changes: 1 addition & 1 deletion quizzes/lib/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.54.0
3.55.0
2 changes: 1 addition & 1 deletion thirdpartylibs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<library>
<location>quizzes</location>
<name>WIRIS QUIZZES engine</name>
<version>3.54.0.1024</version>
<version>3.55.0.1025</version>
<license>GPL</license>
<licenseversion>3.0+</licenseversion>
</library>
Expand Down
4 changes: 2 additions & 2 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

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

$plugin->version = 2017070900;
$plugin->version = 2017081000;
$plugin->requires = 2011120500; // Moodle 2.2.
$plugin->release = '3.54.0.1024';
$plugin->release = '3.55.0.1025';
$plugin->maturity = MATURITY_STABLE;
$plugin->component = 'qtype_wq';
$plugin->dependencies = array (
Expand Down