Döküman kısmı güncellendi#10
Open
Cuneyt-Sahin wants to merge 2 commits into
Open
Conversation
Döküman kısmına flash kart ve quiz kısmı eklendi.Ek olarak da birkaç küçüü döküman bölümleri güncellendi
There was a problem hiding this comment.
Pull request overview
Bu PR, doküman bazlı RAG akışına ek olarak dokümandan quiz ve flashcard üretimi (backend + Flutter UI) ekliyor; ayrıca uzun süren LLM/embedding çağrıları için timeout/polling davranışlarını güncelliyor.
Changes:
- LLM backend’e quiz/flashcard prompt’ları ve
/rag/quiz,/rag/flashcardsendpoint’leri eklendi. - Node backend’e
/documents/:id/quizve/documents/:id/flashcardsroute’ları + ilgili RAG servis fonksiyonları eklendi. - Flutter tarafına quiz/flashcard ekranları, yerel geçmiş saklama (SharedPreferences) ve doküman kartında gelişmiş progress/polling eklendi.
Reviewed changes
Copilot reviewed 20 out of 21 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| pubspec.lock | Flutter bağımlılık kilit dosyası güncellenmiş. |
| llm_backend/app/services/llm_service.py | Ollama üzerinden quiz/flashcard üretimi için yeni servis fonksiyonları. |
| llm_backend/app/models/chat_models.py | Quiz/flashcard request/response Pydantic modelleri eklendi. |
| llm_backend/app/core/prompts.py | RAG prompt güncellendi; quiz/flashcard JSON-only prompt’ları eklendi. |
| llm_backend/app/core/config.py | REQUEST_TIMEOUT varsayılanı 300s’e çekildi. |
| llm_backend/app/api/rag.py | /rag/quiz ve /rag/flashcards endpoint’leri eklendi. |
| lib/shared/services/api_service.dart | Dio send/receive timeout’ları 300s yapıldı. |
| lib/shared/models/models.dart | Document’a totalChunks eklendi; quiz/flashcard model sınıfları eklendi. |
| lib/shared/data/quiz_repository.dart | Quiz session/attempt geçmişi için SharedPreferences tabanlı repo (Riverpod Notifier). |
| lib/shared/data/flashcard_repository.dart | Flashcard set saklama için SharedPreferences tabanlı repo (Riverpod Notifier). |
| lib/shared/data/providers.dart | Küçük import düzeni (boş satır) değişikliği. |
| lib/shared/data/api_document_repository.dart | /documents/:id/quiz ve /documents/:id/flashcards istemcileri eklendi. |
| lib/features/study/presentation/session_running_screen.dart | FAB için heroTag eklendi. |
| lib/features/documents/presentation/quiz_screen.dart | Quiz ayar sheet’i + quiz çözme ekranı + geçmiş sheet’i eklendi. |
| lib/features/documents/presentation/flashcard_screen.dart | Flashcard ayar sheet’i + çalışma ekranı + set detay sheet’i eklendi. |
| lib/features/documents/presentation/documents_screen.dart | Polling 500ms’e çekildi; document kartı stateful progress animasyonu eklendi. |
| lib/features/documents/presentation/document_detail_screen.dart | Quiz/flashcard oluşturma butonları ve oluşturulan içerik listeleri eklendi. |
| lib/app/shell/app_shell.dart | Upload FAB için heroTag eklendi. |
| backend/src/services/llm_backend.service.ts | LLM backend’e quiz/flashcards çağrıları eklendi. |
| backend/src/services/document_rag.service.ts | Quiz/flashcards üretimi için servis fonksiyonları eklendi; context-used logic güncellendi. |
| backend/src/routes/documents.ts | /documents/:id/quiz ve /documents/:id/flashcards route’ları eklendi. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Comment on lines
+25
to
+26
| // 500ms — embedding request'leri aralarında bile yakalayabilmek için | ||
| _poller = Timer.periodic(const Duration(milliseconds: 500), (_) { |
| final batchCount = (chunks / 10).ceil(); // batch başına ~2s (local Ollama) | ||
| final estimatedSeconds = batchCount * 2.0; | ||
| // %5'ten %90'a = 0.85 mesafe, estimatedSeconds * 5 tick | ||
| incrementPerTick = (0.85 / (estimatedSeconds * 5)).clamp(0.0005, 0.01); |
|
|
||
| final _letters = ['A', 'B', 'C', 'D']; | ||
|
|
||
| QuizQuestion get _q => widget.session.questions[_currentIndex]; |
Comment on lines
+314
to
+315
| FlashCard get _card => widget.set.cards[_currentIndex]; | ||
|
|
Comment on lines
+342
to
+346
| onPressed: () => Navigator.of(context).push( | ||
| MaterialPageRoute<void>( | ||
| builder: (_) => QuizScreen(session: session), | ||
| ), | ||
| ), |
Comment on lines
+82
to
+93
| // Test Hazırla butonu | ||
| SizedBox( | ||
| width: double.infinity, | ||
| child: OutlinedButton.icon( | ||
| onPressed: document.status == DocStatus.ready | ||
| ? () async { | ||
| await showQuizSettingsSheet(context, document); | ||
| } | ||
| : null, | ||
| icon: const Icon(Icons.quiz_rounded), | ||
| label: const Text('Test Hazırla'), | ||
| style: OutlinedButton.styleFrom( |
Comment on lines
+50
to
+57
| import json | ||
| import re | ||
|
|
||
| match = re.search(r'(\{.*\}|\[.*\])', result_json, re.DOTALL) | ||
| if match: | ||
| result_json = match.group(0) | ||
|
|
||
| parsed = json.loads(result_json) |
Comment on lines
+45
to
+47
| @router.post("/quiz") | ||
| def quiz_endpoint(req: QuizGenerateRequest): | ||
| try: |
Comment on lines
+369
to
+386
| final total = widget.session.questions.length; | ||
|
|
||
| return Scaffold( | ||
| backgroundColor: const Color(0xFFF8FAFC), | ||
| appBar: AppBar( | ||
| title: Text('${_currentIndex + 1} / $total', style: const TextStyle(fontWeight: FontWeight.bold)), | ||
| centerTitle: true, | ||
| backgroundColor: Colors.transparent, | ||
| elevation: 0, | ||
| leading: IconButton(icon: const Icon(Icons.close_rounded), onPressed: () => Navigator.of(context).pop()), | ||
| ), | ||
| body: Column( | ||
| children: [ | ||
| Padding( | ||
| padding: const EdgeInsets.symmetric(horizontal: 24), | ||
| child: LinearProgressIndicator( | ||
| value: _currentIndex / total, | ||
| minHeight: 6, |
Comment on lines
+478
to
+480
| onPressed: () => Navigator.of(context).push( | ||
| MaterialPageRoute<void>(builder: (_) => FlashcardStudyScreen(set: set)), | ||
| ), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Döküman kısmına flash kart ve quiz kısmı eklendi.Ek olarak da birkaç küçüü döküman bölümleri güncellendi