From 5a2fc7e1870562b776775601a8feb4b79b504be3 Mon Sep 17 00:00:00 2001 From: Daniel Date: Wed, 1 Apr 2026 04:13:50 +0200 Subject: [PATCH] Fix display: update n_chunks after chunk boundary filtering MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The 'Chunk X/5' message was showing 5 even when only 2 chunks were being processed (pages 1-50 and 51-55). n_chunks was not updated after filtering chunks to stay before answer_section_start. Cosmetic fix — the actual extraction was already correct. Co-Authored-By: Claude Sonnet 4.6 (1M context) --- backend/app/tasks/quiz_tasks.py | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/app/tasks/quiz_tasks.py b/backend/app/tasks/quiz_tasks.py index 63ae57d..2d9002f 100644 --- a/backend/app/tasks/quiz_tasks.py +++ b/backend/app/tasks/quiz_tasks.py @@ -130,6 +130,7 @@ def extract_quiz( chunks = [(s, min(e, q_end)) for s, e in chunks if s <= q_end] if not chunks: chunks = [(section.start_page, q_end)] + n_chunks = len(chunks) # update display count after filtering all_valid_questions = [] all_skipped = []