[kde-edu]: Changes in kvtml

Markus Büchele Markus.Buechele at web.de
Mon Apr 23 07:28:25 CEST 2007

Am Sonntag, 22. April 2007 18:34:00 schrieb Frederik Gladhorn:
> Hi all!
> Ok, it took me a while, but I started playing around with the kvtml stuff
> in the lib. I was getting frustrated every time I looked at the KVocTrain
> code, so I decided I have to act.
> There are six weeks left until feature freeze, and I'd like to make a
> rather big chage, that will trouble all that are using our beloved KVTML
> file format.
> For lawyers: I'll be using language for things that can be in KVTML docs.
> These  can of course be totally different things, which is the cause to
> call them identifiers in the lib. Feel free to fill in whatever you like
> instead.
> The concept of original language + x translations is not really great for
> apps that actually can have more than two languages. So far it is never
> possible to practice language 2 with language 3.
> This is intersting for people learing eg. Chinese or Japanese, to have some
> sort of signs and maybe traditional and simplified and be able to practice
> them in respect to each other.
> See bug #93446 (https://bugs.kde.org/show_bug.cgi?id=93446).
> Another thing is that this concept blows up the code unnecessarily and in a
> ugly way. Because everywhere there is special treatment for original, than
> an iteration over all translations.
> KVocTrain and also the lib we have about thousand places like (rather small
> example of duplicate code directly next to each other):
> (from keduvocdocument.cpp)
> if (sort_column == 0)
>         return e1.original().toLower() < e2.original().toLower();
>       else
>         return e1.translation(sort_column).toLower() <
> e2.translation(sort_column).toLower();
> This will become:
> return e1.translation(sort_column).toLower() <
> e2.translation(sort_column).toLower();
> I modified KEduVocExpression as a start, to see how bad changing that is. I
> started with 950 lines of code and I ended up with 530 lines of code (ok,
> it's not tested and will grow a couple of lines again).
> For most of the programs using it there will be little to no problems. The
> original() calls will have to be replaced by translation(0) and
> translation(0) becomes translation(1).
> Only the grading has to be saved a little different, because now it will be
> possible to practice language 2 with 3, which is the point of the whole
> exercise.
> Each word in every language can now save grades from the other language. So
> if I am shown a word in language 2 and enter it correctly in language 3,
> the lang 3 entry saves that it was correct one time from lang 2.
> (Before there was a bool which decided if it was from or to original. See
> attachment.)
Hi Frederik and Peter,

from the point of a user I welcome your (proposed) changes.

My pupils often get confused about the lesson selection dialogue. So I believe 
it its a step forward to make that choice more obvious.

I believe that the addition of sound tags is a great extension which makes a 
lot of sense to learners of foreign languages.

Thank you very much for your excellent work!

I would like to suggest two changes in the code for the query of verb forms:

1. Please change the order of the 3rd person singular to the common 
male/female/neutral. I don't know any other language learning resource where 
the order is KVoctrain's present female/male/neutral order.

2. The names of the tenses are automatically adapted to the standard desktop 
language. I believe it is better to use the expressions (e.g. simple past 
etc.) of the language the verb is taken from. Teachers usually use the 
grammar terms of the foreign language.

Thanks once again!


> The bigger problem is that this change will not be downward compatible. I'd
> adapt the original readers to provide the new structure. To keep
> KEduVocKvtmlReader clean I'd like to have two versions of it. One simply
> reading old files to the new structure and another one to read the new
> files.
> The other big change is the use of lessons. To make KEduVocDocument a
> little cleaner I removed all references to lessons and vocabulary entries,
> exept two functions: rootLesson() and setRootLesson().
> Lessons now actually contain their vocabulary and can contain sublessons.
> This makes organization much nicer and removes many special case treatment
> as well.
> For most apps (unless they begin to like lessons) this is no big change.
> Instead of myDoc->entry(index) it changes to
> myDoc->rootLesson()->entry(index).
> Types will actually be a real class to fix bug #138488, that it was
> impossible to query
> for nouns and have noun:male/femal/nutral included.
> The multiple choice class was a really weird container for five QString.
> I'd replace it with a QStringList which is more flexible and smaller. This
> also get's rid of the fixed maximum of multiple choice answers. Do you want
> to rather keep it?
> Please send your suggestions and concerns!
> Did something always annoy you with KEduVocDocument? Do you want a new
> comfortable function there? Will you burn me on a pile of wood for doing
> this?
> I'd like to get this in soon, so all KDE4 kvtml apps make use from the
> change right from the beginning.
> I think I will need one more week to get the lib done. If there are no
> protests I might actually apply this. I'll happily send out a patch to
> those interested. It's probably still a bit buggy, but if kvoctrain works
> with it, most of the other apps should as well.
> Also tell me, if you want to port your app yourself or if I should do it.
> Any help is of course very appreciated.
> Attached: xml proposal (I think there are still some things mixed up, is
> the old one defined cleanly anywhere?)
> At the moment, I have new lesson, expression and so on classes and almost
> finished writer/reader classes.
> For kvoctrain I hope this makes it possible/necessary to fix:
> #93446, #108568 (a bit), #125555, #138488 and #140039
> Greetings,
> Frederik

More information about the kde-edu mailing list