Skip to content

Commit

Permalink
correct indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
subhajitxyz committed Dec 26, 2024
1 parent ac8d529 commit 034fd9c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5260,7 +5260,6 @@ class StateFragmentTest {
playThroughRatioExplorationState14()
playThroughRatioExplorationState15()


onView(
atPositionOnView(
recyclerViewId = R.id.selection_interaction_recyclerview,
Expand All @@ -5270,11 +5269,11 @@ class StateFragmentTest {
).perform(click())
clickContinueNavigationButton()

//now we are moved to the previous state in deck
scrollToViewType(NEXT_NAVIGATION_BUTTON)
onView(withId(R.id.next_state_navigation_button)).check(matches(isDisplayed()))

onView(withId(R.id.feedback_text_view)).check(matches(withText(containsString("Please continue"))))
onView(withId(R.id.feedback_text_view))
.check(matches(withText(containsString("Please continue"))))

scrollToViewType(NEXT_NAVIGATION_BUTTON)
onView(withId(R.id.next_state_navigation_button)).perform(click())
Expand All @@ -5301,7 +5300,6 @@ class StateFragmentTest {

onView(withId(R.id.content_text_view))
.check(matches(withText(expectedDescription)))

}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,8 @@ class ExplorationProgressController @Inject constructor(
answerOutcome.destinationCase == AnswerOutcome.DestinationCase.STATE_NAME -> {
endState()
if (!answerOutcome.labelledAsCorrectAnswer &&
answerOutcome.feedback.contentId.contains("feedback",true)) {
answerOutcome.feedback.contentId.contains("feedback", true)
) {
explorationProgress.stateDeck.onActualCallLearnAgain(true)
} else {
explorationProgress.stateDeck.onActualCallLearnAgain(false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class StateDeck constructor(

val revisionIdx = calculateWrongAnswerPreviousState(pendingTopState.name)

if(revisionIdx != null && stateIndex == previousStates.size-1 && actualCallLearnAgain) {
if (revisionIdx != null && stateIndex == previousStates.size - 1 && actualCallLearnAgain) {
handleLearnAgainCondition(revisionIdx)
} else {
val previousState = previousStates[stateIndex]
Expand All @@ -74,7 +74,6 @@ class StateDeck constructor(
}
}


/**
* Returns the [State] corresponding to the latest card in the deck, regardless of whichever state
* the learner is currently viewing.
Expand Down Expand Up @@ -161,7 +160,7 @@ class StateDeck constructor(
.setShowContinueButtonAnimation(!isContinueButtonAnimationSeen && isCurrentStateInitial())
.build()

if(!actualCallLearnAgain) {
if (!actualCallLearnAgain) {
currentDialogInteractions.clear()
}
pendingTopState = state
Expand Down Expand Up @@ -284,8 +283,8 @@ class StateDeck constructor(
onActualCallLearnAgain(false)
}

private fun calculateWrongAnswerPreviousState(stateName: String) : Int? {
if(!actualCallLearnAgain) return null
private fun calculateWrongAnswerPreviousState(stateName: String): Int? {
if (!actualCallLearnAgain) return null
for (i in previousStates.size - 1 downTo 0) {
val state = previousStates[i].state
if (state.name == stateName) {
Expand Down

0 comments on commit 034fd9c

Please sign in to comment.