CS 1102: Lab 5

Lab Motivation and Goals

This lab is designed to have you write an interpreter for a portion of the tutoring system language from hwk 4.

Use Advanced Student or Pretty Big language level for this lab.


The starter file provides a data definition and examples of data for a portion of the tutoring system you worked with in hwk 4. Write an interpreter for this language that prompts the user with questions, records the answers, and reports scores as indicated in the exam examples. You will need to use Scheme I/O commands for this, such as printf (for output) and read (for input). Summaries of these are available here.

The interpreter should produce an interaction similar to the ones in the sample exams from homework 4 (minus the parts of the language that have been omitted, such as random messages, hints, and question categories). On a score-based conditional, call the function with the percentage of correct answers given so far.

Figuring out how to store the given answers and results is part of your task here. You may modify the original data definitions if you want, or use a separate data structure to hold the results. You might also pass a list of results so far as an extra argument to your function that processes a list of commands.

Once that's working ...

Extend the language and interpreter in some of the following ways (add whichever ones you find most interesting, in whatever order you choose):

  1. Use macros to improve the language. In particular, you might want to improve the score-based tests to eliminate the lambda by supporting a fixed set of comparisons, as in the following syntax:
      (if-percent-right (below 50) (list ---) (list ---))
    where above and between are also valid comparisons, each of which compares to the percentage right as in the original example. Be creative with this.

  2. Categories of questions, with status reports per category
  3. Multiple-choice questions
  4. Questions with hints