Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help with the following in Java description Design a class hierarchy used to represent test papers that would be given in school. It

I need help with the following in Java

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 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.

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.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Big Data And Hadoop Fundamentals Tools And Techniques For Data Driven Success

Authors: Mayank Bhushan

2nd Edition

9355516665, 978-9355516664

More Books

Students also viewed these Databases questions

Question

5. Explain how it recruits and selects expatriate employees.

Answered: 1 week ago

Question

Have you ever been arrested for a crime?

Answered: 1 week ago