$src = json_decode(file_get_contents('C:/allgifted/mathapi11v2/docs/past year questions/_needsrev_half.json'), true); $out=[]; foreach ($src as $row) { $id=$row['id']; $d=DB::table('questions')->find($id); $out[]=[ 'id'=>$id, 'exists'=>$d? true:false, 'dev_question'=>$d->question ?? null, 'dev_qa'=>$d->qa_status ?? null, 'dev_a0'=>$d->answer0 ?? null, 'dev_a1'=>$d->answer1 ?? null, 'dev_a2'=>$d->answer2 ?? null, 'dev_a3'=>$d->answer3 ?? null, 'dev_ca'=>$d->correct_answer ?? null, ]; } file_put_contents('C:/allgifted/mathapi11v2/docs/past year questions/_dev_versions.json', json_encode($out, JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES)); $missing = count(array_filter($out, fn($x)=>!$x['exists'])); echo "dumped ".count($out)." dev versions; missing_on_dev=$missing\n";