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 #161: Exploration player contentcard supports rich-text part -2 #229

Closed
wants to merge 20 commits into from

Conversation

veena14cs
Copy link
Contributor

@veena14cs veena14cs commented Oct 14, 2019

Explanation

This PR is replica of #189 . It includes rich-text component that parses HTML content. This PR also extracts image from the HTML content.

@veena14cs veena14cs changed the base branch from develop to exploration-content-card-1 October 14, 2019 11:19
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.

I have taken an overview look, you can solve these issues first before I take in-depth look.

app/build.gradle Outdated Show resolved Hide resolved
utility/src/main/java/org/oppia/util/parser/HtmlParser.kt Outdated Show resolved Hide resolved
app/src/main/res/layout/state_fragment.xml Outdated Show resolved Hide resolved
app/src/main/res/layout/state_fragment.xml Outdated Show resolved Hide resolved
@rt4914 rt4914 assigned veena14cs and unassigned rt4914 Oct 14, 2019
@veena14cs veena14cs changed the base branch from exploration-content-card-1 to develop October 14, 2019 12:05
@veena14cs veena14cs assigned rt4914 and unassigned veena14cs Oct 14, 2019
@veena14cs veena14cs requested a review from rt4914 October 14, 2019 12:17
Copy link
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 @veena14cs! Overall structure looks good, but I have a view concerns about tests and how we're integrating the content list fragment. Most of the comments are various style nits.

)
InteractionFeedbackViewHolder(binding)
}
else -> throw IllegalArgumentException("Invalid view type")
Copy link
Member

Choose a reason for hiding this comment

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

I suggest including the viewType parameter in this exception cause since it'll help provide context if the exception is ever thrown.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't understand what viewType parameter you mean. Can you please elaborate on this.
We have only two viewTypes over here one is content and other is learner's interaction.

if (getContentListFragment() == null) {
val contentListFragment = ContentListFragment()
val args = Bundle()
args.putString("exploration_id", dummyExploration_id)
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't we be using the same exploration ID that's being passed into StateFragmentPresenter?

If the explorations that are being included in the APK itself are not satisfactory for testing the state fragment, feel free to modify them to add additional rich text contents as needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes

Shouldn't we be using the same exploration ID that's being passed into StateFragmentPresenter?

Yes we could use. I added dummy exploration id for testing image and modified json.

app/src/main/res/layout/content_card_items.xml Outdated Show resolved Hide resolved
app/src/main/res/layout/content_card_items.xml Outdated Show resolved Hide resolved
)

@Test
fun testContentListFragment_loadHtmlContent_isDisplayed() {
Copy link
Member

Choose a reason for hiding this comment

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

This is only verifying that the recycler view is visible, but not that any specifically correct HTML is also displayed. Please add tests to verify that various content card cases work correctly by verifying that the correct HTML is displayed:

  • One content card
  • One content card with interaction feedback
  • One content card, one interaction feedback, a second content card
  • Two pairs of content cards and interaction feedbacks

Also, I suggest verifying that a configuration change properly keeps the recycler view states across rotations with a fifth test.

Copy link
Contributor

Choose a reason for hiding this comment

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

@BenHenning Actually adding interaction feedback depends on Continue/End Exploration ( #222 ),
so I think maybe you can finish reviewing this #222 and then she can write test-cases for this, or else if you have something else in mind, can you explain the alternate strategy.

@nikitamarysolomanpvt nikitamarysolomanpvt removed their assignment Oct 16, 2019
@rt4914
Copy link
Contributor

rt4914 commented Oct 18, 2019

@veena14cs Are you still working on this PR ?

@veena14cs
Copy link
Contributor Author

@veena14cs Are you still working on this PR ?

No, I am not.

@rt4914
Copy link
Contributor

rt4914 commented Oct 18, 2019

@veena14cs Are you still working on this PR ?

No, I am not.

In such cases make sure you unassign reviewers because otherwise they will review this PR without having any knowledge of not reviewing this PR.

Also, if possible, close this PR.

@rt4914 rt4914 removed their assignment Oct 18, 2019
@veena14cs
Copy link
Contributor Author

This approach is changed. Fix is in the PR #245.

@veena14cs veena14cs closed this Oct 19, 2019
@veena14cs veena14cs deleted the exploration-content-card-2 branch October 19, 2019 07:08
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.

4 participants