org.problets.domain.line
Class CodeSegmentAttempt

java.lang.Object
  extended by org.problets.domain.line.AbstractLine
      extended by org.problets.domain.line.CodeSegmentAttempt
All Implemented Interfaces:
java.lang.Cloneable

public class CodeSegmentAttempt
extends AbstractLine

CodeSegmentAttempt Records one attempt of the student to answer one segment of the code; Maintains the correct answer for the attempt, and tutor's explanation of the grading.

Author:
Amruth Kumar Date: 2 / 25 / 2008

Field Summary
 
Fields inherited from class org.problets.domain.line.AbstractLine
UNASSIGNED_LINE
 
Constructor Summary
CodeSegmentAttempt(int inLineNumber, java.lang.String inInstructions, java.lang.String inTemplate, java.lang.String inActualCode, java.lang.String inStudentCode, boolean inCorrect, DomainModel inSource)
           
 
Method Summary
 void addToExplanation(java.lang.String entry)
          Adds another string to the explanation for the grading of the student's answer
 boolean equals(CodeSegmentAttempt newAttempt)
          Returns true if this CodeSegmentAttempt is for the same line number, instructions and template as the new CodeSegmentAttempt and false otherwise
 java.lang.String getActualCode()
          Returns the actual code for this segment
 java.util.Vector getExplanation()
          Returns the explanation generated for this student's answer so far
 java.lang.String getInstructions()
          Returns the instructions for this code segment
 DomainModel getSource()
          Returns the source of the code line of which this is a segment
 java.lang.String getStudentCode()
          Returns the student code for this segment
 java.lang.String getTemplate()
          Returns the template for this code segment
 boolean isCorrect()
          Returns whether this answer is correct or not
static void main(java.lang.String[] args)
           
 void print()
          Prints all the fields of the class
 void setCorrect()
          Sets that this answer is correct
 void setIncorrect()
          Sets this answer as incorrect
 java.lang.String toString()
          Returns only that which is entered into the log
 
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

CodeSegmentAttempt

public CodeSegmentAttempt(int inLineNumber,
                          java.lang.String inInstructions,
                          java.lang.String inTemplate,
                          java.lang.String inActualCode,
                          java.lang.String inStudentCode,
                          boolean inCorrect,
                          DomainModel inSource)
Method Detail

equals

public boolean equals(CodeSegmentAttempt newAttempt)
Returns true if this CodeSegmentAttempt is for the same line number, instructions and template as the new CodeSegmentAttempt and false otherwise


getInstructions

public java.lang.String getInstructions()
Returns the instructions for this code segment


getTemplate

public java.lang.String getTemplate()
Returns the template for this code segment


getStudentCode

public java.lang.String getStudentCode()
Returns the student code for this segment


getActualCode

public java.lang.String getActualCode()
Returns the actual code for this segment


getExplanation

public java.util.Vector getExplanation()
Returns the explanation generated for this student's answer so far


isCorrect

public boolean isCorrect()
Returns whether this answer is correct or not


getSource

public DomainModel getSource()
Returns the source of the code line of which this is a segment


setCorrect

public void setCorrect()
Sets that this answer is correct


setIncorrect

public void setIncorrect()
Sets this answer as incorrect


addToExplanation

public void addToExplanation(java.lang.String entry)
Adds another string to the explanation for the grading of the student's answer


toString

public java.lang.String toString()
Returns only that which is entered into the log

Specified by:
toString in class AbstractLine

print

public void print()
Prints all the fields of the class

Specified by:
print in class AbstractLine

main

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