Documentation ¶
Index ¶
- func Aggregate(in []float32, aggregation Aggregation) (float32, error)
- func Mean(in []float32) float32
- func Sum(in []float32) float32
- type Aggregates
- type Aggregation
- type Answer
- type AnswerAggregation
- type AnswerSummary
- type AnswerType
- type BenSummary
- type Beneficiary
- type CatalogueOutcomeSet
- type Category
- type CategoryAggregate
- type DateTimeValue
- type Exclusion
- type Export
- type Label
- type Meeting
- type Meetings
- type Organisation
- type OutcomeSet
- func (os *OutcomeSet) ActiveQuestions() []Question
- func (os *OutcomeSet) GetArchivedCategoryQuestions(catID string) []Question
- func (os *OutcomeSet) GetCategory(catID string) *Category
- func (os *OutcomeSet) GetCategoryQuestions(catID string) []Question
- func (os *OutcomeSet) GetQuestion(qID string) *Question
- type Question
- type QuestionType
- type QuestionnaireFetcher
- type Report
- type ReportArgs
- type Source
- type Stats
- type Summon
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Aggregates ¶
type Aggregates struct {
Category []CategoryAggregate `json:"category"`
}
Aggregates stores aggregations associated with a meeting
type Aggregation ¶
type Aggregation string
const ( MEAN Aggregation = "mean" SUM Aggregation = "sum" )
type Answer ¶
type Answer struct { QuestionID string `json:"questionID" bson:"questionID"` Answer interface{} `json:"answer"` Type AnswerType `json:"type"` Notes *string `json:"notes"` }
type AnswerAggregation ¶
type AnswerAggregation struct { ID string `json:"id"` Initial float32 `json:"initial"` Latest float32 `json:"latest"` Stats Stats `json:"stats"` }
AnswerAggregation aggregates answers for a question or category over multiple beneficiaries
type AnswerSummary ¶
type AnswerSummary struct { ID string `json:"id"` Initial DateTimeValue `json:"initial"` Latest DateTimeValue `json:"latest"` NumberOfRecords int `json:"noRecords"` ReportCoverage float32 `json:"reportCoverage"` Stats Stats `json:"stats"` }
AnswerSummary summarises a beneficiary's results for a question or category
type BenSummary ¶
type BenSummary struct { ID string `json:"id"` Questions []AnswerSummary `json:"questions"` Categories []AnswerSummary `json:"categories"` }
BenSummary summarises a beneficiary's results
type Beneficiary ¶
type CatalogueOutcomeSet ¶
type CatalogueOutcomeSet struct { OutcomeSet `json:"outcomeset"` License string `json:"license"` Attribution *string `json:"attribution"` }
type Category ¶
type Category struct { ID string `json:"id"` Name string `json:"name"` Description string `json:"description"` Aggregation Aggregation `json:"aggregation"` }
type CategoryAggregate ¶
type CategoryAggregate struct { CategoryID string `json:"categoryID"` Value float32 `json:"value"` }
CategoryAggregate aggregates multiple questions belonging to the same category to a question category level
type DateTimeValue ¶
DateTimeValue combines a time.Time with a float32
type Exclusion ¶
type Exclusion struct { Beneficiary *string `json:"beneficiary,omitempty"` Question *string `json:"question,omitempty"` Category *string `json:"category,omitempty"` Reason string `json:"reason"` }
Exclusion details what has been excluded from the report and why. The structure can explain entire exclusion of a particular beneficiary, question or category or can explain why a particular question has been excluded on a single beneficiary
type Meeting ¶
type Meeting struct { ID string `json:"id" bson:"_id"` Beneficiary string `json:"beneficiary"` User string `json:"user"` OutcomeSetID string `json:"outcomeSetID" bson:"outcomeSetID"` OrganisationID string `json:"organisationID" bson:"organisationID"` Answers []Answer `json:"answers"` Conducted time.Time `json:"conducted"` Created time.Time `json:"created"` Modified time.Time `json:"modified"` Incomplete bool `json:"incomplete"` Completed time.Time `json:"completed,omitempty"` Notes *string `json:"notes"` // Tags contains all the tags associated with the meeting. // This could be both meeting specific tags and tags inherited from the beneficiary Tags []string `json:"tags"` // BenTags details the tags inherited from the beneficiary BenTags []string `json:"benTags" bson:"benTags"` }
func (*Meeting) GetCategoryAggregate ¶
func (m *Meeting) GetCategoryAggregate(categoryID string, os OutcomeSet) (*CategoryAggregate, error)
GetCategoryAggregate aggregates multiple answers into a single value. If the returned CategoryAggregate is nil, there were either no answers available for the category or not all the questions belonging to the category were answered
func (*Meeting) GetCategoryAggregates ¶
func (m *Meeting) GetCategoryAggregates(os OutcomeSet) ([]CategoryAggregate, error)
func (*Meeting) GetMeetingSpecificTags ¶
GetMeetingSpecificTags gathers the tags specifically assigned to the meeting i.e. removing all tags which are inherited from the beneficiary
type Meetings ¶
type Meetings []Meeting
func (Meetings) FilterDeletedQuestionnaires ¶
func (ms Meetings) FilterDeletedQuestionnaires(qf QuestionnaireFetcher, u auth.User) Meetings
func (Meetings) KeyedByBeneficiary ¶
type Organisation ¶
type OutcomeSet ¶
type OutcomeSet struct { ID string `json:"id" bson:"_id"` OrganisationID string `json:"organisationID" bson:"organisationID"` Name string `json:"name"` Description string `json:"description"` Instructions string `json:"instructions"` Questions []Question `json:"questions"` Categories []Category `json:"categories"` Deleted bool `json:"deleted"` Skippable bool `json:"skippable"` Source *Source `json:"source,omitempty" bson:"source,omitempty"` Created time.Time `json:"_" bson:"created"` }
func (*OutcomeSet) ActiveQuestions ¶
func (os *OutcomeSet) ActiveQuestions() []Question
ActiveQuestions returns only the currently active questions (i.e. not deleted)
func (*OutcomeSet) GetArchivedCategoryQuestions ¶
func (os *OutcomeSet) GetArchivedCategoryQuestions(catID string) []Question
GetArchivedCategoryQuestions gets archived questions belonging to the provided category ID
func (*OutcomeSet) GetCategory ¶
func (os *OutcomeSet) GetCategory(catID string) *Category
func (*OutcomeSet) GetCategoryQuestions ¶
func (os *OutcomeSet) GetCategoryQuestions(catID string) []Question
GetCategoryQuestions gets questions belonging to the provided category ID Does not return archived questions
func (*OutcomeSet) GetQuestion ¶
func (os *OutcomeSet) GetQuestion(qID string) *Question
GetQuestion returns the question with the provided qID or nil
type Question ¶
type Question struct { ID string `json:"id"` Question string `json:"question"` Description string `json:"description"` Short string `json:"short"` Type QuestionType `json:"type"` Deleted bool `json:"deleted"` Options map[string]interface{} `json:"options"` CategoryID string `json:"categoryID,omitempty" bson:"categoryID"` }
func (Question) GetExtremeLabels ¶
type QuestionnaireFetcher ¶
type QuestionnaireFetcher interface {
GetOutcomeSet(id string, u auth.User) (OutcomeSet, error)
}
type Report ¶
type Report struct { Beneficiaries []BenSummary `json:"beneficiaries"` Questions []AnswerAggregation `json:"questions"` Categories []AnswerAggregation `json:"categories"` Excluded []Exclusion `json:"excluded"` Records []Meeting `json:"-"` }
Report aggregates records over multiple beneficiaries
type ReportArgs ¶
type ReportArgs struct { Start time.Time End time.Time QID string Tags []string OrTags bool Open bool MinRequiredRecords int }
ReportArgs defines the arguments required to generate a report
type Stats ¶
type Stats struct { Delta float32 `json:"delta"` LOBFDelta float32 `json:"lobfDelta"` ROC float32 `json:"roc"` }
Stats are values calculated as part of report generation
type Summon ¶
type Summon struct { ID string `bson:"_id"` Organisation string `bson:"organisation"` Questionnaire string `bson:"questionnaireID"` User string `bson:"user"` Created time.Time `bson:"created"` Expires time.Time `bson:"expires"` Generated uint `bson:"generated"` }
Summon are questionnaire links which can be given to multiple beneficiaries. They differ to remote meetings as they are not tied to an individual beneficiary. When clicked, the summon information is used to create a remote meeting for the beneficiary.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
mock
|
|
auth
Package mock_auth is a generated GoMock package.
|
Package mock_auth is a generated GoMock package. |
data
Package mock_data is a generated GoMock package.
|
Package mock_data is a generated GoMock package. |
softoutcomes provides methods for interacting with softoutcomes.org which is a database of soft outcome questionnaires
|
softoutcomes provides methods for interacting with softoutcomes.org which is a database of soft outcome questionnaires |