codeframe

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 7, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

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

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

func (cfh Helper) GetCodeframeObjectValueString(refid, queryPath string) string

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

func (cfh Helper) GetContainersForItem(refid string) map[string][]string

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) GetDACs

func (cfh Helper) GetDACs() []string

get the list of Disability Adjustment Codes supported for this naplan cycle

func (Helper) GetExpectedTestletItems

func (cfh Helper) GetExpectedTestletItems(testRefId, testletRefId string) map[string]struct{}

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

func (cfh Helper) GetItem(refid string) (bool, []byte)

return the json block for a given testitem refid boolean return value indicates if a value was found

func (Helper) GetItemTestletSequenceNumber

func (cfh Helper) GetItemTestletSequenceNumber(itemrefid, testletrefid string) string

returns the sequnce number for a test item within a testlet

func (Helper) GetTestletLocationInStage

func (cfh Helper) GetTestletLocationInStage(testletrefid string) string

find location in stage for testlet comes from codeframe not testlet object

func (Helper) IsSubstituteItem

func (cfh Helper) IsSubstituteItem(itemRefid string) (map[string]struct{}, bool)

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

func (cfh Helper) WritingRubricTypes() []string

returns ordered list of writing rubrics

func (Helper) WritingSubscoreTypes

func (cfh Helper) WritingSubscoreTypes() []string

alias for writing rubrics, known as subscores in results

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL