Skip to content
Snippets Groups Projects
Commit 77fc96ad authored by Christoph Thelen's avatar Christoph Thelen
Browse files

Add empty user at import, ignore them for learning progress

parent 34486ed0
Branches
Tags
No related merge requests found
......@@ -1772,6 +1772,8 @@ public class CouchDBDao implements IDatabaseDao {
answerDoc.put("timestamp", a.getTimestamp());
answerDoc.put("piRound", a.getPiRound());
answerDoc.put("abstention", a.isAbstention());
// we do not store the user's name
answerDoc.put("user", "");
answers.add(answerDoc);
}
}
......
......@@ -35,6 +35,7 @@ public class CourseScore implements Iterable<QuestionScore> {
/**
* @pre questionId has been added before.
* @pre username is set
* @param questionId
* @param username
* @param userscore
......@@ -45,6 +46,10 @@ public class CourseScore implements Iterable<QuestionScore> {
// Most likely this is a question that has no learning progress value.
return;
}
if (username == null || username.isEmpty()) {
// Precondition failed: ignore anonymous users
return;
}
QuestionScore questionScore = scores.get(questionId);
questionScore.add(username, userscore);
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment