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 #4492 & 3537: Improved hints and solution UI UX #4500

Merged
merged 19 commits into from
Aug 19, 2022

Conversation

rt4914
Copy link
Contributor

@rt4914 rt4914 commented Aug 15, 2022

Explanation

Fixes #4492 by introducing a complete revamp of the hint & solution management flow in the app (see designs below).

Fixes #3537 by merging the hint summary layouts.

Note that one part of #4492 isn't implemented: pausing the hint timer while hints are being viewed. Ensuring this is properly implemented is being tracked as part of #4510.

Two new test exemptions were added: one for a new view model file (which seems sensible since most of the changes in this PR are aesthetic and not functional), and a second for a new hints configuration module that's specific to the alpha user study build of the app (which is temporary and we generally don't test thoroughly, anyway).

Designs
https://xd.adobe.com/view/3dca36c2-5115-419c-b25e-0f10526b077c-6899/screen/619724cc-0ecf-4c32-a452-432fded803f5/specs/
https://xd.adobe.com/view/3dca36c2-5115-419c-b25e-0f10526b077c-6899/screen/5311124a-b143-4916-aa46-6e318aca5650/specs/
https://xd.adobe.com/view/3dca36c2-5115-419c-b25e-0f10526b077c-6899/screen/545c6f32-2fec-4a8b-bb53-cecfb8e52f31/specs/

Essential Checklist

  • The PR title and explanation each start with "Fix #bugnum: " (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".)
  • Any changes to scripts/assets files have their rationale included in the PR explanation.
  • The PR follows the style guide.
  • The PR does not contain any unnecessary code changes from Android Studio (reference).
  • The PR is made from a branch that's not called "develop" and is up-to-date with "develop".
  • The PR is assigned to the appropriate reviewers (reference).

For UI-specific PRs only

If your PR includes UI-related changes, then:

  • Add screenshots for portrait/landscape for both a tablet & phone of the before & after UI changes
  • For the screenshots above, include both English and pseudo-localized (RTL) screenshots (see RTL guide)
  • Add a video showing the full UX flow with a screen reader enabled (see accessibility guide)
  • Add a screenshot demonstrating that you ran affected Espresso tests locally & that they're passing

Mobile Portrait

Mobile Landscape

Tablet

Return to Lesson button

NOTE: This button was created later on that's why not all screenshots contain this button but the below screenshot should suffice. It is fully functional too.

Dark Mode (Not Implemented)

Do not have designs for dark mode

RTL Support

Accessibility Output

There are few issues but not solving them right now.

Video Output

20220816_000912.mp4

@rt4914 rt4914 changed the title Fix #4492 & 3537: Improved hints and solution UI UX Fix part of #4492 & 3537: Improved hints and solution UI UX Aug 15, 2022
Copy link
Sponsor Member

@BenHenning BenHenning left a comment

Choose a reason for hiding this comment

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

Thanks for much @rt4914! Really well done implementation. Just had a few comments that I plan to follow up on directly.

if (currentExpandedHintListIndex == -1) {
currentExpandedHintListIndex = null
}
expandedItemsList =
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

Noting that it would be preferable to use a proto here to avoid passing around mutable state.

) {
binding.buttonViewModel = returnToLessonViewModel

binding.returnToLessonButton.setOnClickListener {
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

Could be moved to the view model for slightly simpler binding.

app/src/main/res/values/strings.xml Show resolved Hide resolved
closeHintsAndSolutionsDialog()

onView(withId(R.id.hint_bulb))
.check(matches(withDrawable(R.drawable.ic_keyboard_arrow_right_white_48)))
}
}

@Test
fun testStateFragment_openHintsAndSolution_checkReturnToLessonButtonIsVisible() {
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

What about a test verifying clicking on the return to lesson button?

closeHintsAndSolutionsDialog()

onView(withId(R.id.hint_bulb))
.check(matches(withDrawable(R.drawable.ic_keyboard_arrow_right_white_48)))
}
}

@Test
fun testStateFragment_openHintsAndSolution_checkReturnToLessonButtonIsVisible() {
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

Might be worth adding these new tests to questions' local tests, too.

@BenHenning
Copy link
Sponsor Member

FWIW this seems like a complete fix of #4492 as far as I can tell, though some investigation may be needed with regards to the hint timing logic.

@BenHenning
Copy link
Sponsor Member

Confirming that the current logic will NOT pause the timer while the hints are being viewed (I think this is a change in behavior from the old hints implementation). I think fixing it will be straightforward, but I'll follow up soon.

@BenHenning
Copy link
Sponsor Member

Okay, this is very much not going to be trivial, so I think we may need to skip it for this release. Will follow up with Sean on product priority here.

The main issue is that hints are handled in the domain layer entirely separately from the frontend lifecycle. We almost certainly would need to either somehow provide signal from the frontend when hints are being shown (and not mess this up since it'll break the hints timer), or manage hint state based on the observation of its results (similar to how ExplorationProgressController used to work), but this is difficult and not at all straightforward since hint behaviors are observed through ExplorationProgressController. I suspect we may need the DataProvider dynamic transformation that I'm working on for the beta release in order to even start tackling this issue.

@BenHenning BenHenning changed the title Fix part of #4492 & 3537: Improved hints and solution UI UX Fix #4492 & 3537: Improved hints and solution UI UX Aug 19, 2022
@seanlip
Copy link
Member

seanlip commented Aug 19, 2022

I would say, just make the timer for showing the next hint long enough so that it's unlikely that a student will get another hint while the current hint is showing. 2 or 2.5 minutes should be reasonable.

(Note: this is still a stopgap and we should fix it properly in the long term.)

@BenHenning
Copy link
Sponsor Member

I would say, just make the timer for showing the next hint long enough so that it's unlikely that a student will get another hint while the current hint is showing. 2 or 2.5 minutes should be reasonable.

(Note: this is still a stopgap and we should fix it properly in the long term.)

@seanlip fortunately we can very easily tweak this specifically for the study build. We currently have three hint delays which I think should be adjusted as such:

  • Delay for initial hint: 60 seconds (this should be kept the same since the issue won't affect it)
  • Delay for subsequent hints if the user doesn't try to answer: 30 seconds (bump to 2.5 minutes)
  • Delay for subsequent hints if the user submits a wrong answer: 10 seconds (keep since the user is more likely on the card at this point, and we want them to see the hint quickly)

Does this seem sensible?

@seanlip
Copy link
Member

seanlip commented Aug 19, 2022

Yes, seems reasonable. I slightly lean towards making the third one 15 seconds instead of 10, to give the learner some time to read the wrong answer feedback.

Update hint delay times for the Kenya-specific alpha build of the app.
Copy link
Sponsor Member

@BenHenning BenHenning left a comment

Choose a reason for hiding this comment

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

Approving this with some open comments. #4510 is tracking addressing those comments post-merge. Plus, an additional review should take place for the changes I contributed directly to the PR (since they haven't yet been reviewed).

@BenHenning BenHenning merged commit 6bab482 into develop Aug 19, 2022
@BenHenning BenHenning deleted the improved-hints-and-solution-ui-ux branch August 19, 2022 10:15
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.

Improve presentation of hints for the student. Merge hints_summary.xml into single xml file
3 participants