Javascript -> Add Page / Structure / Content

This topic contains 10 respuestas, has 2 voices, and was last updated by  Anónimo Hace 11 meses, 2 semanas.

  • Author
    Entradas
  • #32707

    Anónimo

    Hello.    I am working with hundreds of courses that need to be updated regularly and it is taking a huge amount of time to copy and paste each section of the book into eXe.

    I would like to build the eXe course automatically using Javascript.    I will actually run an automation script in the console with eXe open and it will build the course, section by section.

    Scraping the data from my course and formatting it into an array is no problem.. the real issue comes when I want to create the eXe course structure (the Ext.grid.tree treeview) and add content to the course.

    So here are my questions:

    1. Using javascript, how can I add a new page to my eXe project?
    2. Using javascript, how can I promote or demote that page in the treeview heirarchy?  For example I want to change it from a “Unit” to a “Chapter”.
    3. Using javascript, how can I create a text iDevice on the specified page, and insert a string into that iDevice?

     

     

     

     

     

  • #32735

    Ignacio Gros
    Keymaster

    Hi,

    There are no defined methods to do those things out of eXe. You could trigger the click event of the different elements to do so, but you’ll have to open each elp anyway…

    Changing the contentv3.xml file of the elp file might be easier. Making big changes might be quite difficult, but it should work if you do them properly.

    Yo can create a SCRIPT to do that in any server language. If you use Python, you might want to check exe_do (using eXe through command line), but those options are not implemented. Please share your code if you find a good solution…

    Thanks.

  • #36269

    Anónimo

    Well it is far from a perfect solution, but I have developed this userscript for eXe 2.5 which is called cBuilder 0.12.1. There is an accompanying script called cScraper which can scrape an HTML file (assuming, for example, that you converted a MS Word file to HTML and set all headings as H1, H2, etc) and produces output in the form of two arrays that you can save into your cScraper script. Note: The cScraper script must be modified and setup before it can build a particular course – you must change the @match line as well as add in the course data arrays myStructure and myStructureText.

    We are still working on both improving cBuilder (it just barely works) as well as developing a new method of automating course creation in line with Ignacio’s suggestion where we simply generate the output of eXe on our own without using the eXe web interface at all. That being said, even this early rudimentary automation script has saved my team hundreds if not thousands of labor hours.

    To get it to work, you need to save an eXe project in Advanced Mode and then change this line to match that name:
    // @match http://localhost:51235/SAMPLE_COURSE
    For example, if your elp was saved as “DOGS_ARE_AWESOME” then the line above would read:
    // @match http://localhost:51235/DOGS_ARE_AWESOME

    Next you simply add the script to Greasemonkey (firefox add-on) or Tampermonkey (Chrome add-on) and enable it. Save and refresh your elp in the eXe web editor and the automation script should activate automatically.

    There are a few known issues and limitations.. cBuilder does not recognize the hierarchical structure of courses and instead promotes each unit at the “Chapter” level – this is actually due to a limitation in the LMS that we use. For now please report any issues or improvements in this thread and do give credit if you use this in your own project. Also feel free to reach out to me if you have any questions about the script.

    See attached file(s).

  • #36274

    Anónimo

    Well it is far from a perfect solution, but I have developed this userscript for eXe 2.5 which is called cBuilder 0.12.1. There is an accompanying script called cScraper which can scrape an HTML file (assuming, for example, that you converted a MS Word file to HTML and set all headings as H1, H2, etc) and produces output in the form of two arrays that you can save into your cScraper script. Note: The cScraper script must be modified and setup before it can build a particular course – you must change the @match line as well as add in the course data arrays myStructure and myStructureText.

    We are still working on both improving cBuilder (it just barely works) as well as developing a new method of automating course creation in line with Ignacio’s suggestion where we simply generate the output of eXe on our own without using the eXe web interface at all. That being said, even this early rudimentary automation script has saved my team hundreds if not thousands of labor hours.

    To get it to work, you need to save an eXe project in Advanced Mode and then change this line to match that name:
    // @match http://localhost:51235/SAMPLE_COURSE
    For example, if your elp was saved as “DOGS_ARE_AWESOME” then the line above would read:
    // @match http://localhost:51235/DOGS_ARE_AWESOME

    Next you simply add the script to Greasemonkey (firefox add-on) or Tampermonkey (Chrome add-on) and enable it. Save and refresh your elp in the eXe web editor and the automation script should activate automatically.

    There are a few known issues and limitations.. cBuilder does not recognize the hierarchical structure of courses and instead promotes each unit at the “Chapter” level – this is actually due to a limitation in the LMS that we use. For now please report any issues or improvements in this thread and do give credit if you use this in your own project. Also feel free to reach out to me if you have any questions about the script.

    See attached files.

    Archivos adjuntos:
    You must be logged in to view attached files.
  • #36277

    Anónimo

    Well it is far from a perfect solution, but I have developed this userscript for eXe 2.5 which is called cBuilder 0.12.1. There is an accompanying script called cScraper which can scrape an HTML file (assuming, for example, that you converted a MS Word file to HTML and set all headings as H1, H2, etc) and produces output in the form of two arrays that you can save into your cBuilder script. Note: The cBuilder script must be modified and setup before it can build a particular course – you must change the @match line as well as add in the course data arrays myStructure and myStructureText.

    We are still working on both improving cBuilder (it just barely works) as well as developing a new method of automating course creation in line with Ignacio’s suggestion where we simply generate the output of eXe on our own without using the eXe web interface at all. That being said, even this early rudimentary automation script has saved my team hundreds if not thousands of labor hours.

    To get it to work, you need to save an eXe project in Advanced Mode and then change this line to match that name:
    // @match http://localhost:51235/SAMPLE_COURSE
    For example, if your elp was saved as “DOGS_ARE_AWESOME” then the line above would read:
    // @match http://localhost:51235/DOGS_ARE_AWESOME

    Next you simply add the script to Greasemonkey (firefox add-on) or Tampermonkey (Chrome add-on) and enable it. Save and refresh your elp in the eXe web editor and the automation script should activate automatically.

    There are a few known issues and limitations.. cBuilder does not recognize the hierarchical structure of courses and instead promotes each unit at the “Chapter” level – this is actually due to a limitation in the LMS that we use. For now please report any issues or improvements in this thread and do give credit if you use this in your own project. Also feel free to reach out to me if you have any questions about the script.

    See attached files.
    Edit: I am having some trouble posting my reply.. it keep disappearing.

  • #36279

    Anónimo

    Disregard this reply.
    (Please delete this extra reply)

  • #36287

    Anónimo

    Well it is far from a perfect solution, but I have developed this userscript for eXe 2.5 which is called cBuilder 0.12.1. There is an accompanying script called cScraper which can scrape an HTML file (assuming, for example, that you converted a MS Word file to HTML and set all headings as H1, H2, etc) and produces output in the form of two arrays that you can save into your cBuilder script. Note: The cBuilder script must be modified and setup before it can build a particular course – you must change the @match line as well as add in the course data arrays myStructure and myStructureText.

    We are still working on both improving cBuilder (it just barely works) as well as developing a new method of automating course creation in line with Ignacio’s suggestion where we simply generate the output of eXe on our own without using the eXe web interface at all. That being said, even this early rudimentary automation script has saved my team hundreds if not thousands of labor hours.

    To get it to work, you need to save an eXe project in Advanced Mode and then change this line to match that name:
    // @match http://localhost:51235/SAMPLE_COURSE
    For example, if your elp was saved as “DOGS_ARE_AWESOME” then the line above would read:
    // @match http://localhost:51235/DOGS_ARE_AWESOME

    Next you simply add the script to Greasemonkey (firefox add-on) or Tampermonkey (Chrome add-on) and enable it. Save and refresh your elp in the eXe web editor and the automation script should activate automatically.

    There are a few known issues and limitations.. cBuilder does not recognize the hierarchical structure of courses and instead promotes each unit at the “Chapter” level – this is actually due to a limitation in the LMS that we use. For now please report any issues or improvements in this thread and do give credit if you use this in your own project. Also feel free to reach out to me if you have any questions about the script.

    I have also attached the accompanying cScraper 0.1.5 script mentioned above. This one isn’t a userscript, you simply paste it into the console in your web browser after converting your entire course to a single HTML file.

    See attached files.

  • #36317

    Ignacio Gros
    Keymaster

    Hi @gregoryn,
    Thank you for sharing the scripts.
    Sorry, but I couldn’t make them work. Maybe I’m doing something wrong or I just didn’t understand their objective. Could you provide a short video to see them working? Thank you very much!

  • #36319

    Anónimo

    The objective is to automatically build an eXe course out of an existing document.

    In my case we have a course book in the form of an MS Word document. We save the MS Word document as HTML and then open that HTML file in our web browser and paste in the cScraper script. cScraper returns its output which are two variables consisting of all of the contents of the book in the form of two arrays which can be plugged into the cBuilder script so that it can convert the book into an eXe course.

    We then setup and run the cBuilder script which automatically builds the entire course in eXe.

    I created a video/turorial going over this process which may be easier to understand:
    https://youtu.be/nkWAeSaz580

    (I apologize that the screen ended up a bit cut off.)
    (At the time of posting, the video is still processing but it should be available soon.)

  • #36352

    Ignacio Gros
    Keymaster

    Yes! Word to HTML. HTML to elp.

    It’s a great start for a better HTML import.

    eXe’s code will be renewed in the near future. There’s still no date, and it won’t be in less than a year. I guess you’d like to know that before improving your solution.

    Good idea! Thank you!

  • #36355

    Anónimo

    If you like that I would also like to show you some of the various mod scripts I have made to extend some features of eXe to meet our requirements. For example we made a script to add features to the SCORM QUIZ iDevice, such as:
    – Do not let the user go on until they achieve a passing score.
    – Display Feedback for each question after the user submits the review quiz (correct feedback in green and incorrect feedback in red).
    – Ask the user a set number of questions from a question bank (for example, display 4 out of 10 questions).
    – Shuffle the order of questions.

    And another which is simpler.. it displays a countdown timer for the user and will not allow the user to advance until the timer reaches zero. The countdown time for an individual unit can either be determined automatically based on the word count or manually set to a specific duration.

    I will probably create a GitHub sooner or later to put some of this stuff on.

You must be logged in to reply to this topic.