[kde-edu]: edu.kde.org: kvtml files

Jeremy Whiting jeremy at scitools.com
Mon Oct 15 15:42:20 CEST 2007


On Sunday 14 October 2007 13:02:56 Ilja wrote:
> Started here: http://lists.kde.org/?l=kde-edu&m=119221981000582&w=2
> Replying to: http://lists.kde.org/?l=kde-edu-devel&m=119238389125745&w=2
>
> Well, :
>
> 1) There would be some kind of class.
>
> class Data_Files {
>   public $files = array();
>   function($filename, $description, $last_update, $support_starting_with) {
>     $this->files[] = array('description' => $description,
>     [..]
>   }
>
>   [..]
>
>   function show($application) {
>     foreach($this->files as $file) {
>       if (??) {
>         // show only these files, that application supports
>       }
>     }
>     [..]
>   }
>
>   // to use on global page, shows program support stuff too
>   $data->show_all();
>   /*
>   like hangman -  parley
>          no        yes
>   */
> }

Ilja,

That sounds pretty good, except for the application support.  The idea with 
kvtml 2 is that all applications can use all kvtml 2 files.  KHangman and 
KAnagram can show files with 2 or 5 or how ever many columns there are, 
currently it will only show words from the first column, but if there's no 
comment tag, it will use the second column word as the hint, etc.  Eventually 
(4.1 maybe) I'd like khangman and kanagram to be able to let you see all the 
words from all columns, possibly with a column choice combobox or something.

>
> 2) There would be all data files listed somewhere (some .inc file, maybe).
>
> $data = new Data_Files;
> $data->append("dela.tar.bz2",
>               "Tarball of German to Latin vocabulary[..]",
>               "2006-03-21", ???);
>
> $data->append("lade.tar.bz2",
>             "Tarball of Latin to German vocabulary[..]",
>             "2005-03-21", ???);
> [..]
>
> And on each application page would be shown only supported files:
> include("all_data.php");
> $data->show(/* Application name */)
>
>
> But I'm not sure how should it be implemented.
>
> So much as I understand about kvtml support:
>
> (KHangMan == Kanagaram) < KWordQuiz < KVocTrain < Parley

Not quite, KHangman and Kanagram do have basically the same reading abilities 
as each other, KWQ I'm not sure about, but I'm pretty sure Peter Hedlund is 
working on it.  Support for multiple languages and the ability to compare the 
second language to the third, etc. is fairly new in the library, so expect 
KWQ to be using all columns soon probably.

>
> So KWordQuiz should support all files, that Kanagram and KHangMan do,
> as so on.
>
> So, maybe one solution would be such, but I'm not sure if it's good
> and logical enough:
>
> define (KHANGMAN, 1)
> define (KANAGRAM, 1)
> define (KWORDQUIZ, 2)
> define (KVOCTRAIN, 3)
> define (PARLEY, 4);
>
> [..]
> $data->append("lade.tar.bz2",
>             [..]
>             "2005-03-21", KWORDQUIZ); // should mean, that support
>                                       // starts with KWordQuiz
>
> // on application page
> $data->show(KVOCTRAIN);
>
> [..]
>
> function show($application) {
>     foreach($this->files as $file) {
>       // KWORDQUIZ = 2               $application = KVOCTRAIN = 3
>       if ($file['support_starts_with'] <= $application) {
>         // show it then
>       }
> [..]
>
>
> Any ideas?

Sorry I didn't have many ideas about the php code, I'm a bit out of practice 
in that regards... :(  Anyway, besides those couple misconceptions, I think 
this will be a great addition to the website.  Great to have you on board :)

Jeremy Whiting


More information about the kde-edu mailing list