Picture of Lars Halkjær
Added script in "server-build.js" optimised out?
by Lars Halkjær - Monday, 2 October 2017, 2:16 PM
 

I have made an extension to the "server-build.js" grunt task that runs a task of my own at the end of the script, when you download a course from the Adapt AT.

One of the things this task does is to add a setting to the SPOOR section in "config.js".
This works fine, if I use "Download" to download a course package.

But in one case it does not work, and I am having trouble finding out why...

If I first run a "Preview" and then a "Download" the setting in the "config.js" is gone.

If I look in the "temp" folder on the AT server and check the course's "build/course" folder, the added setting is in the "config.js" file.

If I then run a "Download", the "config.js" in the "build/course" folder is changed, and no longer has the added setting, and of course the new "download.zip" file in the "build" folder does not have it either.

I suspect it is some kind of build optimisation that prevents my script from running (which seems to be what is happening) but I cannot quite figure out how to get around this.

Picture of Matt Leathes
Re: Added script in "server-build.js" optimised out?
by Matt Leathes - Monday, 2 October 2017, 2:55 PM
 

what's the setting that gets added?

Picture of Lars Halkjær
Re: Added script in "server-build.js" optimised out?
by Lars Halkjær - Monday, 2 October 2017, 11:13 PM
 

The setting is:

"_spoor": {"_advancedSettings": {"_scormVersion": "2004"}}

The purpose of the task is to create a finished SCORM 2004 package for download, ready to upload to an LMS.

Picture of Matt Leathes
Re: Added script in "server-build.js" optimised out?
by Matt Leathes - Tuesday, 3 October 2017, 8:47 AM
 

My apologies - I clearly didn't read your original post properly as I didn't realise this was something you were actually trying to add to config.json, I thought it was getting added in error!

I'm afraid I know very little about the inner workings of the authoring tool, hopefully someone who does know it well can help out. Have you tried asking in the authoring tool chat room?

What I would say is that if you want SCORM 2004 output you could just fork the spoor plugin and force it to always run in SCORM 2004 mode. That would just be a case of changing this line to:

scorm.setVersion("2004");

Then replacing imsmanifest.xml and all the .xsd files in the required folder with the appropriate ones from here.

Picture of Lars Halkjær
Re: Added script in "server-build.js" optimised out?
by Lars Halkjær - Tuesday, 3 October 2017, 10:56 AM
 

Thank you for the answer.

The AT script, together with an extension, allows you to select either 1.2 or 2004 (and enter manifest IDs  and titles), so unfortunately i cannot hardcode it to 2004.

I wasn't aware that the chat room was open for questions - I thought it was for AT developers only.

Picture of Matt Leathes
Re: Added script in "server-build.js" optimised out?
by Matt Leathes - Tuesday, 3 October 2017, 11:08 AM
 

No, it's a open room - feel free to ask there.