Eye halve a spelling chequer

You may notice for fill in the blank type questions that spelling doesn’t really matter for the answers. This is all done behind the scenes by a fairly complex parser. Looking at the SRF, the data is all held in a list associated with the ‘Wrds’ resource

The content of the Wrds is a standard string list, split at null characters (byte =0), However, there are additional factors to take into account. The description is complex. The first byte of the whole file represents the total number of words in the answer (i.e. the number of times we need to check the spellings list to be sure everything is there in a typed answer). Thereafter, different properties are required for each string. The first string in an an entry has as its first byte the number of potential alternatives for a word, with the rest of the string being one of these alternatives.

After sorting this out, you can make direct comparisons – take each word in the typed answer and compare it to the list of alternatives for each entry – if you get a match for every one, job done!

Other ‘wrong answers’, the text field for typing in too early and the Secret Gibberish Response are just done as straight comparisons, so this isn’t used in those cases.

Eye halve a spelling chequer

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s