# Recon: needs_revision MCQ scope

Read-only. Run these from `php artisan tinker` or your MySQL client against **production**. Paste outputs back into chat.

## 1. Question type taxonomy

```sql
-- What question types exist? "MCQ" and "type 1" — same thing or different?
SELECT id, type, description 
FROM types 
ORDER BY id;
```

If the table isn't called `types`, try: `question_types`, or check the FK on `questions`:

```sql
DESCRIBE questions;
-- Look for the column referencing question type (likely type_id or question_type_id)
```

## 2. Volume by type and status

```sql
-- How many needs_revision questions are there, broken down by type?
SELECT 
  t.type AS question_type,
  COUNT(*) AS n
FROM questions q
LEFT JOIN types t ON q.type_id = t.id
WHERE q.qa_status = 'needs_revision'
GROUP BY t.type
ORDER BY n DESC;
```

Replace `types`/`type_id` with the actual table/column from step 1.

## 3. Spot-check sample of needs_revision MCQs

```sql
-- 10 random samples of needs_revision MCQs — sanity check what they look like
SELECT 
  id, 
  LEFT(question, 100) AS question_snippet,
  LEFT(answer0, 30) AS a0,
  LEFT(answer1, 30) AS a1,
  LEFT(answer2, 30) AS a2,
  LEFT(answer3, 30) AS a3,
  correct_answer,
  type_id
FROM questions
WHERE qa_status = 'needs_revision'
  AND type_id IN (/* MCQ type id from step 1 */)
ORDER BY RAND()
LIMIT 10;
```

## 4. Sanity flags

```sql
-- How many have invalid correct_answer (NULL or out of 0-3 range)?
SELECT COUNT(*) 
FROM questions 
WHERE qa_status = 'needs_revision'
  AND type_id IN (/* MCQ type id */)
  AND (correct_answer IS NULL OR correct_answer < 0 OR correct_answer > 3);

-- How many have any answer field empty?
SELECT COUNT(*) 
FROM questions 
WHERE qa_status = 'needs_revision'
  AND type_id IN (/* MCQ type id */)
  AND (answer0 IS NULL OR answer0 = '' 
    OR answer1 IS NULL OR answer1 = ''
    OR answer2 IS NULL OR answer2 = ''
    OR answer3 IS NULL OR answer3 = '');
```

## 5. Image vs text questions

```sql
-- How many MCQs in needs_revision have images? (Matters for LLM solvability)
SELECT 
  CASE 
    WHEN question_image IS NOT NULL AND question_image != '' THEN 'has_image'
    ELSE 'text_only'
  END AS has_image,
  COUNT(*) AS n
FROM questions
WHERE qa_status = 'needs_revision'
  AND type_id IN (/* MCQ type id */)
GROUP BY has_image;
```

---

## What I'll do with the numbers

| Volume of `needs_revision` MCQs | Approach |
|---|---|
| < 50 | Pam reviews manually, no LLM needed |
| 50–500 | Claude API per question, CSV staging, sample-review |
| 500–2,000 | Batched LLM, CSV staging, programmatic sanity checks before bulk apply |
| > 2,000 | Cohort it — start with highest-traffic fields, defer the rest |

Image-heavy questions need vision-capable model; text-only is cheaper and faster. Numbers from step 5 decide which path or whether we split into two passes.

Paste the outputs and I'll write the sized playbook.
