|
|
Correct entry
Added on 8/10/2000
|
This is a script to check the correct entry. This can be useful while developing CBT"s.
Download PC Source Download Mac Source
property spriteNum, currentWord, pNav1, pNav2, pAnswer
on beginSprite me
currentWord = ""
sprite(spriteNum).member.text = ""
sprite(spriteNum).member.editable = true
end
on keyDown me
if the key = return then
dontPassEvent
if currentWord = pAnswer then
case pNav1 of
"Go Next Frame":Go the frame + 1
"Go Previous Frame":Go the frame -1
"Go Next Marker": Go Next
"Go Previous Marker": Go previous
"Go Loop": Go Loop
"Exit":quit
"Go to frame -2": Go the frame -2
"Go to frame +2": Go the frame +2
end case
else
case pNav2 of
"Go Next Frame":Go the frame + 1
"Go Previous Frame":Go the frame -1
"Go Next Marker": Go Next
"Go Previous Marker": Go previous
"Go Loop": Go Loop
"Exit":quit
"Go to frame -2": Go the frame -2
"Go to frame +2": Go the frame +2
end case
currentword = ""
end if
else
dontPassEvent
if the keyCode = 51 then
if currentWord.char.count > 1 then
howMany = (currentWord.char.count - 1)
currentWord = currentWord.char[1..howMany]
else
currentWord = ""
end if
else
if "1234567890abcdefghijklmnopqrstuvwxyz-. " contains the key then
currentWord = currentWord & the key
end if
end if
theText = ""
if currentWord.char.count > 0 then
repeat with x = 1 to currentWord.char.count
theText = currentword
end repeat
end if
sprite(spriteNum).member.text = currentword
end if
end
on getPropertyDescriptionList me
p_list = [:]
addProp p_list, #pAnswer, [#format :#string, #default :"Correct display",#comment :"Type your correct word"]
actionlist=["Go Next Frame","Go Previous Frame","Go Next Marker","Go Previous Marker","Go Loop","Exit","Go to frame -2", "Go to frame +2"]
addProp p_list, #pNav1, [#comment: "Where to go if correct?" ,#format:#String, #range:actionlist,#default:actionlist[8]]
addProp p_list, #pNav2, [#comment: "Where to go if wrong?" ,#format:#String,#range:actionlist,#default:actionlist[1]]
return p_list
end
|
|