org.problets.lib.conceptmap.tutor
Class ForestTutor

java.lang.Object
  extended by org.problets.lib.conceptmap.tutor.ForestTutor

public class ForestTutor
extends java.lang.Object

This class checks the student's answer and decides which aspectsof the student's answer are correct or wrong.


Constructor Summary
ForestTutor(ForestModel actualForestModel, UserBuiltForestModel inUserForestModel)
          Creates the connection matrix to assist in checking the student's answers.
 
Method Summary
 boolean isLinkCorrect(java.lang.String parent, java.lang.String child)
          Returns true if the first name passed as argument is the actual parent of the second name passed as argument.
 boolean isModelCorrect()
          Returns true if the student forest model is correct, false otherwise.
 boolean isParentCorrect(java.lang.String name)
          Returns true if the user-defined parent is correct, false otherwise.
static void main(java.lang.String[] args)
           
 void print(boolean[][] connectionMatrix)
          Prints the connection matrix.
 void update()
          Updates the connection matrix of the user-built forest and the vector of MatrixDifference objects.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ForestTutor

public ForestTutor(ForestModel actualForestModel,
                   UserBuiltForestModel inUserForestModel)
Creates the connection matrix to assist in checking the student's answers. The arguments are the two forest models (the user-built one and the correct one).

Parameters:
actualForestModel - the model of the correct forest
userForestModel - the model of the user-built forest
Method Detail

isParentCorrect

public boolean isParentCorrect(java.lang.String name)
Returns true if the user-defined parent is correct, false otherwise.

Parameters:
name - the name of the node whose correctness is returned
Returns:
true if the user-defined parent of the node passed as argument is correct, false otherwise

isLinkCorrect

public boolean isLinkCorrect(java.lang.String parent,
                             java.lang.String child)
Returns true if the first name passed as argument is the actual parent of the second name passed as argument.

Parameters:
parent - the name of parent node
child - the name of the chilf node
Returns:
true if the first node passed as argument is the actual parent of the second node passed as argument, false otherwise

isModelCorrect

public boolean isModelCorrect()
Returns true if the student forest model is correct, false otherwise.

Returns:
true if the student forest model is correct, false otherwise

update

public void update()
Updates the connection matrix of the user-built forest and the vector of MatrixDifference objects.


print

public void print(boolean[][] connectionMatrix)
Prints the connection matrix.

Parameters:
connectionMatrix - the connection matrix to be printed

main

public static void main(java.lang.String[] args)