Skip to content

Commit

Permalink
Fix #433: Add content and change the thumbnail image for the ratios c…
Browse files Browse the repository at this point in the history
…oncept card (#492)

* Change explanation of ratios concept card

* Add thumbnail image for the ratios skill

* Fix json formatting

* Fix TopicControllerTest
  • Loading branch information
vinitamurthi authored and BenHenning committed Dec 3, 2019
1 parent 8db13d3 commit 5b0d9cf
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ fun setImageDrawable(imageView: ImageView, thumbnailGraphic: SkillThumbnailGraph
SkillThumbnailGraphic.ADDING_AND_SUBTRACTING_FRACTIONS -> R.drawable.topic_fractions_06
SkillThumbnailGraphic.MULTIPLYING_FRACTIONS -> R.drawable.topic_fractions_07
SkillThumbnailGraphic.DIVIDING_FRACTIONS -> R.drawable.topic_fractions_08
SkillThumbnailGraphic.DERIVE_A_RATIO -> R.drawable.topic_ratios_01
else -> R.drawable.topic_fractions_01
}
)
Expand Down
Binary file added app/src/main/res/drawable/topic_ratios_01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 2 additions & 3 deletions domain/src/main/assets/ratios_skills.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,10 @@
"version": 2,
"misconceptions": [],
"skill_contents": {
"worked_examples": [
],
"worked_examples": [],
"explanation": {
"content_id": "explanation",
"html": "<p>There are originally 9 apples and 6 pears, and Bobby ate 3 pears, what is the new ratio of apples to pears</p>"
"html": "<p>A ratio represents a relative relationship between two or more amounts. To write a ratio, start by writing these amounts, separating them by a colon. Remember that the order matters!</p><p>For example, let's say you have 9 apples and 6 pears. You can write the ratio of apples to pears as <b> 9 : 6.</b></p>If, instead, you have 3 pears, 5 apples and 9 bananas, you can write the ratio of apples to bananas to pears as <b>5 : 9 : 3.</b> Notice that the order of items in the ratio follows the order that was asked for."
},
"written_translations": {
"translations_mapping": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,9 @@ class TopicController @Inject constructor(
FRACTIONS_SKILL_ID_2 -> SkillThumbnail.newBuilder()
.setThumbnailGraphic(SkillThumbnailGraphic.MIXED_NUMBERS_AND_IMPROPER_FRACTIONS)
.build()
RATIOS_SKILL_ID_0 -> SkillThumbnail.newBuilder()
.setThumbnailGraphic(SkillThumbnailGraphic.DERIVE_A_RATIO)
.build()
else -> SkillThumbnail.newBuilder()
.setThumbnailGraphic(SkillThumbnailGraphic.IDENTIFYING_THE_PARTS_OF_A_FRACTION)
.build()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ class TopicControllerTest {
"Derive a ratio from a description or a picture"
)
assertThat(conceptCard.explanation.html).contains(
"<p>There are originally 9 apples and 6 pears,")
"<p>A ratio represents a relative relationship between two or more amounts.")
}

@Test
Expand Down
3 changes: 3 additions & 0 deletions model/src/main/proto/thumbnail.proto
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,7 @@ enum SkillThumbnailGraphic {

// Corresponds to Dividing Fractions skill.
DIVIDING_FRACTIONS = 7;

// Corresponds to Derive a ratio from a description or picture skill.
DERIVE_A_RATIO = 8;
}

0 comments on commit 5b0d9cf

Please sign in to comment.