CIS 1068 Assignment 10
Test Papers Assignment

Posted: Sunday, November 17

Due: Monday, December 9 (hard deadline)

80 points

Because it's the end of the semester and there's a deadline for turning in semester grades, absolutely no late submissions can be accepted for credit (even with late penalty). This assignment will be good practice for the exam, so it's highly recommended that you complete it.

description

Design a class hierarchy used to represent test papers that would be given in school. It should include at least the following:

Question

Each question has:

points
Number of points earned for answering the question correctly.
difficulty
Range of difficulty ranging from the constants MIN_DIFFICULTY to MAX_DIFFICULTY.
answerSpace
Amount of space that should be left on the paper so that the test taker can fill in the answer. This can be represented as the number of lines on the page.
questionText
The text of the question, e.g., "How much wood would a woodchuck chuck if a woodchuck could chuck wood?"

For each question, we should be able to create a String representation of the question as it should be presented to the student (for example, during a test or quiz).

ObjectiveQuestion

An ObjectiveQuestion is a type of question which has a definitive answer. For example, the question 2+3 has the answer 5. (A non-objective question would be one where there's no single correct answer, e.g., something like, "The Civil War was neither civil nor a war. Discuss.".)

Each ObjectiveQuestion has:

points
Number of points earned for answering the question correctly.
difficulty
Range of difficulty ranging from the constants MIN_DIFFICULTY to MAX_DIFFICULTY.
answerSpace
Amount of space that should be left on the paper so that the test taker can fill in the answer. This can be represented as the number of lines on the page.
questionText
The text of the question, e.g., "How much wood would a woodchuck chuck if a woodchuck could chuck wood?"
correctAnswer
The correct answer to the question.

For each ObjectiveQuestion, we should be able to create a String representation of the question as it should be presented to the student during a Test. We should also be able to create a String representation of the question which includes the correct answer, such as one that a grader might use when grading a paper.

FillInTheBlankQuestion

A fill in the blank question is a kind of question where the correct answer fills in a missing word in the provided text. For example. " _____ was the 16th US President."

Each FillInTheBlankQuestion has:

points
Number of points earned for answering the question correctly.
difficulty
Range of difficulty ranging from the constants MIN_DIFFICULTY to MAX_DIFFICULTY.
answerSpace
Amount of space that should be left on the paper so that the test taker can fill in the answer. This can be represented as the number of lines on the page.
questionText
The text of the question, e.g., "How much wood would a woodchuck chuck if a woodchuck could chuck wood?"
correctAnswer
The correct answer to the question.

For each FillInTheBlankQuestion, we should be able to create a String representation of the question as it should be presented to the student during a Test. This should include the blank space. We should also be able to create a String representation of the question which includes the correct answer, such as one that a grader might use when grading a paper.

In a test representation, this might look something like:

______ was the 16th US President.

and in an answer key representation, it might look something like:

___Abraham Lincoln___ was the 16th US President.

MultipleChoiceQuestion

A MultipleChoiceQuestion is a kind of question in which there are multiple possible solutions but only one correct solution.

Each MultipleChoiceQuestion has:

points
Number of points earned for answering the question correctly.
difficulty
Range of difficulty ranging from the constants MIN_DIFFICULTY to MAX_DIFFICULTY.
answerSpace
Amount of space that should be left on the paper so that the test taker can fill in the answer. This can be represented as the number of lines on the page. MultipleChoiceQuestions can be answered in only one line.
questionText
The text of the question, e.g., "How much wood would a woodchuck chuck if a woodchuck could chuck wood?"
possibleAnswers
A list of possible answers, only one of which is correct.
correctAnswer
The correct answer among the possibleAnswers.

For each MultipleChoiceQuestion, we should be able to create a String representation of the question as it should be presented to the student during a Test. We should also be able to create a String representation of the question which includes the correct answer, such as one that a grader might use when grading a paper.

In a test representation, this might look something like:

Who lives in a pineapple under the sea?

  1. Peter Griffin
  2. Scooby Doo
  3. Spongebob Squarepants
  4. Eric Cartman

and in an answer key, could look something like:

Who lives in a pineapple under the sea?

  1. Peter Griffin
  2. Scooby Doo
  3. **** Spongebob Squarepants ****
  4. Eric Cartman

Test

Each test has:

questions
a single list of objective questions of any or all of the types previously described. Note: there should be one single collection of objective questions. They should not be partitioned by subtype into separate groups.
totalPoints
the sum of the points of each question

We should be able to generate a String representation of a Test as well as its answer key.

Driver

Write a program that uses your classes in order to generate both a test and an answer key, writing each to the screen. You're not expected to create an interactive, online testing program. You just need to print the test and its answer key.

Extra Credit

Send to a File (+5 points)

Add the ability to send a test and its answer key to files whose names are determined at run time.

Test Bank (+10 points)

Implement a TestBank class, which has:

What to submit

Submit all of your .java files through Canvas, and if you've completed the extra credit part of the assignment, please also provide your example input files.

It's a good idea to confirm through the Canvas submission page that what you've intended to submit was uploaded. We will grade what you submit. If you submit a corrupted, empty, or otherwise incorrect file, this is what we'll grade. It is your responsibility to verify through the Canvas submission page that you've submitted the correct files and that they were uploaded properly.

Here's a Canvas tutorial on how to submit files.