// "1/2" was stored as LaTeX \frac{1}{2} or \dfrac{1}{2} (both contain 'frac{1}{2}') $q = DB::table('questions')->where('qa_status','needs_revision')->where('question','like','%frac{1}{2}%'); $total = DB::table('questions')->where('qa_status','needs_revision')->count(); $rows = $q->orderBy('id')->get(['id','source','skill_id','type_id','question','answer0','answer1','answer2','answer3','correct_answer']); file_put_contents(storage_path('app/needsrev_half.json'), json_encode($rows, JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT)); echo "needs_revision TOTAL: $total\n"; echo "needs_revision AND question has \\frac{1}{2}/\\dfrac{1}{2}: ".$rows->count()."\n"; echo "--- ALL (id | source | first 120 chars) ---\n"; foreach ($rows as $r) { echo "#".$r->id." [".($r->source ?? 'no-source')."] t".$r->type_id.": ".substr(preg_replace('/\s+/',' ',$r->question),0,120)."\n"; }