# 3. Peer-to-Peer Learning — Test Cases

User Type: **Super Administrator**
Source: *Mi Digital Academy - Education CRM Features Document*
Spec: peer_to_peer_learning.md — every feature, sub-feature, and rule covered

## Test Execution Policy

- Zero tolerance: any deviation from the documented behavior is a defect.
- Every failed test is logged with a Bug ID, the feature, the sub-feature, the expected vs actual result, and the severity; 100% of bugs are fixed before the group passes.
- 100% pass rate is required for the group to be marked complete.

## Coverage Matrix

| Feature | Sub-feature / Rule | Test IDs |
|---------|--------------------|----------|
| 3.1 Question/Answer Moderation | Moderation mode: pre-post or post-post | TC-SA-SL-9-001 |
| 3.1 Question/Answer Moderation | Inappropriate content flagging (member/auto) | TC-SA-SL-9-002 |
| 3.1 Question/Answer Moderation | Duplicate question detection and merging | TC-SA-SL-9-003 |
| 3.1 Question/Answer Moderation | Answer quality checks | TC-SA-SL-9-004 |
| 3.1 Question/Answer Moderation | Rule: pre-post item not visible until approved | TC-SA-SL-9-005 |
| 3.1 Question/Answer Moderation | Rule: merged duplicate preserves answers | TC-SA-SL-9-006 |
| 3.1 Question/Answer Moderation | Audit logging of question/answer moderation | TC-SA-SL-9-007 |
| 3.2 Tutor Mode Configuration | Tutor eligibility criteria | TC-SA-SL-10-001 |
| 3.2 Tutor Mode Configuration | Tutor-to-learner matching | TC-SA-SL-10-002 |
| 3.2 Tutor Mode Configuration | Tutor session limits | TC-SA-SL-10-003 |
| 3.2 Tutor Mode Configuration | Rule: ineligible student cannot act as tutor | TC-SA-SL-10-004 |
| 3.2 Tutor Mode Configuration | Rule: tutor at cap cannot take further learners | TC-SA-SL-10-005 |
| 3.2 Tutor Mode Configuration | Audit logging of tutor mode configuration | TC-SA-SL-10-006 |
| 3.3 Reputation System | Reputation earning rules | TC-SA-SL-11-001 |
| 3.3 Reputation System | Reputation levels and thresholds | TC-SA-SL-11-002 |
| 3.3 Reputation System | Reputation-based privileges | TC-SA-SL-11-003 |
| 3.3 Reputation System | Rule: removed contribution does not earn reputation | TC-SA-SL-11-004 |
| 3.3 Reputation System | Rule: privilege applies only at/above defined level | TC-SA-SL-11-005 |
| 3.3 Reputation System | Audit logging of reputation system configuration | TC-SA-SL-11-006 |
| 3.4 Upvote Management | Upvote rules (one per user, reversible) | TC-SA-SL-12-001 |
| 3.4 Upvote Management | Upvote weighting (equal or reputation-weighted) | TC-SA-SL-12-002 |
| 3.4 Upvote Management | Upvote abuse prevention (self-vote blocking, patterns) | TC-SA-SL-12-003 |
| 3.4 Upvote Management | Rule: self-vote blocked | TC-SA-SL-12-004 |
| 3.4 Upvote Management | Rule: burst voting flagged and held | TC-SA-SL-12-005 |
| 3.4 Upvote Management | Audit logging of upvote management | TC-SA-SL-12-006 |

## 3.1 Question/Answer Moderation

### TC-SA-SL-9-001 — Moderation mode: pre-post or post-post
**Type:** Positive
**Covers:** 3.1 → Moderation mode
**Preconditions:** A Super Admin account is active; peer Q&A is enabled.
**Steps:**
1. As a Super Admin, set the moderation mode to pre-post and verify items are held for review.
2. Set the mode to post-post and verify items are visible until taken down.
**Expected Result:** Moderation mode — delivered exactly as documented.
**Priority:** Critical

### TC-SA-SL-9-002 — Inappropriate content flagging (member/auto)
**Type:** Positive
**Covers:** 3.1 → Content flagging
**Preconditions:** Peer Q&A is active.
**Steps:**
1. Configure member reports and auto-detection for inappropriate content.
2. Verify an inappropriate item is flagged by a report and by auto-detection.
**Expected Result:** Inappropriate content flagging — delivered exactly as documented.
**Priority:** High

### TC-SA-SL-9-003 — Duplicate question detection and merging
**Type:** Positive
**Covers:** 3.1 → Duplicate detection and merging
**Preconditions:** Two duplicate questions exist.
**Steps:**
1. Detect the duplicate questions.
2. Merge them and verify the redirect to the canonical question.
**Expected Result:** Duplicate question detection and merging — delivered exactly as documented.
**Priority:** Medium

### TC-SA-SL-9-004 — Answer quality checks
**Type:** Positive
**Covers:** 3.1 → Answer quality checks
**Preconditions:** Answers exist with varying quality.
**Steps:**
1. Run answer quality checks (length, relevance, profanity).
2. Verify low-quality answers are flagged.
**Expected Result:** Answer quality checks — delivered exactly as documented.
**Priority:** Medium

### TC-SA-SL-9-005 — Rule: pre-post item not visible until approved
**Type:** Negative
**Covers:** 3.1 → Rule: pre-post visibility
**Preconditions:** Moderation mode is pre-post; a question is submitted.
**Steps:**
1. Submit a question.
2. Verify it is not visible to others until approved.
**Expected Result:** In pre-post mode, a question/answer is not visible until approved — delivered exactly as documented.
**Priority:** Critical

### TC-SA-SL-9-006 — Rule: merged duplicate preserves answers
**Type:** Negative
**Covers:** 3.1 → Rule: merge preserves answers
**Preconditions:** A duplicate question has answers.
**Steps:**
1. Merge the duplicate into the canonical question.
2. Verify the answers are preserved and the redirect works.
**Expected Result:** A merged duplicate redirects to the canonical question and the answers are preserved — delivered exactly as documented.
**Priority:** High

### TC-SA-SL-9-007 — Audit logging of question/answer moderation
**Type:** Positive
**Covers:** 3.1 → Audit logging
**Preconditions:** Moderation actions have been performed.
**Steps:**
1. Open the audit trail and filter by question/answer moderation.
2. Verify entries show the item, the action, the reason, and the timestamp.
**Expected Result:** Audit logging of question/answer moderation — delivered exactly as documented.
**Priority:** Critical

## 3.2 Tutor Mode Configuration

### TC-SA-SL-10-001 — Tutor eligibility criteria
**Type:** Positive
**Covers:** 3.2 → Tutor eligibility criteria
**Preconditions:** A Super Admin is configuring tutor mode.
**Steps:**
1. Enable tutor mode and set the eligibility criteria (mastery level, reputation, grade).
2. Verify only eligible students can act as tutors.
**Expected Result:** Tutor eligibility criteria — delivered exactly as documented.
**Priority:** Critical

### TC-SA-SL-10-002 — Tutor-to-learner matching
**Type:** Positive
**Covers:** 3.2 → Tutor-to-learner matching
**Preconditions:** Eligible tutors and learners exist.
**Steps:**
1. Configure matching by subject, topic, and performance gap.
2. Verify a learner is matched to a suitable tutor.
**Expected Result:** Tutor-to-learner matching — delivered exactly as documented.
**Priority:** High

### TC-SA-SL-10-003 — Tutor session limits
**Type:** Positive
**Covers:** 3.2 → Tutor session limits
**Preconditions:** Tutor mode is enabled.
**Steps:**
1. Set the session limits (max concurrent learners, weekly cap).
2. Verify the limits are enforced on tutor sessions.
**Expected Result:** Tutor session limits — delivered exactly as documented.
**Priority:** High

### TC-SA-SL-10-004 — Rule: ineligible student cannot act as tutor
**Type:** Negative
**Covers:** 3.2 → Rule: eligibility enforcement
**Preconditions:** A student does not meet the eligibility criteria.
**Steps:**
1. Attempt to act as a tutor as the ineligible student.
2. Verify the tutor role is not available.
**Expected Result:** A student not meeting the eligibility criteria cannot act as a tutor — delivered exactly as documented.
**Priority:** Critical

### TC-SA-SL-10-005 — Rule: tutor at cap cannot take further learners
**Type:** Negative
**Covers:** 3.2 → Rule: cap enforcement
**Preconditions:** A tutor is at the session cap.
**Steps:**
1. Attempt to match another learner to the tutor.
2. Verify the match is blocked until a slot frees.
**Expected Result:** A tutor at the session cap cannot take further learners — delivered exactly as documented.
**Priority:** High

### TC-SA-SL-10-006 — Audit logging of tutor mode configuration
**Type:** Positive
**Covers:** 3.2 → Audit logging
**Preconditions:** Tutor mode configuration changes have been made.
**Steps:**
1. Open the audit trail and filter by tutor mode configuration.
2. Verify entries show the change and the timestamp.
**Expected Result:** Audit logging of tutor mode configuration — delivered exactly as documented.
**Priority:** Critical

## 3.3 Reputation System

### TC-SA-SL-11-001 — Reputation earning rules
**Type:** Positive
**Covers:** 3.3 → Reputation earning rules
**Preconditions:** A Super Admin is configuring the reputation system.
**Steps:**
1. Set the earning rules (helpful answer, accepted answer, quality contribution).
2. Trigger each contribution and verify reputation is earned per the rules.
**Expected Result:** Reputation earning rules — delivered exactly as documented.
**Priority:** Critical

### TC-SA-SL-11-002 — Reputation levels and thresholds
**Type:** Positive
**Covers:** 3.3 → Reputation levels
**Preconditions:** Reputation levels are defined.
**Steps:**
1. Define the levels and their thresholds.
2. Verify a student's level reflects their reputation against the thresholds.
**Expected Result:** Reputation levels and thresholds — delivered exactly as documented.
**Priority:** High

### TC-SA-SL-11-003 — Reputation-based privileges
**Type:** Positive
**Covers:** 3.3 → Reputation-based privileges
**Preconditions:** A privilege is set at a high reputation level.
**Steps:**
1. Set the privilege (e.g., auto-approve at a high level).
2. Verify a student at the level has the privilege and one below does not.
**Expected Result:** Reputation-based privileges — delivered exactly as documented.
**Priority:** High

### TC-SA-SL-11-004 — Rule: removed contribution does not earn reputation
**Type:** Negative
**Covers:** 3.3 → Rule: removed contribution
**Preconditions:** A contribution that earned reputation is removed.
**Steps:**
1. Remove the contribution.
2. Verify the reputation earned from it is not retained (or is reversed per policy).
**Expected Result:** Reputation is earned only from valid contributions — delivered exactly as documented.
**Priority:** High

### TC-SA-SL-11-005 — Rule: privilege applies only at/above defined level
**Type:** Negative
**Covers:** 3.3 → Rule: privilege level enforcement
**Preconditions:** A privilege is set at level 3; a student is at level 2.
**Steps:**
1. Verify the level-2 student does not have the privilege.
2. Raise the student to level 3 and verify the privilege applies.
**Expected Result:** A reputation-based privilege applies only at or above the defined level — delivered exactly as documented.
**Priority:** High

### TC-SA-SL-11-006 — Audit logging of reputation system configuration
**Type:** Positive
**Covers:** 3.3 → Audit logging
**Preconditions:** Reputation system configuration changes have been made.
**Steps:**
1. Open the audit trail and filter by reputation system configuration.
2. Verify entries show the rule, the change, and the timestamp.
**Expected Result:** Audit logging of reputation system configuration — delivered exactly as documented.
**Priority:** Critical

## 3.4 Upvote Management

### TC-SA-SL-12-001 — Upvote rules (one per user, reversible)
**Type:** Positive
**Covers:** 3.4 → Upvote rules
**Preconditions:** Upvotes are enabled on answers.
**Steps:**
1. Upvote an answer as a user and verify the count increments.
2. Remove the upvote and verify the count decrements (reversible).
**Expected Result:** Upvote rules — delivered exactly as documented.
**Priority:** High

### TC-SA-SL-12-002 — Upvote weighting (equal or reputation-weighted)
**Type:** Positive
**Covers:** 3.4 → Upvote weighting
**Preconditions:** Upvotes are enabled.
**Steps:**
1. Set weighting to equal and verify each upvote counts the same.
2. Set weighting to reputation-weighted and verify higher-reputation upvotes weigh more.
**Expected Result:** Upvote weighting — delivered exactly as documented.
**Priority:** Medium

### TC-SA-SL-12-003 — Upvote abuse prevention (self-vote blocking, patterns)
**Type:** Positive
**Covers:** 3.4 → Abuse prevention
**Preconditions:** Upvote abuse prevention is enabled.
**Steps:**
1. Verify self-vote blocking is active.
2. Simulate a burst voting pattern and verify it is detected.
**Expected Result:** Upvote abuse prevention — delivered exactly as documented.
**Priority:** High

### TC-SA-SL-12-004 — Rule: self-vote blocked
**Type:** Negative
**Covers:** 3.4 → Rule: self-vote blocking
**Preconditions:** A user has posted an answer.
**Steps:**
1. Attempt to upvote one's own answer.
2. Verify the self-vote is blocked.
**Expected Result:** A self-vote (upvoting one's own answer) is blocked — delivered exactly as documented.
**Priority:** High

### TC-SA-SL-12-005 — Rule: burst voting flagged and held
**Type:** Negative
**Covers:** 3.4 → Rule: burst voting
**Preconditions:** An item receives a burst of upvotes in a short window.
**Steps:**
1. Simulate burst voting on an item.
2. Verify the pattern is flagged and the votes are held for review.
**Expected Result:** An abuse pattern (burst voting) is flagged and the votes are held for review — delivered exactly as documented.
**Priority:** High

### TC-SA-SL-12-006 — Audit logging of upvote management
**Type:** Positive
**Covers:** 3.4 → Audit logging
**Preconditions:** Upvote configuration changes have been made.
**Steps:**
1. Open the audit trail and filter by upvote management.
2. Verify entries show the change and the timestamp.
**Expected Result:** Audit logging of upvote management — delivered exactly as documented.
**Priority:** Critical
