Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Design a class hierarchy used to represent test papers that would be given in sc

ID: 3560242 • Letter: D

Question

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 the question is worth for this particular test

difficulty

Range of difficulty ranging from 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 during a Test.

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 the question is worth for this particular test

difficulty

Range of difficulty ranging from 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 the question is worth for this particular test

difficulty

Range of difficulty ranging from 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 the question is worth for this particular test

difficulty

Range of difficulty ranging from 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?

and in an answer key, could look something like:

Who lives in a pineapple under the sea?

Test

Each test has:

questions

a list of questions of any or all of the types previously described.

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. We should also be able to send either of these to a file whose name is determined at runtime.

Extra Credit (+50 points)

Implement a TestBank class, which has:

Driver

Write a program that uses your classes in order to generate both a test and an answer key, writing each to the screen and to files chosen at runtime.

Explanation / Answer

contact on timacs12@gmail.com

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote