Skip to content
Snippets Groups Projects
Commit b3d40385 authored by srosse's avatar srosse
Browse files

OO-716: fix multiple choice stats in survey, there is no wrong answer there...

OO-716: fix multiple choice stats in survey, there is no wrong answer there but the QTI return 1 point for the first response and 0 for the next, remove the empty responses from the stats of essay
parent 28b4bfa7
No related branches found
No related tags found
No related merge requests found
......@@ -186,7 +186,7 @@ public class QTI12ItemStatisticsController extends BasicController {
.getItemStatistics(item.getIdent(), maxScore, searchParams);
mainVC.contextPut("solution", item.getQuestion().getSolutionText());
mainVC.contextPut("numOfResults", itemStats.getNumOfResults());
int numOfResults = itemStats.getNumOfResults();
if(!survey) {
mainVC.contextPut("maxScore", maxScore);
}
......@@ -194,10 +194,17 @@ public class QTI12ItemStatisticsController extends BasicController {
List<String> answers = qtiStatisticsManager.getAnswers(item.getIdent(), searchParams);
List<String> cleanedAnswers = new ArrayList<String>();
List<String> cleanedAnswers = new ArrayList<>();
for (String string : answers) {
cleanedAnswers.add(stripAnswerText(string));
String strippedAnswer = stripAnswerText(string);
if(strippedAnswer == null || strippedAnswer.length() == 0) {
numOfResults--;
} else {
cleanedAnswers.add(strippedAnswer);
}
}
mainVC.contextPut("numOfResults", Math.max(0, numOfResults));
mainVC.contextPut("studentAnswers", cleanedAnswers);
}
......
......@@ -149,7 +149,11 @@ public class SeriesFactory {
double rightA;
double wrongA;
if (points > 0.00001f) {
if (survey) {
rightA = answersPerAnswerOption;
wrongA = 0d;
} else if (points > 0.00001f) {
rightA = answersPerAnswerOption;
wrongA = numOfParticipants - notAnswered - answersPerAnswerOption;
} else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment