Documentation
¶
Overview ¶
processing of data withitn the context of the codeframe, e.g. inserting user results into the overall structure of tests, testlets and items for a given domain is complex and repetitive.
This package created to provide a single encapsulated helper that can be fed once with the codeframe data and then answer all codeframe related formatting and data extraction needs.
Index ¶
- type Helper
- func (cfh Helper) GetCodeframeObjectValueString(refid, queryPath string) string
- func (cfh Helper) GetContainersForItem(refid string) map[string][]string
- func (cfh Helper) GetDACs() []string
- func (cfh Helper) GetExpectedTestletItems(testRefId, testletRefId string) map[string]struct{}
- func (cfh Helper) GetItem(refid string) (bool, []byte)
- func (cfh Helper) GetItemTestletSequenceNumber(itemrefid, testletrefid string) string
- func (cfh Helper) GetTestletLocationInStage(testletrefid string) string
- func (cfh Helper) IsSubstituteItem(itemRefid string) (map[string]struct{}, bool)
- func (cfh Helper) ProcessCodeframeRecords(in chan *records.CodeframeRecord) chan *records.CodeframeRecord
- func (cfh Helper) WritingRubricTypes() []string
- func (cfh Helper) WritingSubscoreTypes() []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Helper ¶
type Helper struct {
// contains filtered or unexported fields
}
Encapsulates data and helper methods to make working with codeframe objects easier
func NewHelper ¶
func NewHelper(r *repository.BadgerRepo) (Helper, error)
Creates a new codeframe helper instance. r - a repository containing the rrd data
func (Helper) GetCodeframeObjectValueString ¶
pass a json path to retrieve the value at that location as a string refid - the identifier of the object to be queried queryPath the gjson query string to apply to the object
func (Helper) GetContainersForItem ¶
return the refids of the test/testlet combinations that use a particular item refid - the refid of a test item
returns a map of pairs where key is the testlet refid and value is the test refid
func (Helper) GetExpectedTestletItems ¶
For given test/testlet combination returns list of expected items - returned is a map[string]struct{} so acts as a set that can have lookups performed against it to test for presence of members the contents of the set are the refids of the expected items
func (Helper) GetItem ¶
return the json block for a given testitem refid boolean return value indicates if a value was found
func (Helper) GetItemTestletSequenceNumber ¶
returns the sequnce number for a test item within a testlet
func (Helper) GetTestletLocationInStage ¶
find location in stage for testlet comes from codeframe not testlet object
func (Helper) IsSubstituteItem ¶
for a given item refid, returns the set of refids (string) of the item this item substitutes for, returned as a set (map[string]struct{}) so can be tested for membership. boolean return can be used simply to determine if this item is a substitute
func (Helper) ProcessCodeframeRecords ¶
func (cfh Helper) ProcessCodeframeRecords(in chan *records.CodeframeRecord) chan *records.CodeframeRecord
implement the codeframe pipe interface, so this can be attached to a codeframe emitter.
func (Helper) WritingRubricTypes ¶
returns ordered list of writing rubrics
func (Helper) WritingSubscoreTypes ¶
alias for writing rubrics, known as subscores in results