* @param res the result set containing the record of the question
* @param shift The number of the first column containing the data of the questions within the result set.
* @return the 'question' object requested
*/
protected Question buildQuestionRecordFromResultSet(ResultSet res, int shift) {
Question question = null;
if (null == res) return null;
if (shift > 0) --shift;
try {
int id = res.getInt(shift + 1);
if (id > 0) {
question = new Question();
question.setChoices(new ArrayList<Choice>());
question.setId(id);
question.setSurveyId(res.getInt(shift + 2));
ApsProperties prop = new ApsProperties();
prop.loadFromXml(res.getString(shift + 3));
question.setQuestions(prop);
question.setPos(res.getInt(shift + 4));
question.setSingleChoice(res.getBoolean(shift + 5));
question.setMinResponseNumber(res.getInt(shift + 6));
question.setMaxResponseNumber(res.getInt(shift + 7));
}
} catch (Throwable t) {
ApsSystemUtils.logThrowable(t, this, "buildQuestionRecordFromResultSet",
"Error while building a 'question' object from the result set");
}