|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.problets.domain.line.AbstractLine
org.problets.domain.line.AbstractExplanationLine
org.problets.domain.model.expression.step.AbstractExpressionStep
org.problets.domain.model.expression.step.ExpressionViewStep
public class ExpressionViewStep
To hold one step in the solution to an expression
Field Summary |
---|
Fields inherited from class org.problets.domain.line.AbstractLine |
---|
UNASSIGNED_LINE |
Constructor Summary | |
---|---|
ExpressionViewStep(NodeView inNodeView)
This constructor is called for the correct answer |
Method Summary | |
---|---|
boolean |
checkStepCorrect(java.util.Vector correctAnswer)
Method to see if an ExpressionViewStep matches the corresponding entry in the correct answer vector. |
int |
getAttemptedOrder(java.util.Vector studentAnswer)
Returns the order of attempt if the nodeView of this step was attempted by the student, and -1 otherwise. |
int |
getLeftX()
|
NodeModel |
getNode()
|
NodeView |
getNodeView()
|
int |
getOrder()
getOrder(), getResult() and equals() methods are being redefined here as a first step towards not inheriting any data members from the base class - For correct answer, order and result are already stored in NodeModel referred to by NodeView For student answer, order and result are now stored in NodeModel referred to by StudentNodeView |
java.lang.String |
getResult()
|
boolean |
getResultCorrect()
Returns whether the intermediate result is correct or not. |
int |
getRightX()
|
boolean |
getSideEffectCorrect()
Returns whether the side effects are completely correct or not. |
java.lang.String |
getSideEffectString()
Returns a string of variable names and the values to which they were changed |
boolean |
getStepCorrect()
Returns whether the step, i.e., operator and operand selection is correct or not. |
boolean |
hasSideEffect()
This expression step has side effect if the model of the nodeView is an assignment |
boolean |
isInOrder(ExpressionViewStep right)
Returns true if the order of the node of the original operator of the StudentNodeView that is a part of this step is less than that of the right operand, and false otherwise. |
static void |
main(java.lang.String[] args)
|
void |
print()
Prints all the fields of the class |
void |
restoreAvailable(java.util.Vector operatorVector,
java.util.Vector operandVector)
Updates the operatorViewVector and operandViewVector based on which operators and operands were used for this node when this node is deleted from the student model |
void |
setNCheckResult(java.lang.String inResult,
java.util.Vector correctAnswer)
Sets the value of an expressionViewStep and sets whether it is correct or not. |
void |
setNCheckSideEffects(java.util.Vector inSideEffectVector)
|
void |
setOrder(int inOrder)
setOrder(), setResult() methods are being redefined here as a first step towards not inheriting any data members from the base class - For correct answer, order and result are already stored in NodeModel referred to by NodeView For student answer, order and result are now stored in NodeModel referred to by StudentNodeView |
void |
setResult(java.lang.String inResult)
|
java.lang.String |
toString()
Returns this operator and its two operands. |
void |
updateAvailable(java.util.Vector operatorVector,
java.util.Vector operandVector)
Updates the operatorViewVector and operandViewVector based on which operators and operands were used for this node when this node is added to the student model |
boolean |
valueEquals(ExpressionViewStep right)
This method attempts to match based on the data type of the correct operand. |
Methods inherited from class org.problets.domain.model.expression.step.AbstractExpressionStep |
---|
replaceTagDelimiters |
Methods inherited from class org.problets.domain.line.AbstractExplanationLine |
---|
getEvent, getExplainer, getFeedbackAmount, setFeedbackAmount |
Methods inherited from class org.problets.domain.line.AbstractLine |
---|
clone, getLineNumber, setLineNumber |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ExpressionViewStep(NodeView inNodeView)
Method Detail |
---|
public int getLeftX()
public int getRightX()
public boolean getStepCorrect()
public boolean getSideEffectCorrect()
public boolean getResultCorrect()
public NodeModel getNode()
public NodeView getNodeView()
public boolean hasSideEffect()
public java.lang.String getSideEffectString()
public boolean checkStepCorrect(java.util.Vector correctAnswer)
public boolean valueEquals(ExpressionViewStep right)
public java.lang.String toString()
toString
in class AbstractExpressionStep
public int getOrder()
getOrder
in class AbstractExpressionStep
public java.lang.String getResult()
getResult
in class AbstractExpressionStep
public int getAttemptedOrder(java.util.Vector studentAnswer)
public boolean isInOrder(ExpressionViewStep right)
public void updateAvailable(java.util.Vector operatorVector, java.util.Vector operandVector)
public void restoreAvailable(java.util.Vector operatorVector, java.util.Vector operandVector)
public void setOrder(int inOrder)
setOrder
in class AbstractExpressionStep
public void setResult(java.lang.String inResult)
setResult
in class AbstractExpressionStep
public void setNCheckResult(java.lang.String inResult, java.util.Vector correctAnswer)
public void setNCheckSideEffects(java.util.Vector inSideEffectVector)
public void print()
AbstractExplanationLine
print
in class AbstractExpressionStep
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |