helper

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 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.

processing of data connection

This package created to provide a single encapsulated helper that can be fed once with the object data and then answer all object linkage related needs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CodeframeHelper

type CodeframeHelper struct {
	// contains filtered or unexported fields
}

Encapsulates data and helper methods to make working with codeframe objects easier

func NewCodeframeHelper

func NewCodeframeHelper(r *repository.BadgerRepo, wg *sync.WaitGroup) (CodeframeHelper, error)

Creates a new codeframe helper instance. r - a repository containing the rrd data

func (CodeframeHelper) GetCodeframeObjectValueString

func (cfh CodeframeHelper) 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 (CodeframeHelper) GetContainersForItem

func (cfh CodeframeHelper) 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 (CodeframeHelper) GetDACs

func (cfh CodeframeHelper) GetDACs() []string

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

func (CodeframeHelper) GetExpectedTestletItems

func (cfh CodeframeHelper) 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 (CodeframeHelper) GetItem

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

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

func (CodeframeHelper) GetItemTestletSequenceNumber

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

returns the sequnce number for a test item within a testlet

func (CodeframeHelper) GetItemTests

func (cfh CodeframeHelper) GetItemTests() map[string][]map[string]string

return all codeframe items and their test characteristics

func (CodeframeHelper) GetTest4Item

func (cfh CodeframeHelper) GetTest4Item(itemRefId string) []map[string]string

return the test characteristics for an item

func (CodeframeHelper) GetTestletLocationInStage

func (cfh CodeframeHelper) GetTestletLocationInStage(testletrefid string) string

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

func (CodeframeHelper) HasSubstituteItem

func (cfh CodeframeHelper) HasSubstituteItem(itemRefid string) (map[string]struct{}, bool)

for a given item refid, returns the set of refids (string) of the items that can substitute for it, returned as a set (map[string]struct{}) so can be tested for membership. boolean return can be used simply to determine if this item has a substitute

func (CodeframeHelper) IsSubstituteItem

func (cfh CodeframeHelper) 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 (CodeframeHelper) ProcessCodeframeRecords

func (cfh CodeframeHelper) ProcessCodeframeRecords(in chan *records.CodeframeRecord) chan *records.CodeframeRecord

implement the codeframe pipe interface, so this can be attached to a codeframe emitter.

func (CodeframeHelper) WritingRubricTypes

func (cfh CodeframeHelper) WritingRubricTypes() []string

returns ordered list of writing rubrics

func (CodeframeHelper) WritingSubscoreTypes

func (cfh CodeframeHelper) WritingSubscoreTypes() []string

alias for writing rubrics, known as subscores in results

type ObjectHelper

type ObjectHelper struct {
	// contains filtered or unexported fields
}

Encapsulates data and helper methods to make working with objects easier

func NewObjectHelper

func NewObjectHelper(r *repository.BadgerRepo, wg *sync.WaitGroup) (ObjectHelper, error)

Creates a new object helper instance. r - a repository containing the rrd data

func (ObjectHelper) GetSchoolFromGuid added in v1.0.5

func (cfh ObjectHelper) GetSchoolFromGuid(guid string) string

given object return school ID

func (ObjectHelper) GetSchoolRefIds added in v1.0.5

func (cfh ObjectHelper) GetSchoolRefIds() []string

return all school ref IDs registered

func (ObjectHelper) GetTypeFromGuid

func (cfh ObjectHelper) GetTypeFromGuid(guid string) string

given GUID, return its type

func (ObjectHelper) InCodeFrame

func (cfh ObjectHelper) InCodeFrame(guid string) bool

is this object referenced by the codeframe?

func (ObjectHelper) ProcessObjectRecords

func (cfh ObjectHelper) ProcessObjectRecords(in chan *records.ObjectRecord) chan *records.ObjectRecord

implement the object pipe interface, so this can be attached to a object emitter.

Jump to

Keyboard shortcuts

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