Package de.hsh.graja.transform
Class ProformaUtil
java.lang.Object
de.hsh.graja.transform.ProformaUtil
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic classstatic classstatic classstatic class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic BigDecimalcalcMaxScoreAssumingEachTestRefCeilsOne(proforma.xml21.GradingHintsType gh) Evaluates the root and combine nodes regarding theirfunctionand theirweight.static BigDecimalcalcMaxScoreAssumingEachTestRefCeilsOne(proforma.xml21.GradingHintsType gh, proforma.xml21.GradesBaseRefChildType childRef) static BigDecimalcalcMaxScoreAssumingEachTestRefCeilsOne(proforma.xml21.GradingHintsType gh, proforma.xml21.GradesNodeType node) Evaluates the given node regarding itsfunctionand itsweight.static voidclearFileAndSetAttachedBinFile(proforma.xml21.TaskFileType file, String path) static <T> TfindAnyByInstanceOfClass(proforma.xml21.TaskMetaDataType md, Class<T> clazz) static <T> TfindAnyByInstanceOfClass(proforma.xml21.TestConfigurationType tc, Class<T> clazz) static byte[]getBytesOfEmbeddedFile(proforma.xml21.ResponseFileType file) static byte[]getBytesOfEmbeddedFile(proforma.xml21.TaskFileType file) static StringgetEncoding(proforma.xml21.TaskFileType file) getFile(proforma.xml21.IncludedTaskFileType file) getFile(proforma.xml21.ResponseFileType file) getFile(proforma.xml21.SubmissionFileType file) getFile(proforma.xml21.TaskFileType file) static StringgetNaturalLang(proforma.xml21.SubmissionFileType file) static StringgetNaturalLang(proforma.xml21.TaskFileType file) static StringgetPath(proforma.xml21.ResponseFileType file) static StringgetPath(proforma.xml21.SubmissionFileType file) static StringgetPath(proforma.xml21.TaskFileType file) static StringgetRef(proforma.xml21.GradesBaseRefChildType cr) static StringgetSubRef(proforma.xml21.GradesBaseRefChildType cr) static booleanisAttached(proforma.xml21.TaskFileType file) static booleanisBin(proforma.xml21.TaskFileType file) static booleanisEmbedded(proforma.xml21.ResponseFileType file) static booleanisEmbedded(proforma.xml21.TaskFileType file) static booleanisTxt(proforma.xml21.ResponseFileType file) static booleanisTxt(proforma.xml21.TaskFileType file) static voidvalidateTree(proforma.xml21.GradingHintsType gh) If the grading nodes do not form a tree of combine nodes but instead some other graph, then this method will throw an IllegalArgumentException
-
Constructor Details
-
ProformaUtil
public ProformaUtil()
-
-
Method Details
-
getFile
-
getFile
public static ProformaUtil.IncludedTaskFileChoiceGroup getFile(proforma.xml21.IncludedTaskFileType file) -
getFile
public static ProformaUtil.SubmissionFileChoiceGroup getFile(proforma.xml21.SubmissionFileType file) -
getFile
-
clearFileAndSetAttachedBinFile
-
findAnyByInstanceOfClass
public static <T> T findAnyByInstanceOfClass(proforma.xml21.TestConfigurationType tc, Class<T> clazz) -
getPath
-
getPath
-
getPath
-
isEmbedded
public static boolean isEmbedded(proforma.xml21.TaskFileType file) -
isEmbedded
public static boolean isEmbedded(proforma.xml21.ResponseFileType file) -
isAttached
public static boolean isAttached(proforma.xml21.TaskFileType file) -
isTxt
public static boolean isTxt(proforma.xml21.TaskFileType file) -
isTxt
public static boolean isTxt(proforma.xml21.ResponseFileType file) -
isBin
public static boolean isBin(proforma.xml21.TaskFileType file) -
getNaturalLang
-
getNaturalLang
-
getEncoding
-
getBytesOfEmbeddedFile
public static byte[] getBytesOfEmbeddedFile(proforma.xml21.TaskFileType file) -
getBytesOfEmbeddedFile
public static byte[] getBytesOfEmbeddedFile(proforma.xml21.ResponseFileType file) -
getRef
-
getSubRef
-
calcMaxScoreAssumingEachTestRefCeilsOne
public static BigDecimal calcMaxScoreAssumingEachTestRefCeilsOne(proforma.xml21.GradingHintsType gh) throws NoSuchElementException Evaluates the root and combine nodes regarding theirfunctionand theirweight. This method assumes that each referenced sub-test contributes 0 or 1 as a result.- Returns:
- Throws:
NoSuchElementException
-
calcMaxScoreAssumingEachTestRefCeilsOne
public static BigDecimal calcMaxScoreAssumingEachTestRefCeilsOne(proforma.xml21.GradingHintsType gh, proforma.xml21.GradesNodeType node) throws NoSuchElementException Evaluates the given node regarding itsfunctionand itsweight. This method assumes that each referenced sub-test contributes 0 or 1 as a result.- Returns:
- Throws:
NoSuchElementException
-
calcMaxScoreAssumingEachTestRefCeilsOne
public static BigDecimal calcMaxScoreAssumingEachTestRefCeilsOne(proforma.xml21.GradingHintsType gh, proforma.xml21.GradesBaseRefChildType childRef) -
validateTree
public static void validateTree(proforma.xml21.GradingHintsType gh) If the grading nodes do not form a tree of combine nodes but instead some other graph, then this method will throw an IllegalArgumentException -
findAnyByInstanceOfClass
-