home *** CD-ROM | disk | FTP | other *** search
- on goToQuiz whichBtn
- global gBridgeParts, gAnswered, gCat, gWhichBridge, gCatTitle, gBridgeMonitor
- cursor(4)
- set gAnswered to 0
- repeat while gWhichBridge = VOID
- set whichBridge to random(10)
- if (count(gBridgeLst) <> 10) and (count(gBridgeLst) <> 0) then
- if getPos(gBridgeLst, whichBridge) = 0 then
- set gWhichBridge to whichBridge
- end if
- next repeat
- end if
- set gWhichBridge to whichBridge
- end repeat
- set gCatTitle to word 1 of the name of member the memberNum of sprite whichBtn of castLib "chooser"
- set gCat to word 1 of the name of member the memberNum of sprite whichBtn of castLib "chooser"
- InitializeTracking(gCat)
- clearSndList()
- clearAnimalist()
- go("quiz")
- doMusicBtn()
- set the memberNum of sprite gBridgeMonitor to the number of member ("bridge " & gBridgeParts)
- putUpQuestion()
- cursor(-1)
- end
-
- on putUpQuestion
- global gLangSelect, gWhichQuest, gLangName, gQuestion, gAnswer, gCat, gLangDirect, gAnsSndLst, gAnswered, gStampSpt, gQuestSndLst, gCatTitle
- cursor(4)
- set the visible of sprite 1 to 0
- set the visible of sprite 1 to 1
- updateStage()
- set gAnswered to 0
- set tempLst to []
- set gAnsSndLst to []
- set gQuestSndLst to []
- if (gCatTitle = "allw") or (gCatTitle = "all") then
- findgCat()
- end if
- chooseQuestionNum()
- if gLangDirect = 1 then
- set gQuestSndLst to askQuestionInEnglish(tempLst)
- makeEnglishAnswerLst()
- else
- set gQuestSndLst to askForeignQuestion(tempLst)
- makeForiegnAnswerLst()
- end if
- set text to gQuestion
- set letterLst to []
- setboxSize("questBox")
- set letterLst to countAndCenterText(text, "whi", "center")
- stampOutTxt(letterLst, gStampSpt, "1")
- repeat with X = 1 to 4
- set text to getAt(gAnswerLst, X)
- set letterLst to []
- setboxSize("ans" & X)
- set letterLst to countAndCenterText(text, "whi", "center")
- stampOutTxt(letterLst, gStampSpt, "1")
- end repeat
- set the itemDelimiter to ","
- repeat with X = 1 to count(gAnsSndLst)
- add(tempLst, getAt(gAnsSndLst, X))
- end repeat
- startSndList(gQuestSndLst)
- cursor(-1)
- end
-
- on askQuestionInEnglish sndLst
- global gLangSelect, gWhichQuest, gLangName, gQuestion, gAnswer, gCat, gLangDirect, gQuestSndLst, gSndPath, gFileDelimiter, gAnsSndLst, gCatTitle
- set the itemDelimiter to "*"
- set aWord to item 2 of line gWhichQuest of field ("e " & gCat)
- set gAnswer to item 3 of line gWhichQuest of field (gLangSelect && gCat) of castLib (gLangSelect & "Cst")
- set gQuestion to "What is " & gLangName & " for " & line 1 of field "quote" & aWord & line 1 of field "quote" & "?"
- set engPath to gSndPath & "e" & gFileDelimiter
- add(sndLst, engPath & "eQuest" & gLangSelect & ".aif")
- if (gCat = "tphr") and (gWhichQuest = 109) then
- set aSent to "How do you say 'notebook' in " & gLangName & "?"
- set gQuestion to "What is " & gLangName & " for " & line 1 of field "quote" & aSent & line 1 of field "quote" & "?"
- add(sndLst, gSndPath & "e" & gFileDelimiter & gCat & gFileDelimiter & gLangSelect & gCat & gWhichQuest & ".aif")
- add(gAnsSndLst, gSndPath & gLangSelect & gFileDelimiter & gCat & gFileDelimiter & gCat & gWhichQuest & ".aif")
- else
- if (gCat = "tphr") and (gWhichQuest = 7) then
- set aSent to "My " & gLangName & " is not very good."
- set gQuestion to "What is " & gLangName & " for " & line 1 of field "quote" & aSent & line 1 of field "quote" & "?"
- add(sndLst, gSndPath & "e" & gFileDelimiter & gCat & gFileDelimiter & gLangSelect & gCat & gWhichQuest & ".aif")
- add(gAnsSndLst, gSndPath & gLangSelect & gFileDelimiter & gCat & gFileDelimiter & gCat & gWhichQuest & ".aif")
- else
- add(sndLst, engPath & gCat & gFileDelimiter & gCat & gWhichQuest & ".aif")
- add(gAnsSndLst, gSndPath & gLangSelect & gFileDelimiter & gCat & gFileDelimiter & gCat & gWhichQuest & ".aif")
- end if
- end if
- return sndLst
- end
-
- on makeEnglishAnswerLst
- global gAnswerLst, gAnswer, gLangName, gLangSelect, gCat, gAnsSndLst, gSndPath, gFileDelimiter
- set gAnswerLst to []
- add(gAnswerLst, gAnswer)
- set langPath to gSndPath & gLangSelect & gFileDelimiter
- set the itemDelimiter to "*"
- repeat while count(gAnswerLst) < 4
- set whichField to gLangSelect && gCat
- set whichLine to random(the number of lines in field whichField)
- set aLine to line whichLine of field whichField
- set aAnswer to item 3 of aLine
- if aAnswer = EMPTY then
- beep()
- end if
- set reasonNotTo to checkPossQwest(whichLine, 1, "A")
- if (getPos(gAnswerLst, aAnswer) = 0) and (reasonNotTo = 0) then
- add(gAnswerLst, aAnswer)
- add(gAnsSndLst, langPath & gCat & gFileDelimiter & gCat & whichLine & ".aif")
- end if
- end repeat
- set the itemDelimiter to ","
- mixUpAnswerLst()
- end
-
- on askForeignQuestion sndLst
- global gLangSelect, gWhichQuest, gLangName, gQuestion, gAnswer, gCat, gLangDirect, gFileDelimiter, gSndPath, gAnsSndLst, gCatTitle
- set the itemDelimiter to "*"
- set aWord to item 3 of line gWhichQuest of field (gLangSelect && gCat) of castLib (gLangSelect & "Cst")
- if gLangSelect = "f" then
- set gQuestion to "Comment dit-on " & line 1 of field "quote" & aWord & line 1 of field "quote" & " en anglais?"
- else
- if gLangSelect = "s" then
- set gQuestion to "¿Cómo se dice " & line 1 of field "quote" & aWord & line 1 of field "quote" & " en inglés?"
- else
- if gLangSelect = "I" then
- set gQuestion to "Cos'è l'inglese per " & line 1 of field "quote" & aWord & line 1 of field "quote" & "?"
- else
- if gLangSelect = "g" then
- set gQuestion to "Was ist " & line 1 of field "quote" & aWord & line 1 of field "quote" & " auf englisch?"
- end if
- end if
- end if
- end if
- set engPath to gSndPath & gLangSelect & gFileDelimiter
- add(sndLst, engPath & gLangSelect & "quest.aif")
- add(sndLst, engPath & gCat & gFileDelimiter & gCat & gWhichQuest & ".aif")
- if (gLangSelect = "g") or (gLangSelect = "f") or (gLangSelect = "s") then
- add(sndLst, engPath & gLangSelect & "quest2.aif")
- end if
- if (gCat = "tphr") and (gWhichQuest = 109) then
- set gAnswer to "How do you say 'notebook' in " & gLangName & "?"
- add(gAnsSndLst, gSndPath & "e" & gFileDelimiter & gCat & gFileDelimiter & gLangSelect & gCat & gWhichQuest & ".aif")
- else
- if (gCat = "tphr") and (gWhichQuest = 7) then
- set gAnswer to "My " & gLangName & " is not very good."
- add(gAnsSndLst, gSndPath & "e" & gFileDelimiter & gCat & gFileDelimiter & gLangSelect & gCat & gWhichQuest & ".aif")
- else
- set gAnswer to item 2 of line gWhichQuest of field ("e " & gCat)
- add(gAnsSndLst, gSndPath & "e" & gFileDelimiter & gCat & gFileDelimiter & gCat & gWhichQuest & ".aif")
- end if
- end if
- return sndLst
- end
-
- on makeForiegnAnswerLst
- global gAnswerLst, gAnswer, gLangName, gLangSelect, gSndPath, gCat, gFileDelimiter, gAnsSndLst
- set gAnswerLst to []
- add(gAnswerLst, gAnswer)
- set langPath to gSndPath & "e" & gFileDelimiter
- set the itemDelimiter to "*"
- repeat while count(gAnswerLst) < 4
- set whichField to "e" && gCat
- set whichLine to random(the number of lines in field whichField)
- set aLine to line whichLine of field whichField
- set aAnswer to item 2 of aLine
- set reasonNotTo to checkPossQwest(whichLine, 0, "A")
- if (getPos(gAnswerLst, aAnswer) = 0) and (reasonNotTo = 0) then
- add(gAnswerLst, aAnswer)
- add(gAnsSndLst, langPath & gCat & gFileDelimiter & gCat & whichLine & ".aif")
- end if
- end repeat
- set the itemDelimiter to ","
- mixUpAnswerLst()
- end
-
- on mixUpAnswerLst
- global gAnswerLst, gAnswerSpt, gAnswer, gAnsSndLst, gSndPath
- set tempLst to []
- set tempSndLst to []
- repeat while count(tempLst) < 4
- set aAnswer to random(count(gAnswerLst))
- add(tempLst, getAt(gAnswerLst, aAnswer))
- add(tempSndLst, getAt(gAnsSndLst, aAnswer))
- if getAt(gAnswerLst, aAnswer) = gAnswer then
- set gAnswerSpt to count(tempLst)
- end if
- deleteAt(gAnswerLst, aAnswer)
- deleteAt(gAnsSndLst, aAnswer)
- end repeat
- set gAnswerLst to tempLst
- set gAnsSndLst to []
- repeat with X = 1 to count(tempSndLst)
- add(gAnsSndLst, getAt(tempSndLst, X))
- add(gAnsSndLst, gSndPath & "noSnd.aif")
- end repeat
- end
-
- on enterAnswer whichBtn
- global gAnswerRight, gAnswerSpt, gAnswered, gAnswerLinesBox, gfstLftArr, gLstRtArr, gClickNote, gBridgeMonitor, gBridgeParts, gRightTag, gStampSpt, gEyeSprite, gSwitchSpt, gLangDirect, gLangSelect
- if gAnswered <> 1 then
- set gAnswered to 1
- set the memberNum of sprite gAnswerLinesBox to the number of member "answerarea gray"
- repeat with X = gfstLftArr to gLstRtArr
- if (X <> (gfstLftArr + 1)) and (X <> (gfstLftArr + 4)) and (X <> (gfstLftArr + 7)) and (X <> (gfstLftArr + 10)) then
- set foo to the name of member the memberNum of sprite X of castLib "quiz"
- put "gray" into word the number of words in foo of foo
- set the memberNum of sprite X to the number of member foo
- end if
- end repeat
- set the memberNum of sprite gEyeSprite to the number of member "eye gray"
- set the memberNum of sprite gSwitchSpt to the number of member "switch gray"
- if gLangDirect = 1 then
- set the memberNum of sprite gClickNote to the number of member "e click up"
- else
- set the memberNum of sprite gClickNote to the number of member (gLangSelect & " click up")
- end if
- clearSndList()
- set foo to the name of member the memberNum of sprite whichBtn of castLib "quiz"
- set foo to value(word 1 of foo)
- repeat with X = 1 to 4
- set text to getAt(gAnswerLst, X)
- set letterLst to []
- setboxSize("ans" & X)
- if X = gAnswerSpt then
- set whichColor to "grn"
- else
- if (X = foo) and (foo <> gAnswerSpt) then
- set whichColor to "red"
- else
- set whichColor to "whi"
- end if
- end if
- set letterLst to countAndCenterText(text, whichColor, "center")
- stampOutTxt(letterLst, gStampSpt, "1")
- end repeat
- if gAnswerSpt = foo then
- set gAnswerRight to 1
- set gBridgeParts to gBridgeParts + 1
- set the memberNum of sprite gBridgeMonitor to the number of member ("bridge " & gBridgeParts)
- if gLangDirect = 1 then
- set the memberNum of sprite gRightTag to the number of member "e correct"
- else
- set the memberNum of sprite gRightTag to the number of member (gLangSelect & " correct")
- end if
- puppetSound(1, "yes")
- else
- if gLangDirect = 1 then
- set the memberNum of sprite gRightTag to the number of member "e incorrect"
- else
- set the memberNum of sprite gRightTag to the number of member (gLangSelect & " incorrect")
- end if
- set gAnswerRight to 0
- puppetSound(1, "no")
- end if
- TrackAnswer(gAnswerRight, getAt(gAnswerLst, gAnswerSpt), getAt(gAnswerLst, foo))
- doFeedBack()
- end if
- end
-
- on resetQwest
- global gAnswerLinesBox, gfstLftArr, gLstRtArr, gClickNote, gBridgeParts, gRightTag, gWhichBridge, gBridgeLst, gEyeSprite, gSwitchSpt
- set gAnswered to 0
- clearSndList()
- clearAnimalist()
- if gBridgeParts <> 10 then
- set the memberNum of sprite gAnswerLinesBox to the number of member "answerarea"
- repeat with X = gfstLftArr to gLstRtArr
- if (X <> (gfstLftArr + 1)) and (X <> (gfstLftArr + 4)) and (X <> (gfstLftArr + 7)) and (X <> (gfstLftArr + 10)) then
- set foo to the name of member the memberNum of sprite X of castLib "quiz"
- put "up" into word the number of words in foo of foo
- set the memberNum of sprite X to the number of member foo
- end if
- end repeat
- set the memberNum of sprite gEyeSprite to the number of member "eye up"
- set the memberNum of sprite gSwitchSpt to the number of member "switch up"
- set the memberNum of sprite gClickNote to the number of member "click gray"
- set the memberNum of sprite gRightTag to the number of member "e 2 correct"
- putUpQuestion()
- else
- cursor(4)
- if getPos(gBridgeLst, gWhichBridge) = 0 then
- add(gBridgeLst, gWhichBridge)
- end if
- viewBridge()
- cursor(-1)
- end if
- end
-
- on setLangSelect whichBtn
- global gLangSelect, gLangName, gLangDirect
- set foo to the name of member the memberNum of sprite whichBtn of castLib "chooser"
- set gLangSelect to word 1 of foo
- case gLangSelect of
- "g":
- set gLangName to "German"
- "i":
- set gLangName to "Italian"
- "s":
- set gLangName to "Spanish"
- "f":
- set gLangName to "French"
- "L":
- set gLangName to "Latin"
- "P":
- set gLangName to "Portuguese"
- end case
- if gLangDirect = 1 then
- put "English to " & gLangName into field "direction"
- else
- put gLangName & " to English" into field "direction"
- end if
- end
-
- on switchLangDir
- global gLangDirect, gLangName
- cursor(4)
- if the frameLabel = "find" then
- put EMPTY into field "possWords"
- put EMPTY into field "wordFound"
- put EMPTY into field "wordFind"
- end if
- if gLangDirect = 1 then
- set gLangDirect to 0
- put gLangName & " to English" into field "direction"
- else
- set gLangDirect to 1
- put "English to " & gLangName into field "direction"
- end if
- if the frameLabel = "quiz" then
- putUpQuestion()
- else
- if the frameLabel = "find" then
- prepWdFind()
- else
- if the frameLabel = "chooser" then
- prepChooser()
- end if
- end if
- end if
- cursor(4)
- updateStage()
- cursor(-1)
- end
-
- on chooseQuestionNum
- global gWhichQuest, gPastQwestLst, gCat
- set gWhichQuest to VOID
- repeat while gWhichQuest = VOID
- set whichQwest to random(the number of lines in field ("e " & gCat))
- set reasonNotTo to checkPossQwest(whichQwest, 1, "Q")
- if (getPos(gPastQwestLst, whichQwest) = 0) and (reasonNotTo = 0) then
- add(gPastQwestLst, whichQwest)
- set gWhichQuest to whichQwest
- end if
- end repeat
- if count(gPastQwestLst) >= 8 then
- deleteAt(gPastQwestLst, 1)
- end if
- end
-
- on checkPossQwest whichQwest, whichDirect, QorA
- global gLangDirect, gLangSelect, gCat, gWhichQuest
- set foo to 0
- if gLangDirect = whichDirect then
- if gCat = "mphr" then
- case gLangSelect of
- "g":
- if (whichQwest = 34) or (whichQwest = 48) then
- set foo to 1
- end if
- "f":
- if (whichQwest = 33) or (whichQwest = 48) or (whichQwest = 98) then
- set foo to 1
- end if
- "s":
- if whichQwest = 48 then
- set foo to 1
- end if
- end case
- else
- if gCat = "tphr" then
- case gLangSelect of
- "g":
- if (whichQwest = 65) or (whichQwest = 92) or (whichQwest = 124) then
- set foo to 1
- end if
- "i":
- if (whichQwest = 83) or (whichQwest = 92) then
- set foo to 1
- end if
- "f":
- if (whichQwest = 27) or (whichQwest = 64) or (whichQwest = 65) or (whichQwest = 66) or (whichQwest = 92) or (whichQwest = 108) then
- set foo to 1
- end if
- end case
- else
- if gCat = "geog" then
- if QorA = "a" then
- if (gWhichQuest = 8) or (gWhichQuest = 9) or (gWhichQuest = 10) then
- if (whichQwest = 8) or (whichQwest = 9) or (whichQwest = 10) then
- set foo to 1
- end if
- end if
- end if
- else
- if gCat = "bath" then
- if QorA = "a" then
- if (gWhichQuest = 5) or (gWhichQuest = 6) then
- if (whichQwest = 5) or (whichQwest = 6) then
- set foo to 1
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- return foo
- end
-
- on findgCat
- global gCatTitle, gCat
- if gCatTitle = "allw" then
- set fooNum to random(27)
- else
- if gCatTitle = "all" then
- set fooNum to random(31)
- end if
- end if
- case fooNum of
- "1":
- set gCat to "rltv"
- "2":
- set gCat to "advb"
- "3":
- set gCat to "adjv"
- "4":
- set gCat to "verb"
- "5":
- set gCat to "schl"
- "6":
- set gCat to "tran"
- "7":
- set gCat to "colr"
- "8":
- set gCat to "dirc"
- "9":
- set gCat to "spor"
- "10":
- set gCat to "occp"
- "11":
- set gCat to "anml"
- "12":
- set gCat to "food"
- "13":
- set gCat to "trvl"
- "14":
- set gCat to "body"
- "15":
- set gCat to "buil"
- "16":
- set gCat to "city"
- "17":
- set gCat to "hous"
- "18":
- set gCat to "furn"
- "19":
- set gCat to "weat"
- "20":
- set gCat to "conj"
- "21":
- set gCat to "numb"
- "22":
- set gCat to "bath"
- "23":
- set gCat to "kitc"
- "24":
- set gCat to "time"
- "25":
- set gCat to "geog"
- "26":
- set gCat to "clth"
- "27":
- set gCat to "stor"
- "28", "30":
- set gCat to "tphr"
- "29", "31":
- set gCat to "mphr"
- end case
- return(foo)
- end
-