If you did change the file name and it still didn't work it might be the path. I uploaded the js file to the course Files folder and assigned its url to the src property of the script tag so you can try this method. It should work.
Itamar Tzadok
Posts made by Itamar Tzadok
But my dear Tieku, it is tested in 1.9. That's the beauty of demo.moodle.org. So it should be something with the js file and when I checked the revised files I attached to the previous message I noticed that I changed the js file name to script4rb19.js but in the question code in the xml file the include line remained with reference to the old name 'script4rb.js'
<script type="text/javascript" src="XXXXXXXXX/script4rb.js"></script>
which means that if you changed only the XXXXXXXXX to the js file path the question still couldn't find the js file. So if that's the case, sorry (
), and please try again with the correct file name.
<script type="text/javascript" src="XXXXXXXXX/script4rb19.js"></script>
Itamar
<script type="text/javascript" src="XXXXXXXXX/script4rb.js"></script>
which means that if you changed only the XXXXXXXXX to the js file path the question still couldn't find the js file. So if that's the case, sorry (
), and please try again with the correct file name. <script type="text/javascript" src="XXXXXXXXX/script4rb19.js"></script>
Itamar
There is an extra line
<script src="XXXXXXXXXXX/script4rb.js" type="text/javascript"></script>
in script4rb19.js which you can simply delete.
Itamar
<script src="XXXXXXXXXXX/script4rb.js" type="text/javascript"></script>
in script4rb19.js which you can simply delete.
Itamar
Happy to inform you that it works on 1.9.
Apparently 1.9 encloses the MULTICHOICE field with a span tag and that changes the DOM path.
In the attached zip file you should find the following files:
Note that "thanks" to the new editor feature that converts events' code to "function event..." you cannot edit the question after you upload it because that will mess up the code (in fact we should open an issue in the tracker on that) So you have to set everything up in advance and upload finalized questions with the Moodle XML. Before uploading this example open the XML file and replace XXXXXXXXXX with the path to the js file (including the file name).
Let me know if it works.
Itamar
Apparently 1.9 encloses the MULTICHOICE field with a span tag and that changes the DOM path.
In the attached zip file you should find the following files:
- script4rb19.js
- RB-example-19.xml
Note that "thanks" to the new editor feature that converts events' code to "function event..." you cannot edit the question after you upload it because that will mess up the code (in fact we should open an issue in the tracker on that) So you have to set everything up in advance and upload finalized questions with the Moodle XML. Before uploading this example open the XML file and replace XXXXXXXXXX with the path to the js file (including the file name).
Let me know if it works.
Itamar
Your path to the js file is missing the file name:
<script type="text/javascript" src="C:\Program Files\EasyPHP 2.0b1\www\moodle19\script4rb.js"></script>
<script type="text/javascript" src="C:\Program Files\EasyPHP 2.0b1\www\moodle19"></script>
Should be<script type="text/javascript" src="C:\Program Files\EasyPHP 2.0b1\www\moodle19\script4rb.js"></script>