From: Warren Brown Date: 2003-02-15T02:14:08+09:00 Subject: Re: Directed graph quiz application Brian, > I was thinking about something like this: > atomic number:name:symbol:family > 1:hydrogen:H:nm > 2:helium:He:nm > > and so forth, a little like CSV. But the part I'm > confused about is that the questioning system should > work on a directed graph system, as in some questions > might be > 1's name? > 1's symbol? > 1's family? > hydrogen's atomic number? > hydrogen's symbol? > > and so forth. However, I *can't* ask > nm's name? > > because the designation 'nonmetal' shouldn't point back > to the other fields. It is a one way mapping. So I > think I have to establish a directed graph system > between the fields so that the quiz application knows > what questions to ask. The trivial answer is to change your format to question:answer and then populate the database with only valid combinations. This is easy to code but requires a lot of typing and redundancy. A better solution would be to have your questioning system do this for you. > I'm confused about how to describe these mappings in the little quiz > database files. It'd be nice for it to be human-editable and stuff. As far as a database syntax, I would use something like: =atomic number=name=symbol 1:hydrogen 1:H 1:nm hydrogen:1 hydrogen:H hydrogen:nm H:1 H:hydrogen H:nm Any attribute with a many-to-one flag does not appear as a question. Of course, if you wanted to get really clever, you could actually collect these many-to-one attribute "answers" together and then ask questions like "What are the names of all nm's?" and "What are the atomic numbers of all nm's?" Unfortunately, this gets a little more complicated. Hope this helps! - Warren Brown