Moodle 3.7 use Javascript & jQuery and loading external JS plugin

preview_player
Показать описание
How to use jQuery and Javascript in a Moodle Block. Also import a JS datatable plugin.
Рекомендации по теме
Комментарии
Автор

thank you so much, in the next video please remember to give us the codes on git.

clementmuhirwa
Автор

Where did you go to find that external JS datatable plugin?

Betta
Автор

I am a student at Ruhr University Bochum and am currently working on my master's thesis. I want to write JavaScript functions and use them in question text area. Could you tell me how to export and import a simple function for addition in Stack into Moodle.
For example:
I want to write in example.js in the address such code:

export function sum(x, y) {
return x + y;
}

And I want to use this in Question text in Moodle:

<script>
import * from "./example";
alert(sum(2, 3));
</script>

It should show five as a result. If I can do that, I can realize other functions. If I'm in the wrong direction, please let me know too!

sepehrbanani
Автор

Hi, Excellent video. Is there a github reference for this code ??

gouthamic
Автор

not working, I'm using moodle 3.9.

Mahmudulhasan-tshm
welcome to shbcf.ru