Search in sources :

Example 56 with ResponseDeclaration

use of uk.ac.ed.ph.jqtiplus.node.item.response.declaration.ResponseDeclaration in project openolat by klemens.

the class AssessmentItemFactory method createHintRequestResponseDeclaration.

// <responseDeclaration identifier="HINTREQUEST" cardinality="single" baseType="boolean"/>
public static ResponseDeclaration createHintRequestResponseDeclaration(AssessmentItem assessmentItem) {
    ResponseDeclaration responseDeclaration = new ResponseDeclaration(assessmentItem);
    responseDeclaration.setIdentifier(QTI21Constants.HINT_REQUEST_IDENTIFIER);
    responseDeclaration.setCardinality(Cardinality.SINGLE);
    responseDeclaration.setBaseType(BaseType.BOOLEAN);
    return responseDeclaration;
}
Also used : ResponseDeclaration(uk.ac.ed.ph.jqtiplus.node.item.response.declaration.ResponseDeclaration)

Example 57 with ResponseDeclaration

use of uk.ac.ed.ph.jqtiplus.node.item.response.declaration.ResponseDeclaration in project openolat by klemens.

the class AssessmentItemFactory method createSingleChoiceCorrectResponseDeclaration.

public static ResponseDeclaration createSingleChoiceCorrectResponseDeclaration(AssessmentItem assessmentItem, Identifier declarationId, Identifier correctResponseId) {
    ResponseDeclaration responseDeclaration = new ResponseDeclaration(assessmentItem);
    responseDeclaration.setIdentifier(declarationId);
    responseDeclaration.setCardinality(Cardinality.SINGLE);
    responseDeclaration.setBaseType(BaseType.IDENTIFIER);
    CorrectResponse correctResponse = new CorrectResponse(responseDeclaration);
    responseDeclaration.setCorrectResponse(correctResponse);
    appendIdentifierValue(correctResponse, correctResponseId);
    return responseDeclaration;
}
Also used : CorrectResponse(uk.ac.ed.ph.jqtiplus.node.item.CorrectResponse) ResponseDeclaration(uk.ac.ed.ph.jqtiplus.node.item.response.declaration.ResponseDeclaration)

Example 58 with ResponseDeclaration

use of uk.ac.ed.ph.jqtiplus.node.item.response.declaration.ResponseDeclaration in project openolat by klemens.

the class AssessmentItemFactory method createUploadResponseDeclaration.

public static ResponseDeclaration createUploadResponseDeclaration(AssessmentItem assessmentItem, Identifier declarationId) {
    ResponseDeclaration responseDeclaration = new ResponseDeclaration(assessmentItem);
    responseDeclaration.setIdentifier(declarationId);
    responseDeclaration.setCardinality(Cardinality.SINGLE);
    responseDeclaration.setBaseType(BaseType.FILE);
    return responseDeclaration;
}
Also used : ResponseDeclaration(uk.ac.ed.ph.jqtiplus.node.item.response.declaration.ResponseDeclaration)

Example 59 with ResponseDeclaration

use of uk.ac.ed.ph.jqtiplus.node.item.response.declaration.ResponseDeclaration in project openolat by klemens.

the class DrawingAssessmentItemBuilder method createAssessmentItem.

private static AssessmentItem createAssessmentItem(String title) {
    AssessmentItem assessmentItem = AssessmentItemFactory.createAssessmentItem(QTI21QuestionType.drawing, title);
    // define the response
    Identifier responseDeclarationId = Identifier.assumedLegal("RESPONSE_1");
    ResponseDeclaration responseDeclaration = createDrawingResponseDeclaration(assessmentItem, responseDeclarationId);
    assessmentItem.getNodeGroups().getResponseDeclarationGroup().getResponseDeclarations().add(responseDeclaration);
    // outcomes
    appendDefaultOutcomeDeclarations(assessmentItem, 1.0d);
    ItemBody itemBody = appendDefaultItemBody(assessmentItem);
    appendDrawingInteraction(itemBody, responseDeclarationId);
    // response processing
    ResponseProcessing responseProcessing = createResponseProcessing(assessmentItem, responseDeclarationId);
    assessmentItem.getNodeGroups().getResponseProcessingGroup().setResponseProcessing(responseProcessing);
    return assessmentItem;
}
Also used : Identifier(uk.ac.ed.ph.jqtiplus.types.Identifier) ItemBody(uk.ac.ed.ph.jqtiplus.node.content.ItemBody) AssessmentItemFactory.appendDefaultItemBody(org.olat.ims.qti21.model.xml.AssessmentItemFactory.appendDefaultItemBody) AssessmentItem(uk.ac.ed.ph.jqtiplus.node.item.AssessmentItem) ResponseProcessing(uk.ac.ed.ph.jqtiplus.node.item.response.processing.ResponseProcessing) AssessmentItemFactory.createResponseProcessing(org.olat.ims.qti21.model.xml.AssessmentItemFactory.createResponseProcessing) ResponseDeclaration(uk.ac.ed.ph.jqtiplus.node.item.response.declaration.ResponseDeclaration) AssessmentItemFactory.createDrawingResponseDeclaration(org.olat.ims.qti21.model.xml.AssessmentItemFactory.createDrawingResponseDeclaration)

Example 60 with ResponseDeclaration

use of uk.ac.ed.ph.jqtiplus.node.item.response.declaration.ResponseDeclaration in project openolat by klemens.

the class EssayAssessmentItemBuilder method buildResponseAndOutcomeDeclarations.

@Override
protected void buildResponseAndOutcomeDeclarations() {
    ResponseDeclaration responseDeclaration = createExtendedTextResponseDeclaration(assessmentItem, responseIdentifier);
    assessmentItem.getResponseDeclarations().add(responseDeclaration);
}
Also used : ResponseDeclaration(uk.ac.ed.ph.jqtiplus.node.item.response.declaration.ResponseDeclaration) AssessmentItemFactory.createExtendedTextResponseDeclaration(org.olat.ims.qti21.model.xml.AssessmentItemFactory.createExtendedTextResponseDeclaration)

Aggregations

ResponseDeclaration (uk.ac.ed.ph.jqtiplus.node.item.response.declaration.ResponseDeclaration)132 Identifier (uk.ac.ed.ph.jqtiplus.types.Identifier)54 CorrectResponse (uk.ac.ed.ph.jqtiplus.node.item.CorrectResponse)40 ComplexReferenceIdentifier (uk.ac.ed.ph.jqtiplus.types.ComplexReferenceIdentifier)36 AssessmentItem (uk.ac.ed.ph.jqtiplus.node.item.AssessmentItem)28 SingleValue (uk.ac.ed.ph.jqtiplus.value.SingleValue)28 ResponseProcessing (uk.ac.ed.ph.jqtiplus.node.item.response.processing.ResponseProcessing)24 IdentifierValue (uk.ac.ed.ph.jqtiplus.value.IdentifierValue)24 ArrayList (java.util.ArrayList)22 ItemBody (uk.ac.ed.ph.jqtiplus.node.content.ItemBody)22 DirectedPairValue (uk.ac.ed.ph.jqtiplus.value.DirectedPairValue)22 AssessmentItemFactory.appendDefaultItemBody (org.olat.ims.qti21.model.xml.AssessmentItemFactory.appendDefaultItemBody)20 AssessmentItemFactory.createResponseProcessing (org.olat.ims.qti21.model.xml.AssessmentItemFactory.createResponseProcessing)20 FieldValue (uk.ac.ed.ph.jqtiplus.node.shared.FieldValue)18 Value (uk.ac.ed.ph.jqtiplus.value.Value)16 ChoiceInteraction (uk.ac.ed.ph.jqtiplus.node.item.interaction.ChoiceInteraction)14 HashMap (java.util.HashMap)12 MapEntry (uk.ac.ed.ph.jqtiplus.node.item.response.declaration.MapEntry)12 MultipleValue (uk.ac.ed.ph.jqtiplus.value.MultipleValue)12 IntegerValue (uk.ac.ed.ph.jqtiplus.value.IntegerValue)10