Class MatArtifact
A MatArtifact is part of a ProFormA-Task which is subject to materialization.
The artifact references parts like a file, a weight, or the whole task.
A single MatArtifact instance may reference many similar parts at once, e. g.
all files of a task. The materialization of an artifact is performed
by a MatMethod
. For this, the MatMethod relies on the artifact to
supply data as a template and to consume data as the materialization result (the instance).
Examples:
- Given a MatArtifact of type
MatArtifactType.ATTACHED_TXT_FILE_CONTENTS
that supplies and consumes the content of an attached file. The supplied content contains placeholders for various variation points. The MatMethod might be a search and replace routine provided byMatMethodMustache
that scans the whole string supplied by the artifact, replaces all placeholder occurrences by actual variation point resolution values, and sends the result to the artifact's consumption method. - A MatArtifact of type
MatArtifactType.GRADING_HINTS_WEIGHTS
supplies and consumes weights of several TestRef references from the grading-hints. We apply a MatMethod to the artifact that should multiply all these weights by a factor during materialization, where the factor is resolved from a specific variation point. The multiplying MatMethod receives the weight value from the artifact's supplier. The MatMethod resolves the variation point and multiplies the resolved value to the weight. Usually there would be a single variation point multiplied to the weight, but there could be a set of variation points, that will get resolved one by one and multiplied to the weight. The resulting product is passed to the artifacts consumption method, which will overwrite the original weight value by the new one.
In summary, an artifact defines a data supplier and a data consumer. These two components are used by a MatMethod to perform materialization.
There are some artifacts defined as standard artifacts. A grader may define
further artifacts by using the type MatArtifactType.OTHER
and
by implementing a MatArtifactProvider
subclass that implements
the grader-specific supplying and consuming methods. A grader-specific
artifact must include a dataType
value and a operatesOnTaskXml
value and it
may store additional data in the any
field.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMatArtifact
(String id, MatArtifactType artifactType) MatArtifact
(String id, MatArtifactType artifactType, VpT dataType, Boolean operatesOnTaskXml) MatArtifact
(MatArtifact other) -
Method Summary
Modifier and TypeMethodDescriptionvoid
afterUnmarshal
(javax.xml.bind.Unmarshaller unmarshaller, Object parent) static MatArtifact
clone()
static MatArtifact
fileExistences
(String id) static MatArtifact
<T> T
findAnyByInstanceOfClass
(Class<T> clazz) getAny()
getId()
getPath()
getRef()
Class<?>
static MatArtifact
static MatArtifact
includeAny
(Object... anys) includeChildRefs
(ChildRefRef... childRefs) includeFileIds
(String... fileIds) includePaths
(String... paths) void
init
(Ribbon<TaskUnzipped> rtu) boolean
static MatArtifact
void
void
setProvider
(MatArtifactProvider<?> provider) static MatArtifact
toString()
-
Field Details
-
any
-
-
Constructor Details
-
MatArtifact
public MatArtifact() -
MatArtifact
-
MatArtifact
public MatArtifact(String id, MatArtifactType artifactType, VpT dataType, Boolean operatesOnTaskXml) -
MatArtifact
-
-
Method Details
-
other
-
taskXml
-
fileNames
-
attachedTxtFileContents
-
fileExistences
-
gradingNodeExistences
-
gradingHintsWeights
-
clone
-
afterUnmarshal
-
getId
-
setId
-
getArtifactType
-
getDataType
-
getValueType
-
operatesOnTaskXml
public boolean operatesOnTaskXml() -
getFileId
-
getPath
-
getRef
-
getAny
-
includeFileIds
-
includePaths
-
includeChildRefs
-
includeAny
-
findAnyByInstanceOfClass
-
toString
-
getProvider
-
setProvider
-
init
-