Skip to content

@memberjunction/ng-rubrics

Presentational widgets for rubrics: author a draft, answer one, show a result, confirm a publish, compare versions, and compare evaluators. They take snapshots as inputs and emit what changed. They do not save, publish, or navigate, so they work in Explorer, in an application, or in a dialog. Scoring and previews call RubricScoring from @memberjunction/rubrics-base; there is no second copy of the math.

Start with the Rubrics Guide for the model and the tasks these widgets serve. This README is the component reference.

graph LR
    HOST["Host component<br/><i>loads records, saves, publishes</i>"]
    SNAP["SnapshotFromRows<br/><i>@memberjunction/rubrics-base</i>"]
    W["ng-rubrics widget"]
    HOST -- "rows" --> SNAP -- "snapshot @Input" --> W
    W -- "@Output: answers, nodes, confirm" --> HOST
    HOST -- "Save() / Submit / Status = 'Published'" --> SRV["Entity server<br/><i>validates, scores, freezes</i>"]

Every component is standalone. Import the ones you use, or RubricsModule for all of them.

import { RubricScoringFormComponent, RubricResultComponent } from '@memberjunction/ng-rubrics';
NameType
InputNodesRubricNodeSnapshot[]The criteria tree
InputScales, Bands, BaseBandssnapshotsScales the leaves use; this draft’s and the base version’s bands
InputVersionRubricVersionSnapshot | nullThe draft version, for the preview
InputSampleAnswersRubricFormAnswer[]Answers the preview scores
InputReadOnly, Viewingboolean, 'draft' | 'published'Lock the editor; which side is shown
InputName, PublishedLabel, NextVersion, ComputedBumpstringHeader text
OutputNodesChange, BandsChange, ViewingChangeThe edited tree or bands; the side toggle

Shows each node’s share of its group (advisory nodes are left out of the share) and the problems that would block a publish: a duplicate key, a leaf with no scale, a gate with no minimum.

mj-rubric-scoring-form — answer a rubric

Section titled “mj-rubric-scoring-form — answer a rubric”
NameType
InputVersionRubricVersionSnapshot | nullThe published version being answered
InputAnswersRubricFormAnswer[]Saved answers to resume from
OutputAnswersChangeRubricFormAnswer[]Every change, for autosave
OutputSubmitRubricFormAnswer[]The complete answer set

Digits select a level and N marks the criterion not applicable. The shortcuts are ignored while typing in a text field, so rationale and evidence are never intercepted. Numeric and Percentage scales take a raw value. Submit stays disabled until every required answer, rationale, and evidence item is present.

<mj-rubric-scoring-form
[Version]="version"
[Answers]="answers"
(AnswersChange)="saveDraft($event)"
(Submit)="submit($event)">
</mj-rubric-scoring-form>
NameType
InputVersionRubricVersionSnapshot | nullThe version the evaluation pinned
InputResultRubricScoreResult | nullThe stored result
InputAnswersRubricFormAnswer[]Saved answers, shown beside each bar

Read-only. The score is mapped onto the version’s display range, the band is the stored band, and each criterion is a bar with its rationale and evidence.

mj-rubric-publish-dialog — confirm a publish

Section titled “mj-rubric-publish-dialog — confirm a publish”
NameType
InputBase, DraftRubricVersionSnapshot | nullThe version being replaced and the draft
InputRequestedBump, Summary, ReadOnlyThe author’s choices
OutputRequestedBumpChange, SummaryChange
OutputConfirm{ bump, summary }bump is null unless the author asked for a higher one

Shows the computed bump and the reason for each change. The host publishes by setting the draft’s Status to Published and saving; the server computes the number and hashes.

mj-rubric-version-diff — compare two versions

Section titled “mj-rubric-version-diff — compare two versions”

Inputs Base and Draft. One row per criterion key, with each change and its bump.

mj-rubric-comparison-matrix — compare evaluators

Section titled “mj-rubric-comparison-matrix — compare evaluators”
NameType
InputKeysstring[]Criterion keys, top to bottom
InputColumnsMatrixColumn[]One column per evaluation
InputProvider, RubricId, Major, SubjectEntityIdLets the matrix load the cohort itself
InputViewerStatus, ViewerEvaluationIdstringThe viewer’s own evaluation

Evaluators across, criteria down. Cells that disagree are marked, and the grid shows the human mean, the AI mean, the self mean and the cohort mean. Withdrawn columns stay visible and stay out of the means. While the viewer’s own evaluation is a Draft, cohort figures and other people’s rationales are hidden, so a reviewer scores before seeing anyone else.

Input Cards: RubricVersionCard[], output Open with a version id. A card per version with its status.

RubricCriterionEditorComponent, RubricScoreEditorComponent, RubricScaleLevelEditorComponent, RubricBandEditorComponent, RubricCategoryEditorComponent, and the *HostComponents bind one record each. Hosts load through the Provider the form passes in and never navigate. Explorer’s generated forms use them.