use of org.olat.ims.qti21.ui.components.AssessmentRenderFunctions.getResponseValue in project OpenOLAT by OpenOLAT.
the class AssessmentObjectComponentRenderer method renderExtendedTextBox.
protected void renderExtendedTextBox(AssessmentRenderer renderer, StringOutput sb, AssessmentObjectComponent component, AssessmentItem assessmentItem, ItemSessionState itemSessionState, ExtendedTextInteraction interaction) {
ResponseData responseInput = getResponseInput(itemSessionState, interaction.getResponseIdentifier());
ResponseDeclaration responseDeclaration = getResponseDeclaration(assessmentItem, interaction.getResponseIdentifier());
Cardinality cardinality = responseDeclaration == null ? null : responseDeclaration.getCardinality();
if (cardinality != null && (cardinality.isRecord() || cardinality.isSingle())) {
String responseInputString = extractSingleCardinalityResponseInput(responseInput);
renderExtendedTextBox(renderer, sb, component, assessmentItem, itemSessionState, interaction, responseInputString);
} else {
if (interaction.getMaxStrings() != null) {
int maxStrings = interaction.getMaxStrings().intValue();
for (int i = 0; i < maxStrings; i++) {
String responseInputString = extractResponseInputAt(responseInput, i);
renderExtendedTextBox(renderer, sb, component, assessmentItem, itemSessionState, interaction, responseInputString);
}
} else {
// <xsl:with-param name="stringsCount" select="if (exists($responseValue)) then max(($minStrings, qw:get-cardinality-size($responseValue))) else $minStrings"/>
int stringCounts = interaction.getMinStrings();
Value responseValue = AssessmentRenderFunctions.getResponseValue(assessmentItem, itemSessionState, interaction.getResponseIdentifier(), renderer.isSolutionMode());
if (exists(responseValue)) {
stringCounts = java.lang.Math.max(interaction.getMinStrings(), getCardinalitySize(responseValue));
}
for (int i = 0; i < stringCounts; i++) {
String responseInputString = extractResponseInputAt(responseInput, i);
renderExtendedTextBox(renderer, sb, component, assessmentItem, itemSessionState, interaction, responseInputString);
}
}
}
}
use of org.olat.ims.qti21.ui.components.AssessmentRenderFunctions.getResponseValue in project openolat by klemens.
the class AssessmentObjectComponentRenderer method renderExtendedTextBox.
protected void renderExtendedTextBox(AssessmentRenderer renderer, StringOutput sb, AssessmentObjectComponent component, AssessmentItem assessmentItem, ItemSessionState itemSessionState, ExtendedTextInteraction interaction) {
ResponseData responseInput = getResponseInput(itemSessionState, interaction.getResponseIdentifier());
ResponseDeclaration responseDeclaration = getResponseDeclaration(assessmentItem, interaction.getResponseIdentifier());
Cardinality cardinality = responseDeclaration == null ? null : responseDeclaration.getCardinality();
if (cardinality != null && (cardinality.isRecord() || cardinality.isSingle())) {
String responseInputString = extractSingleCardinalityResponseInput(responseInput);
renderExtendedTextBox(renderer, sb, component, assessmentItem, itemSessionState, interaction, responseInputString);
} else {
if (interaction.getMaxStrings() != null) {
int maxStrings = interaction.getMaxStrings().intValue();
for (int i = 0; i < maxStrings; i++) {
String responseInputString = extractResponseInputAt(responseInput, i);
renderExtendedTextBox(renderer, sb, component, assessmentItem, itemSessionState, interaction, responseInputString);
}
} else {
// <xsl:with-param name="stringsCount" select="if (exists($responseValue)) then max(($minStrings, qw:get-cardinality-size($responseValue))) else $minStrings"/>
int stringCounts = interaction.getMinStrings();
Value responseValue = AssessmentRenderFunctions.getResponseValue(assessmentItem, itemSessionState, interaction.getResponseIdentifier(), renderer.isSolutionMode());
if (exists(responseValue)) {
stringCounts = java.lang.Math.max(interaction.getMinStrings(), getCardinalitySize(responseValue));
}
for (int i = 0; i < stringCounts; i++) {
String responseInputString = extractResponseInputAt(responseInput, i);
renderExtendedTextBox(renderer, sb, component, assessmentItem, itemSessionState, interaction, responseInputString);
}
}
}
}
Aggregations