@@ -1,21 +1,19 @@
package com.betatech.learnspanish.helper

import android.app.PendingIntent.getActivity
import android.content.Context
import com.betatech.learnspanish.data.model.db.*
import org.json.JSONArray
import org.json.JSONException
import org.json.JSONObject
import java.io.IOException
import java.io.InputStream
import java.nio.charset.Charset

object ParseJsonDataFile {

fun parse(context: Context): Triple<List<Exercise>, List<Lesson>, List<Quiz>> {
fun parse(context: Context): Triple<List<Exercise>, List<Lesson>, List<Question>> {
val exercises = mutableListOf<Exercise>()
val lessons = mutableListOf<Lesson>()
val quizzes = mutableListOf<Quiz>()
val questions = mutableListOf<Question>()

try {
val jsonObject = JSONObject(loadJsonFromAssets(context) ?: "")
@@ -31,9 +29,9 @@ object ParseJsonDataFile {
isCompleted = i == 0 // By default mark first one complete
)

parseLessonFromExercise(exerciseJsonObject, exercise, lessons)
parseLessonsFromExercise(exerciseJsonObject, exercise, lessons)

parseQuizFromExercise(exerciseJsonObject, exercise, quizzes)
parseQuestionsFromExercise(exerciseJsonObject, exercise, questions)

exercises.add(exercise)
}
@@ -46,7 +44,7 @@ object ParseJsonDataFile {
return Triple(
exercises,
lessons,
quizzes
questions
)
}

@@ -72,7 +70,7 @@ object ParseJsonDataFile {
return json
}

private fun parseLessonFromExercise(
private fun parseLessonsFromExercise(
exerciseJsonObject: JSONObject,
exercise: Exercise,
lessons: MutableList<Lesson>
@@ -111,31 +109,31 @@ object ParseJsonDataFile {
return Examples(examples)
}

private fun parseQuizFromExercise(
private fun parseQuestionsFromExercise(
exerciseJsonObject: JSONObject,
exercise: Exercise,
quizzes: MutableList<Quiz>
questions: MutableList<Question>
) {
if (exerciseJsonObject.has("quiz")) {
val quizJsonArray = exerciseJsonObject.getJSONArray("quiz")
for (k in 0 until quizJsonArray.length()) {
val quizJsonObject = quizJsonArray.getJSONObject(k)
val quiz = Quiz(
id = quizJsonObject.getString("id"),
val questionJsonObject = quizJsonArray.getJSONObject(k)
val question = Question(
id = questionJsonObject.getString("id"),
exerciseId = exercise.id,
questionNumber = quizJsonObject.getInt("question_number"),
question = quizJsonObject.getString("question"),
questionType = quizJsonObject.getString("type"),
hint = quizJsonObject.getString("hint"),
correctAnswer = quizJsonObject.getString("correct_answer"),
options = parseOptionsFromQuiz(quizJsonObject.getJSONArray("options"))
questionNumber = questionJsonObject.getInt("question_number"),
question = questionJsonObject.getString("question"),
questionType = questionJsonObject.getString("type"),
hint = questionJsonObject.getString("hint"),
correctAnswer = questionJsonObject.getString("correct_answer"),
options = parseOptionsFromQuestion(questionJsonObject.getJSONArray("options"))
)
quizzes.add(quiz)
questions.add(question)
}
}
}

private fun parseOptionsFromQuiz(optionsJsonArray: JSONArray): Options {
private fun parseOptionsFromQuestion(optionsJsonArray: JSONArray): Options {
val options = mutableListOf<String>()
for (i in 0 until optionsJsonArray.length()) {
options.add(optionsJsonArray.getString(i))
@@ -7,24 +7,24 @@ import com.betatech.learnspanish.data.Repository
import com.betatech.learnspanish.data.model.db.Lesson

class LessonsViewModel(
private val repository: Repository,
private val exerciseId: String?
repository: Repository,
exerciseId: String?
) : ViewModel() {

val lessons = repository.getLessonsByExerciseId(exerciseId ?: "")

private var _lesson = MutableLiveData<Lesson>()
private val _lesson = MutableLiveData<Lesson>()
val lesson: LiveData<Lesson> = _lesson
private var currentLessonIndex = -1

private var _isPreviousButtonVisible = MutableLiveData<Boolean>(false)
var isPreviousButtonVisible: LiveData<Boolean> = _isPreviousButtonVisible
private val _isPreviousButtonVisible = MutableLiveData<Boolean>(false)
val isPreviousButtonVisible: LiveData<Boolean> = _isPreviousButtonVisible

private var _isNextButtonVisible = MutableLiveData<Boolean>(false)
var isNextButtonVisible: LiveData<Boolean> = _isNextButtonVisible
private val _isNextButtonVisible = MutableLiveData<Boolean>(false)
val isNextButtonVisible: LiveData<Boolean> = _isNextButtonVisible

private var _isQuizButtonEnabled = MutableLiveData<Boolean>(false)
var isQuizButtonEnabled: LiveData<Boolean> = _isQuizButtonEnabled
private val _isQuizButtonEnabled = MutableLiveData<Boolean>(false)
val isQuizButtonEnabled: LiveData<Boolean> = _isQuizButtonEnabled

/**
* Once, lessons for particular exercise is
@@ -53,6 +53,9 @@ class LessonsViewModel(
}
}

/**
* Move to the next lesson in the exercise
*/
fun nextLesson() {
if (currentLessonIndex < ((lessons.value?.size ?: 0) - 1)) {
currentLessonIndex++
@@ -65,6 +68,9 @@ class LessonsViewModel(
}
}

/**
* Move to the previous lesson in the exercise
*/
fun previousLesson() {
if (currentLessonIndex > 0) {
currentLessonIndex--
@@ -7,6 +7,8 @@ import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import androidx.fragment.app.viewModels
import androidx.lifecycle.Observer
import androidx.navigation.fragment.findNavController
import androidx.navigation.fragment.navArgs
import com.betatech.learnspanish.databinding.FragmentQuizBinding
import com.betatech.learnspanish.helper.getViewModelFactory
@@ -36,6 +38,25 @@ class QuizFragment : Fragment() {
override fun onActivityCreated(savedInstanceState: Bundle?) {
super.onActivityCreated(savedInstanceState)
dataBinding.lifecycleOwner = this.viewLifecycleOwner
setupLiveObservers()
}

private fun setupLiveObservers() {
viewModel.questions.observe(this, Observer {
if (it != null && it.isNotEmpty()) {
viewModel.setupFirstQuestion()
}
})
viewModel.quizState.observe(this, Observer { quizState ->
when (quizState) {
QuizViewModel.QuizState.NOT_ANSWERED -> dataBinding.mcqAnswerView.rgOptions.clearCheck()
QuizViewModel.QuizState.COMPLETE -> findNavController().popBackStack()
QuizViewModel.QuizState.FAIL -> findNavController().popBackStack()
else -> {
// do nothing
}
}
})
}

}
@@ -1,12 +1,181 @@
package com.betatech.learnspanish.ui.quiz

import android.os.Build
import android.text.Html
import android.view.View
import android.widget.RadioGroup
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.Transformations
import androidx.lifecycle.ViewModel
import com.betatech.learnspanish.R
import com.betatech.learnspanish.data.Repository
import com.betatech.learnspanish.data.model.db.Question
import java.util.*

/**
* ViewModel for the quiz screen
*/
class QuizViewModel(
repository: Repository,
exerciseId: String?
) : ViewModel() {

val quizzess = repository.getQuizzesByExerciseId(exerciseId ?: "")
// Helper class to change UI depending upon the question state
enum class QuizState {
NOT_ANSWERED, // Question is being displayed, and user hasn't answered
CORRECT_ANSWER, // User Answer is correct, show correct answer banner
WRONG_ANSWER, // User answer is incorrect, show incorrect answer message along with correct answer
FAIL, // When all life are lost, quiz will end
COMPLETE // All question has been answered
}

val questions = repository.getQuestionsByExerciseId(exerciseId ?: "")

private val _currentQuestionIndex = MutableLiveData(0)
private val _numberOfQuestionAnswered = MutableLiveData(0)

val question: LiveData<Question> =
Transformations.map(_currentQuestionIndex, ::getCurrentQuestion)

val progress: LiveData<Int> =
Transformations.map(_numberOfQuestionAnswered, ::calculateProgress)

private val _userAnswer = MutableLiveData("")
val userAnswer: LiveData<String> = _userAnswer

/**
* User has 3 life, he/she can continue game till 3 incorrect answer
* On forth incorrect answer, quiz will stop and have to played from
* start.
*/
private val _lifeLeft = MutableLiveData(3)
val lifeLeft: LiveData<Int> = _lifeLeft

private val _quizState = MutableLiveData<QuizState>(QuizState.NOT_ANSWERED)
val quizState: LiveData<QuizState> = _quizState

/**
* Used to render HTML content in TextView that
* display Question on screen.
*/
fun formatHtml(string: String?): CharSequence = when {
string == null -> ""
Build.VERSION.SDK_INT >= Build.VERSION_CODES.N -> Html.fromHtml(
string,
Html.FROM_HTML_MODE_COMPACT
)
else -> Html.fromHtml(string)
}


/**
* If question type == "mcq", then radio buttons will be shown,
* to choose option from multiple options
*/
fun onRadioButtonSelected(radioGroup: RadioGroup, id: Int) {
when (id) {
R.id.rb_option_one -> _userAnswer.value = question.value?.options?.data?.get(0) ?: ""
R.id.rb_option_two -> _userAnswer.value = question.value?.options?.data?.get(1) ?: ""
R.id.rb_option_three -> _userAnswer.value = question.value?.options?.data?.get(2) ?: ""
R.id.rb_option_four -> _userAnswer.value = question.value?.options?.data?.get(3) ?: ""
}
}

/**
* If question type == "type", then edit text will be shown
* to enter answer
*/
fun onAnswerTyped(string: CharSequence, start: Int, before: Int, count: Int) {
_userAnswer.value = string.toString()
}

// Click listener attached to Button(R.id.btn_check) in [fragment_quiz.xml]
fun checkAnswer(view: View) {
if (quizState.value == QuizState.NOT_ANSWERED) {
if (_userAnswer.value ?: "" == "") return

_numberOfQuestionAnswered.value = _numberOfQuestionAnswered.value?.plus(1)

if (_userAnswer.value?.toLowerCase(Locale.US) == question.value?.correctAnswer?.toLowerCase(
Locale.US
) ?: "-1"
) {
handleCorrectAnswerState()
} else {
handleWrongAnswerState()
}

} else {
prepareNextQuestion()
}

}

fun setupFirstQuestion() {
if (question.value == null) {
_currentQuestionIndex.value = 0
}
}

/**
* Calculate progress depending upon the number of question
* answered.
*
* @return value between 0 to 100
*/
private fun calculateProgress(questionIndex: Int): Int = when {
questions.value?.size ?: 0 == 0 -> 0
else -> (questionIndex * 100) / (questions.value?.size ?: 1)
}

private fun getCurrentQuestion(questionIndex: Int): Question? = when {
questions.value?.size ?: 0 == 0 -> null
else -> questions.value!![questionIndex]
}

/**
* If user enter incorrect answer,
* decrease life by one
*/
private fun handleWrongAnswerState() {
_quizState.value = QuizState.WRONG_ANSWER
_lifeLeft.value = _lifeLeft.value?.minus(1)
}

private fun handleCorrectAnswerState() {
_quizState.value = QuizState.CORRECT_ANSWER
}

/**
* Check whether all questions has been answered or
* all life has lost, in that case change [QuizState]
* accordingly
*/
private fun prepareNextQuestion() {
if (_numberOfQuestionAnswered.value == questions.value?.size) {
_quizState.value = QuizState.COMPLETE
return
}

if (_lifeLeft.value == 0) {
_quizState.value = QuizState.FAIL
return
}
// Continue with next question
showNextQuestion()
}

/**
* NOTE: [_quizState] value be reset to first [QuizState.NOT_ANSWERED]
* so that RadioGroup can clear check, and after that
* [_currentQuestionIndex] should be increased
*/
private fun showNextQuestion() {
_quizState.value = QuizState.NOT_ANSWERED
_userAnswer.value = ""
_currentQuestionIndex.value = _currentQuestionIndex.value?.plus(1)
}


}
@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">

<data>

<import type="android.view.View" />

<import type="com.betatech.learnspanish.ui.quiz.QuizViewModel.QuizState" />

<variable
name="viewmodel"
type="com.betatech.learnspanish.ui.quiz.QuizViewModel" />

</data>

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@{viewmodel.quizState == QuizState.CORRECT_ANSWER ? @color/success : @color/error}"
tools:background="@color/error"
android:minHeight="100dp">

<TextView
android:id="@+id/tv_banner_message"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:textColor="@android:color/white"
android:textSize="30sp"
android:textStyle="bold"
android:text="@{viewmodel.quizState == QuizState.CORRECT_ANSWER ? @string/correct_answer_msg : viewmodel.quizState == QuizState.WRONG_ANSWER ? @string/wrong_answer_msg : @string/empty_string }"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="Wrong Answer" />

<TextView
android:id="@+id/tv_correct_answer"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:visibility="@{viewmodel.quizState == QuizState.WRONG_ANSWER ? View.VISIBLE : View.GONE, default = gone}"
tools:visibility="visible"
tools:text="Correct Answer is : Cheese"
android:text="@{@string/display_correct_answer(viewmodel.question.correctAnswer)}"
android:textColor="@android:color/white"
android:textSize="18sp"
app:layout_constraintEnd_toEndOf="@id/tv_banner_message"
app:layout_constraintStart_toStartOf="@id/tv_banner_message"
app:layout_constraintTop_toBottomOf="@id/tv_banner_message" />
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
@@ -1,29 +1,136 @@
<?xml version="1.0" encoding="utf-8"?>

<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
xmlns:bind="http://schemas.android.com/apk/res-auto">

<data>

<import type="android.view.View" />

<import type="com.betatech.learnspanish.ui.quiz.QuizViewModel.QuizState" />

<variable
name="viewmodel"
type="com.betatech.learnspanish.ui.quiz.QuizViewModel" />

</data>

<FrameLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/frameLayout3"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.quiz.QuizFragment">

<!-- TODO: Update blank fragment layout -->
<androidx.constraintlayout.widget.Guideline
android:id="@+id/start_margin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_begin="16dp" />

<androidx.constraintlayout.widget.Guideline
android:id="@+id/end_margin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_end="16dp" />


<ProgressBar
android:id="@+id/game_progress"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:max="100"
android:progress="@{viewmodel.progress}"
app:layout_constraintEnd_toStartOf="@+id/tv_life_left"
app:layout_constraintStart_toStartOf="@+id/start_margin"
app:layout_constraintTop_toTopOf="parent" />

<TextView
android:id="@+id/tv_life_left"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{@string/life_left_string(viewmodel.lifeLeft)}"
tools:text="Life left 3"
app:layout_constraintBottom_toBottomOf="@+id/game_progress"
app:layout_constraintEnd_toStartOf="@+id/end_margin"
app:layout_constraintTop_toTopOf="@+id/game_progress" />

<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@{`` + viewmodel.quizzess.size()}" />
android:id="@+id/tv_question"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
android:text="@{viewmodel.formatHtml(viewmodel.question.question)}"
tools:text="What does Queso means?"
android:textSize="18sp"
app:layout_constraintEnd_toStartOf="@+id/end_margin"
app:layout_constraintStart_toStartOf="@+id/start_margin"
app:layout_constraintTop_toBottomOf="@+id/game_progress" />

<include
android:id="@+id/mcq_answer_view"
layout="@layout/mcq_answer_view"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
android:visibility='@{"mcq".equals(viewmodel.question.questionType) ? View.VISIBLE : View.GONE, default = gone}'
tools:visibility="visible"
app:layout_constraintEnd_toEndOf="@id/end_margin"
app:layout_constraintStart_toStartOf="@id/start_margin"
app:layout_constraintTop_toBottomOf="@+id/question_textview_barrier"
bind:viewmodel="@{viewmodel}" />

<include
android:id="@+id/type_answer_view"
layout="@layout/type_answer_view"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
android:visibility='@{"type".equals(viewmodel.question.questionType) ? View.VISIBLE : View.GONE, default = gone}'
app:layout_constraintEnd_toEndOf="@id/end_margin"
app:layout_constraintStart_toStartOf="@id/start_margin"
app:layout_constraintTop_toBottomOf="@+id/question_textview_barrier"
bind:viewmodel="@{viewmodel}" />

<androidx.constraintlayout.widget.Barrier
android:id="@+id/question_textview_barrier"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:barrierDirection="bottom"
app:constraint_referenced_ids="tv_question"
tools:layout_editor_absoluteY="731dp" />

<Button
android:id="@+id/btn_check"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:enabled='@{"".equals(viewmodel.userAnswer) ? false : true}'
android:onClick="@{viewmodel::checkAnswer}"
android:text="@{viewmodel.quizState == QuizState.NOT_ANSWERED ? @string/check_answer_btn_title : @string/next_question_btn_title}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/end_margin"
app:layout_constraintStart_toStartOf="@+id/start_margin" />

<include
android:id="@+id/message"
layout="@layout/banner"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:visibility="@{viewmodel.quizState == QuizState.NOT_ANSWERED ? View.GONE : View.VISIBLE, default = gone}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="@id/start_margin"
app:layout_constraintTop_toTopOf="parent"
bind:viewmodel="@{viewmodel}"
tools:visibility="visible" />

</FrameLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

</layout>
@@ -0,0 +1,61 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">

<data>

<import type="android.view.View" />

<import type="com.betatech.learnspanish.ui.quiz.QuizViewModel.QuizState" />

<variable
name="viewmodel"
type="com.betatech.learnspanish.ui.quiz.QuizViewModel" />

</data>

<RadioGroup
android:id="@+id/rg_options"
android:onCheckedChanged="@{viewmodel::onRadioButtonSelected}"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent">

<RadioButton
android:id="@+id/rb_option_one"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clickable="@{viewmodel.quizState == QuizState.NOT_ANSWERED ? true : false}"
android:text="@{viewmodel.question.options.data.size() > 0 ? viewmodel.question.options.data.get(0) : @string/empty_string}"
android:visibility="@{viewmodel.question.options.data.size() > 0 ? View.VISIBLE: View.GONE, default = gone}"
tools:text="Option One" />

<RadioButton
android:id="@+id/rb_option_two"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clickable="@{viewmodel.quizState == QuizState.NOT_ANSWERED ? true : false}"
android:text="@{viewmodel.question.options.data.size() > 1 ? viewmodel.question.options.data.get(1) : @string/empty_string}"
android:visibility="@{viewmodel.question.options.data.size() > 1 ? View.VISIBLE: View.GONE, default = gone}"
tools:text="Option Two" />

<RadioButton
android:id="@+id/rb_option_three"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clickable="@{viewmodel.quizState == QuizState.NOT_ANSWERED ? true : false}"
android:text="@{viewmodel.question.options.data.size() > 2 ? viewmodel.question.options.data.get(2) : @string/empty_string}"
android:visibility="@{viewmodel.question.options.data.size() > 2 ? View.VISIBLE: View.GONE, default = gone}"
tools:text="Option Three" />

<RadioButton
android:id="@+id/rb_option_four"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clickable="@{viewmodel.quizState == QuizState.NOT_ANSWERED ? true : false}"
android:text="@{viewmodel.question.options.data.size() > 3 ? viewmodel.question.options.data.get(3) : @string/empty_string}"
android:visibility="@{viewmodel.question.options.data.size() > 3 ? View.VISIBLE: View.GONE, default = gone}"
tools:text="Option Four" />
</RadioGroup>
</layout>
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">

<data>

<import type="android.text.InputType" />

<import type="com.betatech.learnspanish.ui.quiz.QuizViewModel.QuizState" />

<variable
name="viewmodel"
type="com.betatech.learnspanish.ui.quiz.QuizViewModel" />

</data>

<EditText
android:id="@+id/et_answer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="@{viewmodel.quizState == QuizState.NOT_ANSWERED ? InputType.TYPE_CLASS_TEXT : InputType.TYPE_NULL}"
android:onTextChanged="@{viewmodel::onAnswerTyped}"
android:hint="@string/enter_answer_hint"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:importantForAutofill="no" />
</layout>
@@ -6,7 +6,7 @@
"id": "5e01dcae0e9b410552996c8f",
"exercise_number": 1,
"title": "Spanish Alphabets",
"description": "Learn spanish alphabets and their pronounciation",
"description": "Learn spanish alphabets and their pronunciation",
"lessons": [
{
"id": "5e01dcae8941c2463a7a918d",
@@ -58,7 +58,7 @@
{
"id": "5e01dcaeaf60ee949362503c",
"question_number": 1,
"question": "Select correct pronounciation for <b>a</b>",
"question": "Select correct pronunciation for <b>a</b>",
"type": "mcq",
"hint": "",
"correct_answer": "a",
@@ -72,21 +72,16 @@
{
"id": "5e01dcae87b20232f432ecde",
"question_number": 2,
"question": "Select correct pronounciation for <b>b</b>",
"type": "mcq",
"question": "Type correct pronunciation for <b>b</b>",
"type": "type",
"hint": "",
"correct_answer": "be",
"options": [
"b",
"be",
"bee",
"ba"
]
"options": []
},
{
"id": "5e01dcae0803b2c03f3cee25",
"question_number": 3,
"question": "Select correct pronounciation for <b>c</b>",
"question": "Select correct pronunciation for <b>c</b>",
"type": "mcq",
"hint": "",
"correct_answer": "ce",
@@ -100,7 +95,7 @@
{
"id": "5e01dcaed67b7f27776bad38",
"question_number": 4,
"question": "Select correct pronounciation for <b>d</b>",
"question": "Select correct pronunciation for <b>d</b>",
"type": "mcq",
"hint": "",
"correct_answer": "de",
@@ -114,7 +109,7 @@
{
"id": "5e01dcaed68baa6ef48add80",
"question_number": 5,
"question": "Select correct pronounciation for <b>e</b>",
"question": "Select correct pronunciation for <b>e</b>",
"type": "mcq",
"hint": "",
"correct_answer": "e",
@@ -3,4 +3,6 @@
<color name="colorPrimary">#008577</color>
<color name="colorPrimaryDark">#00574B</color>
<color name="colorAccent">#D81B60</color>
<color name="success">#4caf50</color>
<color name="error">#f44336</color>
</resources>
@@ -1,10 +1,26 @@
<resources>
<!-- ========================= Common ============================ -->
<string name="app_name">Learn Spanish</string>
<string name="empty_string" translatable="false" />
<!-- ============================================================= -->

<!-- TODO: Remove or change this placeholder text -->
<string name="hello_blank_fragment">Hello blank fragment</string>
<!-- =============== Fragment Toolbar Titles ===================== -->
<string name="exercises_fragment_title">Learn Spanish</string>
<string name="lessons_fragment_title">Lessons</string>
<string name="no_lesson_available">No Lesson Available for this Exercise</string>
<string name="quiz_fragment_title">Quiz</string>
<!-- ============================================================= -->

<!-- ===================== Lesson Fragment ======================= -->
<string name="no_lesson_available">No Lesson Available for this Exercise</string>
<!-- ============================================================= -->

<!-- ====================== Quiz Fragment ======================== -->
<string name="life_left_string">Life left %1$d</string>
<string name="check_answer_btn_title">Check</string>
<string name="next_question_btn_title">Continue</string>
<string name="enter_answer_hint">Enter answer</string>
<string name="correct_answer_msg">Correct Answer</string>
<string name="wrong_answer_msg">Wrong Answer</string>
<string name="display_correct_answer">Correct Answer is : %1$s</string>
<!-- ============================================================= -->
</resources>