org.problets.domain.view.code.synthesis
Class SynthesisCodeModel

java.lang.Object
  extended by org.problets.domain.view.code.synthesis.SynthesisCodeModel

public class SynthesisCodeModel
extends java.lang.Object

Merges synthesis annotations in the original template with the corresponding code segments in the code

Since:
2 / 15 / 2008
Author:
Amruth Kumar

Constructor Summary
SynthesisCodeModel()
           
 
Method Summary
static java.util.Vector getActualAnswer(CodeModel code)
          Returns the actual answers for this code-writing problem
static boolean hasAttempted(java.util.Vector codeText)
          Returns whether all the code segments have been attempted
static void main(java.lang.String[] args)
           
static java.util.Vector preProcessCode(java.util.Vector codeText, java.lang.String originalTemplate)
           
static void preProcessInstructions(CodeModel code)
          Preprocesses the instructions for the problem.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SynthesisCodeModel

public SynthesisCodeModel()
Method Detail

getActualAnswer

public static java.util.Vector getActualAnswer(CodeModel code)
Returns the actual answers for this code-writing problem


preProcessCode

public static java.util.Vector preProcessCode(java.util.Vector codeText,
                                              java.lang.String originalTemplate)

preProcessInstructions

public static void preProcessInstructions(CodeModel code)
Preprocesses the instructions for the problem. If none exist and this is a code writing problem, introduces a default instruction involving the output of the code. If instructions exist, replaces tokens with code lexemes and updates the code's template to contain the new instructions


hasAttempted

public static boolean hasAttempted(java.util.Vector codeText)
Returns whether all the code segments have been attempted


main

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