Picture of Antonia Newey
Script load order/HTML embedded JavaScript
by Antonia Newey - Friday, 15 December 2017, 11:13 AM
 

Hello again,

I'm starting to try and write some some javascript to achieve the goals I set out in my previous post (https://community.adaptlearning.org/mod/forum/discuss.php?d=2528). Unfortunately I don't have a huge amount of experience, especially with the View/Model/Controller side of things.

I know that scripts is loaded by the scriptLoader.js file, but I was wondering if there was a way to see what order things got loaded in, incase I wanted to add the script as a file? 

In a sort of introductory test, I edited the mcq Model to print the title (or actually another variable I gave them) of the questions to the console when they were answered incorrectly. Now I wanted to collect them instead so I can print them out later. I wasn't really sure what I was looking for, but something similar to what I wanted seemed to be creating a global variable to add them to, which I could later retrieve. But to be global I thought I would have to embed it in the html in the page, so would I have to edit index.html? And then to actually print it I could modify the assessmentResults component to include the gathered info.

Does that make sense as a way to gather the data? Any help or advice you could give me would be most appreciated as I am kind of stumbling about in the dark at the moment.

Kind Regards,

Antonia

Picture of Antonia Newey
Re: Script load order/HTML embedded JavaScript
by Antonia Newey - Friday, 15 December 2017, 2:06 PM
 

Never mind! This is all sorted now, a colleague helped me return the information in a different way. Now all I need to do is work out how to make it accept 'no answer' as an answer.