Skip to content

Commit b3cc378

Browse files
authored
Merge pull request #373 from shikharbhuddi/SameOptionsToastsQuiz
Fixed number of toasts if two or more options in Quiz Template are same.
2 parents f54d1cb + f8a53e4 commit b3cc378

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

source-code/app/src/main/java/org/buildmlearn/toolkit/templates/QuizTemplate.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,9 @@ public void onClick(View v) {
221221
isValidated = false;
222222
return;
223223
}
224-
225-
for (int i = 0; i < options.size(); i++) {
226-
for (int j = 0; j < i; j++) {
227-
if (!options.get(i).getText().toString().trim().isEmpty() && options.get(i).getText().toString().trim().equalsIgnoreCase(options.get(j).getText().toString().trim())) {
224+
for(int i=0;i<options.size();i++){
225+
for(int j=0;j<i;j++){
226+
if (isValidated && !options.get(i).getText().toString().trim().isEmpty() && options.get(i).getText().toString().trim().equalsIgnoreCase(options.get(j).getText().toString().trim())) {
228227
Toast.makeText(activity.getApplication(), activity.getString(R.string.same_options), Toast.LENGTH_SHORT).show();
229228
isValidated = false;
230229
}

0 commit comments

Comments
 (0)