Skip to content

Commit

Permalink
Merge pull request #80 from wiris/v4.9.0
Browse files Browse the repository at this point in the history
V4.9.0
  • Loading branch information
ptorrent-at-wiris authored Sep 21, 2023
2 parents 6e55ce5 + b551927 commit 7be549f
Show file tree
Hide file tree
Showing 170 changed files with 3,501 additions and 1,083 deletions.
3 changes: 0 additions & 3 deletions info.php
Original file line number Diff line number Diff line change
Expand Up @@ -370,9 +370,6 @@ function wrs_createtablerow($testname, $reporttext, $solutionlink, $condition) {

$output .= html_writer::start_tag('tr', array('class' => 'wrs_filter wrs_plugin'));

require_once($CFG->dirroot . '/lib/editor/tinymce/lib.php');
$tinyeditor = new tinymce_texteditor();

$rb = com_wiris_quizzes_api_Quizzes::getInstance();

$questionxml = '<question><wirisCasSession>&lt;session lang=&quot;en&quot; version=&quot;2.0&quot;' .
Expand Down
2 changes: 1 addition & 1 deletion question.php
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ public function join_all_text() {
public function join_question_text() {
$text = $this->questiontext;
foreach ($this->hints as $hint) {
$tet .= ' ' . $hint->hint;
$text .= ' ' . $hint->hint;
}
return $text;
}
Expand Down
6 changes: 3 additions & 3 deletions quizzes/lib/Date.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ public function getTime() {
public function __call($m, $a) {
if(isset($this->$m) && is_callable($this->$m))
return call_user_func_array($this->$m, $a);
else if(isset($this->»dynamics[$m]) && is_callable($this->»dynamics[$m]))
return call_user_func_array($this->»dynamics[$m], $a);
else if(isset($this->»dynamics[$m]) && is_callable($this->»dynamics[$m]))
return call_user_func_array($this->»dynamics[$m], $a);
else if('toString' == $m)
return $this->__toString();
else
throw new HException('Unable to call «'.$m.'»');
throw new HException('Unable to call «'.$m.'»');
}
static function now() {
return Date::fromPhpTime(round(microtime(true), 3));
Expand Down
6 changes: 3 additions & 3 deletions quizzes/lib/EReg.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@ public function match($s) {
public function __call($m, $a) {
if(isset($this->$m) && is_callable($this->$m))
return call_user_func_array($this->$m, $a);
else if(isset($this->»dynamics[$m]) && is_callable($this->»dynamics[$m]))
return call_user_func_array($this->»dynamics[$m], $a);
else if(isset($this->»dynamics[$m]) && is_callable($this->»dynamics[$m]))
return call_user_func_array($this->»dynamics[$m], $a);
else if('toString' == $m)
return $this->__toString();
else
throw new HException('Unable to call «'.$m.'»');
throw new HException('Unable to call «'.$m.'»');
}
function __toString() { return 'EReg'; }
}
18 changes: 9 additions & 9 deletions quizzes/lib/HList.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,26 +138,26 @@ public function add($item) {
public function __call($m, $a) {
if(isset($this->$m) && is_callable($this->$m))
return call_user_func_array($this->$m, $a);
else if(isset($this->»dynamics[$m]) && is_callable($this->»dynamics[$m]))
return call_user_func_array($this->»dynamics[$m], $a);
else if(isset($this->»dynamics[$m]) && is_callable($this->»dynamics[$m]))
return call_user_func_array($this->»dynamics[$m], $a);
else if('toString' == $m)
return $this->__toString();
else
throw new HException('Unable to call «'.$m.'»');
throw new HException('Unable to call «'.$m.'»');
}
function __toString() { return $this->toString(); }
}
function HList_0(&$»this) {
if($»this->q === null) {
function HList_0(&$»this) {
if($»this->q === null) {
return null;
} else {
return $»this->q[0];
return $»this->q[0];
}
}
function HList_1(&$»this) {
if($»this->h === null) {
function HList_1(&$»this) {
if($»this->h === null) {
return null;
} else {
return $»this->h[0];
return $»this->h[0];
}
}
12 changes: 6 additions & 6 deletions quizzes/lib/Hash.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ public function getIterator() {
public function toString() {
$s = "{";
$it = $this->keys();
$it = $it;
while($it->hasNext()) {
$i = $it->next();
$»it = $it;
while($»it->hasNext()) {
$i = $»it->next();
$s .= $i;
$s .= " => ";
$s .= Std::string($this->get($i));
Expand Down Expand Up @@ -56,12 +56,12 @@ public function set($key, $value) {
public function __call($m, $a) {
if(isset($this->$m) && is_callable($this->$m))
return call_user_func_array($this->$m, $a);
else if(isset($this->dynamics[$m]) && is_callable($this->dynamics[$m]))
return call_user_func_array($this->dynamics[$m], $a);
else if(isset($this->»dynamics[$m]) && is_callable($this->»dynamics[$m]))
return call_user_func_array($this->»dynamics[$m], $a);
else if('toString' == $m)
return $this->__toString();
else
throw new HException('Unable to call '.$m.'');
throw new HException('Unable to call »'.$m.'»');
}
function __toString() { return $this->toString(); }
}
13 changes: 7 additions & 6 deletions quizzes/lib/IntHash.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@ public function __construct() {
if(!php_Boot::$skip_constructor) {
$this->h = array();
}}

public function getIterator() {
return $this->iterator();
}
public function toString() {
$s = "{";
$it = $this->keys();
$»it = $it;
while($»it->hasNext()) {
$i = $»it->next();
$»it = $it;
while($»it->hasNext()) {
$i = $»it->next();
$s .= _hx_string_rec($i, "");
$s .= " => ";
$s .= Std::string($this->get($i));
Expand Down Expand Up @@ -54,12 +55,12 @@ public function set($key, $value) {
public function __call($m, $a) {
if(isset($this->$m) && is_callable($this->$m))
return call_user_func_array($this->$m, $a);
else if(isset($this->»dynamics[$m]) && is_callable($this->»dynamics[$m]))
return call_user_func_array($this->»dynamics[$m], $a);
else if(isset($this->»dynamics[$m]) && is_callable($this->»dynamics[$m]))
return call_user_func_array($this->»dynamics[$m], $a);
else if('toString' == $m)
return $this->__toString();
else
throw new HException('Unable to call «'.$m.'»');
throw new HException('Unable to call «'.$m.'»');
}
function __toString() { return $this->toString(); }
}
6 changes: 3 additions & 3 deletions quizzes/lib/IntIter.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ public function hasNext() {
public function __call($m, $a) {
if(isset($this->$m) && is_callable($this->$m))
return call_user_func_array($this->$m, $a);
else if(isset($this->»dynamics[$m]) && is_callable($this->»dynamics[$m]))
return call_user_func_array($this->»dynamics[$m], $a);
else if(isset($this->»dynamics[$m]) && is_callable($this->»dynamics[$m]))
return call_user_func_array($this->»dynamics[$m], $a);
else if('toString' == $m)
return $this->__toString();
else
throw new HException('Unable to call «'.$m.'»');
throw new HException('Unable to call «'.$m.'»');
}
function __toString() { return 'IntIter'; }
}
96 changes: 48 additions & 48 deletions quizzes/lib/Lambda.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,29 @@ public function __construct(){}
static function harray($it) {
$a = new _hx_array(array());
if(null == $it) throw new HException('null iterable');
$»it = $it->iterator();
while($»it->hasNext()) {
$i = $»it->next();
$»it = $it->iterator();
while($»it->hasNext()) {
$i = $»it->next();
$a->push($i);
}
return $a;
}
static function hlist($it) {
$l = new HList();
if(null == $it) throw new HException('null iterable');
$»it = $it->iterator();
while($»it->hasNext()) {
$i = $»it->next();
$»it = $it->iterator();
while($»it->hasNext()) {
$i = $»it->next();
$l->add($i);
}
return $l;
}
static function map($it, $f) {
$l = new HList();
if(null == $it) throw new HException('null iterable');
$»it = $it->iterator();
while($»it->hasNext()) {
$x = $»it->next();
$»it = $it->iterator();
while($»it->hasNext()) {
$x = $»it->next();
$l->add(call_user_func_array($f, array($x)));
}
return $l;
Expand All @@ -36,28 +36,28 @@ static function mapi($it, $f) {
$l = new HList();
$i = 0;
if(null == $it) throw new HException('null iterable');
$»it = $it->iterator();
while($»it->hasNext()) {
$x = $»it->next();
$»it = $it->iterator();
while($»it->hasNext()) {
$x = $»it->next();
$l->add(call_user_func_array($f, array($i++, $x)));
}
return $l;
}
static function has($it, $elt, $cmp = null) {
if($cmp === null) {
if(null == $it) throw new HException('null iterable');
$»it = $it->iterator();
while($»it->hasNext()) {
$x = $»it->next();
$»it = $it->iterator();
while($»it->hasNext()) {
$x = $»it->next();
if($x == $elt) {
return true;
}
}
} else {
if(null == $it) throw new HException('null iterable');
$»it = $it->iterator();
while($»it->hasNext()) {
$x = $»it->next();
$»it = $it->iterator();
while($»it->hasNext()) {
$x = $»it->next();
if(call_user_func_array($cmp, array($x, $elt))) {
return true;
}
Expand All @@ -67,9 +67,9 @@ static function has($it, $elt, $cmp = null) {
}
static function exists($it, $f) {
if(null == $it) throw new HException('null iterable');
$»it = $it->iterator();
while($»it->hasNext()) {
$x = $»it->next();
$»it = $it->iterator();
while($»it->hasNext()) {
$x = $»it->next();
if(call_user_func_array($f, array($x))) {
return true;
}
Expand All @@ -78,9 +78,9 @@ static function exists($it, $f) {
}
static function hforeach($it, $f) {
if(null == $it) throw new HException('null iterable');
$»it = $it->iterator();
while($»it->hasNext()) {
$x = $»it->next();
$»it = $it->iterator();
while($»it->hasNext()) {
$x = $»it->next();
if(!call_user_func_array($f, array($x))) {
return false;
}
Expand All @@ -89,18 +89,18 @@ static function hforeach($it, $f) {
}
static function iter($it, $f) {
if(null == $it) throw new HException('null iterable');
$»it = $it->iterator();
while($»it->hasNext()) {
$x = $»it->next();
$»it = $it->iterator();
while($»it->hasNext()) {
$x = $»it->next();
call_user_func_array($f, array($x));
}
}
static function filter($it, $f) {
$l = new HList();
if(null == $it) throw new HException('null iterable');
$»it = $it->iterator();
while($»it->hasNext()) {
$x = $»it->next();
$»it = $it->iterator();
while($»it->hasNext()) {
$x = $»it->next();
if(call_user_func_array($f, array($x))) {
$l->add($x);
}
Expand All @@ -109,9 +109,9 @@ static function filter($it, $f) {
}
static function fold($it, $f, $first) {
if(null == $it) throw new HException('null iterable');
$»it = $it->iterator();
while($»it->hasNext()) {
$x = $»it->next();
$»it = $it->iterator();
while($»it->hasNext()) {
$x = $»it->next();
$first = call_user_func_array($f, array($x, $first));
}
return $first;
Expand All @@ -120,16 +120,16 @@ static function count($it, $pred = null) {
$n = 0;
if($pred === null) {
if(null == $it) throw new HException('null iterable');
$»it = $it->iterator();
while($»it->hasNext()) {
$_ = $»it->next();
$»it = $it->iterator();
while($»it->hasNext()) {
$_ = $»it->next();
$n++;
}
} else {
if(null == $it) throw new HException('null iterable');
$»it = $it->iterator();
while($»it->hasNext()) {
$x = $»it->next();
$»it = $it->iterator();
while($»it->hasNext()) {
$x = $»it->next();
if(call_user_func_array($pred, array($x))) {
$n++;
}
Expand All @@ -143,9 +143,9 @@ static function hempty($it) {
static function indexOf($it, $v) {
$i = 0;
if(null == $it) throw new HException('null iterable');
$»it = $it->iterator();
while($»it->hasNext()) {
$v2 = $»it->next();
$»it = $it->iterator();
while($»it->hasNext()) {
$v2 = $»it->next();
if($v == $v2) {
return $i;
}
Expand All @@ -156,15 +156,15 @@ static function indexOf($it, $v) {
static function concat($a, $b) {
$l = new HList();
if(null == $a) throw new HException('null iterable');
$»it = $a->iterator();
while($»it->hasNext()) {
$x = $»it->next();
$»it = $a->iterator();
while($»it->hasNext()) {
$x = $»it->next();
$l->add($x);
}
if(null == $b) throw new HException('null iterable');
$»it = $b->iterator();
while($»it->hasNext()) {
$x = $»it->next();
$»it = $b->iterator();
while($»it->hasNext()) {
$x = $»it->next();
$l->add($x);
}
return $l;
Expand Down
6 changes: 3 additions & 3 deletions quizzes/lib/Reflect.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ static function setProperty($o, $field, $value) {
}
static function callMethod($o, $func, $args) {
if(is_string($o) && !is_array($func)) {
return call_user_func_array(Reflect::field($o, $func), $args->»a);
return call_user_func_array(Reflect::field($o, $func), $args->»a);
}
return call_user_func_array(((is_callable($func)) ? $func : array($o, $func)), ((null === $args) ? array() : $args->»a));
return call_user_func_array(((is_callable($func)) ? $func : array($o, $func)), ((null === $args) ? array() : $args->»a));
}
static function fields($o) {
if($o === null) {
Expand Down Expand Up @@ -78,7 +78,7 @@ static function deleteField($o, $f) {
if(!_hx_has_field($o, $f)) {
return false;
}
if(isset($o->»dynamics[$f])) unset($o->»dynamics[$f]); else if($o instanceof _hx_anonymous) unset($o->$f); else $o->$f = null;
if(isset($o->»dynamics[$f])) unset($o->»dynamics[$f]); else if($o instanceof _hx_anonymous) unset($o->$f); else $o->$f = null;
return true;
}
static function copy($o) {
Expand Down
Loading

0 comments on commit 7be549f

Please sign in to comment.