From fc02351adbe2fa330e78c796c8d401df9ebfafbe Mon Sep 17 00:00:00 2001 From: kristoffer Date: Mon, 20 Apr 2026 13:28:00 +0200 Subject: [PATCH 1/2] fixed task-bootstrapping --- .../backend/bootstrap/DevDataBootstrap.kt | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/main/kotlin/edu/ntnu/idi/idatt/backend/bootstrap/DevDataBootstrap.kt b/src/main/kotlin/edu/ntnu/idi/idatt/backend/bootstrap/DevDataBootstrap.kt index 3df32441..ea734411 100644 --- a/src/main/kotlin/edu/ntnu/idi/idatt/backend/bootstrap/DevDataBootstrap.kt +++ b/src/main/kotlin/edu/ntnu/idi/idatt/backend/bootstrap/DevDataBootstrap.kt @@ -502,7 +502,7 @@ class DevDataBootstrap( ), ), ), - binaryChoiceTask( + SeedTask( difficultyLevel = 3, taskType = TaskType.NEWS_COMPARISON, title = localized("Nyhetskvartalet 3: Følelser og fakta", "News Quarter 3: Feelings and facts"), @@ -510,25 +510,25 @@ class DevDataBootstrap( "Velg teksten som bruker mest fakta og minst følelsespress.", "Choose the text that uses the most facts and the least emotional pressure.", ), - promptText = localized( - "Hvilken ingress virker mest pålitelig?", - "Which introduction seems most reliable?", - ), - correctOption = explainedOption( - 1, - "Tre klasser testet lesetidene sine i to uker og skrev ned resultatene.", - "Three classes tested their reading times for two weeks and wrote down the results.", - true, - "Den beskriver hva som er gjort og bygger på observerbare fakta.", - "It explains what was done and relies on observable facts.", - ), - incorrectOption = explainedOption( - 2, - "Alle er rasende etter den utrolig skumle nyheten som sprer seg overalt.", - "Everyone is furious after the incredibly scary news spreading everywhere.", - false, - "Den prøver å styre følelsene dine uten å gi konkrete opplysninger.", - "It tries to steer your feelings without giving concrete information.", + items = listOf( + SeedItem( + itemOrder = 1, + promptText = localized( + "Tre klasser testet lesetidene sine i to uker og skrev ned resultatene.", + "Three classes tested their reading times for two weeks and wrote down the results.", + ), + metadataJson = null, + options = emptyList(), + ), + SeedItem( + itemOrder = 2, + promptText = localized( + "Alle er rasende etter den utrolig skumle nyheten som sprer seg overalt.", + "Everyone is furious after the incredibly scary news spreading everywhere.", + ), + metadataJson = null, + options = emptyList(), + ), ), ), ) From 1cba303d1e5a3c48358d676330e15f6158c297f2 Mon Sep 17 00:00:00 2001 From: kristoffer Date: Mon, 20 Apr 2026 14:47:41 +0200 Subject: [PATCH 2/2] added seeding stopProgress for ada in bootstrapping --- .../ntnu/idi/idatt/backend/bootstrap/DevDataBootstrap.kt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/kotlin/edu/ntnu/idi/idatt/backend/bootstrap/DevDataBootstrap.kt b/src/main/kotlin/edu/ntnu/idi/idatt/backend/bootstrap/DevDataBootstrap.kt index ea734411..06b1e664 100644 --- a/src/main/kotlin/edu/ntnu/idi/idatt/backend/bootstrap/DevDataBootstrap.kt +++ b/src/main/kotlin/edu/ntnu/idi/idatt/backend/bootstrap/DevDataBootstrap.kt @@ -31,6 +31,7 @@ import edu.ntnu.idi.idatt.backend.users.profile.domain.PupilProfile import edu.ntnu.idi.idatt.backend.users.profile.domain.TeacherProfile import edu.ntnu.idi.idatt.backend.users.profile.infrastructure.PupilProfileRepository import edu.ntnu.idi.idatt.backend.users.profile.infrastructure.TeacherProfileRepository +import edu.ntnu.idi.idatt.backend.game.mapstops.application.PupilProgressSeedingService import org.slf4j.LoggerFactory import org.springframework.boot.ApplicationArguments import org.springframework.boot.ApplicationRunner @@ -63,6 +64,7 @@ class DevDataBootstrap( private val mapStopBootstrap: MapStopBootstrap, private val mapStopsRepository: MapStopsRepository, private val taskRepository: TaskRepository, + private val pupilProgressSeedingService: PupilProgressSeedingService, ) : ApplicationRunner { private val logger = LoggerFactory.getLogger(javaClass) @@ -129,6 +131,11 @@ class DevDataBootstrap( stops = mapStopsRepository.findAllByIsActiveTrueOrderByDisplayOrderAsc(), ) + pupilProgressSeedingService.seedIfAbsent( + pupil = pupilAda, + classroom = sampleClassroom, + ) + logger.info( "Development bootstrap ensured sample rows for users, profiles, refresh tokens, classroom {} with join code {}, and seeded tasks for {} active map stops", sampleClassroom.title,