---
title: "Grading and completion"
description: "Configure scoring, feedback, answer matching, and completion independently."
source: "https://docs.blend-ed.com/interactive-content-xblock/grading-and-completion/"
---

# Grading and completion

Grading and completion are separate. A block can publish a score without a custom completion rule, or mark an exploration complete without producing a score.

## Publish grades
Turn on **Enable Auto-Grading** when responses should publish a grade to Open edX. **Weight** is the maximum score. If auto-grading is off, interactions and completion are still saved, but no grade event is published.

Choose one evaluation approach in Studio.

### JavaScript-controlled grading
Select **None (JS controls grading)** and include a boolean `correct` property:

```
submitInteraction({ answer: selectedAnswer, correct: selectedAnswer === "Paris" });
```
- `true` awards the full weight.
- `false` awards zero.
- An optional `feedback` property overrides the configured feedback message.

This approach suits interactions whose result is easier to calculate in the browser. The server accepts the submitted boolean; it does not independently verify the activity logic.

### Single-answer matching
Select **Single Answer** and enter the expected answer. Submit an `answer` property without a `correct` property:

```
submitInteraction({ answer: learnerAnswer });
```
The server converts both values to strings, trims surrounding whitespace, and compares them without case sensitivity. A match awards the full weight.

### Multiple-field matching
Select **Multiple Fields** and map each field name to its expected value. Submit matching property names:

```
submitInteraction({ country: "France", capital: "Paris" });
```
Each matching field receives an equal share of the weight. All fields must match for the response to be marked correct, but a partial score is published when only some match. Comparisons are trimmed and case-insensitive.

> **Note**
> If submitted data contains a boolean `correct`, JavaScript-controlled grading takes precedence over configured answer matching.

## Configure feedback
Set correct and incorrect feedback in **Grading Configuration**. Keep **Show Feedback to Learners** enabled to display the result after submission. Keep **Show Previous Response** enabled to show the saved result when the learner returns; the previous-response panel is shown only when learner feedback is also enabled.

Use **Test Grading** in Studio to exercise the selected mode before saving. For custom JavaScript-controlled grading, the test opens the activity in a sandboxed preview and displays the payload from `submitInteraction()`.

## Choose a completion mode

| Mode | Completion event | Grade event |
| --- | --- | --- |
| **On submit** | Emitted whenever `submitInteraction()` is handled. This is the default. | Published only when auto-grading is enabled. |
| **On view** | Emitted once after at least 50% of the block remains visible for the configured delay. | Never published by the completion action. |
| **Manual** | Emitted once when author code calls `window.markComplete()`. | Never published by the completion action. |

**View Completion Delay** is measured in milliseconds and defaults to `3000`. Use **On view** for a short simulation or explanation with no natural submission. Use **Manual** when the activity itself knows when the learner has finished.

On-view and manual completion are idempotent for each learner. They do not evaluate an answer, modify the saved response, or publish a score.
