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 #3946: Fix solution automatically revealing after first hint reveal #3955

Merged
merged 6 commits into from
Oct 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -2603,6 +2603,7 @@ class StateFragmentTest {
targetTextViewId: Int
) {
scrollToViewType(SELECTION_INTERACTION)
// First, check that the option matches what's expected by the test.
onView(
atPositionOnView(
recyclerViewId = R.id.selection_interaction_recyclerview,
Expand Down

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions domain/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ DOMAIN_ASSETS = generate_assets_list_from_text_protos(
"test_single_interactive_state_exp_with_one_hint_and_solution",
"test_single_interactive_state_exp_with_one_hint_and_no_solution",
"test_single_interactive_state_exp_with_only_solution",
"test_single_interactive_state_exp_with_solution_missing_answer",
],
skills_file_names = [
"skills",
Expand Down
44 changes: 41 additions & 3 deletions domain/src/main/assets/test_exp_id_2.json
Original file line number Diff line number Diff line change
Expand Up @@ -692,8 +692,20 @@
"refresher_exploration_id": "",
"missing_prerequisite_skill_id": ""
},
"hints": [],
"solution": null
"hints": [{
"hint_content": {
"content_id": "hint_1",
"html": "<p>11 * 11 can be rephrased as 11 * 10, then add 11 at the end.</p>"
}
}],
"solution": {
"answer_is_exclusive": false,
"correct_answer": "",
"explanation": {
"content_id": "solution",
"html": "<p>11 times 11 is 121.</p>"
}
}
},
"classifier_model_id": "",
"recorded_voiceovers": {
Expand All @@ -702,11 +714,37 @@
"feedback_3": {},
"feedback_1": {},
"content": {},
"default_outcome": {}
"default_outcome": {},
"hint_1": {},
"solution": {}
}
},
"written_translations": {
"translations_mapping": {
"hint_1": {
"pt": {
"data_format": "html",
"translation": {"translation" : "<p> 11 * 11 pode ser reformulado como 11 * 10 e, em seguida, adicione 11 no final. </p>"},
"needs_update": false
},
"ar": {
"data_format": "html",
"translation": {"translation" : "يمكن إعادة صياغة <p> 11 * 11 على أنها 11 * 10، ثم أضف 11 في النهاية. </p>"},
"needs_update": false
}
},
"solution": {
"pt": {
"data_format": "html",
"translation": {"translation" : "<p> 11 vezes 11 é 121. </p>"},
"needs_update": false
},
"ar": {
"data_format": "html",
"translation": {"translation" : "<p> 11 مرات 11 هو 121. </p>"},
"needs_update": false
}
},
"feedback_2": {
"pt": {
"data_format": "html",
Expand Down
57 changes: 57 additions & 0 deletions domain/src/main/assets/test_exp_id_2.textproto
Original file line number Diff line number Diff line change
Expand Up @@ -825,10 +825,54 @@ states {
value {
}
}
recorded_voiceovers {
key: "hint_1"
value {
}
}
recorded_voiceovers {
key: "solution"
value {
}
}
content {
html: "<p>What is 11 times 11?</p>"
content_id: "content"
}
written_translations {
key: "hint_1"
value {
translation_mapping {
key: "pt"
value {
html: "<p> 11 * 11 pode ser reformulado como 11 * 10 e, em seguida, adicione 11 no final. </p>"
}
}
translation_mapping {
key: "ar"
value {
html: "\331\212\331\205\331\203\331\206 \330\245\330\271\330\247\330\257\330\251 \330\265\331\212\330\247\330\272\330\251 <p> 11 * 11 \330\271\331\204\331\211 \330\243\331\206\331\207\330\247 11 * 10\330\214 \330\253\331\205 \330\243\330\266\331\201 11 \331\201\331\212 \330\247\331\204\331\206\331\207\330\247\331\212\330\251. </p>"
}
}
}
}
written_translations {
key: "solution"
value {
translation_mapping {
key: "pt"
value {
html: "<p> 11 vezes 11 \303\251 121. </p>"
}
}
translation_mapping {
key: "ar"
value {
html: "<p> 11 \331\205\330\261\330\247\330\252 11 \331\207\331\210 121. </p>"
}
}
}
}
written_translations {
key: "feedback_2"
value {
Expand Down Expand Up @@ -970,6 +1014,19 @@ states {
rule_type: "IsGreaterThan"
}
}
solution {
interaction_id: "NumericInput"
explanation {
html: "<p>11 times 11 is 121.</p>"
content_id: "solution"
}
}
hint {
hint_content {
html: "<p>11 * 11 can be rephrased as 11 * 10, then add 11 at the end.</p>"
content_id: "hint_1"
}
}
default_outcome {
dest_state_name: "NumberInput"
feedback {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
{
"exploration_id": "test_single_interactive_state_exp_with_solution_missing_answer",
"version": 1,
"exploration": {
"init_state_name": "Text",
"states": {
"Text": {
"content": {
"content_id": "content",
"html": "<p>In which language does Oppia mean 'to learn'?</p>"
},
"interaction": {
"id": "TextInput",
"customization_args": {
"rows": {
"value": 1.0
},
"placeholder": {
"value": {
"content_id": "ca_placeholder_0",
"unicode_str": "Enter a language"
}
}
},
"answer_groups": [{
"rule_specs": [{
"rule_type": "Equals",
"inputs": {
"x": {
"contentId": "<unknown>",
"normalizedStrSet": ["finnish"]
}
}
}],
"outcome": {
"dest": "End",
"feedback": {
"content_id": "feedback_1",
"html": "<p>Correct!</p>"
},
"labelled_as_correct": false
}
}],
"default_outcome": {
"dest": "Text",
"feedback": {
"content_id": "default_outcome",
"html": "<p>Not quite. Try again (or maybe use a search engine).</p>"
},
"labelled_as_correct": false
},
"hints": [],
"solution": {
"answer_is_exclusive": false,
"explanation": {
"content_id": "solution",
"html": "<p>'Oppia' is translated from Finnish.</p>"
}
}
},
"recorded_voiceovers": {
"voiceovers_mapping": {
"feedback_1": {},
"content": {},
"default_outcome": {},
"solution": {}
}
},
"written_translations": {
"translations_mapping": {
"feedback_1": {},
"content": {},
"default_outcome": {},
"solution": {}
}
}
},
"End": {
"content": {
"content_id": "content",
"html": "Congratulations, you have finished!"
},
"param_changes": [],
"interaction": {
"id": "EndExploration",
"customization_args": {
"recommendedExplorationIds": {
"value": []
}
},
"answer_groups": [],
"default_outcome": null,
"hints": [],
"solution": null
},
"recorded_voiceovers": {
"voiceovers_mapping": {
"content": {}
}
},
"written_translations": {
"translations_mapping": {
"content": {}
}
}
}
},
"objective": "Test exploration.",
"language_code": "en",
"title": "Prototype exploration with only one solution and no hints"
}
}
Loading