Class MatArtifact


  • public class MatArtifact
    extends Object

    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 by MatMethodMustache 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.