Recent Changes - Search:

Get GNU Solfege at SourceForge.net. Fast, secure and Free Open Source software downloads

Implementation

This page does not desribe the current implementation. It was a draft used for discussion. Parts of it has been implemented.

Uuid crash

Might theoretically happen for generated uuids. More likely to happen if people forget to generate a new uuid when they make copies of lesson files to modify them. Not a big problem because Solfege will notice this the first time they run Solfege and offer to fix it.

Why not generate unique identifiers based on some sort of hash (md5?) of lesson module and its parameters? Or just use url as an unique identified? It's not like uuid is always the ultimate solution (kfoltman)
I don't want a hash of the lesson file, because then the learning tree will break if we update the file. But using an url as id would work just fine. In fact, the current implementation in the newexercisesetup branch does not put any restrictions to what you put in the id-string. But if a id string is missing, then a uuid is added. Do you mean ids like this: lesson_id="http://solfege.org/lessonid/321"? Then we can say in the docs that only lesson files part of an official Solfege release can use the solfege.org domain. Did some testing, and we have to remember that the id string has to be usable as a file name. So an url won't work now, unless we find a way to escape the filename. (TomCato)

Lesson files for the 'pure python exercises'

Example lesson file:

 
# GNU Solfege
# Copyright (C) 2005 Tom Cato Amundsen

header {
    module = harmonicinterval
    intervals = 2, 4, 7
    disable_unused_intervals = yes
    title = "Major second, major third and pure fifth"
    theory = "theory-intervals.html"
    lesson_id = "5274234f-7521-462c-9806-8bd46980242b"
}

'Normal' lesson files

Example lesson file:

 
# GNU Solfege
# Copyright (C) 2005 Tom Cato Amundsen

header {
    module = chord
    title = "Minor and major triads"
    theory = "theory-chords.html"
    lesson_id = "816253ad-48e4-4567-a3b8-a0306c856f15"
    test = "4x"
    test_requirements = "90%"
}
question { name="major" music=chord("c' e' g'") }
question { name="minor" music=chord("c' es' g'") }

Changes with header block and includes

The handling for the header block when including files has changed. The old implementation was to ignore all header blocks except the one in the toplevel file. Now we parse all headers, and let the values from the most toplevel file override the values from included files.

Lesson file changes

Changes to the header block:

  • The content variable is gone. It is replaced by the module variable that should be set to the name of the python module running the lesson file. So while you did write
 content = id-by-name

 in solfege 2.4.0, you should write

 module = idbyname

in solfege 3.0. Also the module variable can only hold the name of one module.

As described in SITS.00079?, there are a few new variables that can be put in header files.

Learning tree

The learning tree is a text file with the output of pprint.pformat(LearningTree.m_data). When we load the file, we just use eval to parse it. I'm writing a gui learning tree editor.

The LearningTree has two data structures.

m_deps
one entry for each lesson file where the lesson_id maps to a list of lesson_ids representing all the lesson files this lesson file depends on
m_topics
A list of dicts where each dict has two keys: 'name' maps to the name of the topic. This name is used in the Practise menu. 'lessons' is a list for lesson_ids telling what lessons belong to this topic.

This "Practise" menu has submenus for different topics like "Intervals", "Beginner chords", "Diffiult Chords" etc, and that the lesson files will have entries on these submenus. There is not additional levels of submenus.

Not implemented yet

It should be possible to set the "visibility", so that only exercises matching the users skills are displayed.

Gui

We will build the menu structure or the topic index from the file described above and the lesson files.

Edit - History - Print - Recent Changes - Search
Page last modified on May 27, 2005, at 09:32 AM