Answer

Answers Answer (Media Link Entry)
Methods Supported:
  • GET – feed is read only

Filters supported:
  • QuestionID – ID of the associated Question

  • ResultID – ID of the associated Result

Expansions supported:
  • Question – expands the associated Question

  • Result – expands the associated Result

  • ScoringTask – expands the associated ScoringTask, due to a known issue this expansion will only return entities that are associated with a ScoringTask.

$orderby is not supported.

The Answers feed contains detailed information about the answers given by participants. Each question that a participant answers generates a unique record in this feed.

EntityType: Answer

Answer entities are drawn from A_Answer in the data model but contain only a subset of the properties. They are read only in OData.

The Answer entity is a media link entity. The value of an Answer entity (obtained by appending /$value to the entity’s URL) is the full answer given by the participant (for constructed response questions). See below for an example of how to obtain this.

Entity Key: QuestionID Edm.Int64 NOT NULL

The fulle ID of the question being answered, see A_Answer.Question_MID. for more information.

Entity Key: ResultID Edm.Int32 NOT NULL

The ID of the associated Result, see A_Answer.Result_ID.

Entity Key: BlockNumber Edm.Int16 NOT NULL

The sequence number of the block within the which the question was presented. See A_Answer.Block_Number.

Entity Key: Occurrence Edm.Int16 NOT NULL

See A_Answer.Occurrence.

QuestionNumber Edm.Int16 NOT NULL

The sequence number of the question presented within the block. See A_Answer.Question_Number.

TimesAnswered Edm.Int16 NOT NULL

See A_Answer.Times_Answered.

MaxScore Edm.Int32 NOT NULL

See A_Answer.Max_Score.

ActualScore Edm.Int32 NOT NULL

See A_Answer.Actual_Score.

AnswerTruncated Edm.String

See A_Answer.Answer_Truncated. A truncated representation of the answer given by the Participant. The format of this field varies depending on the type of the associated question.

New in version 2021.05.

Revision Edm.Int32

Reserved for future use.

Question Question

Navigation property to the single Question associated with this answer.

Result Result

Navigation property to the single Result associated with this answer.

ScoringTask ScoringTask

Navigation property to an optional ScoringTask associated with this answer. ScoringTasks are only associated with answers that require subjective marking.

AnswerAuditLogs AnswerAuditLog Collection

Navigation property to an audit log of changes to this answer record (e.g., with Scoring Editor).

New in version 2021.05.

EntityType: AnswerAuditLog

Changes to Answer records (other than those made by the participant during the assessment itself) are recorded in AnswerAuditLog entities.

New in version 2021.05.

Entity Key: ID Edm.Int32 NOT NULL

An internal ID for this log entity.

ResultID Edm.Int32 NOT NULL

The ResultID of the associated Result. Changes to the score given for an answer will result in corresponding changes to the result.

QuestionID Edm.Int64 NOT NULL

The QuestionID (used in the association with the corresponding Answer entity).

BlockNumber Edm.Int16 NOT NULL

The block number in which this answer was given (used in the association with the corresponding Answer entity).

Occurrence Edm.Int16 NOT NULL

Deprecated property used in the association with the corresponding Answer entity).

RevisionNumber Edm.Int32 NOT NULL

A revision number for ordering changes to the associated Answer.

AdministratorName Edm.String

The login name of the Administrator that made the change. This property is set to the name of the logged in user when changes are made through the user interface. Changes made through the API can provide any value for this field (e.g., the name of a user in a remote system integrated using this API).

ActualScoreOld Edm.Int32 NOT NULL

The original score awarded for the associated answer.

ActualScoreNew Edm.Int32 NOT NULL

The new score awarded for the associated answer.

AnswerFullOld Edm.String

The original Answer provided by the participant.

AnswerFullNew Edm.String

The updated Answer as if provided by the participant. These fields are provided for compatibility with the classic Score Editor tool only. The modification of participant-provided answers is deprecated.

Comment Edm.String

A comment describing the reason for the change.

TimeStampUtc Edm.DateTime NOT NULL

The UTC time and date of the change.

Answer Answer

Navigation property to the Answer entity affected by this change.

Reading the Participant’s Answer

The Answer entity is a media link entity with a corresponding media stream that contains the participant’s full answer. The stream is only available when the Question required a constructed response such as an Essay or File Upload question.

Here is an example:

<service root>/Results(634445534)/Answers?$expand=Question

{
    odata.metadata: "<service root>/$metadata#Answers",
    value: [
        {
            odata.mediaReadLink: "<service root>/Answers(QuestionID=5845494007544735L,ResultID=634445534,BlockNumber=1,Occurrence=1)/$value",
            odata.mediaContentType: "application/octet-stream",
            Question: {
                odata.mediaReadLink: "<service root>/Questions(5845494007544735L)/$value",
                odata.mediaContentType: "application/xml",
                ID: "5845494007544735",
                Revision: 2,
                Language: "-",
                Status: 0,
                Description: "Essay Question",
                Author: "Jane",
                Editor: "John",
                CreatedDateTime: "2016-05-20T09:29:05Z",
                ModifiedDateTime: "2016-05-20T10:53:44Z",
                QuestionType: "ESSAY "
            },
            QuestionID: "5845494007544735",
            ResultID: 634445534,
            BlockNumber: 1,
            Occurrence: 1,
            QuestionNumber: 1,
            TimesAnswered: 1,
            MaxScore: 10,
            ActualScore: 0
        },
        {
            odata.mediaReadLink: "<service root>/Answers(QuestionID=1712759025350437L,ResultID=634445534,BlockNumber=1,Occurrence=1)/$value",
            odata.mediaContentType: "application/octet-stream",
            Question: {
                odata.mediaReadLink: "<service root>/Questions(1712759025350437L)/$value",
                odata.mediaContentType: "application/xml",
                ID: "1712759025350437",
                Revision: 2,
                Language: "-",
                Status: 0,
                Description: "File Upload Question",
                Author: "Jane",
                Editor: "John",
                CreatedDateTime: "2016-05-20T09:59:28Z",
                ModifiedDateTime: "2016-05-20T10:53:45Z",
                QuestionType: "UPLOAD "
            },
            QuestionID: "1712759025350437",
            ResultID: 634445534,
            BlockNumber: 1,
            Occurrence: 1,
            QuestionNumber: 2,
            TimesAnswered: 1,
            MaxScore: 1,
            ActualScore: 0
        }
    ]
}

Notice the media links in each Answer entity, the Questions have been expanded to make it clearer. Question number 1 was an essay question and the media link provides the plain text typed by the candidate. Question number 2 is a file upload question and actually returns an image.

Warning

when returning Answer entities the content type encoded in the entity’s serialised representation is defaulted to application/octet-stream for performance reasons (as the data model does not contain this information).

To obtain the true content type you must issue a HEAD (or GET) request on the odata.mediaReadLink directly.

Here’s a sample HTTP session when retrieving the file uploaded by the participant:

<service root>/Answers(QuestionID=1712759025350437L,ResultID=634445534,BlockNumber=1,Occurrence=1)/$value

GET <service root>/Answers(QuestionID=1712759025350437L,ResultID=634445534,BlockNumber=1,Occurrence=1)/$value HTTP/1.1
Host: ondemand.questionmark.eu
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:47.0) Gecko/20100101 Firefox/47.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
DNT: 1
Referer: <service root>/Results(634445534)/Answers
Cookie: language=en
Connection: keep-alive
Authorization: Basic <security details removed!>

HTTP/1.1 200 OK
Cache-Control: no-cache
Pragma: no-cache
Transfer-Encoding: chunked
Content-Type: image/gif; name="070a2a779af97859f8a0c7342a4068b183db506108b90a660259ce58f964fcaf.gif"
Expires: -1
Accept-Ranges: bytes
Server: Microsoft-IIS/8.5
Content-Disposition: inline; filename="070a2a779af97859f8a0c7342a4068b183db506108b90a660259ce58f964fcaf.gif"
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Tue, 05 Jul 2016 10:56:52 GMT
Strict-Transport-Security: max-age=31536000; includeSubDomains

<GIF image data>