Exam base

This commit is contained in:
micialware committed 2026-10-03 01:13:11 +03:00
1 parent 6628d79307
commit 4b9e257cdf
12 files changed
+183 -17

No files matched your search

+7 -1
View File
@@ -18,6 +18,7 @@ use log::info;
use parking_lot::{Mutex, RwLock};
use rusqlite::Connection;
use std::sync::Arc;
use crate::data_provider::exam::{ExamEntryRepository, ExamRepository};
pub const USER_FONT: Font = Font::with_name("Noto Sans JP");
@@ -70,6 +71,8 @@ pub struct AppState {
pub connection: Arc<Mutex<SqliteConnection>>,
pub sync_data: Arc<RwLock<AppSettings>>,
pub history: HistoryRepository,
pub exam: ExamRepository,
pub exam_entries: ExamEntryRepository
}
impl Default for AppState {
@@ -87,7 +90,9 @@ impl AppState {
word_groups: WordGroupRepository::new(connection.clone()),
card_states: CardStateRepository::new(connection.clone()),
history: HistoryRepository::new(connection.clone()),
exam: ExamRepository::new(connection.clone()),
custom_fields: CustomFieldRepository::new(connection.clone()),
exam_entries: ExamEntryRepository::new(connection.clone()),
sync_data: Arc::new(RwLock::new(AppSettings {
key: None,
auto_web_fetch: false,
@@ -108,7 +113,8 @@ pub fn fill_state(state: &mut AppState) {
state.history.write().start().unwrap();
state.card_states.write().start().unwrap();
state.custom_fields.write().start().unwrap();
state.exam.write().start().unwrap();
state.exam_entries.write().start().unwrap();
state.sync_data = Arc::new(RwLock::new(setting))
}