Suppose you're working on a programming course. You're introducing functions. You make a couple of worked examples, one without a function, and one with.
After students have seen the example, you want students to think about what they've seen. You want them to stop reading at this point.
Wait, what? You want them to stop reading?
Yes, stop. You want to switch their attention to a somewhat different task: evaluate what they've read. Connect it to other things.
Here's what an author might type in the Skilling editor, to set this up:
The validation code calls the function, and passes it an error message. Like this:
showError("Sorry, the count must be a number.");
The validation code doesn't have to know _how_ @showError()@ shows the message. Could be a simple @alert()@, or a fancy popup.
internal_name = error_message_function
The second example used a function to show errors to the user.
How would you compare that to the first example?
Let's check out another example. Then you get to do an exercise.
You can see the reflect tag in the middle. It includes a question or statement you want students to think about. Having a good question is important. Something like "Summarize the last four paragraphs" won't prompt as much deep thinking as "What do that last two examples have in common?"
Here's what the reflect tag shows students:
There's nothing below the Continue button. The rest of the page is missing.
Oh, I get it! There's nothing new to read. There's only the question, and a text box.
Right! Nothing to distract attention.
Students type into the text box, like this:
The text is saved automatically. That little blue thing on the right shows when the browser is sending data to the server.
When the user hits the Continue button, the rest of the page shows.