# Grading System — Figma Production Specs

---

## 1. GRADING TYPES

### Per-Assignment/Exam Configuration

| Grading Type | Display | Scale | Use Case |
|-------------|---------|-------|----------|
| `percentage` | "78%" | 0–100% | Default, universal |
| `letter_grade` | "B+" | A+/A/B+/B/C+/C+/C/D+/D/D+/F | Traditional schools |
| `numeric_score` | "78/100" | Raw number out of max | Simple scoring |
| `custom_scale` | "Good (70-89%)" | Teacher-defined tiers | Flexible grading |

### Letter Grade Mapping (Default)

| Range | Grade | Color |
|-------|-------|-------|
| 90–100 | A+ | #22C55E |
| 80–89 | A | #22C55E |
| 75–79 | B+ | #22C55E |
| 70–74 | B | #22C55E |
| 65–69 | C+ | #F59E0B |
| 60–64 | C | #F59E0B |
| 55–59 | D+ | #F59E0B |
| 50–54 | D | #F59E0B |
| 45–49 | D+ | #DC2626 |
| 0–44 | F | #DC2626 |

### Custom Scale Builder (TCH-12)

```
┌──────────────────────────────────────────────────────────────┐
│  Custom Grading Scale                                        │
│                                                              │
│  Label        Min %    Max %    Color    [Delete]           │
│  ┌──────────┐┌──────┐┌──────┐┌──────┐                      │
│  │ Excellent ││ 90   ││ 100  ││ #22C │                      │
│  └──────────┘└──────┘└──────┘└──────┘                      │
│  ┌──────────┐┌──────┐┌──────┐┌──────┐                      │
│  │ Good      ││ 70   ││ 89   ││ #F59 │                      │
│  └──────────┘└──────┘└──────┘└──────┘                      │
│  ┌──────────┐┌──────┐┌──────┐┌──────┐                      │
│  │ Pass      ││ 50   ││ 69   ││ #F59 │                      │
│  └──────────┘└──────┘└──────┘└──────┘                      │
│  ┌──────────┐┌──────┐┌──────┐┌──────┐                      │
│  │ Fail      ││ 0    ││ 49   ││ #DC2 │                      │
│  └──────────┘└──────┘└──────┘└──────┘                      │
│                                                              │
│  [+ Add Tier]                                                │
│                                                              │
│  ⚠ Tiers must not overlap. Gaps will be auto-filled.        │
└──────────────────────────────────────────────────────────────┘
```

---

## 2. ASSIGNMENT GRADING WORKFLOW

### Workflow Diagram

```
Teacher creates assignment (TCH-09)
    ↓
Students submit (STU-07)
    ↓
Auto-graded questions → Score calculated instantly
Manual questions → Flagged for review
    ↓
Teacher opens TCH-11 (Grade Submission)
    ↓
Reviews each submission:
├── Auto-graded portion: Verified
├── Manual portion: Teacher scores + feedback
└── Final score = Auto + Manual
    ↓
Click "Submit Grade"
    ↓
Score saved → Student notified → Parent notified (if configured)
    ↓
"Release Grades" (optional batch release)
    ↓
Feedback visible per show_feedback_after configuration
```

### TCH-11: Grade Submission Panel

```
┌──────────────────────────────────────────────────────────────┐
│  Grade Submission                                  3/12      │
├──────────────────────────────────────┬───────────────────────┤
│                                      │                       │
│  Submission Viewer                  │  GRADING PANEL        │
│                                      │  (360px, fixed)      │
│  Amara Asante                       │                       │
│  Submitted: Jun 14, 3:45 PM         │  Score                │
│                                      │  ┌──────────────┐    │
│  Q1: What is 2+2?                   │  │ 78        /100│    │
│  Student answer: 4                   │  └──────────────┘    │
│  ✓ Correct (10/10)                  │                       │
│                                      │  78%                  │
│  Q2: Solve 3x+7=22                  │  B+ (RP/Badge)        │
│  Student answer: x=5                 │                       │
│  ✓ Correct (10/10)                  │  ✓ Passing            │
│                                      │                       │
│  Q3: Essay question                 │  Feedback             │
│  Student answer: [essay text...]     │  ┌──────────────┐    │
│  ⚠ Pending manual grading           │  │ Great work on │    │
│                                      │  │ Q1 and Q2.    │    │
│  Q4: File upload                    │  │ Your essay...  │    │
│  📄 worksheet.pdf (2.4 MB)         │  │                │    │
│  [Preview] [Download]               │  └──────────────┘    │
│                                      │                       │
│                                      │  ──────────────────  │
│                                      │                       │
│                                      │  [Skip]  [Submit]    │
│                                      │   ghost    primary   │
│                                      │                       │
└──────────────────────────────────────┴───────────────────────┘
```

### Scoring Rules

| Scenario | Score Calculation |
|----------|-------------------|
| All auto-graded | Sum of correct × points each |
| Mixed auto + manual | Auto points + manual points (manual graded separately) |
| All manual | Teacher assigns total score |
| Partial credit (Multi) | (correct_selected / total_correct) × points |
| Partial credit (Numeric) | Full credit if within tolerance |
| Partial credit (Matching) | Points per correctly matched pair |

### Feedback Fields

| Field | Type | Required | Visibility |
|-------|------|----------|------------|
| Score | Number | Yes | Student + Parent |
| Grade Letter | Auto-calculated | Auto | Student + Parent |
| Feedback text | Textarea | No | Per feedback config |
| Per-question feedback | Textarea | No | Student only |
| Rubric scores | Slider per criteria | No | Student + Parent |

---

## 3. EXAM GRADING WORKFLOW

### Auto-Grade Process

```
Student submits exam (STU-09)
    ↓
System auto-grades all auto-gradable questions:
├── MC: Compare selected vs correct → full points or 0
├── Multi Select: Partial credit if enabled
├── T/F: Compare selected vs correct → full points or 0
├── Fill in Blank: Compare (case-insensitive by default) → full points or 0
├── Matching: Points per correctly matched pair
└── Numeric: Full credit if within tolerance
    ↓
Manual questions flagged:
├── Short Answer → TCH-15 Review Queue
├── Essay → TCH-15 Review Queue
└── File Upload → TCH-15 Review Queue
    ↓
Initial score = auto-graded portion only
"Partial grade available — X questions pending manual review"
    ↓
Teacher reviews manual questions (TCH-15)
    ↓
Final score = auto + manual
    ↓
Teacher clicks "Finalize" → grades released per config
```

### TCH-15: Question Review Queue

```
┌──────────────────────────────────────────────────────────────┐
│  Review Queue                                    8 pending   │
│                                                              │
│  [Pending Review (8)] [Reviewed (12)] [Overridden (2)]      │
│                                                              │
│  ┌──────────────────────────────────────────────────────────┐│
│  │ Q3: Essay — "Explain photosynthesis"                     ││
│  │ Student: Amara Asante                                    ││
│  │ Points possible: 20                                      ││
│  │                                                          ││
│  │ "Photosynthesis is the process by which plants..."       ││
│  │ [Full student answer displayed here]                     ││
│  │                                                          ││
│  │ Marking criteria:                                        ││
│  │ "Award marks for: definition (5), process (10),          ││
│  │  examples (5)"                                           ││
│  │                                                          ││
│  │ Score: [____] / 20    Feedback: [____________]          ││
│  │                                                          ││
│  │ [Submit Grade]  [Skip]  [View Full Submission]          ││
│  └──────────────────────────────────────────────────────────┘│
│                                                              │
│  ┌──────────────────────────────────────────────────────────┐│
│  │ Q5: Short Answer — "What is the capital of Burkina Faso?"││
│  │ Student: Kofi Mensah                                     ││
│  │ Points possible: 5                                       ││
│  │                                                          ││
│  │ Student answer: "Ouagadougou"                            ││
│  │ Correct answer: "Ouagadougou" (reference)                ││
│  │                                                          ││
│  │ Score: [____] / 5    Feedback: [____________]           ││
│  │                                                          ││
│  │ [Submit Grade]  [Skip]                                   ││
│  └──────────────────────────────────────────────────────────┘│
│                                                              │
└──────────────────────────────────────────────────────────────┘
```

---

## 4. RUBRIC SCORING

### Rubric Definition (on assignment/exam)

```
┌──────────────────────────────────────────────────────────────┐
│  Rubric: Essay Grading Criteria                              │
│                                                              │
│  Criteria          Excellent(5)  Good(3)  Fair(1)  Poor(0)  │
│  ┌───────────────┬─────────────┬────────┬────────┬────────┐ │
│  │ Understanding │ Deep        │ Good   │ Basic  │ Minimal│ │
│  │ of topic      │ knowledge   │ knowl. │ knowl. │ knowl. │ │
│  ├───────────────┼─────────────┼────────┼────────┼────────┤ │
│  │ Writing       │ Clear,      │ Good   │ Some   │ Poor   │ │
│  │ quality       │ structured  │ writing│ errors │ writng │ │
│  ├───────────────┼─────────────┼────────┼────────┼────────┤ │
│  │ Evidence &    │ Strong      │ Good   │ Some   │ No     │ │
│  │ examples      │ evidence    │ evid.  │ evid.  │ evid.  │ │
│  └───────────────┴─────────────┴────────┴────────┴────────┘ │
│                                                              │
│  Total: [auto-calculated from criteria scores]              │
└──────────────────────────────────────────────────────────────┘
```

### Rubric in Grading Panel

```
Score: [Auto-calculated from rubric selections]

Understanding: [Excellent ▾] = 5 pts
Writing quality: [Good ▾] = 3 pts  
Evidence: [Fair ▾] = 1 pts

Total: 9 / 15 pts
```

---

## 5. BULK GRADING

### Bulk Score Release

```
┌──────────────────────────────────────────────────────────────┐
│  Bulk Actions                                                │
│                                                              │
│  Selected: 12 submissions                                    │
│                                                              │
│  [Release All Grades]  [Download Scoresheet]  [Export]       │
│                                                              │
│  ⚠ Releasing grades will notify all students and parents.    │
│  This action cannot be undone.                               │
│                                                              │
│  [Confirm Release]  [Cancel]                                 │
└──────────────────────────────────────────────────────────────┘
```

### Score Moderation (Admin)

```
┌──────────────────────────────────────────────────────────────┐
│  Score Moderation                                            │
│                                                              │
│  Original score: 78%                                         │
│  Moderated score: [82] %                                     │
│  Reason: [Teacher adjustment for participation]              │
│  Moderated by: Admin Name                                    │
│                                                              │
│  [Apply Moderation]                                          │
└──────────────────────────────────────────────────────────────┘
```

---

## 6. GRADE RELEASE WORKFLOW

### Release Options

| Option | Description | Visibility |
|--------|-------------|------------|
| `immediate` | Grade visible right after teacher saves | Instant |
| `after_due` | Grade visible after due date passes | Delayed |
| `after_all_graded` | Grade visible after all submissions graded | Batch |
| `manual` | Teacher manually releases when ready | Manual |

### Release Confirmation Modal

```
RP/Modal (md)
├── Header: "Release Grades?"
├── Content:
│   "You are about to release grades for:"
│   "Math Quiz Ch.5 — 12 graded submissions"
│   ""
│   "Students will be able to see:"
│   "✓ Their score and grade"
│   "✓ Feedback (if provided)"
│   "✓ Correct answers (if configured)"
│   ""
│   RP/Banner (warning): "This action cannot be undone."
├── Footer:
│   [Cancel] (ghost)  [Release Grades] (primary)
```

---

## 7. INLINE FEEDBACK

### Per-Question Feedback (TCH-11)

```
┌──────────────────────────────────────────────────────────────┐
│  Q1: What is 2+2?                                            │
│  Student answer: 4                                            │
│  ✓ Correct (10/10)                                           │
│                                                              │
│  ┌──────────────────────────────────────────────────────────┐│
│  │ Feedback for this question:                              ││
│  │ [Correct! Well done.]                    [Save]         ││
│  └──────────────────────────────────────────────────────────┘│
└──────────────────────────────────────────────────────────────┘
```

### Overall Feedback

```
┌──────────────────────────────────────────────────────────────┐
│  Overall Feedback                                            │
│  ┌──────────────────────────────────────────────────────────┐│
│  │ Excellent work on the multiple choice questions. Your   ││
│  │ essay could use more specific examples next time.       ││
│  └──────────────────────────────────────────────────────────┘│
│  Character count: 98/2000                                    │
└──────────────────────────────────────────────────────────────┘
```

---

## 8. GRADE VIEW (Student Side — STU-10)

### Score Display by Grading Type

| Type | Display | Color |
|------|---------|-------|
| `percentage` | "78%" (large) | color/secondary |
| `letter_grade` | "B+" (large) | color/success |
| `numeric_score` | "78 / 100" | color/secondary |
| `custom_scale` | "Good (70-89%)" | Scale color band |

### Feedback Display Rules

| Condition | Student Sees |
|-----------|-------------|
| `show_feedback_after` = `immediately` | Feedback right after submission |
| `show_feedback_after` = `after_due` | Feedback after due date passes |
| `show_feedback_after` = `after_graded` | Feedback after teacher finalizes |
| `show_feedback_after` = `never` | No feedback shown |
| `show_correct_answers` = true | Side-by-side: Student answer vs Correct |
| `feedback_visibility` = `student` | Only student sees |
| `feedback_visibility` = `parent` | Only parent sees |
| `feedback_visibility` = `both` | Both see |