Just to add to Sturgis post.
It is indeed confusing. A global variable is accessible from every open stack. It has to be declared either on top of the script that has handler that use the global variable or inside a handler as a global variable. The declaration is
global gGlobalVariable
where the prepended g is just a convention to mark this as a global variable. It is not necessary to prepend the variable, it can be any non-reserved name. But it is highly recommended to have such a naming convention. Global variables, once declared and filled persist until you quit LiveCode or your app.
Then there are so called "script local variables"
Those are declared at the top of a script and are accessible from every handler in that script. The script local variables persist between runs of different handlers of that script until you close the stack or edit the script.
The declaration is:
local sLocalVariable
where s is prepended again just as a convenient way to mark script local variables.
Then there are so called "local variables". You don't have to declare them and and they "live" only in the handler where they are used and only as long as the handler runs.
e.g.
put "abc" into tVariableName
t is prepended, you guessed it, as a way to mark local variables and is optional.
So what probably happened here is they wanted to use global variables but since all the code is in the card script a script local variable would just work as well and decided to use script local variables but forgot to rename the variables...
My take on gobal variables is that I tend to avoid them and use script local variables or custom properties instead. Global variables can be changed by any script in any stack currently open. While at first that seems quite handy it turns out it can be difficult which script accesses/changes a global variable. Especially if you use the same names for global variables in different stacks for different thing, e.g. gDate
I hope Sturgis and I could help to clarify this "test" Runrev has put up to test whether people actually read the scripts or just copy them

But seriously, you should post a comment to the lesson and ask them to make the code consistent.
Kind regards
Bernd