diff --git a/core/src/main/res/values-pt/strings.xml b/core/src/main/res/values-pt/strings.xml
index 1ded572a..136ae0ee 100644
--- a/core/src/main/res/values-pt/strings.xml
+++ b/core/src/main/res/values-pt/strings.xml
@@ -125,4 +125,17 @@
Login
Mostrar o cartão de login
Mostrar o cartão de login na página inicial
+ More options
+ Abrir navegação
+ Copiar seed labirinto
+ Recomeçar labirinto
+ Gerar labirinto
+ Labirinto aleatório
+ Gerar labirinto com perguntas aleatórias, todos os modos de jogo serão incluidos.
+ Labirinto customizado
+ Gerar labirinto com opções personalizadas
+ Expandir opções de personalização
+ "Quando usa uma seed personalizada, as perguntas de múltipla escolha não serão geradas aleatoriamente por essa seed. "
+ Gerar
+ Seed
\ No newline at end of file
diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml
index eff89458..56632bae 100644
--- a/core/src/main/res/values/strings.xml
+++ b/core/src/main/res/values/strings.xml
@@ -2,6 +2,7 @@
Quick Quiz
Back
+ More options
Saved questions
Wordle
Wordle infinite
@@ -125,4 +126,16 @@
Easy
Medium
Hard
+ Open drawer
+ Copy maze seed
+ Restart maze
+ Generate maze
+ Random maze
+ Generate maze with random questions, all game modes will be included.
+ Custom maze
+ Generate maze with custom options
+ Expand custom options
+ When using custom seed, multi choice questions will not be random generated by this seed.
+ Generate
+ Seed
\ No newline at end of file
diff --git a/data/src/main/java/com/infinitepower/newquiz/data/worker/maze/GenerateMazeQuizWorker.kt b/data/src/main/java/com/infinitepower/newquiz/data/worker/maze/GenerateMazeQuizWorker.kt
index fbf3ba06..be3c826f 100644
--- a/data/src/main/java/com/infinitepower/newquiz/data/worker/maze/GenerateMazeQuizWorker.kt
+++ b/data/src/main/java/com/infinitepower/newquiz/data/worker/maze/GenerateMazeQuizWorker.kt
@@ -67,36 +67,43 @@ class GenerateMazeQuizWorker @AssistedInject constructor(
val allMazeItemsAsync = gameModes.map { mode ->
when (mode) {
GameModes.MULTI_CHOICE -> generateMultiChoiceMazeItems(
+ mazeSeed = seed,
questionSize = questionSizePerMode,
multiChoiceQuizType = MultiChoiceQuizType.NORMAL,
random = random
)
GameModes.LOGO -> generateMultiChoiceMazeItems(
+ mazeSeed = seed,
questionSize = questionSizePerMode,
multiChoiceQuizType = MultiChoiceQuizType.LOGO,
random = random
)
GameModes.FLAG -> generateMultiChoiceMazeItems(
+ mazeSeed = seed,
questionSize = questionSizePerMode,
multiChoiceQuizType = MultiChoiceQuizType.FLAG,
random = random
)
GameModes.WORDLE -> generateWordleMazeItems(
+ mazeSeed = seed,
questionSize = questionSizePerMode,
wordleQuizType = WordleQuizType.TEXT,
random = random
)
GameModes.GUESS_NUMBER -> generateWordleMazeItems(
+ mazeSeed = seed,
questionSize = questionSizePerMode,
wordleQuizType = WordleQuizType.NUMBER,
random = random
)
GameModes.GUESS_MATH_FORMULA -> generateWordleMazeItems(
+ mazeSeed = seed,
questionSize = questionSizePerMode,
wordleQuizType = WordleQuizType.MATH_FORMULA,
random = random
)
GameModes.GUESS_MATH_SOLUTION -> generateMultiChoiceMazeItems(
+ mazeSeed = seed,
questionSize = questionSizePerMode,
multiChoiceQuizType = MultiChoiceQuizType.GUESS_MATH_SOLUTION,
random = random
@@ -132,10 +139,11 @@ class GenerateMazeQuizWorker @AssistedInject constructor(
}
private suspend fun generateMultiChoiceMazeItems(
+ mazeSeed: Int,
questionSize: Int,
multiChoiceQuizType: MultiChoiceQuizType,
difficulty: QuestionDifficulty = QuestionDifficulty.Easy,
- random: Random = Random,
+ random: Random = Random
): List {
val questions = when (multiChoiceQuizType) {
MultiChoiceQuizType.NORMAL -> multiChoiceQuestionRepository.getRandomQuestions(
@@ -158,6 +166,7 @@ class GenerateMazeQuizWorker @AssistedInject constructor(
return questions.map { question ->
MazeQuiz.MazeItem.MultiChoice(
+ mazeSeed = mazeSeed,
question = question,
difficulty = difficulty
)
@@ -165,6 +174,7 @@ class GenerateMazeQuizWorker @AssistedInject constructor(
}
private suspend fun generateWordleMazeItems(
+ mazeSeed: Int,
questionSize: Int,
wordleQuizType: WordleQuizType,
difficulty: QuestionDifficulty = QuestionDifficulty.Easy,
@@ -187,6 +197,7 @@ class GenerateMazeQuizWorker @AssistedInject constructor(
}
).map { word ->
MazeQuiz.MazeItem.Wordle(
+ mazeSeed = mazeSeed,
word = word,
wordleQuizType = wordleQuizType,
difficulty = difficulty
diff --git a/math-quiz/src/main/java/com/infinitepower/newquiz/math_quiz/list/MathQuizListScreen.kt b/math-quiz/src/main/java/com/infinitepower/newquiz/math_quiz/list/MathQuizListScreen.kt
index ae523b8d..20211427 100644
--- a/math-quiz/src/main/java/com/infinitepower/newquiz/math_quiz/list/MathQuizListScreen.kt
+++ b/math-quiz/src/main/java/com/infinitepower/newquiz/math_quiz/list/MathQuizListScreen.kt
@@ -20,7 +20,6 @@ import com.infinitepower.newquiz.core.ui.home_card.components.HomeCardItemConten
import com.infinitepower.newquiz.core.ui.home_card.model.HomeCardItem
import com.infinitepower.newquiz.core.util.ui.nav_drawer.NavDrawerUtil
import com.infinitepower.newquiz.math_quiz.list.data.getMathQuizListCardItemData
-import com.ramcosta.composedestinations.annotation.DeepLink
import com.infinitepower.newquiz.core.R as CoreR
import com.ramcosta.composedestinations.annotation.Destination
import com.ramcosta.composedestinations.navigation.DestinationsNavigator
@@ -68,7 +67,7 @@ private fun MathQuizListScreenImpl(
IconButton(onClick = openDrawer) {
Icon(
imageVector = Icons.Rounded.Menu,
- contentDescription = "Open drawer"
+ contentDescription = stringResource(id = CoreR.string.open_drawer)
)
}
}
diff --git a/maze-quiz/src/main/java/com/infinitepower/newquiz/maze_quiz/MazeScreen.kt b/maze-quiz/src/main/java/com/infinitepower/newquiz/maze_quiz/MazeScreen.kt
index 484bffb4..96a6eae1 100644
--- a/maze-quiz/src/main/java/com/infinitepower/newquiz/maze_quiz/MazeScreen.kt
+++ b/maze-quiz/src/main/java/com/infinitepower/newquiz/maze_quiz/MazeScreen.kt
@@ -5,8 +5,12 @@ import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.rounded.ArrowBack
+import androidx.compose.material.icons.rounded.ContentCopy
+import androidx.compose.material.icons.rounded.MoreVert
import androidx.compose.material.icons.rounded.RestartAlt
import androidx.compose.material3.CircularProgressIndicator
+import androidx.compose.material3.DropdownMenu
+import androidx.compose.material3.DropdownMenuItem
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
@@ -17,9 +21,13 @@ import androidx.compose.material3.TopAppBar
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
+import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
+import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
+import androidx.compose.ui.platform.LocalClipboardManager
import androidx.compose.ui.res.stringResource
+import androidx.compose.ui.text.AnnotatedString
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.lifecycle.compose.ExperimentalLifecycleComposeApi
import androidx.lifecycle.compose.collectAsStateWithLifecycle
@@ -29,7 +37,6 @@ import com.infinitepower.newquiz.core.theme.NewQuizTheme
import com.infinitepower.newquiz.core.theme.spacing
import com.infinitepower.newquiz.maze_quiz.components.GenerateMazeComponent
import com.infinitepower.newquiz.maze_quiz.components.MazeComponent
-import com.infinitepower.newquiz.model.math_quiz.MathFormula
import com.infinitepower.newquiz.model.maze.MazeQuiz
import com.infinitepower.newquiz.model.maze.MazeQuiz.MazeItem
import com.infinitepower.newquiz.model.question.QuestionDifficulty
@@ -76,8 +83,12 @@ private fun MazeScreenImpl(
) {
val spaceMedium = MaterialTheme.spacing.medium
+ val clipboardManager = LocalClipboardManager.current
+
val formulas = uiState.mathMaze.items
+ var moreOptionsExpanded by remember { mutableStateOf(false) }
+
Scaffold(
topBar = {
TopAppBar(
@@ -93,11 +104,45 @@ private fun MazeScreenImpl(
}
},
actions = {
- if (!uiState.isMazeEmpty) {
- IconButton(onClick = { uiEvent(MazeScreenUiEvent.RestartMaze) }) {
- Icon(
- imageVector = Icons.Rounded.RestartAlt,
- contentDescription = "Restart"
+ IconButton(onClick = { moreOptionsExpanded = true }) {
+ Icon(
+ imageVector = Icons.Rounded.MoreVert,
+ contentDescription = stringResource(id = CoreR.string.more_options)
+ )
+ }
+ DropdownMenu(
+ expanded = moreOptionsExpanded,
+ onDismissRequest = { moreOptionsExpanded = false }
+ ) {
+ if (formulas.isNotEmpty()) {
+ DropdownMenuItem(
+ text = { Text(stringResource(id = CoreR.string.copy_maze_seed)) },
+ onClick = {
+ val mazeSeed = uiState.mazeSeed
+ if (mazeSeed != null) {
+ clipboardManager.setText(AnnotatedString(mazeSeed.toString()))
+ }
+ moreOptionsExpanded = false
+ },
+ leadingIcon = {
+ Icon(
+ imageVector = Icons.Rounded.ContentCopy,
+ contentDescription = stringResource(id = CoreR.string.copy_maze_seed)
+ )
+ }
+ )
+ DropdownMenuItem(
+ text = { Text(stringResource(id = CoreR.string.restart_maze)) },
+ onClick = {
+ uiEvent(MazeScreenUiEvent.RestartMaze)
+ moreOptionsExpanded = false
+ },
+ leadingIcon = {
+ Icon(
+ imageVector = Icons.Rounded.RestartAlt,
+ contentDescription = stringResource(id = CoreR.string.restart_maze)
+ )
+ }
)
}
}
@@ -143,7 +188,8 @@ fun MazeScreenPreview() {
word = "1+1=2",
difficulty = QuestionDifficulty.Easy,
played = true,
- wordleQuizType = WordleQuizType.MATH_FORMULA
+ wordleQuizType = WordleQuizType.MATH_FORMULA,
+ mazeSeed = 0
)
}
@@ -151,7 +197,8 @@ fun MazeScreenPreview() {
MazeItem.Wordle(
word = "1+1=2",
difficulty = QuestionDifficulty.Easy,
- wordleQuizType = WordleQuizType.MATH_FORMULA
+ wordleQuizType = WordleQuizType.MATH_FORMULA,
+ mazeSeed = 0
)
}
diff --git a/maze-quiz/src/main/java/com/infinitepower/newquiz/maze_quiz/MazeScreenUiState.kt b/maze-quiz/src/main/java/com/infinitepower/newquiz/maze_quiz/MazeScreenUiState.kt
index 04f25aca..736d2fbe 100644
--- a/maze-quiz/src/main/java/com/infinitepower/newquiz/maze_quiz/MazeScreenUiState.kt
+++ b/maze-quiz/src/main/java/com/infinitepower/newquiz/maze_quiz/MazeScreenUiState.kt
@@ -11,4 +11,7 @@ data class MazeScreenUiState(
) {
val isMazeEmpty: Boolean
get() = mathMaze.items.isEmpty()
+
+ val mazeSeed: Int?
+ get() = mathMaze.items.firstOrNull()?.mazeSeed
}
\ No newline at end of file
diff --git a/maze-quiz/src/main/java/com/infinitepower/newquiz/maze_quiz/components/GenerateMazeComponent.kt b/maze-quiz/src/main/java/com/infinitepower/newquiz/maze_quiz/components/GenerateMazeComponent.kt
index f55f952e..3ad44e47 100644
--- a/maze-quiz/src/main/java/com/infinitepower/newquiz/maze_quiz/components/GenerateMazeComponent.kt
+++ b/maze-quiz/src/main/java/com/infinitepower/newquiz/maze_quiz/components/GenerateMazeComponent.kt
@@ -14,7 +14,9 @@ import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
+import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
+import com.infinitepower.newquiz.core.R as CoreR
import com.infinitepower.newquiz.core.common.annotation.compose.PreviewNightLight
import com.infinitepower.newquiz.core.theme.NewQuizTheme
import com.infinitepower.newquiz.core.theme.spacing
@@ -38,7 +40,7 @@ internal fun GenerateMazeComponent(
) {
item {
Text(
- text = "Generate Maze",
+ text = stringResource(id = CoreR.string.generate_maze),
style = MaterialTheme.typography.displaySmall
)
}
@@ -47,7 +49,7 @@ internal fun GenerateMazeComponent(
Spacer(modifier = Modifier.height(spaceExtraLarge))
GenerateMazeCard(
onClick = {
- onGenerateClick(null, null) // empty list means all game modes selected
+ onGenerateClick(null, null) // null list means all game modes selected
}
)
Spacer(modifier = Modifier.height(spaceMedium))
@@ -80,12 +82,12 @@ private fun GenerateMazeCard(
.padding(spaceMedium)
) {
Text(
- text = "Random Maze",
+ text = stringResource(id = CoreR.string.random_maze),
style = MaterialTheme.typography.headlineMedium
)
Spacer(modifier = Modifier.height(spaceSmall))
Text(
- text = "Generate maze with random questions, all game modes will be included.",
+ text = stringResource(id = CoreR.string.generate_maze_with_random_items),
style = MaterialTheme.typography.titleMedium
)
}
diff --git a/maze-quiz/src/main/java/com/infinitepower/newquiz/maze_quiz/components/GenerateMazeWithSeedCard.kt b/maze-quiz/src/main/java/com/infinitepower/newquiz/maze_quiz/components/GenerateMazeWithSeedCard.kt
index 1b74fbc2..1ace4144 100644
--- a/maze-quiz/src/main/java/com/infinitepower/newquiz/maze_quiz/components/GenerateMazeWithSeedCard.kt
+++ b/maze-quiz/src/main/java/com/infinitepower/newquiz/maze_quiz/components/GenerateMazeWithSeedCard.kt
@@ -23,6 +23,7 @@ import androidx.compose.material3.OutlinedTextField
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
+import androidx.compose.runtime.ReadOnlyComposable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateListOf
import androidx.compose.runtime.mutableStateOf
@@ -30,6 +31,7 @@ import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
+import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.unit.dp
import com.infinitepower.newquiz.core.common.annotation.compose.PreviewNightLight
@@ -37,6 +39,7 @@ import com.infinitepower.newquiz.core.theme.NewQuizTheme
import com.infinitepower.newquiz.core.theme.spacing
import com.infinitepower.newquiz.data.worker.maze.GenerateMazeQuizWorker.Companion.GameModes
import kotlin.random.Random
+import com.infinitepower.newquiz.core.R as CoreR
@Composable
@ExperimentalMaterial3Api
@@ -107,12 +110,12 @@ private fun GenerateMazeWithSeedCardImpl(
modifier = Modifier.weight(1f)
) {
Text(
- text = "Custom Maze",
+ text = stringResource(id = CoreR.string.custom_maze),
style = MaterialTheme.typography.headlineMedium
)
Spacer(modifier = Modifier.height(spaceSmall))
Text(
- text = "Generate maze with custom options",
+ text = stringResource(id = CoreR.string.generate_maze_with_custom_options),
style = MaterialTheme.typography.titleMedium
)
@@ -121,7 +124,7 @@ private fun GenerateMazeWithSeedCardImpl(
IconButton(onClick = onExpandClick) {
Icon(
imageVector = dropDownIcon,
- contentDescription = "Expand custom options"
+ contentDescription = stringResource(id = CoreR.string.expand_custom_options)
)
}
}
@@ -144,7 +147,7 @@ private fun GenerateMazeWithSeedCardImpl(
OutlinedTextField(
value = seed,
onValueChange = setSeed,
- label = { Text(text = "Seed") },
+ label = { Text(text = stringResource(id = CoreR.string.seed)) },
modifier = Modifier.fillMaxWidth(),
singleLine = true,
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Number)
@@ -153,7 +156,7 @@ private fun GenerateMazeWithSeedCardImpl(
if (GameModes.MULTI_CHOICE.ordinal in gameModesSelected) {
Text(
- text = "When using custom seed, multi choice questions will not be random generated by this seed.",
+ text = stringResource(id = CoreR.string.custom_maze_multi_choice_warning),
style = MaterialTheme.typography.bodyMedium
)
}
@@ -164,7 +167,7 @@ private fun GenerateMazeWithSeedCardImpl(
modifier = Modifier.align(Alignment.End),
enabled = generateButtonEnabled
) {
- Text(text = "Generate")
+ Text(text = stringResource(id = CoreR.string.generate))
}
}
}
@@ -191,7 +194,7 @@ private fun GameModesComponent(
Row(
verticalAlignment = Alignment.CenterVertically
) {
- Text(text = mode.name)
+ Text(text = getGameModeText(gameMode = mode))
Spacer(modifier = Modifier.weight(1f))
Checkbox(
checked = index in gameModesSelected,
@@ -202,6 +205,18 @@ private fun GameModesComponent(
}
}
+@Composable
+@ReadOnlyComposable
+fun getGameModeText(gameMode: GameModes) = when (gameMode) {
+ GameModes.MULTI_CHOICE -> stringResource(id = CoreR.string.multi_choice_quiz)
+ GameModes.LOGO -> stringResource(id = CoreR.string.logo_quiz)
+ GameModes.FLAG -> stringResource(id = CoreR.string.flag_quiz)
+ GameModes.WORDLE -> stringResource(id = CoreR.string.wordle)
+ GameModes.GUESS_NUMBER -> stringResource(id = CoreR.string.guess_number)
+ GameModes.GUESS_MATH_FORMULA -> stringResource(id = CoreR.string.guess_math_formula)
+ GameModes.GUESS_MATH_SOLUTION -> stringResource(id = CoreR.string.guess_solution)
+}
+
@Composable
@PreviewNightLight
@OptIn(ExperimentalMaterial3Api::class)
diff --git a/maze-quiz/src/main/java/com/infinitepower/newquiz/maze_quiz/components/MazeComponent.kt b/maze-quiz/src/main/java/com/infinitepower/newquiz/maze_quiz/components/MazeComponent.kt
index 58834fd0..df37a1ee 100644
--- a/maze-quiz/src/main/java/com/infinitepower/newquiz/maze_quiz/components/MazeComponent.kt
+++ b/maze-quiz/src/main/java/com/infinitepower/newquiz/maze_quiz/components/MazeComponent.kt
@@ -167,21 +167,13 @@ private fun MazeComponentImpl(
detectTapGestures(
onTap = { tapOffset ->
val tapPoint = tapOffset.toMazePoint()
- Log.d("MazeComponent", "Items: $items")
- Log.d("MazeComponent", "Tap point: $tapPoint")
val tapIndex = mazePoints.indexOfFirstOrNull { mazePoint ->
val realMazePoint = mazePoint.copy(y = mazePoint.y + topScroll)
tapPoint.isInsideCircle(realMazePoint, circleRadius)
}
- Log.d("MazeComponent", "Tap index: $tapIndex")
-
if (tapIndex != null) {
- Log.d(
- "MazeComponent",
- "Tap Is Playable: ${items.isPlayableItem(tapIndex)}"
- )
if (items.isPlayableItem(tapIndex)) onClick(tapIndex)
}
}
@@ -275,7 +267,8 @@ private fun MazeComponentPreview() {
word = "1+1=2",
difficulty = QuestionDifficulty.Easy,
played = true,
- wordleQuizType = WordleQuizType.MATH_FORMULA
+ wordleQuizType = WordleQuizType.MATH_FORMULA,
+ mazeSeed = 0
)
}
@@ -283,7 +276,8 @@ private fun MazeComponentPreview() {
MazeQuiz.MazeItem.Wordle(
word = "1+1=2",
difficulty = QuestionDifficulty.Easy,
- wordleQuizType = WordleQuizType.MATH_FORMULA
+ wordleQuizType = WordleQuizType.MATH_FORMULA,
+ mazeSeed = 0
)
}
diff --git a/model/src/main/java/com/infinitepower/newquiz/model/maze/MazeQuiz.kt b/model/src/main/java/com/infinitepower/newquiz/model/maze/MazeQuiz.kt
index e79b5358..e4e96f62 100644
--- a/model/src/main/java/com/infinitepower/newquiz/model/maze/MazeQuiz.kt
+++ b/model/src/main/java/com/infinitepower/newquiz/model/maze/MazeQuiz.kt
@@ -11,6 +11,7 @@ data class MazeQuiz(
) {
sealed interface MazeItem {
val id: Int
+ val mazeSeed: Int
val difficulty: QuestionDifficulty
val played: Boolean
@@ -19,6 +20,7 @@ data class MazeQuiz(
val word: String,
val wordleQuizType: WordleQuizType,
override val id: Int = 0,
+ override val mazeSeed: Int,
override val difficulty: QuestionDifficulty = QuestionDifficulty.Easy,
override val played: Boolean = false
) : MazeItem
@@ -27,6 +29,7 @@ data class MazeQuiz(
data class MultiChoice(
val question: MultiChoiceQuestion,
override val id: Int = 0,
+ override val mazeSeed: Int,
override val difficulty: QuestionDifficulty = QuestionDifficulty.Easy,
override val played: Boolean = false
) : MazeItem
diff --git a/model/src/main/java/com/infinitepower/newquiz/model/maze/MazeQuizItemEntity.kt b/model/src/main/java/com/infinitepower/newquiz/model/maze/MazeQuizItemEntity.kt
index 88591201..127f32af 100644
--- a/model/src/main/java/com/infinitepower/newquiz/model/maze/MazeQuizItemEntity.kt
+++ b/model/src/main/java/com/infinitepower/newquiz/model/maze/MazeQuizItemEntity.kt
@@ -18,6 +18,7 @@ data class MazeQuizItemEntity(
val difficulty: QuestionDifficulty,
val played: Boolean,
val type: Type,
+ val mazeSeed: Int,
// Multi choice quiz
@Embedded("maze_question_")
@@ -39,17 +40,18 @@ data class MazeQuizItemEntity(
fun MazeQuizItemEntity.toMazeQuizItem(): MazeQuiz.MazeItem = when (type) {
MazeQuizItemEntity.Type.WORDLE -> {
val wordleItem = this.wordleItem ?: throw NullPointerException("Wordle word is null")
- MazeQuiz.MazeItem.Wordle(wordleItem.wordleWord, wordleItem.wordleQuizType, id, difficulty, played)
+ MazeQuiz.MazeItem.Wordle(wordleItem.wordleWord, wordleItem.wordleQuizType, id, mazeSeed, difficulty, played)
}
MazeQuizItemEntity.Type.MULTI_CHOICE -> {
val question = this.multiChoiceQuestion ?: throw NullPointerException("Question is null")
- MazeQuiz.MazeItem.MultiChoice(question, id, difficulty, played)
+ MazeQuiz.MazeItem.MultiChoice(question, id, mazeSeed, difficulty, played)
}
}
fun MazeQuiz.MazeItem.toEntity(): MazeQuizItemEntity = when (this) {
is MazeQuiz.MazeItem.Wordle -> MazeQuizItemEntity(
id = id,
+ mazeSeed = mazeSeed,
difficulty = difficulty,
played = played,
type = MazeQuizItemEntity.Type.WORDLE,
@@ -60,6 +62,7 @@ fun MazeQuiz.MazeItem.toEntity(): MazeQuizItemEntity = when (this) {
)
is MazeQuiz.MazeItem.MultiChoice -> MazeQuizItemEntity(
id = id,
+ mazeSeed = mazeSeed,
difficulty = difficulty,
played = played,
type = MazeQuizItemEntity.Type.MULTI_CHOICE,