Language Design Exercise: An Automated Testing Service You are designing a software system for giving computer-based exams. We want to define a language for describing exams and provide an interpreter that will administer exams in that language through a text interface. Since this is an automated testing system, we want to provide features such as skipping questions (if a student is doing well on a topic) or printing progress reports (such as what percentage of questions answered correctly) during the exam. The language we design would be used by a teacher to write down an exam that the interpreter would then give to a student. The teacher specifies (in the program) which questions to ask, when to skip questions based on past results, when to print summaries of a student's progress, and when to print other messages to the student. Your system (interpreter) "runs" this program to administer the exam to a student. To help you get started, some sample interactions with the exam system are provided below. Your exam system should be able to capture/administer both of these exams. Review session students will work on the language design with Ethan on Thursday and on the interpreter in class (with Kathi) on Friday. Students who have stayed in Perrault will sketch out both parts of this assignment during lecture on Friday. ------------------------------------------------------------------------------ Sample Exams Here are sample sessions from giving two exams that a teacher might want to program using your (one) language. A WPI history exam > (give-exam wpi-history) When was WPI founded? Ans: 1900 Let's see if you know your WPI personalities. What is Gompei? Ans [type hint for a hint]: hint Think bleating Ans: goat Who was the first president of WPI?: (1) Boynton (2) Washburn (3) Thompson Ans: 1 You got 50% of the personalities questions right Name one of the two towers behind a WPI education Ans: boynton You got 25% of the questions right There's more WPI history on the web. And life. ================================================================ A Math exam Two different students took the same math exam. The following two examples show the students' interactions with the exam program. Your language should be sufficient to create one exam that could yield these two different interactions based on students' answers. Student #1 > (give-exam math-exam) What is 3*4+2? Ans: 14 What is 2+3*4? Ans: 20 What is 5+2*6? Ans: 42 You seem to be having trouble with order of operations. Do the multiplication first. What is 3+5*2? Ans: 13 What is the reduced form of 12/18?: (1) 6/9 (2) 1/1.5 (3) 2/3 Ans: 3 What is 8+3*2? Ans: 11 You got 40% of the arithmetic problems right You got 100% of the fractions problems right Student #2 > (give-exam math-exam) What is 3*4+2? Ans: 14 What is 2+3*4? Ans: 14 What is 5+2*6? Ans: 19 What is the reduced form of 12/18?: (1) 6/9 (2) 1/1.5 (3) 2/3 Ans: 3 What is 1/4 + 1/2?: (1) 3/4 (2) 1/6 (3) 2/6 Ans: 1 You got 66% of the arithmetic problems right You got 100% of the fractions problems right