Exemplo n.º 1
0
  public JSONObject getJSON(JSONObject jo) {
    Problem p = null;
    try {
      p = ProblemMgr.getProblem(getProbId());
    } catch (SQLException e) {
      e.printStackTrace(); // To change body of catch statement use File | Settings | File
      // Templates.
    }

    if (p != null && p.isQuickAuth() && p.isMultiChoice()) {
      jo.element(letter, val);
    }

    return jo;
  }
Exemplo n.º 2
0
 /**
  * Return all the ready problems in the database . Orders them by id. Forwards the request to the
  * database problem magager.
  *
  * @param smgr
  * @return a List of Problem objects
  * @throws Exception
  */
 protected List<Problem> getAllProblems(SessionManager smgr) throws Exception {
   return ProblemMgr.getAllProblems();
   //        return dbProblemMgr.getAllProblems(smgr.getConnection());
 }
Exemplo n.º 3
0
 public List<Problem> getProblemsInTopic(Connection conn, int probGroupID) throws SQLException {
   //       return dbProblemMgr.getProblemsInTopic(conn,probGroupID);
   return ProblemMgr.getTopicProblems(probGroupID);
 }