Wednesday, June 29, 2011

A Deep Dive into the Lectora Project File

by Jonathan Shoaf

It may surprise some people that the Lectora project file, that .awt file, is actually XML. Big flipping deal? Well, maybe. In making this file XML, Lectora is allowing developers to make changes to it without going through the Lectora interface.

Editing the XML directly allows you to perform some tasks much quicker than using Lectora itself. For example, you can search and replace text to change the video sizes in your project. You can even automate the course creation process. For example, I have a Lectora project template for video-based content. I created an automated process that takes a list of videos and turns it into a new Lectora project based on the template saving me hours of work.

Break open a Lectora project of your choice in your favorite XML or text editor. Let’s take a look at the XML and see how you can use it. The top level of a Lectora project is tagged as lectoratitle. This section contains four sections:
  • titledata - contains basic title information such as the title type (e.g. AICC) and a title ID.
  • resourcedata - contains all the resources that are in the title including images, animations, and more.
  • variabledata - contains definitions for all user defined variables in your project.
  • objectdata - contains all information about chapters, quizzes, pages, and more.
The objectdata section is the section you will want to check out first. Let’s take a closer look. This section more or less mirrors the title explorer. The XML gives you access to the same objects (title, chapter, pages) and properties that are in the title explorer. The main element here is title. Under title you’ll have the usual suspects from the title explorer:
  • Chapters - chapter
  • Pages - page
  • Actions - action
  • Groups - objgroup
  • Animations - animimage
  • Images - image
  • Text - text
  • Videos - video
  • And more...
You may be thinking this is a bit overwhelming. What can I do with this information? Let me give you a couple of examples with videos. For argument’s sake, let’s say you have a project with 50 videos spread through out the project. You set all of them to auto start. Your client has reviewed the project and changed his mind...they should all be set to not auto start. Argh!

Now that you know a little about the XML file structure, let’s use it to your advantage! The tag for a video is as follows:

<video autostart=”true” displaycontroller=”true” id=”7473” parent=”7471” videotype=”standard”></video>

Are you thinking what I’m thinking? Search and replace. In your favorite text editor, search for <video autostart=”true” and replace with <video autostart=”false”. This will change the settings for all videos so use wisely.  Which brings me to a best practice: Always backup the Lectora project file before monkeying around with the XML!

Let’s take the same example again. Your client has given you a new set of videos but the dimensions of the video have changed from 640x480 to 800x600. A search and replace can go a long way here to. Each video has the size as a part of the XML data as follows:


You can again, do some quick batch changes to your project that would take much longer if you were using the Lectora interface.

I suggest opening up the Lectora .awt project file in your favorite text or XML editor and exploring what’s in there. An editor with color coding and automatic formatting will help a lot.  Make a small change then load it back into Lectora to verify the change has been made in your project.

Being familiar with the XML will help you next time batch changes need to be made to your project. Having experienced a deep dive into the project file XML could prove very insightful!


  1. Great advice. Especially backing up the XML before you get started.

    And always always always remember that find/replace can't read your mind. Make sure the text you replace is unique enough that it isn't found outside your specific problem area (eg don't search for autostart=”true” when you need to search for <video autostart=”true”).

  2. And when simple 'replace' is not enough, you can use regular expressions!

  3. Great Post. Thanks for sharing. Here is a good tutorial on Lectora.


Thank you for your comments.