Well, I don't much like dBases, or XML, so here's what I'd probably do....

Answer (a)

1. Have a folder for each category.
2. in the folder, have a file (category.tx, maybe?) with the first line containing the category name, and subsequent lines containing the verbiage for it.
3. have a sub-folder for each quiz
4. within it, have file (quiz.txt ?) with the first line containing the title, and subsequent lines with the verbiage
5. within the folder, have a file per question, having
     question
     4 lines for answers, each being :
               "answer" TAB "True or False"
      subsequent line holding the verbiage for question

and then the script would do something like

local sArray    -- to hold data for testing

on mouseUp
   set the defaultFolder to "C:/Users/Alex/Documents/Programming/RunRev"
   put the defaultFolder
   readfile "category1", "quiz1", "question"
end mouseUp
on readfile pCategory, pQuiz, pQuestion
   -- the real version would use the params to set the folder / subfolder
   -- and read the appropriate question file
   local tFile
   put URL "file:category.txt" into tFile
   put line 1 of tFile into sArray["category"]
   put line 2 to -1 of tFile into sArray["category verbiage"]
put URL "file:quiz.txt" into tFile
   put line 1 of tFile into sArray["quiz"]
   put line 2 to -1 of tFile into sArray["quiz verbiage"]
put URL "file:question.txt" into tFile
   put line 1 of tFile into sArray["question"]
   put line 6 to -1 of tFile into sArray["question verbiage"]
repeat with i=2 to 5 put item 2 of line i of tFile into sArray["answer"][item 1 of line i of tFile]
   end repeat
   printarray sArray
end readfile
on printarray pArr
   repeat for each line K in the keys of pArr
      put "doing " && K & CR after msg
      if pArr[K] is an array then
         repeat for each line K1 in the keys of pArr[K]
            put K1 && ":" && pArr[K][K1] & CR after msg
         end repeat
      else
         put K && ":" && pArr[K] & CR after msg
      end if
   end repeat
end printarray



Answer (b)
instead of a subfolder, I might have a Tab separated "spreadsheet" with the quiz/questions/answers. Changes would be pretty obvious

-- Alex.

Sivakatirswami wrote:
I'm trying to wrap my head around the "container" for a multiple choice question quizes.

And individual quiz will run inside a revlet eventually. We can them successively from the web server.

The GUI will have sounds and images when users make selections etc.
That's the easy part... the back end is still eluding me...

XML files could work, but I would rather use a dBase, but, then I'm not sure how I can push it into an array (not having yet familiarized myself on the multi-dimensional arrays yet.)

If anyone has insights please "fire away."  Here are the elements:

1) Category of Quiz  e.g. Biology -- comprising many quizes
2) Verbiage for the category of quizes: e.g. some introductory or descriptive text 3) Title of Quiz e.g. "Let's Study Mammals" -- comprising title for a single quiz containing 2 or more questions with answers. 4) Verbiage for a specific Quiz: e.g. some explanatory text related to a specific quiz 5) Question: e.g. "Which of these are not mammals?" -- being the single question "parent" of 4 answers
         6) Verbiage related to a specific question
7) Four answers (ever more, never less) e.g.
        Trout
        Goat
        Cow
        Peacock
8)  Boolean Property for each answer in relation to the question e.g.
        Trout is False
        Goat is True
        Cow is True
        Peacock is False

That's it.... OK, so, yes, I could build an XML file for each individual quizes, keep these in a folders named for the category of quiz, one XML file per quiz and Revolution could easily ingest this, apply it to button states etc.

but

I *think* I could also wrap my head around created a relational data base to contain all these elements as well, which is probably a better idea.

But, then, whether I use XML or a dBase, what I don't yet know how to do is pull a single question and answer with all the above elements into a single array... is it even possible? What would the array look like? Before I run off to search the docs for how to use Multi-dimensional arrays any input from all you wizards will be appreciated, especially the dBase design experienced. And if anyone knows of tutorials or specific places I can go to to study up RunRev's new arrays, please point me in the right direction.

Thanks!
Sivakatirswami

_______________________________________________
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


_______________________________________________
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to