diff --git a/src/main/java/github/weichware10/util/config/Configuration.java b/src/main/java/github/weichware10/util/config/Configuration.java index 110cce4..338f01b 100644 --- a/src/main/java/github/weichware10/util/config/Configuration.java +++ b/src/main/java/github/weichware10/util/config/Configuration.java @@ -31,20 +31,23 @@ protected Configuration() { * Konstruktor für Configuration vom Typ CodeChartsConfiguration. * * @param configId - configId der übergebenen Konfiguration - * @param question - Fragestellung zum Versuch + * @param imageUrl - die URL des Bildes + * @param intro - das Intro + * @param outro - das Outro + * @param tutorial - ob das Tutorial angezeigt werden soll * @param codeChartsConfiguration - Konfiguration von CodeCharts */ - public Configuration(String configId, String question, String imageUrl, + public Configuration(String configId, String imageUrl, String intro, String outro, boolean tutorial, CodeChartsConfiguration codeChartsConfiguration) { this.toolType = ToolType.CODECHARTS; - this.question = question; this.configId = configId; this.imageUrl = imageUrl; this.intro = intro; this.outro = outro; this.tutorial = tutorial; this.codeChartsConfiguration = codeChartsConfiguration; + this.question = null; } /** diff --git a/src/main/java/github/weichware10/util/db/Configurations.java b/src/main/java/github/weichware10/util/db/Configurations.java index 94df76b..66f4161 100644 --- a/src/main/java/github/weichware10/util/db/Configurations.java +++ b/src/main/java/github/weichware10/util/db/Configurations.java @@ -55,7 +55,6 @@ public Configuration get(String configId) { // bei jedem Typ existent ToolType toolType = ToolType.valueOf(rs.getString("tooltype")); String imageUrl = rs.getString("imageurl"); - String question = rs.getString("question"); String intro = rs.getString("intro"); String outro = rs.getString("outro"); boolean tutorial = rs.getBoolean("tutorial"); @@ -85,13 +84,14 @@ public Configuration get(String configId) { randomized, maxDepth, iterations, defaultHorizontal, defaultVertical); // komplette Konfiguration zurückgeben - configuration = new Configuration(configId, question, imageUrl, intro, outro, + configuration = new Configuration(configId, imageUrl, intro, outro, tutorial, codeChartsConfiguration); } else { // ZOOMMAPS spezifische Werte double speed = rs.getDouble("speed"); double imageViewWidth = rs.getDouble("imageview_width"); double imageViewHeight = rs.getDouble("imageview_height"); + String question = rs.getString("question"); // ZoomMapsConfiguration erstellen ZoomMapsConfiguration zoomMapsConfiguration = new ZoomMapsConfiguration( diff --git a/src/test/java/github/weichware10/util/config/ConfigClientTest.java b/src/test/java/github/weichware10/util/config/ConfigClientTest.java index 7b7d896..baaab19 100644 --- a/src/test/java/github/weichware10/util/config/ConfigClientTest.java +++ b/src/test/java/github/weichware10/util/config/ConfigClientTest.java @@ -52,7 +52,6 @@ public void loadingShouldReturnCorrectBooleanDataBase() { // set config to test with final String configId = dbClient.configurations.set(new Configuration( "null", - "question?", "url", "intro", "outro", diff --git a/src/test/java/github/weichware10/util/config/ConfigLoaderTest.java b/src/test/java/github/weichware10/util/config/ConfigLoaderTest.java index 29c4199..97a34dc 100644 --- a/src/test/java/github/weichware10/util/config/ConfigLoaderTest.java +++ b/src/test/java/github/weichware10/util/config/ConfigLoaderTest.java @@ -33,7 +33,6 @@ public void shouldOnlyLoadFromValidTrialId() { // set config to test with final String configId = dbClient.configurations.set(new Configuration( "null", - "question?", "url", "intro", "outro", diff --git a/src/test/java/github/weichware10/util/config/ConfigWriterTest.java b/src/test/java/github/weichware10/util/config/ConfigWriterTest.java index ad042a6..0da8491 100644 --- a/src/test/java/github/weichware10/util/config/ConfigWriterTest.java +++ b/src/test/java/github/weichware10/util/config/ConfigWriterTest.java @@ -23,9 +23,8 @@ public void onlyWriteToDataBase() { dotenv.get("DB_PASSWORD"), dotenv.get("DB_SCHEMA")); - String configId = ConfigWriter.toDataBase(new Configuration("null", "question?", "url", - "intro", "outro", true, - new CodeChartsConfiguration()), dbClient); + String configId = ConfigWriter.toDataBase(new Configuration("null", "url", + "intro", "outro", true, new CodeChartsConfiguration()), dbClient); assertTrue("ConfigWriter should write to valid database", configId != null); } diff --git a/src/test/java/github/weichware10/util/config/ConfigurationTest.java b/src/test/java/github/weichware10/util/config/ConfigurationTest.java index 2c640cd..69b550f 100644 --- a/src/test/java/github/weichware10/util/config/ConfigurationTest.java +++ b/src/test/java/github/weichware10/util/config/ConfigurationTest.java @@ -11,7 +11,7 @@ public class ConfigurationTest { @Test public void toStringWorks() { - Configuration ccc = new Configuration("con_id", "question?", "url", "intro", "outro", true, + Configuration ccc = new Configuration("con_id", "url", "intro", "outro", true, new CodeChartsConfiguration()); Configuration zmc = new Configuration("con_id", "question?", "url", "intro", "outro", true, new ZoomMapsConfiguration()); diff --git a/src/test/java/github/weichware10/util/db/ConfigurationsTest.java b/src/test/java/github/weichware10/util/db/ConfigurationsTest.java index 0c91f90..d02760b 100644 --- a/src/test/java/github/weichware10/util/db/ConfigurationsTest.java +++ b/src/test/java/github/weichware10/util/db/ConfigurationsTest.java @@ -38,10 +38,10 @@ public static void configurationsTestSetup() { new int[]{ 3, 5 }, new long[]{ 300, 500 }, false, true, true, 5, 15, -1, -1); - ccConfig = new Configuration("dunno yet", null, "url", "intro", "outro", true, + ccConfig = new Configuration("dunno yet", "url", "intro", "outro", true, codeChartsConfiguration); String ccConfigId = dbClient.configurations.set(ccConfig); - ccConfig = new Configuration(ccConfigId, null, "url", "intro", "outro", true, + ccConfig = new Configuration(ccConfigId, "url", "intro", "outro", true, codeChartsConfiguration); ZoomMapsConfiguration zoomMapsConfiguration1 = new ZoomMapsConfiguration(4, 30, 30); @@ -71,7 +71,7 @@ public void setConfigurationsShouldWork() { Configuration config; String configId; - config = new Configuration("", "Question?", "url", "intro", "outro", true, + config = new Configuration("", "url", "intro", "outro", true, codeChartsConfiguration); configId = dbClient.configurations.set(config); assertTrue("configId sollte mit con_ anfangen.", configId.startsWith("con_")); diff --git a/src/test/java/github/weichware10/util/db/TrialsTest.java b/src/test/java/github/weichware10/util/db/TrialsTest.java index 715a976..9ed08fb 100644 --- a/src/test/java/github/weichware10/util/db/TrialsTest.java +++ b/src/test/java/github/weichware10/util/db/TrialsTest.java @@ -46,8 +46,7 @@ public static void trialsTestSetup() { "OBST", Arrays.asList("banane", "orange"), new int[] { 3, 5 }, new long[] { 300, 500 }, false, true, true, 5, 15, -1, -1); - codeConfig = new Configuration("temp", "Warum ist die Banane krumm?", "url", - "intro", "outro", true, ccConf); + codeConfig = new Configuration("temp", "url", "intro", "outro", true, ccConf); configIdCc = dbClient.configurations.set(codeConfig); ZoomMapsConfiguration zmConf = new ZoomMapsConfiguration(4.3, 300, 300);