diff --git a/src/main/kotlin/edu/ntnu/idi/idatt/backend/bootstrap/tasks/FinalBossTaskSeeds.kt b/src/main/kotlin/edu/ntnu/idi/idatt/backend/bootstrap/tasks/FinalBossTaskSeeds.kt deleted file mode 100644 index 928f10cf..00000000 --- a/src/main/kotlin/edu/ntnu/idi/idatt/backend/bootstrap/tasks/FinalBossTaskSeeds.kt +++ /dev/null @@ -1,123 +0,0 @@ -package edu.ntnu.idi.idatt.backend.bootstrap.tasks - -import edu.ntnu.idi.idatt.backend.game.tasks.domain.TaskType - -internal fun finalBossTaskSeed(): SeedTask = - SeedTask( - difficultyLevel = 1, - taskType = TaskType.FINAL_BOSS, - title = localized("Datasenteret: Finalekamp", "Data Center: Final showdown"), - introText = - localizedOptional( - "Datatyven bruker triks fra hele spillet. Stopp opp, tenk, og velg klokt.", - "The data thief uses tricks from the whole game. Pause, think, and choose carefully.", - ), - items = - listOf( - binaryChoiceItem( - 1, - "Datatyven sender en overskrift med masse store bokstaver og sterke følelser. Hva er det første faresignalet?", - "The data thief sends a headline with lots of capital letters and strong feelings. What is the first warning sign?", - explainedOption( - 1, - "At overskriften prøver å få deg til å reagere før du tenker.", - "That the headline tries to make you react before you think.", - true, - "Sensasjonsspråk brukes ofte for å presse fram raske delinger.", - "Sensational language is often used to push quick sharing.", - ), - explainedOption( - 2, - "At teksten er kort.", - "That the text is short.", - false, - "Kort tekst er ikke i seg selv et faresignal.", - "Short text is not a warning sign by itself.", - ), - ), - binaryChoiceItem( - 2, - "Du får et bilde som ser ekte ut, men hendene har for mange fingre. Hva bør du tenke?", - "You get an image that looks real, but the hands have too many fingers. What should you think?", - explainedOption( - 1, - "At bildet kan være KI-generert eller manipulert.", - "That the image may be AI-generated or manipulated.", - true, - "Rare detaljer er et kjent tegn på kunstige bilder.", - "Odd details are a known sign of artificial images.", - ), - explainedOption( - 2, - "At personen bare beveget hendene fort.", - "That the person just moved their hands quickly.", - false, - "Det forklarer ikke ekstra fingre.", - "That does not explain extra fingers.", - ), - ), - binaryChoiceItem( - 3, - "En e-post sier at du må klikke på en lenke med én gang. Hva gjør du?", - "An email says you must click a link right away. What do you do?", - explainedOption( - 1, - "Stopper opp og sjekker avsenderen før jeg gjør noe.", - "Pause and check the sender before I do anything.", - true, - "Hastverk er vanlig i svindel.", - "Urgency is common in scams.", - ), - explainedOption( - 2, - "Klikker fort så meldingen forsvinner.", - "Click quickly so the message goes away.", - false, - "Det er akkurat det en svindler ønsker.", - "That is exactly what a scammer wants.", - ), - ), - binaryChoiceItem( - 4, - "En ukjent nettside bruker en pen logo, men har et rart domenenavn. Hva stoler du mest på?", - "An unknown website uses a nice logo, but has a strange domain name. What do you trust more?", - explainedOption( - 1, - "Domenenavnet og om informasjonen kan dobbeltsjekkes.", - "The domain name and whether the information can be double-checked.", - true, - "Utseende alene er ikke nok.", - "Appearance alone is not enough.", - ), - explainedOption( - 2, - "Logoen, fordi profesjonelle logoer betyr at siden er trygg.", - "The logo, because professional logos mean the site is safe.", - false, - "Logoer kan kopieres.", - "Logos can be copied.", - ), - ), - binaryChoiceItem( - 5, - "Vennene dine sier du må dele et rykte nå. Hva er beste valg?", - "Your friends say you must share a rumor now. What is the best choice?", - explainedOption( - 1, - "Vent, spør etter kilden, og del bare hvis informasjonen kan bekreftes.", - "Wait, ask for the source, and only share if the information can be confirmed.", - true, - "Du stopper feilinformasjon fra å spre seg videre.", - "You stop misinformation from spreading further.", - ), - explainedOption( - 2, - "Del det først og undersøk senere.", - "Share it first and investigate later.", - false, - "Da kan ryktet allerede ha spredt seg.", - "By then the rumor may already have spread.", - ), - ), - ), - ) diff --git a/src/main/kotlin/edu/ntnu/idi/idatt/backend/game/gameProgress/infrastructure/PupilGameProgressRepository.kt b/src/main/kotlin/edu/ntnu/idi/idatt/backend/game/gameProgress/infrastructure/PupilGameProgressRepository.kt index bbcf872e..2d6d4306 100644 --- a/src/main/kotlin/edu/ntnu/idi/idatt/backend/game/gameProgress/infrastructure/PupilGameProgressRepository.kt +++ b/src/main/kotlin/edu/ntnu/idi/idatt/backend/game/gameProgress/infrastructure/PupilGameProgressRepository.kt @@ -19,14 +19,4 @@ interface PupilGameProgressRepository : JpaRepository } diff --git a/src/main/kotlin/edu/ntnu/idi/idatt/backend/game/tasks/domain/TaskType.kt b/src/main/kotlin/edu/ntnu/idi/idatt/backend/game/tasks/domain/TaskType.kt index 96820b67..e0125339 100644 --- a/src/main/kotlin/edu/ntnu/idi/idatt/backend/game/tasks/domain/TaskType.kt +++ b/src/main/kotlin/edu/ntnu/idi/idatt/backend/game/tasks/domain/TaskType.kt @@ -4,12 +4,10 @@ package edu.ntnu.idi.idatt.backend.game.tasks.domain * Coarse content categories for authored tasks. */ enum class TaskType { - EMAIL_REVIEW, NEWS_COMPARISON, IMAGE_ASSESSMENT, IMAGE_SELECT, PASSWORD_EVALUATION, SOCIAL_SCENARIO, - FINAL_BOSS, GENERIC, } diff --git a/src/main/kotlin/edu/ntnu/idi/idatt/backend/iam/domain/UserStatus.kt b/src/main/kotlin/edu/ntnu/idi/idatt/backend/iam/domain/UserStatus.kt index 67dae155..12cb0df4 100644 --- a/src/main/kotlin/edu/ntnu/idi/idatt/backend/iam/domain/UserStatus.kt +++ b/src/main/kotlin/edu/ntnu/idi/idatt/backend/iam/domain/UserStatus.kt @@ -6,5 +6,4 @@ package edu.ntnu.idi.idatt.backend.iam.domain enum class UserStatus { ACTIVE, INACTIVE, - SUSPENDED, } diff --git a/src/main/kotlin/edu/ntnu/idi/idatt/backend/medals/domain/Medal.kt b/src/main/kotlin/edu/ntnu/idi/idatt/backend/medals/domain/Medal.kt index 2dfc2547..92917a23 100644 --- a/src/main/kotlin/edu/ntnu/idi/idatt/backend/medals/domain/Medal.kt +++ b/src/main/kotlin/edu/ntnu/idi/idatt/backend/medals/domain/Medal.kt @@ -29,19 +29,19 @@ import jakarta.persistence.Table class Medal( @Id @GeneratedValue(strategy = GenerationType.IDENTITY) - val id: Long = 0, + var id: Long = 0, @Column(nullable = false, unique = true) - val code: String, + var code: String, @Column(nullable = false) - val title: String, + var title: String, @Column - val description: String?, + var description: String?, @Enumerated(EnumType.STRING) @Column(nullable = false) - val medalType: MedalType, + var medalType: MedalType, @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "stop_id") - val stop: MapStop?, + var stop: MapStop?, @Column - val iconUrl: String?, + var iconUrl: String?, ) diff --git a/src/main/kotlin/edu/ntnu/idi/idatt/backend/mystery/infrastructure/WeeklyMysteryRepository.kt b/src/main/kotlin/edu/ntnu/idi/idatt/backend/mystery/infrastructure/WeeklyMysteryRepository.kt index 2b896af8..4d4c6147 100644 --- a/src/main/kotlin/edu/ntnu/idi/idatt/backend/mystery/infrastructure/WeeklyMysteryRepository.kt +++ b/src/main/kotlin/edu/ntnu/idi/idatt/backend/mystery/infrastructure/WeeklyMysteryRepository.kt @@ -16,13 +16,6 @@ interface WeeklyMysteryRepository : JpaRepository { /** Full history ordered newest-first. Used by the teacher management view. */ fun findAllByClassroomIdOrderByWeekStartDesc(classroomId: Long): List - /** Whether a given submission is already featured in a specific week. Used for UI hints. */ - fun existsByClassroomIdAndSubmissionIdAndWeekStart( - classroomId: Long, - submissionId: Long, - weekStart: LocalDate, - ): Boolean - /** Removes a specific featured entry so a teacher can un-feature a submission from a week. */ fun deleteByIdAndClassroomId( id: Long, diff --git a/src/main/kotlin/edu/ntnu/idi/idatt/backend/upload/application/FileStorageService.kt b/src/main/kotlin/edu/ntnu/idi/idatt/backend/upload/application/FileStorageService.kt index 7753311e..3581522c 100644 --- a/src/main/kotlin/edu/ntnu/idi/idatt/backend/upload/application/FileStorageService.kt +++ b/src/main/kotlin/edu/ntnu/idi/idatt/backend/upload/application/FileStorageService.kt @@ -22,7 +22,7 @@ import java.util.UUID */ @Service class FileStorageService( - @Value("\${app.uploads.base-url}") private val baseUrl: String, + @Value($$"${app.uploads.base-url}") private val baseUrl: String, @Value($$"${app.uploads.base-dir:${user.home}/nettdetektivene/uploads}") private val baseDirPath: String, ) { private val baseStorageDir by lazy { Paths.get(baseDirPath).toAbsolutePath() } diff --git a/src/main/kotlin/edu/ntnu/idi/idatt/backend/xp/infrastructure/PupilXpEventRepository.kt b/src/main/kotlin/edu/ntnu/idi/idatt/backend/xp/infrastructure/PupilXpEventRepository.kt index e885a2d2..06fec3e7 100644 --- a/src/main/kotlin/edu/ntnu/idi/idatt/backend/xp/infrastructure/PupilXpEventRepository.kt +++ b/src/main/kotlin/edu/ntnu/idi/idatt/backend/xp/infrastructure/PupilXpEventRepository.kt @@ -18,18 +18,6 @@ interface PupilXpEventRepository : JpaRepository { */ fun findAllByIdPupilUserId(pupilUserId: Long): List - /** - * Checks whether one XP event has already been awarded to one pupil. - * - * @param pupilUserId identifier of the pupil. - * @param xpEventId identifier of the XP event definition. - * @return `true` when the composite award row already exists. - */ - fun existsByIdPupilUserIdAndIdXpEventId( - pupilUserId: Long, - xpEventId: Long, - ): Boolean - /** * Finds the awarded XP row for one pupil-event pair. *