Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
subhajitxyz committed Nov 19, 2024
1 parent 94fd8be commit 492a54c
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ class FractionInteractionViewModel private constructor(
val callback: Observable.OnPropertyChangedCallback =
object : Observable.OnPropertyChangedCallback() {
override fun onPropertyChanged(sender: Observable, propertyId: Int) {
Log.d("testHang","onPendingAnswerErrorOrAvailabilityCheck is called in onPropertychanges ")
errorOrAvailabilityCheckReceiver.onPendingAnswerErrorOrAvailabilityCheck(
pendingAnswerError,
true // Allow submit on empty answer.
Expand Down Expand Up @@ -88,21 +87,14 @@ class FractionInteractionViewModel private constructor(
}
}
AnswerErrorCategory.SUBMIT_TIME -> {
//App got stuck during a student playthrough #5568 -> pendingAnswer can be possible reason
//it should be null for enable for submit button.
//my observation as per date 11/12/24 -> error found in time of submit answer ->
//pendinAnserError is string. -> submit button is disabled.
// if again checkPendingAnswerError is called and doesnot match with any category
//pendingAnswerError should be null . but this time it was set string previously.
pendingAnswerError =
FractionParsingUiError.createFromParsingError(
fractionParser.getSubmitTimeError(answerText.toString())
).getErrorMessageFromStringRes(resourceHandler)
}
else -> {} // we are not setting it null like other (RatioExpressionInputInterationviewModel)
else -> {}
}
errorMessage.set(pendingAnswerError)
Log.d("testHang","errorMessage is set in checkPendingAnswerError ")
return pendingAnswerError
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class SelectionInteractionContentViewModel(
private val selectionInteractionViewModel: SelectionInteractionViewModel,
val isEnabled: ObservableBoolean
) : ObservableViewModel() {
var isAnswerSelected = ObservableBoolean() //it should be false for disable the submit_button... find how it can be false
var isAnswerSelected = ObservableBoolean()

fun handleItemClicked() {
val isCurrentlySelected = isAnswerSelected.get()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,6 @@ class SelectionInteractionViewModel private constructor(
}

checkPendingAnswerError(userAnswerState.answerErrorCategory)
//checkPendingAnswerError(AnswerErrorCategory.SUBMIT_TIME)

}

override fun getUserAnswerState(): UserAnswerState {
Expand Down Expand Up @@ -177,9 +175,6 @@ class SelectionInteractionViewModel private constructor(
null
}
AnswerErrorCategory.SUBMIT_TIME ->
//THE situation can happen if this will return a empty string.
//now we have to find ,in which possible case, it will return a empty string.
//""
getSubmitTimeError().getErrorMessageFromStringRes(resourceHandler)
else -> null
}
Expand Down Expand Up @@ -212,33 +207,27 @@ class SelectionInteractionViewModel private constructor(
checkPendingAnswerError(AnswerErrorCategory.REAL_TIME)
return when {
isCurrentlySelected -> {
Log.d("testRadio","first time selected case 1")
selectedItems -= itemIndex
updateIsAnswerAvailable()
updateSelectionText()
updateItemSelectability()
false
}
!areCheckboxesBound() -> {
Log.d("testRadio","first time selected case 2")
// De-select all other items to simulate a radio button group.
choiceItems.forEach { item -> item.isAnswerSelected.set(false) }
selectedItems.clear()
selectedItems += itemIndex
updateIsAnswerAvailable()
true
}
selectedItems.size < maxAllowableSelectionCount -> {
Log.d("testRadio","first time selected case 3")
selectedItems += itemIndex
updateIsAnswerAvailable()
updateSelectionText()
updateItemSelectability()
true
}
else -> {
Log.d("testRadio","first time selected case 4")
// Do not change the current status if it isn't valid to do so.
isCurrentlySelected
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ class AdministratorControlsFragmentTest {
TestPlatformParameterModule.forceEnableDownloadsSupport(true)
Intents.init()
setUpTestApplicationComponent()
// profileTestHelper.initializeProfiles()
profileTestHelper.initializeProfiles()
testCoroutineDispatchers.registerIdlingResource()
}

Expand Down

0 comments on commit 492a54c

Please sign in to comment.