Map<String, String> map = Utils.getContainsMap(params, REQ_KEY_QUESTION_PREFIX, REQ_KEY_QUESTION_TEST3);
if(map.isEmpty()) return aList;
Iterator<Question> it = getScholarOrCraftsmanQuestionSet(testKey).iterator();
while(it.hasNext()){
Question q = it.next();
Answer a = new Answer();
a.setLabel(q.getLabel());
a.setStatement(q.getStatement());
String key = Utils.getRequestKey(REQ_KEY_QUESTION_TEST3, q.getId(), q.getOrder(), q.isForward());
int value = -1;
try{
value = Integer.parseInt(map.get(key));
if(q.isForward()){
if(value>0){
a.setFwdScore(value);
a.setRewScore(0);
}else if(value<0){
a.setFwdScore(0);
a.setRewScore(value*(-1));
}else{
a.setFwdScore(0);
a.setRewScore(0);
}
}else{
if(value>0){
a.setFwdScore(0);
a.setRewScore(value);
}else if(value<0){
a.setFwdScore(value*(-1));
a.setRewScore(0);
}else{
a.setFwdScore(0);
a.setRewScore(0);
}
}
aList.add(a);
}catch(RuntimeException e){
log.log(Level.INFO, "WorkoutContext#getScholarOrCraftsmanAnswers()内処理:"+map.get(key), e);