Forum

How to decode QTI 2.1 format TAO result XML file in json format ?

edited February 3 in Developers

Here is my tao QTI 2.1 standard result XML file:

<?xml version="1.0" encoding="UTF-8"?>
<assessmentResult xmlns="http://www.imsglobal.org/xsd/imsqti_result_v2p1">
    <context sourcedId="i15797669427993412"/>
    <testResult identifier="rdf#i15806468948013573" datestamp="2020-02-02T07:35:23.304">
        <outcomeVariable identifier="LtiOutcome" cardinality="single" baseType="float">
            <value>
                <![CDATA[0]]>
            </value>
        </outcomeVariable>
    </testResult>
    <itemResult identifier="item-2" datestamp="2020-02-02T07:35:12.912" sessionStatus="final">
        <responseVariable identifier="numAttempts" cardinality="single" baseType="integer">
            <candidateResponse>
                <value>
                    <![CDATA[1]]>
                </value>
            </candidateResponse>
        </responseVariable>
        <responseVariable identifier="duration" cardinality="single" baseType="duration">
            <candidateResponse>
                <value>
                    <![CDATA[PT14.880281S]]>
                </value>
            </candidateResponse>
        </responseVariable>
        <outcomeVariable identifier="completionStatus" cardinality="single" baseType="identifier">
            <value>
                <![CDATA[completed]]>
            </value>
        </outcomeVariable>
        <responseVariable identifier="RESPONSE" cardinality="single" baseType="file">
            <candidateResponse>
                <value>
                    <![CDATA[   ]]>
                </value>
            </candidateResponse>
        </responseVariable>
    </itemResult>
    <itemResult identifier="item-4" datestamp="2020-02-02T07:35:23.300" sessionStatus="final">
        <responseVariable identifier="numAttempts" cardinality="single" baseType="integer">
            <candidateResponse>
                <value>
                    <![CDATA[1]]>
                </value>
            </candidateResponse>
        </responseVariable>
        <responseVariable identifier="duration" cardinality="single" baseType="duration">
            <candidateResponse>
                <value>
                    <![CDATA[PT7.172761S]]>
                </value>
            </candidateResponse>
        </responseVariable>
        <outcomeVariable identifier="completionStatus" cardinality="single" baseType="identifier">
            <value>
                <![CDATA[completed]]>
            </value>
        </outcomeVariable>
        <outcomeVariable identifier="SCORE" cardinality="single" baseType="float">
            <value>
                <![CDATA[0]]>
            </value>
        </outcomeVariable>
        <responseVariable identifier="RESPONSE" cardinality="single" baseType="identifier">
            <candidateResponse>
                <value>
                    <![CDATA[D]]>
                </value>
            </candidateResponse>
        </responseVariable>
    </itemResult>
    <itemResult identifier="item-3" datestamp="2020-02-02T07:35:15.804" sessionStatus="final">
        <responseVariable identifier="numAttempts" cardinality="single" baseType="integer">
            <candidateResponse>
                <value>
                    <![CDATA[1]]>
                </value>
            </candidateResponse>
        </responseVariable>
        <responseVariable identifier="duration" cardinality="single" baseType="duration">
            <candidateResponse>
                <value>
                    <![CDATA[PT2.616635S]]>
                </value>
            </candidateResponse>
        </responseVariable>
        <outcomeVariable identifier="completionStatus" cardinality="single" baseType="identifier">
            <value>
                <![CDATA[completed]]>
            </value>
        </outcomeVariable>
        <outcomeVariable identifier="SCORE" cardinality="single" baseType="float">
            <value>
                <![CDATA[0]]>
            </value>
        </outcomeVariable>
        <responseVariable identifier="RESPONSE" cardinality="single" baseType="integer">
            <candidateResponse>
                <value>
                    <![CDATA[0]]>
                </value>
            </candidateResponse>
        </responseVariable>
    </itemResult>
</assessmentResult>

Now I want to convert this file in json format.But I can not understand how to do this.If any decoder please let me know.Thank you....

Comments

  • @cynclonmaster thanks for your response, i was able to get the json from the result xml from TAO Restful API in my angular app, Now what I want is to get the item name got from the result json as provided in my question.

    In TAO REST API we can request for item by id but it provides xml as file but i want it from my app. could you help me on how could i get the item information?

  • What are you trying to achieve? If you are trying to include TAO in another application have you looked at LTI?

Sign In or Register to comment.

We use cookies on our website to support technical features that enhance your user experience. Cookie Policy Privacy Policy

×