Used to determine if a user has completed a module already @param ApplicationRoot The current running context of an application @param moduleId The module identifier @param userId The user identifier @return The module name of the module IF the user has not completed AND the user has previously open
(String ApplicationRoot, String moduleId, String userId)
| 167 | * @return The module name of the module IF the user has not completed AND the user has previously opened the challenge. |
| 168 | */ |
| 169 | public static String checkPlayerResult(String ApplicationRoot, String moduleId, String userId) |
| 170 | { |
| 171 | log.debug("*** Getter.checkPlayerResult ***"); |
| 172 | |
| 173 | String result = null; |
| 174 | Connection conn = Database.getCoreConnection(ApplicationRoot); |
| 175 | try |
| 176 | { |
| 177 | log.debug("Preparing userCheckResult call"); |
| 178 | CallableStatement callstmnt = conn.prepareCall("call userCheckResult(?, ?)"); |
| 179 | callstmnt.setString(1, moduleId); |
| 180 | callstmnt.setString(2, userId); |
| 181 | log.debug("Executing userCheckResult"); |
| 182 | ResultSet resultSet = callstmnt.executeQuery(); |
| 183 | resultSet.next(); |
| 184 | result = resultSet.getString(1); |
| 185 | } |
| 186 | catch(SQLException e) |
| 187 | { |
| 188 | log.debug("userCheckResult Failure: " + e.toString()); |
| 189 | result = null; |
| 190 | } |
| 191 | Database.closeConnection(conn); |
| 192 | log.debug("*** END checkPlayerResult ***"); |
| 193 | return result; |
| 194 | } |
| 195 | |
| 196 | /** |
| 197 | * Used to decipher whether or not a user exists as a player |