Skip to content

Shipping a modified lesson

Martin Quinson edited this page Aug 10, 2015 · 2 revisions

Modifying lessons

The lessons integrated into the tool are quite complicated to edit and maintain. This is because they are translated between several human languages, and also because they are used for all supported programming language. About the translation between human language, you should only edit the english HTML, never edit the translated HTML. If you do so, your work will get lost the next time that the translated HTML is regenerated with po4a.

Shipping a lesson to the pupils

There is two ways to distribute a given lesson to the pupils. The first one to integrate your lesson directly to the PLM archive. For that, you just have to edit the file lessons.chooser.LessonChooser.html to add a link to the lesson you've just created. You probably want to add a block such as: <li><a href="lesson://lessons.myPackage"> Name your lesson:</a> Its description.</li>

Then, rebuild the jar file using the provided ant file (ant dist on the command line) and distribute it.

Unless you work on PLM itself, this method is bothersome in most case, as your pupils have to re-download the full archive just to get an update of your exercises. It is much preferable to build an external jar file that can be loaded in the PLM directly from the lesson chooser.

Packaging a lesson as a JAR file

The only requirement to create such a JAR is adding a line to the Manifest file, indicating what is the name of the lesson package you're shipping in the JAR. The attribute to add to the Manifest is the following:
LessonPackage: *yourPackageName*

Once generated, your JAR should have the following structure:

  • META-INF/ ** MANIFEST.MF (with the LessonPackage attribute)
  • lessons/ ** yourPackageName/ *** Main.java *** all of your lesson files

If you have created your lesson inside of the Eclipse IDE, you should be able to export it as a JAR pretty easily.

  1. First, create a Manifest file in your project, so you can use it for the JAR. It must contain at least the LessonPackage attribute, as described above.
  2. Then, right-click on your lesson package, and select "Export…". In the popup, select "JAR file", and validate.
  3. Your package should be selected in the resources frame. Input the file destination for your JAR, and check the options.
  4. On the last screen, choose the option "Use existing manifest from workspace", and select the Manifest you've created before.
  5. Create the JAR!

You should now have a package ready to be loaded into the PLM, using the appropriate link in the lesson chooser.