@Override public boolean equals(final Object object) { if (!(object instanceof PairValue)) { return false; } final PairValue other = (PairValue) object; return sourceValue.equals(other.sourceValue) && destValue.equals(other.destValue) || sourceValue.equals(other.destValue) && destValue.equals(other.sourceValue); }
@Override public boolean equals(final Object object) { if (!(object instanceof IdentifierValue)) { return false; } final IdentifierValue other = (IdentifierValue) object; return identifierValue.equals(other.identifierValue); }
/** * Returns true if given target is special (EXIT_TEST, EXIT_TESTPART, EXIT_SECTION); false otherwise. * * @param target given target * @return true if given target is special (EXIT_TEST, EXIT_TESTPART, EXIT_SECTION); false otherwise */ public static boolean isSpecial(final Identifier target) { return target.equals(EXIT_TEST) || target.equals(EXIT_TESTPART) || target.equals(EXIT_SECTION); } }
public static boolean isReservedIdentifier(final Identifier identifier) { Assert.notNull(identifier, "identifier"); return identifier.equals(QtiConstants.VARIABLE_DURATION_IDENTIFIER) || identifier.equals(QtiConstants.VARIABLE_COMPLETION_STATUS_IDENTIFIER) || identifier.equals(QtiConstants.VARIABLE_NUMBER_OF_ATTEMPTS_IDENTIFIER); }
public boolean isValidVariableIdentifier(final Identifier identifier) { return validOutcomeDeclarationMap.containsKey(identifier) || QtiConstants.VARIABLE_DURATION_IDENTIFIER.equals(identifier); }
private Value evaluateResponseValue(final Identifier identifier) { if (identifier.equals(QtiConstants.VARIABLE_DURATION_IDENTIFIER)) { return itemSessionState.computeDurationValue(); } else if (identifier.equals(QtiConstants.VARIABLE_NUMBER_OF_ATTEMPTS_IDENTIFIER)) { return itemSessionState.getNumAttemptsValue(); } return itemSessionState.getResponseValue(identifier); }
@Override public boolean handleNode(final QtiNode node) { if (node instanceof AssessmentSection) { final AssessmentSection assessmentSection = (AssessmentSection) node; if (assessmentSection.getIdentifier().equals(sectionIdentifier)) { /* Found matching section, so search for all assessmentItemRefs below this */ result.addAll(QueryUtils.search(AssessmentItemRef.class, assessmentSection)); } } /* Keep searching */ return true; } }, getSubjectTest());
private OutcomeVariable extractOutcomeVariable(final List<ItemVariable> itemVariables, final Identifier outcomeIdentifier) { for (final ItemVariable itemVariable : itemVariables) { if (itemVariable.getIdentifier().equals(outcomeIdentifier) && itemVariable.getVariableType()==VariableType.OUTCOME) { return (OutcomeVariable) itemVariable; } } return null; }
public TestPart getTestPart(final Identifier testPartIdentifier) { for (final TestPart testPart : getTestParts()) { if (testPartIdentifier.equals(testPart.getIdentifier())) { return testPart; } } return null; }
private Value evaluateOutcomeValue(final Identifier identifier) { if (identifier.equals(QtiConstants.VARIABLE_COMPLETION_STATUS_IDENTIFIER)) { return itemSessionState.getCompletionStatusValue(); } return itemSessionState.getOutcomeValue(identifier); }
public TestPlanNode getTestPartNode(final Identifier identifier) { for (final TestPlanNode testPartNode : getTestPartNodes()) { if (identifier.equals(testPartNode.getIdentifier())) { return testPartNode; } } return null; }
public Value getVariableValue(final Identifier identifier) { Assert.notNull(identifier); Value result; if (QtiConstants.VARIABLE_DURATION_IDENTIFIER.equals(identifier)) { result = computeDurationValue(); } else { result = getOutcomeValue(identifier); } return result; }
public HotspotChoice getHotspotChoice(final Identifier identifier) { for (final HotspotChoice choice : getHotspotChoices()) { if (choice.getIdentifier() != null && choice.getIdentifier().equals(identifier)) { return choice; } } return null; }
/** * Gets gapChoice child with given identifier or null. * * @param identifier given identifier * @return gapChoice with given identifier or null */ public GapChoice getGapChoice(final Identifier identifier) { for (final GapChoice choice : getGapChoices()) { if (choice.getIdentifier() != null && choice.getIdentifier().equals(identifier)) { return choice; } } return null; }
/** * Returns value of weight with given identifier or default weight value (if weight was not found). * * @param identifier identifier of requested weight * @return value of weight with given identifier or default weight value (if weight was not found) */ public double lookupWeight(final Identifier identifier) { for (final Weight weight : getWeights()) { if (weight.getIdentifier().equals(identifier)) { return weight.getValue(); } } return Weight.DEFAULT_WEIGHT; }
/** * Gets associableHotspot child with given identifier or null. * * @param identifier given identifier * @return associableHotspot with given identifier or null */ public AssociableHotspot getAssociableHotspot(final Identifier identifier) { for (final AssociableHotspot choice : getAssociableHotspots()) { if (choice.getIdentifier() != null && choice.getIdentifier().equals(identifier)) { return choice; } } return null; }
/** * Gets simpleChoice child with given identifier or null. * * @param identifier given identifier * @return simpleChoice with given identifier or null */ public SimpleChoice getSimpleChoice(final Identifier identifier) { for (final SimpleChoice choice : getSimpleChoices()) { if (choice.getIdentifier() != null && choice.getIdentifier().equals(identifier)) { return choice; } } return null; }
/** * Gets simpleAssociableChoice child with given identifier or null. * * @param identifier given identifier * @return simpleAssociableChoice with given identifier or null */ public SimpleAssociableChoice getSimpleAssociableChoice(final Identifier identifier) { for (final SimpleAssociableChoice choice : getSimpleAssociableChoices()) { if (choice.getIdentifier() != null && choice.getIdentifier().equals(identifier)) { return choice; } } return null; }
@Override public OutcomeDeclaration getOutcomeDeclaration(final Identifier identifier) { Assert.notNull(identifier); for (final OutcomeDeclaration declaration : getOutcomeDeclarations()) { if (declaration.getIdentifier() != null && declaration.getIdentifier().equals(identifier)) { return declaration; } } return null; }