allAnswersINL.put(k,0);
correctAnswersALL.put(k,0);
allAnswers.put(k,0);
}
for (Response r:responses) {
LevelOfExperience k = r.getLevelOfExperience();
for (TechnicalQuestion q:TechnicalQuestions.QUESTIONS) {
if (k!=null && r.hasAnswered(q.getId())) {
boolean c = r.hasAnsweredCorrectly(q.getId());
increase(allAnswers,k);
if (c) {
increase(correctAnswersALL,k);
}
if (q.getType() == Type.INLINING) {
increase(allAnswersINL,k);
if (c) {
increase(correctAnswersINL,k);
}
}
else if (q.getType() == Type.RECOMPILATION) {
increase(allAnswersRECP,k);
if (c) {
increase(correctAnswersRECP,k);
}
}
else if (q.getType() == Type.UPGRADE) {
increase(allAnswersUPGR,k);
if (c) {
increase(correctAnswersUPGR,k);
}
}
}
}
}
System.out.println("correct answer ratio depending on level of experience");
// use keys from any map, they are all the same
System.out.println("key,corr. answers UPGR,all answers UPGR,corr. answers RECP,all answers RECP,corr. answers INL,all answers INL,corr. answers ALL,all answers");
char SEP = ',';
for (Entry<Object,Integer> e:correctAnswersRECP.entrySet()) {
Object k = e.getKey();
System.out.print(k.toString().toLowerCase().replace('_',' '));
System.out.print(SEP);
System.out.print(correctAnswersUPGR.get(k));
System.out.print(SEP);
System.out.print(allAnswersUPGR.get(k));