use of org.olat.ims.qti21.model.xml.interactions.SimpleChoiceAssessmentItemBuilder in project OpenOLAT by OpenOLAT.
the class CSVToAssessmentItemConverter method processChoice_smc.
private void processChoice_smc(String[] parts, SimpleChoiceAssessmentItemBuilder choiceBuilder) {
double point = parseFloat(parts[0], 1.0f);
String content = parts[1];
ChoiceInteraction interaction = choiceBuilder.getChoiceInteraction();
SimpleChoice newChoice = AssessmentItemFactory.createSimpleChoice(interaction, content, choiceBuilder.getQuestionType().getPrefix());
choiceBuilder.addSimpleChoice(newChoice);
choiceBuilder.setMapping(newChoice.getIdentifier(), point);
if (point > 0.0) {
if (choiceBuilder instanceof MultipleChoiceAssessmentItemBuilder) {
((MultipleChoiceAssessmentItemBuilder) choiceBuilder).addCorrectAnswer(newChoice.getIdentifier());
} else {
((SingleChoiceAssessmentItemBuilder) choiceBuilder).setCorrectAnswer(newChoice.getIdentifier());
}
}
}
use of org.olat.ims.qti21.model.xml.interactions.SimpleChoiceAssessmentItemBuilder in project OpenOLAT by OpenOLAT.
the class CSVToAssessmentItemConverter method processPoints.
private void processPoints(String[] parts) {
if (currentItem == null)
return;
double points = parseFloat(parts[1], 1.0f);
AssessmentItemBuilder itemBuilder = currentItem.getItemBuilder();
if (itemBuilder instanceof SimpleChoiceAssessmentItemBuilder) {
itemBuilder.setMinScore(0.0d);
itemBuilder.setMaxScore(points);
} else if (itemBuilder instanceof FIBAssessmentItemBuilder) {
itemBuilder.setMinScore(0.0d);
itemBuilder.setMaxScore(points);
} else if (itemBuilder instanceof KPrimAssessmentItemBuilder) {
itemBuilder.setMinScore(0.0d);
itemBuilder.setMaxScore(points);
} else if (itemBuilder instanceof MatchAssessmentItemBuilder) {
itemBuilder.setMinScore(0.0d);
itemBuilder.setMaxScore(points);
}
}
use of org.olat.ims.qti21.model.xml.interactions.SimpleChoiceAssessmentItemBuilder in project openolat by klemens.
the class CSVToAssessmentItemConverter method processChoice_smc.
private void processChoice_smc(String[] parts, SimpleChoiceAssessmentItemBuilder choiceBuilder) {
double point = parseFloat(parts[0], 1.0f);
String content = parts[1];
ChoiceInteraction interaction = choiceBuilder.getChoiceInteraction();
SimpleChoice newChoice = AssessmentItemFactory.createSimpleChoice(interaction, content, choiceBuilder.getQuestionType().getPrefix());
choiceBuilder.addSimpleChoice(newChoice);
choiceBuilder.setMapping(newChoice.getIdentifier(), point);
if (point > 0.0) {
if (choiceBuilder instanceof MultipleChoiceAssessmentItemBuilder) {
((MultipleChoiceAssessmentItemBuilder) choiceBuilder).addCorrectAnswer(newChoice.getIdentifier());
} else {
((SingleChoiceAssessmentItemBuilder) choiceBuilder).setCorrectAnswer(newChoice.getIdentifier());
}
}
}
use of org.olat.ims.qti21.model.xml.interactions.SimpleChoiceAssessmentItemBuilder in project openolat by klemens.
the class CSVToAssessmentItemConverter method processPoints.
private void processPoints(String[] parts) {
if (currentItem == null)
return;
double points = parseFloat(parts[1], 1.0f);
AssessmentItemBuilder itemBuilder = currentItem.getItemBuilder();
if (itemBuilder instanceof SimpleChoiceAssessmentItemBuilder) {
itemBuilder.setMinScore(0.0d);
itemBuilder.setMaxScore(points);
} else if (itemBuilder instanceof FIBAssessmentItemBuilder) {
itemBuilder.setMinScore(0.0d);
itemBuilder.setMaxScore(points);
} else if (itemBuilder instanceof KPrimAssessmentItemBuilder) {
itemBuilder.setMinScore(0.0d);
itemBuilder.setMaxScore(points);
} else if (itemBuilder instanceof MatchAssessmentItemBuilder) {
itemBuilder.setMinScore(0.0d);
itemBuilder.setMaxScore(points);
}
}
Aggregations