[comp.sys.mac.hypercard] "HC Stack locking help request"

fugitt@eos.UUCP (Katherine Fugitt) (08/21/90)

I am building a tutorial and a quiz to be taken immedeately after 
finishing the tutorial as two seperate stacks in HyperCard.  I'd
like to be able to lock the students out of the quiz until they have
finished the tutorial and lock them out of the tutorial once they start
the quiz.  Is there a way to do this using only HyperTalk?  Can a 
"on openStack" script check another stack to see if a flag has been
set?

Thanks for any help...

-- 
Katherine Fugitt
fugitt@eos.arc.nasa.gov  (or)....!ames!eos!fugitt
Everyone's entitled to their own stupid opinion! :-) :-) :-) :-) :-)

bc@Apple.COM (bill coderre) (08/22/90)

In article <7064@eos.UUCP> fugitt@eos.UUCP (Katherine Fugitt) writes:
|I am building a tutorial and a quiz to be taken immedeately after 
|finishing the tutorial as two seperate stacks in HyperCard.  I'd
|like to be able to lock the students out of the quiz until they have
|finished the tutorial and lock them out of the tutorial once they start
|the quiz.  Is there a way to do this using only HyperTalk?  Can a 
|"on openStack" script check another stack to see if a flag has been
|set?

Well, let's forget any notions of "foolproofness" here, and just talk
about relatively safe methods that most users won't feel like
circumventing.

The simplest way to store state across Hypercard sessions (which wipe
global variables) is to put the info in a text file. All versions of
Hypercard have pretty good handling of text files, and it is very well
documented, so I won't bother to go into it here.

If the idea of a separate file bugs you, you might want to write a
non-portable, slightly hackish script that:
	locks the screen
	goes to a certain card in each other stack
and	puts appropriate state into a card field or something

Another approach to this plan might be to write a function that:
	retrieves a "last completed" time from another stack
		in a way similar to above
and	if this stack's "last completed" time is older,
		opens the stack
	else complains.

Note that globals are preserved for the lifetime of a Hypercard
session, so that might be enough for you. When the tutorial finishes,
it sets a global. If the other stack on open doesn't see the global,
it complains.

Obviously, none of these methods is entirely secure or reliable. What
happens, for example, when the external file gets "accidentally"
deleted? Or when somebody starts nosing around on cards?

Well, it's possible to use some form of encryption, but probably
unnecessary, especially since there will be cases of honest people
messing things up, and also it's probably not a good idea to lock
users out entirely until a hacker can repair the damage.

I'd opt for the simplest method that works, and realize that someone
somewhere is gonna go around it.

bc
hypercard hacker consultant to several major companies