toolness / weather-outfit-fun

Learn to code by making an app that shows you an outfit to wear based on the weather forecast.
http://toolness.github.io/weather-outfit-fun/tutorial/
1 stars 5 forks source link

[WIP] Tell users about incomplete challenge prerequisites. #32

Open toolness opened 9 years ago

toolness commented 9 years ago

This pull request tells users about incomplete challenge prerequisites.

The primary use case for this is to make sure that the user does the very first challenge, which instructs them to add the main <script> tag, before any others; this particular one is very important, because without it, we can't actually detect if they've completed anything.

However, we can also use this mechanism to ensure the user has acquired any necessary knowledge/concepts before going down a particular path, too.

With this addition, if the prerequisites of a challenge aren't satisfied, the following is shown instead of the "waiting for you to complete this challenge" message:

capture

Note that there are a few wrinkles with this right now: if the user's code momentarily doesn't parse due to a very temporary syntax error (e.g. because the user is in the middle of typing something) then a prerequisite may register as being incomplete, which could derail the user's focus as their tutorial pane suddenly tells them that something they've already done isn't finished.