]> WPIA git - gigi.git/blobdiff - src/org/cacert/gigi/dbObjects/CATS.java
add: fill the new columns and test the adjusted api-call
[gigi.git] / src / org / cacert / gigi / dbObjects / CATS.java
index 7268d7048a1627f20386bec4f137f078ecabe084..700d76ee21175291101fadf1a5dde1bab532a275 100644 (file)
@@ -11,9 +11,9 @@ public class CATS {
 
     private static HashMap<String, Integer> names = new HashMap<>();
 
-    public static final String ASSURER_CHALLANGE_NAME = "Assurer's Challenge";
+    public static final String ASSURER_CHALLENGE_NAME = "Assurer's Challenge";
 
-    public static final int ASSURER_CHALLANGE_ID;
+    public static final int ASSURER_CHALLENGE_ID;
 
     private CATS() {
 
@@ -26,7 +26,7 @@ public class CATS {
                 names.put(res.getString(2), res.getInt(1));
             }
         }
-        ASSURER_CHALLANGE_ID = getID(ASSURER_CHALLANGE_NAME);
+        ASSURER_CHALLENGE_ID = getID(ASSURER_CHALLENGE_NAME);
     }
 
     public static synchronized int getID(String name) {
@@ -42,11 +42,13 @@ public class CATS {
         return i;
     }
 
-    public static void enterResult(User user, String testType, Date passDate) {
-        try (GigiPreparedStatement ps = new GigiPreparedStatement("INSERT INTO `cats_passed` SET `user_id`=?, `variant_id`=?, `pass_date`=?")) {
+    public static void enterResult(User user, String testType, Date passDate, String language, String version) {
+        try (GigiPreparedStatement ps = new GigiPreparedStatement("INSERT INTO `cats_passed` SET `user_id`=?, `variant_id`=?, `pass_date`=?, `language`=?, `version`=?")) {
             ps.setInt(1, user.getId());
             ps.setInt(2, getID(testType));
             ps.setTimestamp(3, new Timestamp(passDate.getTime()));
+            ps.setString(4, language);
+            ps.setString(5, version);
             ps.execute();
         }
     }