Skip to content

Commit

Permalink
Merge branch 'hotfix-0.13.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
theblackwidower committed Oct 28, 2018
2 parents 3323d31 + e44c43b commit 035ba79
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ android {
applicationId 'com.noprestige.kanaquiz'
minSdkVersion 17
targetSdkVersion 28
versionCode 15
versionName '0.13'
versionCode 16
versionName '0.13.1'
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
javaCompileOptions {
annotationProcessorOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ public String getCurrentQuestionText()
return currentQuestion.getQuestionText();
}

public String getCurrentQuestionKey()
{
return currentQuestion.getDatabaseKey();
}

public boolean checkCurrentAnswer(String response)
{
return currentQuestion.checkAnswer(response);
Expand Down
10 changes: 5 additions & 5 deletions app/src/main/java/com/noprestige/kanaquiz/quiz/MainQuiz.java
Original file line number Diff line number Diff line change
Expand Up @@ -188,16 +188,16 @@ private void checkAnswer(String answer)
if (retryCount == 0)
{
totalCorrect++;
LogDao.reportCorrectAnswer(lblQuestion.getText().toString());
LogDao.reportCorrectAnswer(questionBank.getCurrentQuestionKey());
}
else if (retryCount <= MAX_RETRIES) //anything over MAX_RETRIES gets no score at all
{
float score = (float) Math.pow(0.5f, retryCount);
totalCorrect += score;
LogDao.reportRetriedCorrectAnswer(lblQuestion.getText().toString(), score);
LogDao.reportRetriedCorrectAnswer(questionBank.getCurrentQuestionKey(), score);
}
else
LogDao.reportRetriedCorrectAnswer(lblQuestion.getText().toString(), 0);
LogDao.reportRetriedCorrectAnswer(questionBank.getCurrentQuestionKey(), 0);
}
else
{
Expand All @@ -221,7 +221,7 @@ else if (OptionsControl
retryCount++;
isGetNewQuestion = false;

LogDao.reportIncorrectRetry(lblQuestion.getText().toString(), answer);
LogDao.reportIncorrectRetry(questionBank.getCurrentQuestionKey(), answer);

delayHandler.postDelayed(() ->
{
Expand All @@ -231,7 +231,7 @@ else if (OptionsControl
}

if (isGetNewQuestion)
LogDao.reportIncorrectAnswer(lblQuestion.getText().toString(), answer);
LogDao.reportIncorrectAnswer(questionBank.getCurrentQuestionKey(), answer);
}

if (isGetNewQuestion)
Expand Down

0 comments on commit 035ba79

Please sign in to comment.