Commit 65b430c8 authored by Andreas Gärtner's avatar Andreas Gärtner

Added points_unchecked to IliasAnswer and to getAnswers select

statement.
parent 9a3608bc
......@@ -3,14 +3,14 @@ package de.thm.arsnova.connector.model;
public class IliasAnswer {
private String text;
private double points;
private double points_unchecked;
public IliasAnswer(String text, double points) {
public IliasAnswer(String text, double points, double points_unchecked) {
this.text = text;
this.points = points;
this.points_unchecked = points_unchecked;
}
public IliasAnswer() {}
public String getText() {
return text;
}
......@@ -18,4 +18,8 @@ public class IliasAnswer {
public double getPoints() {
return points;
}
public double getPointsUnchecked() {
return points_unchecked;
}
}
......@@ -258,15 +258,17 @@ public class IliasConnectorDaoImpl implements UniRepDao {
final JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
return jdbcTemplate.query(
"SELECT answertext, points FROM qpl_a_sc WHERE question_fi = ? "
+ "UNION SELECT answertext, points FROM qpl_a_mc WHERE question_fi = ?",
"SELECT answertext, points, NULL points_unchecked FROM qpl_a_sc WHERE question_fi = ? "
+ "UNION SELECT answertext, points, points_unchecked FROM qpl_a_mc "
+ "WHERE question_fi = ?",
new String[] {String.valueOf(questionId), String.valueOf(questionId)},
new RowMapper<IliasAnswer>() {
@Override
public IliasAnswer mapRow(final ResultSet resultSet, final int row) throws SQLException {
return new IliasAnswer(
resultSet.getString("answertext"),
resultSet.getDouble("points")
resultSet.getDouble("points"),
resultSet.getDouble("points_unchecked")
);
}
}
......
Markdown is supported
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