Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #387, #1771: Show concept cards #1637

Merged
merged 63 commits into from
Sep 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
43a919c
Add support for showing concept cards in feedback, and add a concept
BenHenning Nov 19, 2019
170b16b
Introduce test coroutine dispatchers support in Espresso.
BenHenning Aug 10, 2020
9474c85
Merge branch 'develop' into introduce-test-dispatchers-support-in-esp…
BenHenning Aug 10, 2020
eb4b02f
Revert "Fixes #941: Add radar effect in Hints and solution (#1475)"
BenHenning Aug 10, 2020
e50d2b6
Merge branch 'revert-41eb10b' into introduce-test-dispatchers-support…
BenHenning Aug 10, 2020
6d175b2
Stabilize StateFragmentTest such that it passes on both Robolectric and
BenHenning Aug 11, 2020
51eb59e
Enable StateFragmentTest (Robolectric) & StateFragmentLocalTest for CI.
BenHenning Aug 11, 2020
a422d26
Merge branch 'develop' into introduce-test-dispatchers-support-in-esp…
BenHenning Aug 11, 2020
ee0de59
Add thorough documentation for new dispatchers.
BenHenning Aug 11, 2020
cbf893b
Merge branch 'develop' into introduce-test-dispatchers-support-in-esp…
BenHenning Aug 12, 2020
a30280a
Clean up comments & add additional documentation.
BenHenning Aug 12, 2020
e33830f
Fix lint errors.
BenHenning Aug 12, 2020
d5b9f74
Fix broken test after changes to FakeSystemClock.
BenHenning Aug 12, 2020
f462f08
Merge branch 'introduce-test-dispatchers-support-in-espresso' into st…
BenHenning Aug 12, 2020
e52a0a5
Merge branch 'develop' into introduce-test-dispatchers-support-in-esp…
BenHenning Aug 12, 2020
172fe04
Merge branch 'introduce-test-dispatchers-support-in-espresso' into st…
BenHenning Aug 12, 2020
bf2fd82
Fix linter errors.
BenHenning Aug 12, 2020
0b5cd9b
Merge branch 'develop' into introduce-test-dispatchers-support-in-esp…
BenHenning Aug 12, 2020
6c39003
Merge branch 'introduce-test-dispatchers-support-in-espresso' into st…
BenHenning Aug 12, 2020
0d2f8e3
Merge branch 'develop' into stabilize-state-fragment-test
BenHenning Aug 12, 2020
f9829c2
Merge branch 'develop' into show-concept-card-links
BenHenning Aug 13, 2020
251a740
Update test lesson to include references to concept cards.
BenHenning Aug 13, 2020
f162edd
Lint fixes & use HtmlCompat instead of Html.
BenHenning Aug 13, 2020
7895ef6
Add support for the newer & finalized tag format.
BenHenning Aug 13, 2020
122c25d
Lint fixes.
BenHenning Aug 13, 2020
9f9d643
Use a custom executor service for Glide requests that coordinates with
BenHenning Sep 2, 2020
8abc514
Introduce new executor service which allows interop with Kotlin
BenHenning Sep 2, 2020
8cc31bd
Merge branch 'develop' into introduce-coroutine-executor-service
BenHenning Sep 2, 2020
668d126
Fix flaky timeout tests by improving cancellation cooperation for
BenHenning Sep 2, 2020
76d5310
Add documentation & clean up unused code.
BenHenning Sep 2, 2020
96d2825
Lint fixes.
BenHenning Sep 2, 2020
5b0948a
Significantly reorganize invokeAll() to try and make it more cooperative
BenHenning Sep 2, 2020
3a276ae
Merge branch 'develop' into introduce-coroutine-executor-service
BenHenning Sep 2, 2020
e7019d1
Lint fixes.
BenHenning Sep 2, 2020
2ddef4c
Merge branch 'introduce-coroutine-executor-service' into stabilize-st…
BenHenning Sep 2, 2020
09a0df3
Post-merge module fixes.
BenHenning Sep 2, 2020
051e563
Post-merge fixes with ratio input & add a TODO to improve speed of the
BenHenning Sep 2, 2020
068a4e5
Revert "Fixes part of #40 & #42: Generalisation Highfi Mobile Portrai…
BenHenning Sep 2, 2020
6a4ce89
Ensure terminated tasks do not interfere with one another (timeouts
BenHenning Sep 2, 2020
e473905
Merge branch 'revert-1653-state-recycler-view-buttons-highfi' into in…
BenHenning Sep 2, 2020
c65c13c
Merge branch 'introduce-coroutine-executor-service' into stabilize-st…
BenHenning Sep 2, 2020
9c2c16b
Ignore failing tests until #1769 is resolved.
BenHenning Sep 2, 2020
1fd435e
Fix awaitTermination & improve test. Improve stack trace for test
BenHenning Sep 2, 2020
452b6fe
Merge branch 'introduce-coroutine-executor-service' into stabilize-st…
BenHenning Sep 2, 2020
48f4d6d
Fix slow & broken tests in Robolectric for StateFragmentLocalTest.
BenHenning Sep 2, 2020
f3061f0
Merge branch 'stabilize-state-fragment-test' into show-concept-card-l…
BenHenning Sep 2, 2020
543199f
Add missing deps for StateFragmentLocalTest.
BenHenning Sep 2, 2020
841a5a3
Merge branch 'stabilize-state-fragment-test' into show-concept-card-l…
BenHenning Sep 2, 2020
f37ea48
Address TODOs (including adding support for list tags which replaces the
BenHenning Sep 2, 2020
e306f9c
Lint fixes.
BenHenning Sep 2, 2020
46a361d
Merge branch 'develop' into revert-1653-state-recycler-view-buttons-h…
BenHenning Sep 2, 2020
e321df5
Merge branch 'revert-1653-state-recycler-view-buttons-highfi' into in…
BenHenning Sep 2, 2020
9485c26
Address reviewer comments.
BenHenning Sep 2, 2020
79801af
Merge branch 'introduce-coroutine-executor-service' into stabilize-st…
BenHenning Sep 2, 2020
c35f78e
Merge branch 'stabilize-state-fragment-test' into show-concept-card-l…
BenHenning Sep 2, 2020
868200f
Address review comments. Fix new concept card tests on Espresso & add
BenHenning Sep 3, 2020
1cf3775
Add support for concept cards in questions. Note that it's not clear how
BenHenning Sep 3, 2020
98dcc9b
Fix image-breaking duplicated code in HtmlParser, fix a paragraph
BenHenning Sep 3, 2020
bd9a51a
Lint fixes.
BenHenning Sep 3, 2020
5010d44
Merge branch 'develop' into introduce-coroutine-executor-service
BenHenning Sep 3, 2020
19a8155
Merge branch 'introduce-coroutine-executor-service' into stabilize-st…
BenHenning Sep 3, 2020
f26955d
Merge branch 'develop' into stabilize-state-fragment-test
BenHenning Sep 3, 2020
48a7875
Merge branch 'stabilize-state-fragment-test' into show-concept-card-l…
BenHenning Sep 3, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ dependencies {
'androidx.test.espresso:espresso-core:3.2.0',
'androidx.test.espresso:espresso-intents:3.1.0',
'androidx.test.ext:junit:1.1.1',
'com.google.truth:truth:0.43',
'com.github.bumptech.glide:mocks:4.11.0',
'com.google.truth:truth:0.43',
'org.robolectric:annotations:4.3',
'org.robolectric:robolectric:4.3',
'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.2.2',
Expand All @@ -121,6 +121,7 @@ dependencies {
'androidx.test.espresso:espresso-core:3.2.0',
'androidx.test.espresso:espresso-intents:3.1.0',
'androidx.test.ext:junit:1.1.1',
'com.github.bumptech.glide:mocks:4.11.0',
'com.google.truth:truth:0.43',
'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.2.2',
'org.mockito:mockito-android:2.7.22',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import android.app.Application
import dagger.BindsInstance
import dagger.Component
import org.oppia.app.activity.ActivityComponent
import org.oppia.app.player.state.hintsandsolution.HintsAndSolutionConfigModule
import org.oppia.app.shim.IntentFactoryShimModule
import org.oppia.app.shim.ViewBindingShimModule
import org.oppia.domain.classify.InteractionsModule
Expand Down Expand Up @@ -57,7 +58,8 @@ import javax.inject.Singleton
LogStorageModule::class, IntentFactoryShimModule::class,
ViewBindingShimModule::class, PrimeTopicAssetsControllerModule::class,
ExpirationMetaDataRetrieverModule::class, RatioInputModule::class,
UncaughtExceptionLoggerModule::class, ApplicationStartupListenerModule::class
UncaughtExceptionLoggerModule::class, ApplicationStartupListenerModule::class,
HintsAndSolutionConfigModule::class
]
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import org.oppia.app.player.state.listener.RouteToHintsAndSolutionListener
import org.oppia.app.player.state.listener.StateKeyboardButtonListener
import org.oppia.app.player.stopplaying.StopExplorationDialogFragment
import org.oppia.app.player.stopplaying.StopStatePlayingSessionListener
import org.oppia.app.topic.conceptcard.ConceptCardListener
import javax.inject.Inject

private const val TAG_STOP_EXPLORATION_DIALOG = "STOP_EXPLORATION_DIALOG"
Expand All @@ -34,7 +35,8 @@ class ExplorationActivity :
RevealHintListener,
RevealSolutionInterface,
DefaultFontSizeStateListener,
HintsAndSolutionExplorationManagerListener {
HintsAndSolutionExplorationManagerListener,
ConceptCardListener {

@Inject
lateinit var explorationActivityPresenter: ExplorationActivityPresenter
Expand Down Expand Up @@ -181,4 +183,6 @@ class ExplorationActivity :
override fun onExplorationStateLoaded(state: State) {
this.state = state
}

override fun dismissConceptCard() = explorationActivityPresenter.dismissConceptCard()
}
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,10 @@ class ExplorationActivityPresenter @Inject constructor(
}
}

fun dismissConceptCard() {
getExplorationFragment()?.dismissConceptCard()
}

private fun updateToolbarTitle(explorationId: String) {
subscribeToExploration(explorationDataController.getExplorationById(explorationId))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,6 @@ class ExplorationFragment : InjectableFragment() {
fun revealSolution(saveUserChoice: Boolean) {
explorationFragmentPresenter.revealSolution(saveUserChoice)
}

fun dismissConceptCard() = explorationFragmentPresenter.dismissConceptCard()
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ class ExplorationFragmentPresenter @Inject constructor(
getStateFragment()?.revealSolution(saveUserChoice)
}

fun dismissConceptCard() = getStateFragment()?.dismissConceptCard()

private fun getStateFragment(): StateFragment? {
return fragment
.childFragmentManager
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,6 @@ class StateFragment :
fun revealSolution(saveUserChoice: Boolean) {
stateFragmentPresenter.revealSolution(saveUserChoice)
}

fun dismissConceptCard() = stateFragmentPresenter.dismissConceptCard()
}
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,9 @@ class StateFragmentPresenter @Inject constructor(
.addAudioVoiceoverSupport(
explorationId, viewModel.currentStateName, viewModel.isAudioBarVisible,
this::getAudioUiManager
).build()
)
.addConceptCardSupport()
.build()
}

fun revealHint(saveUserChoice: Boolean, hintIndex: Int) {
Expand Down Expand Up @@ -461,6 +463,14 @@ class StateFragmentPresenter @Inject constructor(
subscribeToAnswerOutcome(explorationProgressController.submitAnswer(answer))
}

fun dismissConceptCard() {
fragment.childFragmentManager.findFragmentByTag(
CONCEPT_CARD_DIALOG_FRAGMENT_TAG
)?.let { dialogFragment ->
fragment.childFragmentManager.beginTransaction().remove(dialogFragment).commitNow()
}
}

private fun moveToNextState() {
viewModel.setCanSubmitAnswer(canSubmitAnswer = false)
explorationProgressController.moveToNextState().observe(
Expand All @@ -487,8 +497,6 @@ class StateFragmentPresenter @Inject constructor(
binding.stateRecyclerView.smoothScrollToPosition(0)
}

private fun isAudioShowing(): Boolean = viewModel.isAudioBarVisible.get()!!
anandwana001 marked this conversation as resolved.
Show resolved Hide resolved

/** Updates submit button UI as active if pendingAnswerError null else inactive. */
fun updateSubmitButton(pendingAnswerError: String?, inputAnswerAvailable: Boolean) {
if (inputAnswerAvailable) {
Expand Down
Loading