Closed alirahimifachr closed 1 year ago
Many thanks for the pull request. It is now merged into the code. However, I have two questions, sorry for my ignorance:
filter.php
it is tested if a file exists: if ($tmp = fopen($url, 'r')) {
$result[0] = 'error';
$result[1] =
get_string('errorNotFound_pre', 'filter_jsxgraph') .
$serverversion .
get_string('errorNotFound_post', 'filter_jsxgraph');
return $result;
} else {
if (isset($tmp)) {
fclose($tmp);
}
}
That looks as if the error is thrown if the file exists. Is this correct?
filter.php
if ($require === self::REQUIRE_WITH_KEY) {
$codeprefix = "require(['jsxgraphcore'], function (JXG) { \n if ($cond) { \n";
$codepostfix = "}\n });\n";
} elseif($require === self::REQUIRE_WITH_PATH) {
$codeprefix = "import JXG from '" . "../../filter/jsxgraph/jsxgraphcore.js" . "'; \nif ($cond) {";
$codepostfix = "};";
} elseif (self::REQUIRE_WITHOUT) {
...
REQUIRE_WITH_PATH
does a CommonJS import of the *.js
version. But I do not see ES6 imports. Didn't moodle switch to ES6 imports since version 3.8?
Best wishes, Alfred
https://github.com/jsxgraph/moodle-filter_jsxgraph/issues/29