overhauled histograms
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
@@ -11,7 +11,7 @@ import java.util.Map;
|
||||
public interface PollDb {
|
||||
Collection<Poll> listPolls(UmbrellaUser user);
|
||||
|
||||
Poll.Evaluation loadEvaluation(String id);
|
||||
Poll.Evaluation loadEvaluation(Poll poll);
|
||||
|
||||
Poll loadPoll(String id);
|
||||
|
||||
|
||||
@@ -114,7 +114,7 @@ public class PollModule extends BaseHandler implements PollService {
|
||||
}
|
||||
}
|
||||
var result = new HashMap<>(poll.toMap());
|
||||
var evaluation = pollDb.loadEvaluation(poll.id());
|
||||
var evaluation = pollDb.loadEvaluation(poll);
|
||||
result.put(Field.EVALUATION,evaluation.toMap());
|
||||
return sendContent(ex,result);
|
||||
}
|
||||
|
||||
@@ -150,10 +150,10 @@ public class SqliteDb extends BaseDb implements PollDb {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Poll.Evaluation loadEvaluation(String pollId) {
|
||||
public Poll.Evaluation loadEvaluation(Poll poll) {
|
||||
try {
|
||||
var result = new Poll.Evaluation();
|
||||
var rs = select(ALL).from(TABLE_SELECTIONS).where(POLL_ID,equal(pollId)).exec(db);
|
||||
var result = new Poll.Evaluation(poll);
|
||||
var rs = select(ALL).from(TABLE_SELECTIONS).where(POLL_ID,equal(poll.id())).exec(db);
|
||||
while (rs.next()) result.count(rs);
|
||||
rs.close();
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user