Updates a users result of a specific module @param ApplicationRoot The current running context of the application @param moduleId Identifier of the module the user is completing @param userId Identifier of the user completing the module @param extra The additional comments submitted in feedback by t
(String ApplicationRoot, String moduleId, String userId, String extra, int before, int after, int difficulty)
| 759 | * @return The module name of the module completed by the user |
| 760 | */ |
| 761 | public static String updatePlayerResult(String ApplicationRoot, String moduleId, String userId, String extra, int before, int after, int difficulty) |
| 762 | { |
| 763 | log.debug("*** Setter.updatePlayerResult ***"); |
| 764 | |
| 765 | String result = null; |
| 766 | Connection conn = Database.getCoreConnection(ApplicationRoot); |
| 767 | try |
| 768 | { |
| 769 | log.debug("Preparing userUpdateResult call"); |
| 770 | CallableStatement callstmnt = conn.prepareCall("call userUpdateResult(?, ?, ?, ?, ?, ?)"); |
| 771 | callstmnt.setString(1, moduleId); |
| 772 | callstmnt.setString(2, userId); |
| 773 | callstmnt.setInt(3, before); |
| 774 | callstmnt.setInt(4, after); |
| 775 | callstmnt.setInt(5, difficulty); |
| 776 | callstmnt.setString(6, extra); |
| 777 | log.debug("Executing userUpdateResult"); |
| 778 | callstmnt.execute(); |
| 779 | //User Executed. Now Get the Level Name Langauge Key |
| 780 | result = Getter.getModuleNameLocaleKey(ApplicationRoot, moduleId); |
| 781 | } |
| 782 | catch(SQLException e) |
| 783 | { |
| 784 | log.error("userUpdateResult Failure: " + e.toString()); |
| 785 | result = null; |
| 786 | } |
| 787 | Database.closeConnection(conn); |
| 788 | log.debug("*** END updatePlayerResult ***"); |
| 789 | return result; |
| 790 | } |
| 791 | |
| 792 | /** |
| 793 | * Adds or Subtracts points from a user. |