From 4cf85773605dbc264ef8c18051080a52a31430f9 Mon Sep 17 00:00:00 2001
From: Noel De Martin
Date: Mon, 13 Mar 2023 16:54:47 +0100
Subject: [PATCH] MOBILE-4278 quiz: Fix prompt rendering
---
.../mod/quiz/tests/behat/basic_usage.feature | 30 +++++++++----------
.../quiz/tests/behat/quiz_navigation.feature | 10 +++----
.../component/addon-qtype-multichoice.html | 6 +++-
3 files changed, 25 insertions(+), 21 deletions(-)
diff --git a/src/addons/mod/quiz/tests/behat/basic_usage.feature b/src/addons/mod/quiz/tests/behat/basic_usage.feature
index 73479ebc3..66946304d 100755
--- a/src/addons/mod/quiz/tests/behat/basic_usage.feature
+++ b/src/addons/mod/quiz/tests/behat/basic_usage.feature
@@ -61,24 +61,24 @@ Feature: Attempt a quiz in app
Then I should find "Text of the first question" in the app
But I should not find "Text of the second question" in the app
- When I press "Next" near "Question 1" in the app
+ When I press "Next" in the app
Then I should find "Text of the second question" in the app
But I should not find "Text of the first question" in the app
- When I press "Previous" near "Question 2" in the app
+ When I press "Previous" in the app
Then I should find "Text of the first question" in the app
But I should not find "Text of the second question" in the app
- When I press "Next" near "Quiz 1" in the app
+ When I press "Next" in the app
Then I should find "Text of the second question" in the app
But I should not find "Text of the first question" in the app
- When I press "Previous" near "Quiz 1" in the app
+ When I press "Previous" in the app
Then I should find "Text of the first question" in the app
But I should not find "Text of the second question" in the app
- When I press "Next" near "Question 1" in the app
- And I press "Submit" near "Quiz 1" in the app
+ When I press "Next" in the app
+ And I press "Submit" in the app
Then I should find "Summary of attempt" in the app
When I press "Not yet answered" within "2" "ion-item" in the app
@@ -109,29 +109,29 @@ Feature: Attempt a quiz in app
When I press "Attempt quiz now" in the app
And I press "Four" in the app
And I press "Three" in the app
- And I press "Next" near "Quiz 2" in the app
+ And I press "Next" in the app
And I set the field "Answer" to "testing" in the app
- And I press "Next" near "Question 2" in the app
+ And I press "Next" in the app
And I set the field "Answer" to "5" in the app
- And I press "Next" near "Question 3" in the app
+ And I press "Next" in the app
And I set the field "Answer" to "Testing an essay" in the app
- And I press "Next" "ion-button" near "Question 4" in the app
+ And I press "Next" "ion-button" in the app
And I press "quick" ".drag" in the app
And I press "" ".place1.drop" in the app
And I press "fox" ".drag" in the app
And I press "" ".place2.drop" in the app
And I press "lazy" ".drag" in the app
And I press "" ".place3.drop" in the app
- And I press "Next" near "Question 5" in the app
+ And I press "Next" in the app
And I press "True" in the app
- And I press "Next" near "Question 6" in the app
+ And I press "Next" in the app
And I press "Choose... , frog" in the app
And I press "amphibian" in the app
And I press "Choose... , newt" in the app
And I press "insect" in the app
And I press "Choose... , cat" in the app
And I press "mammal" in the app
- And I press "Submit" near "Question 7" in the app
+ And I press "Submit" in the app
Then I should not find "Not yet answered" in the app
When I press "Submit all and finish" in the app
@@ -144,9 +144,9 @@ Feature: Attempt a quiz in app
Given I entered the quiz activity "Quiz 1" on course "Course 1" as "student1" in the app
When I press "Attempt quiz now" in the app
And I press "True" in the app
- And I press "Next" near "Question 1" in the app
+ And I press "Next" in the app
And I press "False" in the app
- And I press "Submit" near "Question 2" in the app
+ And I press "Submit" in the app
And I press "Submit all and finish" in the app
And I press "OK" in the app
Then I should find "Review" in the app
diff --git a/src/addons/mod/quiz/tests/behat/quiz_navigation.feature b/src/addons/mod/quiz/tests/behat/quiz_navigation.feature
index 8ecb4e422..d951e86af 100644
--- a/src/addons/mod/quiz/tests/behat/quiz_navigation.feature
+++ b/src/addons/mod/quiz/tests/behat/quiz_navigation.feature
@@ -35,23 +35,23 @@ Feature: Attempt a quiz in app
Then I should find "Text of the first question" in the app
But I should not find "Text of the second question" in the app
- When I press "Next" near "Question 1" in the app
+ When I press "Next" in the app
Then I should find "Text of the second question" in the app
But I should not find "Text of the first question" in the app
- When I press "Previous" near "Question 2" in the app
+ When I press "Previous" in the app
Then I should find "Text of the first question" in the app
But I should not find "Text of the second question" in the app
- When I press "Next" near "Quiz 1" in the app
+ When I press "Next" in the app
Then I should find "Text of the second question" in the app
But I should not find "Text of the first question" in the app
- When I press "Previous" near "Quiz 1" in the app
+ When I press "Previous" in the app
Then I should find "Text of the first question" in the app
But I should not find "Text of the second question" in the app
- When I press "Next" near "Question 1" in the app
+ When I press "Next" in the app
And I press "Submit" in the app
Then I should find "Summary of attempt" in the app
diff --git a/src/addons/qtype/multichoice/component/addon-qtype-multichoice.html b/src/addons/qtype/multichoice/component/addon-qtype-multichoice.html
index 17a7b0abb..c8befbfa3 100644
--- a/src/addons/qtype/multichoice/component/addon-qtype-multichoice.html
+++ b/src/addons/qtype/multichoice/component/addon-qtype-multichoice.html
@@ -7,7 +7,11 @@
[contextLevel]="contextLevel" [contextInstanceId]="contextInstanceId" [courseId]="courseId">
- {{ multiQuestion.prompt }}
+
+
+
+