use of uk.ac.ed.ph.jqtiplus.node.content.basic.Block in project OpenOLAT by OpenOLAT.
the class SimpleChoiceAssessmentItemBuilder method getQuestionBlocks.
/**
* @return A copy of the list of blocks which make the question.
* The list is a copy and modification will not be persisted.
*/
public List<Block> getQuestionBlocks() {
List<Block> blocks = assessmentItem.getItemBody().getBlocks();
List<Block> questionBlocks = new ArrayList<>(blocks.size());
for (Block block : blocks) {
if (block instanceof ChoiceInteraction) {
break;
} else if (block != null) {
questionBlocks.add(block);
}
}
return questionBlocks;
}
use of uk.ac.ed.ph.jqtiplus.node.content.basic.Block in project OpenOLAT by OpenOLAT.
the class EssayAssessmentItemBuilder method getQuestionBlocks.
/**
* @return A copy of the list of blocks which make the question.
* The list is a copy and modification will not be persisted.
*/
public List<Block> getQuestionBlocks() {
List<Block> blocks = assessmentItem.getItemBody().getBlocks();
List<Block> questionBlocks = new ArrayList<>(blocks.size());
for (Block block : blocks) {
if (block instanceof ExtendedTextInteraction) {
break;
} else {
questionBlocks.add(block);
}
}
return questionBlocks;
}
use of uk.ac.ed.ph.jqtiplus.node.content.basic.Block in project OpenOLAT by OpenOLAT.
the class EssayAssessmentItemBuilder method extractExtendedTextInteraction.
private void extractExtendedTextInteraction() {
try (StringOutput sb = new StringOutput()) {
List<Block> blocks = assessmentItem.getItemBody().getBlocks();
for (Block block : blocks) {
if (block instanceof ExtendedTextInteraction) {
extendedTextInteraction = (ExtendedTextInteraction) block;
responseIdentifier = extendedTextInteraction.getResponseIdentifier();
break;
} else {
serializeJqtiObject(block, sb);
}
}
question = sb.toString();
} catch (IOException e) {
log.error("", e);
}
}
use of uk.ac.ed.ph.jqtiplus.node.content.basic.Block in project OpenOLAT by OpenOLAT.
the class DrawingAssessmentItemBuilder method getQuestionBlocks.
/**
* @return A copy of the list of blocks which make the question.
* The list is a copy and modification will not be persisted.
*/
public List<Block> getQuestionBlocks() {
List<Block> blocks = assessmentItem.getItemBody().getBlocks();
List<Block> questionBlocks = new ArrayList<>(blocks.size());
for (Block block : blocks) {
if (block instanceof DrawingInteraction) {
break;
} else {
questionBlocks.add(block);
}
}
return questionBlocks;
}
use of uk.ac.ed.ph.jqtiplus.node.content.basic.Block in project OpenOLAT by OpenOLAT.
the class FIBAssessmentItemBuilder method extractQuestions.
public String extractQuestions() {
try (StringOutput sb = new StringOutput()) {
List<Block> blocks = assessmentItem.getItemBody().getBlocks();
for (Block block : blocks) {
serializeJqtiObject(block, sb);
}
question = sb.toString();
} catch (IOException e) {
log.error("", e);
}
return question;
}
Aggregations