Alex Tweedly wrote:
Well, I don't much like dBases, or XML, so here's what I'd probably
do....
Ha! Alex, thank you... a man after my own heart. I've often cogitated
and cogitated and ended up using flat text files for data that runs in
the 2000 record or less category because I too had a resistance to
adding a "third" layer beyond Rev + Text" to the framework. Call it a
phobia for complexity.
And to find that indeed, it meant less over head and greater clarity in
the end, assuming one is rigorously consistent with folder, filename
nomenclature etc. The beauty of well structured plain text data is
accessibility with no "service agents" required other than some savvy
I/O (read and write) in rev...
An interesting solution.... and keeps is all on the xTalk/plain English
planet. Sometimes using the "cool new" tools like XML and SQL, only gets
you headaches. But I can see our dBase wizards shaking their heads (smile)
At any rate you show quite clearly how to build the array, whatever the
container might be. And given that I have the same penchant for avoiding
dBases as you do. I will probably follow your lead.
Another option is to use a stack to hold it on the web server. Which I
do for a number of other projects. It's quite efficient.
(http://www.himalayanacademy.com/resources/lexicon/ uses a 7MB/3,500
card stack on the back end to hold the dictionary... try it... I think
you will be amazed at the speed.)
But I have not heard yet if the iRevServer Engine will honor "start
using stack Quizes"
Thanks for taking the time to share your vision on this. I really
appreciate
Cheers from Kauai
Sivakatirswami
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
[email protected]
Please visit this url to subscribe, unsubscribe and manage your
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
_______________________________________________
use-revolution mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
_______________________________________________
use-revolution mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution