The question metrics bind to a Generator and process the question feature that can be contained in the
formation metadata. It tracks when questions begin, when attempts are made and when the question ends (completed).
The lifecycle for the events are:
`
Generator | Metrics
begin - the formation has the question feature in the metadata, the question has started. Raised before the
starting message has been yielded. IQuestionMetricsEventPayloadAttemptImmutable
attempt - the user has attempted the question. If the question was correct or the points/attempts have been
exhausted, the question has ended, otherwise the user will be prompted for another response.
IQuestionMetricsEventPayloadAttemptImmutable
end - the question has either been correctly answered or the points/attempts have been depleted. This is
raised before any final redirect message such as Well Done!.
IQuestionMetricsEventPayloadEndImmutable.
change - raised alongside every other event. Useful to invalidate a view that depends on the metrics so that
they can be re-rendered. Always raised after any of the above events.
IQuestionMetricsEventPayloadChangeImmutable
The question metrics bind to a Generator and process the
question
feature that can be contained in the formation metadata. It tracks when questions begin, when attempts are made and when the question ends (completed). The lifecycle for the events are:`
Generator | Metrics+---------+ +-------+ | feature +---> | begin | +---------+ +---+---+ | ........v......... | yield question <-------------------+ ''''''''+''''''''' | | | +----v----+ | +---------> | attempt | | | +----+----+ | | | | |
~v~~ | | ( correct? ) | | ~+~~+~ | | | | | | yes +- no -+ | | | | | | | ~~v~~~ | | | ( attempts left? ) | | | ~+~~+~ | | | | | | | | no yes | | | | | | | +---+--+ | | | | ~v~ +---+---+ | | ( redirect? )- no -> retry | | | ~+~ +---^---+ | | | | | | | .........+........ | | +- yes -> yield redirect | | | '''''''''''''''''' +--+---+ +--v--+ | step +-------> | end | +--+---+ +--+--+ | | | ~v~~ | ( group? )- yes -+ | ~+~~~~' | | | | | | .....v.... | | | submit | | | '''''+'''' | | |+------------+ | | |
~v~| ( redirect? )- no -+ |~+~' | | | | | | ........v......... | | | yield redirect | | | ''''''''+'''''''' | | | | +----v----+ | +---------> | finally <-------+ +---------+`
The events that are generated are:begin
- the formation has thequestion
feature in the metadata, the question has started. Raised before the starting message has been yielded. IQuestionMetricsEventPayloadAttemptImmutableattempt
- the user has attempted the question. If the question was correct or the points/attempts have been exhausted, the question has ended, otherwise the user will be prompted for another response. IQuestionMetricsEventPayloadAttemptImmutableend
- the question has either been correctly answered or the points/attempts have been depleted. This is raised before any final redirect message such as Well Done!. IQuestionMetricsEventPayloadEndImmutable.finally
- raised after any redirect message has occurred. IQuestionMetricsEventPayloadFinallyImmutablechange
- raised alongside every other event. Useful to invalidate a view that depends on the metrics so that they can be re-rendered. Always raised after any of the above events. IQuestionMetricsEventPayloadChangeImmutable