Search in sources :

Example 46 with FieldValue

use of uk.ac.ed.ph.jqtiplus.node.shared.FieldValue in project openolat by klemens.

the class AssessmentItemFactory method appendFloatValue.

private static void appendFloatValue(CorrectResponse correctResponse, double response) {
    FieldValue fieldValue = new FieldValue(correctResponse);
    FloatValue identifierValue = new FloatValue(response);
    fieldValue.setSingleValue(identifierValue);
    correctResponse.getFieldValues().add(fieldValue);
}
Also used : FieldValue(uk.ac.ed.ph.jqtiplus.node.shared.FieldValue) FloatValue(uk.ac.ed.ph.jqtiplus.value.FloatValue)

Example 47 with FieldValue

use of uk.ac.ed.ph.jqtiplus.node.shared.FieldValue in project openolat by klemens.

the class AssessmentItemFactory method appendStringValue.

private static void appendStringValue(CorrectResponse correctResponse, String response) {
    FieldValue fieldValue = new FieldValue(correctResponse);
    StringValue identifierValue = new StringValue(response);
    fieldValue.setSingleValue(identifierValue);
    correctResponse.getFieldValues().add(fieldValue);
}
Also used : FieldValue(uk.ac.ed.ph.jqtiplus.node.shared.FieldValue) StringValue(uk.ac.ed.ph.jqtiplus.value.StringValue)

Example 48 with FieldValue

use of uk.ac.ed.ph.jqtiplus.node.shared.FieldValue in project openolat by klemens.

the class AssessmentTestFactory method createOutcomeDeclaration.

public static OutcomeDeclaration createOutcomeDeclaration(AssessmentTest assessmentTest, Identifier identifier, Double defaultValue) {
    OutcomeDeclaration outcomeDeclaration = new OutcomeDeclaration(assessmentTest);
    outcomeDeclaration.setIdentifier(identifier);
    outcomeDeclaration.setCardinality(Cardinality.SINGLE);
    outcomeDeclaration.setBaseType(BaseType.FLOAT);
    DefaultValue defaultVal = new DefaultValue(outcomeDeclaration);
    outcomeDeclaration.setDefaultValue(defaultVal);
    FieldValue fieldValue = new FieldValue(defaultVal);
    FloatValue identifierValue = new FloatValue(defaultValue);
    fieldValue.setSingleValue(identifierValue);
    defaultVal.getFieldValues().add(fieldValue);
    return outcomeDeclaration;
}
Also used : DefaultValue(uk.ac.ed.ph.jqtiplus.node.shared.declaration.DefaultValue) FieldValue(uk.ac.ed.ph.jqtiplus.node.shared.FieldValue) FloatValue(uk.ac.ed.ph.jqtiplus.value.FloatValue) OutcomeDeclaration(uk.ac.ed.ph.jqtiplus.node.outcome.declaration.OutcomeDeclaration)

Aggregations

FieldValue (uk.ac.ed.ph.jqtiplus.node.shared.FieldValue)48 CorrectResponse (uk.ac.ed.ph.jqtiplus.node.item.CorrectResponse)24 DirectedPairValue (uk.ac.ed.ph.jqtiplus.value.DirectedPairValue)20 SingleValue (uk.ac.ed.ph.jqtiplus.value.SingleValue)20 ArrayList (java.util.ArrayList)16 ResponseDeclaration (uk.ac.ed.ph.jqtiplus.node.item.response.declaration.ResponseDeclaration)16 DefaultValue (uk.ac.ed.ph.jqtiplus.node.shared.declaration.DefaultValue)16 IdentifierValue (uk.ac.ed.ph.jqtiplus.value.IdentifierValue)16 OutcomeDeclaration (uk.ac.ed.ph.jqtiplus.node.outcome.declaration.OutcomeDeclaration)14 Identifier (uk.ac.ed.ph.jqtiplus.types.Identifier)14 FloatValue (uk.ac.ed.ph.jqtiplus.value.FloatValue)12 Value (uk.ac.ed.ph.jqtiplus.value.Value)12 IntegerValue (uk.ac.ed.ph.jqtiplus.value.IntegerValue)10 MultipleValue (uk.ac.ed.ph.jqtiplus.value.MultipleValue)10 OrderedValue (uk.ac.ed.ph.jqtiplus.value.OrderedValue)10 PairValue (uk.ac.ed.ph.jqtiplus.value.PairValue)10 PointValue (uk.ac.ed.ph.jqtiplus.value.PointValue)10 ComplexReferenceIdentifier (uk.ac.ed.ph.jqtiplus.types.ComplexReferenceIdentifier)8 Map (java.util.Map)4 BaseValue (uk.ac.ed.ph.jqtiplus.node.expression.general.BaseValue)4