Suppose I want to design an XML file that encodes exam quest

Suppose I want to design an XML file that encodes exam questions and their answers. There are four types of exam questions: 1) true/false, 2) multiple choice, 3) essay, and 4) matching. The questions have the following information associated with them:

- true/false questions have a question statement and the answer.

- multiple choice questions have a question, some number of choices, and the correct answer.

- essay questions have a general statement, and then one or more parts, each of which consists of a question and an answer. Finally an essay question may have an optional hint.

- matching questions have one or more potential answers, one or more statements that are to be matched with the answers, and an answer key that contains statement-answer pairs (i.e., each pair has two parts, a statement and the correct matched answer for that statement).

Additionally each question contains the number of points that it is worth (the parts of an essay question do not have point values associated with them--only the overall question does).

Your solution should show me the hierarchy of element tags you will use. Place an asterisk (*), plus (+), or question mark (?) next to an element if it can occur 0 or more times, 1 or more times, or 0/1 times respectively. If you require one of two elements or sets of elements, you can write <element1> | <element2> and use the following syntax:

<element1>

...

|

<element2>

...

Hints:

Formatting, such as horizontal rules and question numbers/letters, should not be part of your structure.

Only use attributes if you want points deducted.

Here is a sample specification for the address book example presented in class:

Do not worry about the types of the data contained in the elements (e.g., integer, string, etc.). All I care about is the way you structure your data.

Things you might want to think about:

What appear to be the major parts of the exam? The major parts might serve as tags.

Do the questions seem to fall into certain types of categories? The categories might serve as tags.

Do the questions seem to share some parts in common? How could you cleanly handle the fact that questions share some parts in common and have some differences?

Solution

question
   type
   statement*
   hint?
   question*
       choices*
       answer
       points?
   |
   possible matching answers?
   answer key*
       statement-answer pair+
           points?
   points?

Both multiple choice and true/false have question statement in common. Essay questions also have questions and corresponding answers. Only the structure of matching questions is different. Also, except essay questions, every type has points associated with each question.

Suppose I want to design an XML file that encodes exam questions and their answers. There are four types of exam questions: 1) true/false, 2) multiple choice, 3
Suppose I want to design an XML file that encodes exam questions and their answers. There are four types of exam questions: 1) true/false, 2) multiple choice, 3

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site