Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/service/AssessmentServiceImpl.java =================================================================== diff -u -re194f22014c7cbffaf5168f1982aa89e7c34c34d -r0a7722c693be32526cebf8057b86eb94de2e8707 --- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/service/AssessmentServiceImpl.java (.../AssessmentServiceImpl.java) (revision e194f22014c7cbffaf5168f1982aa89e7c34c34d) +++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/service/AssessmentServiceImpl.java (.../AssessmentServiceImpl.java) (revision 0a7722c693be32526cebf8057b86eb94de2e8707) @@ -1423,16 +1423,18 @@ //prepare extra data for VSA type of questions, so teachers can allocate answers into groups if (question.getType() == QbQuestion.TYPE_VERY_SHORT_ANSWERS) { + boolean isQuestionCaseSensitive = question.getQbQuestion().isCaseSensitive(); //find all questionResults that are not allocated into groups yet List notAllocatedQuestionResults = new ArrayList<>(); + Set notAllocatedAnswers = new HashSet<>(); for (AssessmentQuestionResult questionResult : allQuestionResults) { String answer = questionResult.getAnswer(); if (StringUtils.isBlank(answer)) { continue; } boolean isAnswerAllocated = false; - boolean isQuestionCaseSensitive = question.getQbQuestion().isCaseSensitive(); + String normalisedAnswer = AssessmentEscapeUtils.normaliseVSAnswer(answer); for (QbOption option : qbQuestion.getQbOptions()) { Collection alternatives = AssessmentEscapeUtils.normaliseVSOption(option.getName()); @@ -1449,7 +1451,14 @@ } if (!isAnswerAllocated) { - notAllocatedQuestionResults.add(questionResult); + if (!isQuestionCaseSensitive) { + normalisedAnswer = normalisedAnswer.toLowerCase(); + } + // do not add repetitive students' suggestions for teacher to assign to an option + if (!notAllocatedAnswers.contains(normalisedAnswer)) { + notAllocatedAnswers.add(normalisedAnswer); + notAllocatedQuestionResults.add(questionResult); + } } } questionSummary.setNotAllocatedQuestionResults(notAllocatedQuestionResults);