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 #259 and part of #163: Finish state fragment UI structure #270

Merged
merged 275 commits into from
Nov 7, 2019

Conversation

BenHenning
Copy link
Member

@BenHenning BenHenning commented Oct 29, 2019

This fixes #259, and part of #163 (core structure to unblock #164, but no tests yet).

This PR introduces the core functionality to enable all supported prototype interactions (minus number with units) and full exploration functionality, per supported peripheral systems for audio and interactions (including answer classification).

In total, this PR includes:

  • Introducing a new prototype exploration that supports all prototype interactions (minus numbers with units) that we can expand upon to fully verify the functionality in the exploration player
  • A full state adapter that binds each of the interaction types based on EphemeralState from the ExplorationProgressController
  • Generalizing interaction additions in the state fragment to a Dagger module and removal of all other dependencies on interaction IDs
  • Replacement of both item selection and state fragment RecyclerView adapters with BindableAdapter (which required some minor changes to BindableAdapter), leading to an end-to-end data-bound UI for the exploration player
  • Reworking of navigation buttons to de-couple the Continue interaction so that it can be modeled on its own
  • Introduction of automatic answer submission for interactions that do no need an explicit Submit button (like Continue and Multiple Choice), with dynamic support for interactions that can be in either state (ItemSelection)
  • Reworking of answer submission to be driven through view models rather than interaction views
  • Moved the audio button to a custom toolbar with the audio icon (though it's not currently switching state based on enabled state)
  • Updated to a newer (pre-release) AndroidX fragment library to simplify a tricky edge case where we needed to be able to associate a view with a fragment
  • Introduced support for displaying feedback cards
  • Introduced support for displaying read-only interactions with past answers (and support for converting InteractionObjects to text answers)
  • Removed the temporary state name view since that debug view is no longer necessary with hooked up navigation buttons & feedback since folks can observe the current state based on what's displayed
  • Introduction of a new view scope for custom views. This scope inherits from the fragment scope, and indirectly from the activity and application scopes. So far this is only used for the selection interaction view, and there's no pattern yet for 'view presenters'.
  • Some various bug fixes, including: parsing issues with fractions and reducing the number of individual updates to the recycler view to make the rendering experience less janky
  • Minor infrastructure improvements not worth individually calling out (including resolving Remove Duplicate InteractionAnswerRetriever #259)

Next steps for #163 would be introducing missing tests to guard against regressions. This is blocked on fixing downstream testing issues around swapping dependencies, and fixing existing tests on develop (#295).

Known next steps for #164 include:

  • Ensuring the audio button properly switches & animates when the cellular setting is toggled
  • Only showing the audio button when voiceovers are available
  • Verify that voiceovers play correctly for content and feedback
  • Expand the cellular button touch target to be 48dp per accessibility guidelines (it's currently too small and I have some difficulty tapping on it)
  • Add animations for RecyclerView updates
  • Add a loading state when entering the exploration to remove initial jank
  • Improvements in all interactions to improve smoothness (especially item selection's recycler view since it has similar issues to the state fragment recycler view)
  • Realtime validation and error reporting for invalid answers in each interaction (where relevant, and including adding min selection support for item selection and reporting the selection count)
  • Artificial UIs delays throughout the state fragment to make the conversational flow smoother (e.g. ensuring the 'Continue' button response shows up and is read before continuing to the next state)
  • Fixing the enter button crashing the app on the keyboard
  • Any other changes that improve the UX of the exploration player, or fix issues
  • Ensure the conversational flow looks & behaves correctly in parity with Oppia web (e.g. https://www.oppia.org/explore/0 for reference)

nikitamarysolomanpvt and others added 30 commits October 10, 2019 15:35
Separated this in its own PR.
Moved test case to StateFragment
Moved test case to StateFragment,PR suggestions updated
… topic-player-multiple-tabs

# Conflicts:
#	app/build.gradle
#	app/src/main/AndroidManifest.xml
#	app/src/main/res/values/styles.xml
… text-input-lowfi-numeric-input-interaction-view-part-2

# Conflicts:
#	app/src/sharedTest/java/org/oppia/app/player/state/StateFragmentTest.kt
Copy link
Contributor

@rt4914 rt4914 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really great implementation. Mostly nit changes and also, I have addressed some of the issues which I think needs to be fixed in this PR or in High-fi.

@BenHenning
Copy link
Member Author

Thanks @veena14cs & @rt4914 -- I will address comments tomorrow since it's getting a bit late for me.

Rajat, I think most of that should be resolved as part of highfi work, but I agree with hiding the item selection & radio buttons on wrong answers. Let's talk about this during the Android team meeting later. I need a refresher on how Oppia web handles this, too.

Also note that the item selection interaction in the exploration itself has a bug--it doesn't display feedback for the correct answer. I think you might have run into this--it's not an issue with the implementation, but the exploration itself. I'll make a note to patch that as part of resolving the open comments.

Copy link
Contributor

@jamesxu0 jamesxu0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM other than the unresolved comments.

Conflicts:
	app/src/main/java/org/oppia/app/fragment/FragmentComponent.kt
	app/src/main/java/org/oppia/app/home/HomeFragmentPresenter.kt
	app/src/sharedTest/java/org/oppia/app/testing/InputInteractionViewTestActivityTest.kt
	domain/src/main/java/org/oppia/domain/util/StateRetriever.kt
it was pulled in with earlier, unfinalized changes and we have since
realized it's not possible to test the image parser based on the current
project setup.
recent topic & home fragment changes.

Also, hide the topic button in the home fragment since the topic is
accessible directly via the home fragment tiles.
item selection state for the correct answer so that the player doesn't
seem broken.
@BenHenning
Copy link
Member Author

Thanks everyone for looking at this. There were a large number of style & small fixes in the latest batch, along with a few minor functional changes & build fixes. See the commit log for more detail.

@rt4914 I fixed the prototype exploration having no output which led to the player feeling broken. I did not address your other comments around the multiple item selection & multiple choice blocks showing up, or the correct answer box. We'll need to address both in highfi work (I don't want to bloat this PR anymore).

Also note that for the correct answer box, that's based on whether an answer is labeled as correct. Most answers aren't labeled as correct in the explorations saved in Oppia's backend, so we'll often not show the box even when it's implemented. We should still implement it though, especially for questions (@jamesxu0 FYI). Please let me know if you want to discuss this further.

@rt4914
Copy link
Contributor

rt4914 commented Nov 7, 2019

@BenHenning I have taken overview look and also checked all the comments. Almost all replies makes sense and most of my questions will get answered in High-fi work.

Copy link
Contributor

@veena14cs veena14cs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great.

@veena14cs veena14cs removed their assignment Nov 7, 2019
@BenHenning
Copy link
Member Author

One follow up from talking to @seanlip: we should be showing the completed answers for each interaction, rather than the whole interaction. This works better with the conversational dialog, and it matches Oppia web: https://www.oppia.org/explore/0. Updated my top comment to include this as a future work item.

This might make more sense to do as part of follow-up #163 work since it's a bit more structural. I'll note that in #163 as well.

@BenHenning BenHenning merged commit a23de65 into develop Nov 7, 2019
@BenHenning BenHenning deleted the finish-state-fragment-ui-structure branch November 7, 2019 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove Duplicate InteractionAnswerRetriever
7 participants