import json, os

with open('_work_barmodels/chunk_prod_image.json', 'r', encoding='utf-8') as f:
    data = json.load(f)

entries = data[256:320]
print(f'Got {len(entries)} entries (256-319)')
for i, e in enumerate(entries):
    idx = 256 + i
    img = e.get('question_image', '')
    q = e.get('question', '')[:150].replace('\n', ' ')
    sol = e.get('solution', '')
    if sol:
        sol_preview = sol[:120].replace('\n', ' ')
    else:
        sol_preview = 'NULL'
    hints = e.get('hints', [])
    ans = e.get('answers', [])
    corr = e.get('correct_index')
    print(f'--- [{idx}] id={e["id"]} type={e["type"]} correct_idx={corr}')
    print(f'  answers: {ans}')
    print(f'  image: {img if img else "none"}')
    print(f'  question: {q}')
    print(f'  solution: {sol_preview}')
    if hints:
        for hi, h in enumerate(hints):
            print(f'  hint{hi}: {str(h)[:150]}')
    print()
