›
›
›
  1. docs
  2. ›
  3. byrcsc/laravel-checklist
1.x
Browse documentationOpenClose

Getting started

  • Introduction
  • Installation and setup
  • Quick start

Core concepts

  • Templates and versions
  • Items and sections
  • Checklist lifecycle
  • Answers and evidence
  • Conditional rules
  • Scoring
  • Recurring schedules
  • Audit history

Operations

  • Author a template
  • Run a checklist
  • Create a schedule
  • Customize notifications
  • Export and report
  • Verify audit history
  • Composing with sibling packages

Reference

  • Configuration
  • Builder API
  • Models and scopes
  • Events and notifications
  • Console commands
  • Enums and contracts
  • Testing
  • Troubleshooting

Getting started

  • Introduction
  • Installation and setup
  • Quick start

Core concepts

  • Templates and versions
  • Items and sections
  • Checklist lifecycle
  • Answers and evidence
  • Conditional rules
  • Scoring
  • Recurring schedules
  • Audit history

Operations

  • Author a template
  • Run a checklist
  • Create a schedule
  • Customize notifications
  • Export and report
  • Verify audit history
  • Composing with sibling packages

Reference

  • Configuration
  • Builder API
  • Models and scopes
  • Events and notifications
  • Console commands
  • Enums and contracts
  • Testing
  • Troubleshooting

byrcsc/laravel-checklist · 1.x

Scoring.

Submission stores weighted item scores, nested section rollups, threshold results, and critical failures.

Submitting a checklist calculates one score from its answers and stores it, so the result never changes afterwards. Scores are stored as ratios from 0.0 to 1.0, while template authors set pass thresholds as percentages.

Item handlers decide scores

Checkbox, yes/no, pass/fail, rating, and scored select items contribute to the total. Text, number, date, and unscored select items do not enter either side of the calculation.

A rating is normalized linearly between its bounds. On a 1 to 5 scale, answers 1, 3, and 5 score 0.0, 0.5, and 1.0.

A multiple select uses the mean score of its selected options. An empty multiple select is unanswered and unscored, not a zero.

Weights change relative contribution

$version = TemplateBuilder::make('Weighted inspection')
    ->passThreshold(75)
    ->passFail('Brakes')->weight(3)
    ->passFail('Cabin light')->weight(1)
    ->publish();

If brakes pass and the cabin light fails, the score is 3 / 4 = 0.75. Absolute weight values do not matter; their ratios do.

The calculator excludes unanswered, unscored, and not-applicable answers from the possible weight. Hiding an answered item removes its earned and possible weight together.

Thresholds decide pass status

passThreshold(75) compares the stored ratio against 0.75. Landing exactly on the threshold passes. The calculator rounds its ratio before comparison so binary floating-point noise does not turn an exact boundary into a failure.

Without a threshold, the package still stores a score but leaves passed as null. A score and a verdict are separate facts.

Critical failure overrides the threshold

$builder->passFail('Emergency stop operates')->critical();

Any applicable critical answer whose handler reports a score of exactly zero sets critical_failed and forces passed to false, even when the total score exceeds the threshold or no threshold exists.

Unscored answers never fail. A rating fails only at the bottom of its scale. A select option without a score is worth zero once any option on that item has a score.

Section rollups include descendants

Each section score covers its own items and every nested section below it. Every item contributes once to each ancestor rollup and once to the checklist total.

$score = $checklist->sectionScore($section);
$same = $checklist->sectionScore($section->id);

A section with no applicable scorable answers has a null score, not zero.

Results are stored at submission

Before submission, score, passed, and section_scores are null. Successful submission stores the calculation so historical reports do not rerun current code against old work.

Reopening clears stored results. The next submission recalculates them from the corrected applicable answers.

What to read next

  • Items and sections for each handler's answer and score behavior.
  • Export and report to query stored scores and critical failures.
  • Models and scopes for result accessors and scopes.
PreviousConditional rulesNextRecurring schedules
View source

On this page

  1. Item handlers decide scores
  2. Weights change relative contribution
  3. Thresholds decide pass status
  4. Critical failure overrides the threshold
  5. Section rollups include descendants
  6. Results are stored at submission
  7. What to read next