GetQuestionCorrectAnswer
This method returns the correct answer of a question. The method can also be used to return the correct answer for a specific question revision as recorded in the repository. If no revision is identified in the input parameters when this method is called the latest revision is returned automatically. This method also only returns a correct answer if the question has a maximum score greater than 0.
The table below provides details behind the logic used in this method to find the correct answers and the question types it is compatible with.
Question type | Logic used | Example of returned data |
---|---|---|
Knowledge Matrix |
A correct answer is reported only if each outcome that scores 1 point or greater references one choice matching one option |
<Answer>France: Paris, Germany: Berlin, US: New York, UK: London, Spain: Madrid</Answer> <Outcome>0, 1, 3, 4</Outcome> |
Matching |
A correct answer is reported only if each outcome that scores 1 point or greater references one choice matching one option |
<Answer>France = Paris, UK = London, Germany = Berlin, US = Washington</Answer> <Outcome>right</Outcome> |
Multiple Choice |
A correct answer is only reported if all outcomes that are scored achieve 1 point or greater and reference a single choice |
<Answer>Delhi</Answer> <Outcome>1 Delhi</Outcome> |
Multiple Response |
A correct answer is only reported if all outcomes that are scored 1 point or greater reference a single choice to be selected or a series of choices with AND |
<Answer>a. psychoanalysis</Answer> <Outcome>0 a. psychoanalysis </Outcome> |
Numeric |
A correct answer is reported only if there is only one choice, there is one outcome that scores highest and it has a single condition of a choice matching a number (not within range) |
<Answer>30.0</Answer> <Outcome>right</Outcome> |
Pull-down List |
A correct answer is reported only if each outcome that scores 1 point or greater references one choice matching one option |
<Answer>Chandighar: Haryana, Mumbai: Maharastra, Bangalore: Karnataka, Hyderabad: Andhra Pradesh</Answer> <Outcome>0, 2, 3, 4</Outcome> |
Select a Blank |
A correct answer is reported only if there is only one outcome scoring 1 point or more. |
<Answer>The capital of Canada is Ottawa</Answer> <Outcome>right</Outcome> |
True/False |
A correct answer is only reported if all outcomes that are scored achieve 1 point or greater and reference a single choice |
<Answer>True</Answer> <Outcome>0 True</Outcome> |
Yes/No |
A correct answer is only reported if all outcomes that are scored achieve 1 point or greater and reference a single choice |
<Answer>Yes</Answer> <Outcome>0 Yes</Outcome> |
If a Question_ID or a revision number is not valid or correctly entered an error message is returned. Using this method against any of the following question types will also return an error message:
- Adobe Flash
- Adobe Captivate
- Drag & Drop
- Hotspot
- Essay
- Explanation
- File upload
- Fill in the Blanks
- Likert Scale
- Ranking
- Spoken Response
- Survey Matrix
- Text Match
A SOAP fault will be returned if a database error occurs.
Parameters
Input name | Description | Data type | Optional field? |
---|---|---|---|
Question_ID |
The unique question ID of a question |
String |
N |
Revision |
The revision version of the question you would like to retrieve the answer for (if no revision parameters are supplied the latest revision is automatically retrieved) |
Integer |
Y |
Response
Output name | Description | Data type |
---|---|---|
Answer |
The correct answer for the question specified in Question_ID |
String |
Outcome |
The outcome that identifies the correct answer/answers as stored in the Perception repository |
String |
Troubleshooting
Please refer to the following page for any error codes that are displayed when using this method.