Picture of Denis War
ConfigModel change location where course.json is?
by Denis War - Tuesday, 2 April 2019, 11:29 AM
 

Hello,

 

is it somehow possible to change the Path from ConfigModel('course/config.json')

to some global/other value?

All i have found is, that it's hardcoded in adapt/js/adapt.min.js

 

If there is no other solution, i have to write an script, which change the path with regex..

 

Greetz

Dekmar

 

 

Picture of Matt Leathes
Re: ConfigModel change location where course.json is?
by Matt Leathes - Tuesday, 2 April 2019, 1:19 PM
 

When posting, please make it clear whether you are using the Authoring Tool or the Framework - and what version.

Picture of Denis War
Re: ConfigModel change location where course.json is?
by Denis War - Tuesday, 2 April 2019, 3:21 PM
 

I'm using a custom Application with a PHP, the course was exported with "Course publish" , but also grunt is possible for me.

At the moment it's the default index.html with offline_API_wrapper.js

   <script src="offline_API_wrapper.js" type="text/javascript"></script>
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <title></title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
        <link href="adapt/css/adapt.css" type="text/css" rel="stylesheet">
        <script src="libraries/modernizr.js" type="text/javascript"></script>
        <script src="adapt/js/scriptLoader.js" type="text/javascript"></script>

 

I have found out, that i could initialize an Adapt Object with

 

 Adapt = require('core/js/adapt');

 

after the scriptLoader.js , but its to late at this point,because the config will be parsed.

 

Btw: sorry for my english , it's not my mother language

Picture of Matt Leathes
Re: ConfigModel change location where course.json is?
by Matt Leathes - Tuesday, 2 April 2019, 3:55 PM
 

You will need to export the course from the authoring tool to change this.

You can then amend the file app.js in the exported source and republish it using Grunt.

Several members of the Adapt community are German-speakers... so do feel free to post in that language if it's easier!