public static Boolean UpdateQuestion(Question QuestionToUpdate)
    {
        List<String> statements = new ArrayList<String>();
        statements.add(String.format("Update Question Set QuestionText = '%s', isValidated = %s, isRejected = %s where QuestionId = %d", QuestionToUpdate.questionText, QuestionToUpdate.isValidated? "TRUE" : "FALSE", QuestionToUpdate.isRejected? "True" : "False", QuestionToUpdate.dbId));

        for (Answer A : QuestionToUpdate.answers)
        {
            if (A.dbId == 0)
            {
              statements.add (String.format("insert into questionanswer (QuestionId, AnswerId, AnswerText, IsCorrect)values "
                      + "(%d, ((select max(AnswerId) from questionanswer where questionid = %d) + 1), '%s', %s)", QuestionToUpdate.dbId, QuestionToUpdate.dbId, A.answerText, A.isCorrect? "TRUE" : "FALSE"));
            }
            else 
            {
              statements.add(String.format ("update questionanswer set AnswerText = '%s', IsCorrect = %s where QuestionId = %d and AnswerID = %d", A.answerText, A.isCorrect? "TRUE" : "FALSE", QuestionToUpdate.dbId, A.dbId ));
            }
        }
        return runStatementBatch(statements);
    }