diff --git a/build.gradle.kts b/build.gradle.kts index 0ef0bdc..946c13c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,7 +8,7 @@ plugins { } subprojects { group = "com.github.cs125-illinois.questioner" - version = "2022.10.2" + version = "2022.10.3" tasks.withType { kotlinOptions { jvmTarget = JavaVersion.VERSION_17.toString() diff --git a/lib/build.gradle.kts b/lib/build.gradle.kts index 7571566..0f896b4 100644 --- a/lib/build.gradle.kts +++ b/lib/build.gradle.kts @@ -12,9 +12,9 @@ dependencies { implementation("org.ow2.asm:asm:9.4") api("com.beyondgrader.resource-agent:agent:2022.9.3") - api("com.github.cs125-illinois.jeed:core:2022.10.1") - api("com.github.cs125-illinois:jenisol:2022.10.0") - api("io.kotest:kotest-runner-junit5:5.4.2") + api("com.github.cs125-illinois.jeed:core:2022.10.2") + api("com.github.cs125-illinois:jenisol:2022.10.1") + api("io.kotest:kotest-runner-junit5:5.5.1") api("com.google.truth:truth:1.1.3") api("com.github.cs125-illinois:libcs1:2022.9.1") } diff --git a/lib/src/test/resources/questions.json b/lib/src/test/resources/questions.json index b5dd99f..782ed47 100644 --- a/lib/src/test/resources/questions.json +++ b/lib/src/test/resources/questions.json @@ -507,133 +507,6 @@ }, "fauxStatic": false }, - "With Template Imports": { - "name": "With Template Imports", - "type": "METHOD", - "klass": "Question", - "metadata": { - "contentHash": "5d70228ab7a1b8f7c8ee61584ff9e859", - "packageName": "com.examples.withtemplateimports", - "version": "2022.7.0", - "author": "challen@illinois.edu", - "javaDescription": "

Example to test use of import statements in method templates.

", - "usedFiles": [], - "templateImports": [ - "java.util.List", - "java.util.ArrayList", - "java.util.Arrays" - ], - "focused": false - }, - "annotatedControls": {}, - "question": { - "klass": "Question", - "contents": "import edu.illinois.cs.cs125.questioner.lib.Correct;\nimport edu.illinois.cs.cs125.questioner.lib.TemplateImports;\nimport edu.illinois.cs.cs125.questioner.lib.Wrap;\nimport java.util.Arrays;\nimport java.util.List;\n\n/*\n * Example to test use of import statements in method templates.\n */\n\n@Correct(name = \"With Template Imports\", version = \"2022.7.0\", author = \"challen@illinois.edu\")\n@Wrap\n@TemplateImports(paths = \"java.util.List,java.util.ArrayList,java.util.Arrays\")\npublic class Question {\n public static List max(int first, int second) {\n return Arrays.asList(first, second);\n }\n}", - "language": "java", - "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/withtemplateimports/Question.java" - }, - "correct": { - "klass": "Question", - "contents": "public static List max(int first, int second) {\n return Arrays.asList(first, second);\n}", - "language": "java", - "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/withtemplateimports/Question.java", - "complexity": 1, - "features": { - "featureMap": { - "METHOD": 1, - "RETURN": 1, - "VISIBILITY_MODIFIERS": 1, - "STATIC_METHOD": 1, - "BOXING_CLASSES": 1, - "TYPE_PARAMETERS": 1, - "DOT_NOTATION": 1, - "DOTTED_METHOD_CALL": 1 - }, - "importList": [], - "typeList": [ - "List", - "Integer", - "int" - ], - "identifierList": [], - "dottedMethodList": [ - "asList" - ] - }, - "lineCount": { - "source": 3, - "comment": 0, - "blank": 0 - }, - "expectedDeadCount": 1 - }, - "alternativeSolutions": [], - "incorrect": [], - "common": [], - "javaTemplate": "import java.util.Arrays;\nimport java.util.List;\nimport java.util.ArrayList;\n\npublic class Question {\n {{{ contents }}}\n}", - "importWhitelist": [ - "java.util.List", - "java.util.ArrayList", - "java.util.Arrays" - ], - "importBlacklist": [], - "slug": "with-template-imports", - "hasKotlin": false, - "published": { - "name": "With Template Imports", - "type": "METHOD", - "path": "with-template-imports", - "author": "challen@illinois.edu", - "version": "2022.7.0", - "packageName": "com.examples.withtemplateimports", - "languages": [ - "java" - ], - "descriptions": { - "java": "

Example to test use of import statements in method templates.

" - }, - "complexity": { - "java": 1 - }, - "features": { - "java": { - "featureMap": { - "METHOD": 1, - "RETURN": 1, - "VISIBILITY_MODIFIERS": 1, - "STATIC_METHOD": 1, - "BOXING_CLASSES": 1, - "TYPE_PARAMETERS": 1, - "DOT_NOTATION": 1, - "DOTTED_METHOD_CALL": 1 - }, - "importList": [], - "typeList": [ - "List", - "Integer", - "int" - ], - "identifierList": [], - "dottedMethodList": [ - "asList" - ] - } - }, - "lineCounts": { - "java": { - "source": 3, - "comment": 0, - "blank": 0 - } - }, - "templateImports": [ - "java.util.List", - "java.util.ArrayList", - "java.util.Arrays" - ] - }, - "fauxStatic": false - }, "Counter": { "name": "Counter", "type": "KLASS", @@ -1111,49 +984,57 @@ }, "fauxStatic": false }, - "Combine Minus Two": { - "name": "Combine Minus Two", + "With Template Imports": { + "name": "With Template Imports", "type": "METHOD", "klass": "Question", "metadata": { - "contentHash": "20cdf15b91970109fdef324f27e1cacf", - "packageName": "com.examples.combineminustwo", - "version": "2021.6.0", + "contentHash": "c89221c76a84f3162a726fdc8ee8ab4a", + "packageName": "com.examples.testing.withtemplateimports", + "version": "2022.7.0", "author": "challen@illinois.edu", - "javaDescription": "

Write a function combine that, given two String arguments, returns the second appended to the first.\nExcept you should omit the first two characters of each String.\nFor example, given Java and Kotlin, you would return vatlin.\nYou can assume that each String is of length at least two.

", + "javaDescription": "

Example to test use of import statements in method templates.

", "usedFiles": [], - "templateImports": [], + "templateImports": [ + "java.util.List", + "java.util.ArrayList", + "java.util.Arrays" + ], "focused": false }, "annotatedControls": {}, "question": { "klass": "Question", - "contents": "import edu.illinois.cs.cs125.jenisol.core.FixedParameters;\nimport edu.illinois.cs.cs125.jenisol.core.RandomParameters;\nimport edu.illinois.cs.cs125.jenisol.core.Two;\nimport edu.illinois.cs.cs125.questioner.lib.Correct;\nimport edu.illinois.cs.cs125.questioner.lib.Generators;\nimport edu.illinois.cs.cs125.questioner.lib.Wrap;\nimport java.util.Arrays;\nimport java.util.List;\nimport java.util.Random;\n\n/*\n * Write a function `combine` that, given two `String` arguments, returns the second appended to the first.\n * Except you should omit the first two characters of each `String`.\n * For example, given `Java` and `Kotlin`, you would return `vatlin`.\n * You can assume that each `String` is of length at least two.\n */\n\n@Correct(name = \"Combine Minus Two\", author = \"challen@illinois.edu\", version = \"2021.6.0\")\n@Wrap\npublic class Question {\n String combine(String first, String second) {\n return first.substring(2) + second.substring(2);\n }\n\n @FixedParameters\n private static final List> FIXED =\n Arrays.asList(new Two<>(\"Java\", \"Kotlin\"), new Two<>(\"CS125\", \"CS124\"));\n\n @RandomParameters\n private static Two randomStrings(Random random) {\n String first = Generators.randomAlphanumericStringWithLength(random, random.nextInt(32) + 2);\n String second = Generators.randomAlphanumericStringWithLength(random, random.nextInt(32) + 2);\n return new Two<>(first, second);\n }\n}", + "contents": "import edu.illinois.cs.cs125.questioner.lib.Correct;\nimport edu.illinois.cs.cs125.questioner.lib.TemplateImports;\nimport edu.illinois.cs.cs125.questioner.lib.Wrap;\nimport java.util.Arrays;\nimport java.util.List;\n\n/*\n * Example to test use of import statements in method templates.\n */\n\n@Correct(name = \"With Template Imports\", version = \"2022.7.0\", author = \"challen@illinois.edu\")\n@Wrap\n@TemplateImports(paths = \"java.util.List,java.util.ArrayList,java.util.Arrays\")\npublic class Question {\n public static List max(int first, int second) {\n return Arrays.asList(first, second);\n }\n}", "language": "java", - "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/combineminustwo/Question.java" + "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/testing/withtemplateimports/Question.java" }, "correct": { "klass": "Question", - "contents": "String combine(String first, String second) {\n return first.substring(2) + second.substring(2);\n}", + "contents": "public static List max(int first, int second) {\n return Arrays.asList(first, second);\n}", "language": "java", - "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/combineminustwo/Question.java", + "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/testing/withtemplateimports/Question.java", "complexity": 1, "features": { "featureMap": { - "ARITHMETIC_OPERATORS": 1, "METHOD": 1, "RETURN": 1, - "STRING": 3, - "DOT_NOTATION": 2, - "DOTTED_METHOD_CALL": 2 + "VISIBILITY_MODIFIERS": 1, + "STATIC_METHOD": 1, + "BOXING_CLASSES": 1, + "TYPE_PARAMETERS": 1, + "DOT_NOTATION": 1, + "DOTTED_METHOD_CALL": 1 }, "importList": [], "typeList": [ - "String" + "List", + "Integer", + "int" ], "identifierList": [], "dottedMethodList": [ - "substring" + "asList" ] }, "lineCount": { @@ -1166,23 +1047,27 @@ "alternativeSolutions": [], "incorrect": [], "common": [], - "javaTemplate": "public class Question {\n {{{ contents }}}\n}", - "importWhitelist": [], + "javaTemplate": "import java.util.Arrays;\nimport java.util.List;\nimport java.util.ArrayList;\n\npublic class Question {\n {{{ contents }}}\n}", + "importWhitelist": [ + "java.util.List", + "java.util.ArrayList", + "java.util.Arrays" + ], "importBlacklist": [], - "slug": "combine-minus-two", + "slug": "with-template-imports", "hasKotlin": false, "published": { - "name": "Combine Minus Two", + "name": "With Template Imports", "type": "METHOD", - "path": "combine-minus-two", + "path": "with-template-imports", "author": "challen@illinois.edu", - "version": "2021.6.0", - "packageName": "com.examples.combineminustwo", + "version": "2022.7.0", + "packageName": "com.examples.testing.withtemplateimports", "languages": [ "java" ], "descriptions": { - "java": "

Write a function combine that, given two String arguments, returns the second appended to the first.\nExcept you should omit the first two characters of each String.\nFor example, given Java and Kotlin, you would return vatlin.\nYou can assume that each String is of length at least two.

" + "java": "

Example to test use of import statements in method templates.

" }, "complexity": { "java": 1 @@ -1190,20 +1075,24 @@ "features": { "java": { "featureMap": { - "ARITHMETIC_OPERATORS": 1, "METHOD": 1, "RETURN": 1, - "STRING": 3, - "DOT_NOTATION": 2, - "DOTTED_METHOD_CALL": 2 + "VISIBILITY_MODIFIERS": 1, + "STATIC_METHOD": 1, + "BOXING_CLASSES": 1, + "TYPE_PARAMETERS": 1, + "DOT_NOTATION": 1, + "DOTTED_METHOD_CALL": 1 }, "importList": [], "typeList": [ - "String" + "List", + "Integer", + "int" ], "identifierList": [], "dottedMethodList": [ - "substring" + "asList" ] } }, @@ -1214,52 +1103,54 @@ "blank": 0 } }, - "templateImports": [] + "templateImports": [ + "java.util.List", + "java.util.ArrayList", + "java.util.Arrays" + ] }, "fauxStatic": false }, - "Fancy String Compare": { - "name": "Fancy String Compare", - "type": "METHOD", + "Test Constructor NotNull": { + "name": "Test Constructor NotNull", + "type": "KLASS", "klass": "Question", "metadata": { - "contentHash": "238a3487d82ef1431fab06a22392a361", - "packageName": "com.examples.fancystringcompare", - "version": "2021.6.0", + "contentHash": "0f5d87fda490b597fa6cf22e0d1d96d1", + "packageName": "com.examples.testing.withconstructornotnull", + "version": "2022.10.0", "author": "challen@illinois.edu", - "javaDescription": "

Write a method fancyCompare that takes two String arguments. If the two Strings are equal, return -1.\nOtherwise, return the length of the longer String.\nYou should assert that both inputs are not null.

", - "usedFiles": [ - "/Users/challen/code/questioner-problems/src/main/java/com/examples/fancystringcompare/incorrect/badequals/Question.java" - ], + "javaDescription": "

Testing @NotNull annotation on constructor parameters.

", + "usedFiles": [], "templateImports": [], - "focused": false + "focused": true }, "annotatedControls": {}, "question": { "klass": "Question", - "contents": "import edu.illinois.cs.cs125.questioner.lib.Correct;\nimport edu.illinois.cs.cs125.questioner.lib.Wrap;\n\n/*\n * Write a method `fancyCompare` that takes two `String` arguments. If the two `String`s are equal, return -1.\n * Otherwise, return the length of the longer `String`.\n * You should `assert` that both inputs are not `null`.\n */\n\n@SuppressWarnings(\"ManualMinMaxCalculation\")\n@Correct(name = \"Fancy String Compare\", author = \"challen@illinois.edu\", version = \"2021.6.0\")\n@Wrap\npublic class Question {\n int fancyEquals(String first, String second) {\n assert first != null;\n assert second != null;\n if (first.equals(second)) {\n return -1;\n // mutate-disable-conditional-boundary\n // mutate-disable-modify-length-and-size\n } else if (first.length() > second.length()) {\n return first.length();\n } else {\n return second.length();\n }\n }\n}", + "contents": "import edu.illinois.cs.cs125.jenisol.core.NotNull;\nimport edu.illinois.cs.cs125.questioner.lib.Correct;\n\n/*\n * Testing @NotNull annotation on constructor parameters.\n */\n\n@Correct(name = \"Test Constructor NotNull\", version = \"2022.10.0\", author = \"challen@illinois.edu\", focused = true)\npublic class Question {\n private final int stringLength;\n\n public Question(@NotNull String value) {\n stringLength = value.length();\n }\n\n public int getStringLength() {\n return stringLength;\n }\n}", "language": "java", - "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/fancystringcompare/Question.java" + "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/testing/withconstructornotnull/Question.java" }, "correct": { "klass": "Question", - "contents": "int fancyEquals(String first, String second) {\n assert first != null;\n assert second != null;\n if (first.equals(second)) {\n return -1;\n // mutate-disable-conditional-boundary\n // mutate-disable-modify-length-and-size\n } else if (first.length() > second.length()) {\n return first.length();\n } else {\n return second.length();\n }\n}", + "contents": "public class Question {\n private final int stringLength;\n\n public Question(String value) {\n stringLength = value.length();\n }\n\n public int getStringLength() {\n return stringLength;\n }\n}\n", "language": "java", - "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/fancystringcompare/Question.java", - "complexity": 3, + "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/testing/withconstructornotnull/Question.java", + "complexity": 2, "features": { "featureMap": { - "COMPARISON_OPERATORS": 3, - "IF_STATEMENTS": 1, - "ELSE_STATEMENTS": 1, - "ELSE_IF": 1, + "VARIABLE_REASSIGNMENTS": 1, "METHOD": 1, - "RETURN": 3, - "STRING": 2, - "NULL": 2, - "ASSERT": 2, - "DOT_NOTATION": 5, - "DOTTED_METHOD_CALL": 5 + "RETURN": 1, + "CONSTRUCTOR": 1, + "GETTER": 1, + "STRING": 1, + "CLASS": 1, + "VISIBILITY_MODIFIERS": 4, + "FINAL_FIELD": 1, + "DOT_NOTATION": 1, + "DOTTED_METHOD_CALL": 1 }, "importList": [], "typeList": [ @@ -1268,65 +1159,53 @@ ], "identifierList": [], "dottedMethodList": [ - "equals", "length" ] }, "lineCount": { - "source": 11, - "comment": 2, - "blank": 0 + "source": 9, + "comment": 0, + "blank": 3 }, - "expectedDeadCount": 3 + "expectedDeadCount": 0 }, "alternativeSolutions": [], - "incorrect": [ - { - "klass": "Question", - "contents": "int fancyEquals(String first, String second) {\n assert first != null;\n assert second != null;\n if (first == second) {\n return -1;\n } else if (first.length() > second.length()) { // mutate-disable-conditional-boundary\n return first.length();\n } else {\n return second.length();\n }\n}", - "reason": "TEST", - "language": "java", - "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/fancystringcompare/incorrect/badequals/Question.java", - "starter": false, - "needed": true - } - ], + "incorrect": [], "common": [], - "javaTemplate": "public class Question {\n {{{ contents }}}\n}", "importWhitelist": [], "importBlacklist": [], - "slug": "fancy-string-compare", + "slug": "test-constructor-notnull", "hasKotlin": false, "published": { - "name": "Fancy String Compare", - "type": "METHOD", - "path": "fancy-string-compare", + "name": "Test Constructor NotNull", + "type": "KLASS", + "path": "test-constructor-notnull", "author": "challen@illinois.edu", - "version": "2021.6.0", - "packageName": "com.examples.fancystringcompare", + "version": "2022.10.0", + "packageName": "com.examples.testing.withconstructornotnull", "languages": [ "java" ], "descriptions": { - "java": "

Write a method fancyCompare that takes two String arguments. If the two Strings are equal, return -1.\nOtherwise, return the length of the longer String.\nYou should assert that both inputs are not null.

" + "java": "

Testing @NotNull annotation on constructor parameters.

" }, "complexity": { - "java": 3 + "java": 2 }, "features": { "java": { "featureMap": { - "COMPARISON_OPERATORS": 3, - "IF_STATEMENTS": 1, - "ELSE_STATEMENTS": 1, - "ELSE_IF": 1, + "VARIABLE_REASSIGNMENTS": 1, "METHOD": 1, - "RETURN": 3, - "STRING": 2, - "NULL": 2, - "ASSERT": 2, - "DOT_NOTATION": 5, - "DOTTED_METHOD_CALL": 5 + "RETURN": 1, + "CONSTRUCTOR": 1, + "GETTER": 1, + "STRING": 1, + "CLASS": 1, + "VISIBILITY_MODIFIERS": 4, + "FINAL_FIELD": 1, + "DOT_NOTATION": 1, + "DOTTED_METHOD_CALL": 1 }, "importList": [], "typeList": [ @@ -1335,90 +1214,321 @@ ], "identifierList": [], "dottedMethodList": [ - "equals", "length" ] } }, "lineCounts": { "java": { - "source": 11, - "comment": 2, - "blank": 0 + "source": 9, + "comment": 0, + "blank": 3 } }, "templateImports": [] }, "fauxStatic": false }, - "String Duplicates": { - "name": "String Duplicates", + "Classroom Getters and Setters": { + "name": "Classroom Getters and Setters", + "type": "KLASS", + "klass": "Classroom", + "metadata": { + "contentHash": "6769836b4d831d087d98dd4c24354fd4", + "packageName": "com.examples.testing.withgettersandsetters", + "version": "2022.9.0", + "author": "challen@illinois.edu", + "javaDescription": "

Getter and setter testing.

", + "usedFiles": [], + "templateImports": [], + "focused": false + }, + "annotatedControls": {}, + "question": { + "klass": "Classroom", + "contents": "import edu.illinois.cs.cs125.questioner.lib.Correct;\n\n/*\n * Getter and setter testing.\n */\n\n@Correct(\n name = \"Classroom Getters and Setters\",\n version = \"2022.9.0\",\n author = \"challen@illinois.edu\")\npublic class Classroom {\n private final String name;\n private int capacity;\n\n public Classroom(String setName, int setEnrollment) {\n assert setEnrollment >= 0;\n assert setName != null;\n name = setName;\n capacity = setEnrollment;\n }\n\n public int getCapacity() {\n return capacity;\n }\n\n public void setCapacity(int setEnrollment) {\n assert setEnrollment >= 0;\n capacity = setEnrollment;\n }\n\n public String getName() {\n return name;\n }\n}", + "language": "java", + "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/testing/withgettersandsetters/Classroom.java" + }, + "correct": { + "klass": "Classroom", + "contents": "public class Classroom {\n private final String name;\n private int capacity;\n\n public Classroom(String setName, int setEnrollment) {\n assert setEnrollment >= 0;\n assert setName != null;\n name = setName;\n capacity = setEnrollment;\n }\n\n public int getCapacity() {\n return capacity;\n }\n\n public void setCapacity(int setEnrollment) {\n assert setEnrollment >= 0;\n capacity = setEnrollment;\n }\n\n public String getName() {\n return name;\n }\n}\n", + "language": "java", + "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/testing/withgettersandsetters/Classroom.java", + "complexity": 4, + "features": { + "featureMap": { + "VARIABLE_REASSIGNMENTS": 3, + "COMPARISON_OPERATORS": 3, + "METHOD": 3, + "RETURN": 2, + "CONSTRUCTOR": 1, + "GETTER": 2, + "SETTER": 1, + "STRING": 3, + "NULL": 1, + "CLASS": 1, + "ASSERT": 3, + "VISIBILITY_MODIFIERS": 7, + "FINAL_FIELD": 1 + }, + "importList": [], + "typeList": [ + "String", + "int" + ], + "identifierList": [], + "dottedMethodList": [] + }, + "lineCount": { + "source": 20, + "comment": 0, + "blank": 5 + }, + "expectedDeadCount": 4 + }, + "alternativeSolutions": [], + "incorrect": [], + "common": [], + "importWhitelist": [], + "importBlacklist": [], + "slug": "classroom-getters-and-setters", + "hasKotlin": false, + "published": { + "name": "Classroom Getters and Setters", + "type": "KLASS", + "path": "classroom-getters-and-setters", + "author": "challen@illinois.edu", + "version": "2022.9.0", + "packageName": "com.examples.testing.withgettersandsetters", + "languages": [ + "java" + ], + "descriptions": { + "java": "

Getter and setter testing.

" + }, + "complexity": { + "java": 4 + }, + "features": { + "java": { + "featureMap": { + "VARIABLE_REASSIGNMENTS": 3, + "COMPARISON_OPERATORS": 3, + "METHOD": 3, + "RETURN": 2, + "CONSTRUCTOR": 1, + "GETTER": 2, + "SETTER": 1, + "STRING": 3, + "NULL": 1, + "CLASS": 1, + "ASSERT": 3, + "VISIBILITY_MODIFIERS": 7, + "FINAL_FIELD": 1 + }, + "importList": [], + "typeList": [ + "String", + "int" + ], + "identifierList": [], + "dottedMethodList": [] + } + }, + "lineCounts": { + "java": { + "source": 20, + "comment": 0, + "blank": 5 + } + }, + "templateImports": [] + }, + "fauxStatic": false + }, + "Test Empty Constructor": { + "name": "Test Empty Constructor", + "type": "KLASS", + "klass": "Question", + "metadata": { + "contentHash": "99f38223aa37346c80979626df0dc69c", + "packageName": "com.examples.testing.withemptyconstructor", + "version": "2022.9.0", + "author": "challen@illinois.edu", + "javaDescription": "

Test to make sure we can parse the empty constructor.

", + "usedFiles": [ + "/Users/challen/code/questioner-problems/src/main/java/com/examples/testing/withemptyconstructor/correct/java/emptyconstructor/Question.java" + ], + "templateImports": [], + "focused": false + }, + "annotatedControls": {}, + "question": { + "klass": "Question", + "contents": "import edu.illinois.cs.cs125.questioner.lib.Correct;\n\n/*\n * Test to make sure we can parse the empty constructor.\n */\n\n@Correct(name = \"Test Empty Constructor\", version = \"2022.9.0\", author = \"challen@illinois.edu\")\npublic class Question {\n private int value = 0;\n\n int next() {\n return value++;\n }\n}", + "language": "java", + "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/testing/withemptyconstructor/Question.java" + }, + "correct": { + "klass": "Question", + "contents": "public class Question {\n private int value = 0;\n\n int next() {\n return value++;\n }\n}\n", + "language": "java", + "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/testing/withemptyconstructor/Question.java", + "complexity": 1, + "features": { + "featureMap": { + "VARIABLE_REASSIGNMENTS": 1, + "UNARY_OPERATORS": 1, + "METHOD": 1, + "RETURN": 1, + "CLASS": 1, + "VISIBILITY_MODIFIERS": 2 + }, + "importList": [], + "typeList": [ + "int" + ], + "identifierList": [], + "dottedMethodList": [] + }, + "lineCount": { + "source": 6, + "comment": 0, + "blank": 2 + }, + "expectedDeadCount": 1 + }, + "alternativeSolutions": [ + { + "klass": "Question", + "contents": "public class Question {\n private int value;\n\n public Question() {\n value = 0;\n }\n\n int next() {\n return value++;\n }\n}\n", + "language": "java", + "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/testing/withemptyconstructor/correct/java/emptyconstructor/Question.java", + "complexity": 2, + "features": { + "featureMap": { + "VARIABLE_REASSIGNMENTS": 2, + "UNARY_OPERATORS": 1, + "METHOD": 1, + "RETURN": 1, + "CONSTRUCTOR": 1, + "CLASS": 1, + "VISIBILITY_MODIFIERS": 3 + }, + "importList": [], + "typeList": [ + "int" + ], + "identifierList": [], + "dottedMethodList": [] + }, + "lineCount": { + "source": 9, + "comment": 0, + "blank": 3 + }, + "expectedDeadCount": 0 + } + ], + "incorrect": [], + "common": [], + "importWhitelist": [], + "importBlacklist": [], + "slug": "test-empty-constructor", + "hasKotlin": false, + "published": { + "name": "Test Empty Constructor", + "type": "KLASS", + "path": "test-empty-constructor", + "author": "challen@illinois.edu", + "version": "2022.9.0", + "packageName": "com.examples.testing.withemptyconstructor", + "languages": [ + "java" + ], + "descriptions": { + "java": "

Test to make sure we can parse the empty constructor.

" + }, + "complexity": { + "java": 1 + }, + "features": { + "java": { + "featureMap": { + "VARIABLE_REASSIGNMENTS": 1, + "UNARY_OPERATORS": 1, + "METHOD": 1, + "RETURN": 1, + "CLASS": 1, + "VISIBILITY_MODIFIERS": 2 + }, + "importList": [], + "typeList": [ + "int" + ], + "identifierList": [], + "dottedMethodList": [] + } + }, + "lineCounts": { + "java": { + "source": 6, + "comment": 0, + "blank": 2 + } + }, + "templateImports": [] + }, + "fauxStatic": false + }, + "With Feature Check": { + "name": "With Feature Check", "type": "METHOD", "klass": "Question", "metadata": { - "contentHash": "848fc37fe58894f89831bf5323eb8e78", - "packageName": "com.examples.stringduplicates", - "version": "2022.2.0", + "contentHash": "1d850909c5792f96c01604b921f26c21", + "packageName": "com.examples.testing.withfeaturecheck", + "version": "2022.7.0", "author": "challen@illinois.edu", - "javaDescription": "

Given a non-null String containing comma-separated values, write a method detectDuplicates\nthat returns true if the String includes duplicate values, and false otherwise.\nTrim whitespace from all Strings.

", - "kotlinDescription": "

Given a String containing comma-separated values, write a method detectDuplicates\nthat returns true if the String includes duplicate values, and false otherwise.\nTrim whitespace from all Strings.

", + "javaDescription": "

Test whether feature checking works.

", + "kotlinDescription": "

For testing features.

", "usedFiles": [ - "/Users/challen/code/questioner-problems/src/main/java/com/examples/stringduplicates/correct/java/usesmap/Question.java", - "/Users/challen/code/questioner-problems/src/main/java/com/examples/stringduplicates/correct/kotlin/Question.kt" - ], - "templateImports": [ - "java.util.Map", - "java.util.HashMap" + "/Users/challen/code/questioner-problems/src/main/java/com/examples/testing/withfeaturecheck/incorrect/java/usesloop/Question.java", + "/Users/challen/code/questioner-problems/src/main/java/com/examples/testing/withfeaturecheck/incorrect/kotlin/usesloop/Question.kt", + "/Users/challen/code/questioner-problems/src/main/java/com/examples/testing/withfeaturecheck/correct/kotlin/Question.kt" ], + "templateImports": [], "focused": false }, "annotatedControls": {}, "question": { "klass": "Question", - "contents": "import edu.illinois.cs.cs125.jenisol.core.NotNull;\nimport edu.illinois.cs.cs125.jenisol.core.RandomParameters;\nimport edu.illinois.cs.cs125.questioner.lib.Correct;\nimport edu.illinois.cs.cs125.questioner.lib.Generators;\nimport edu.illinois.cs.cs125.questioner.lib.TemplateImports;\nimport edu.illinois.cs.cs125.questioner.lib.Wrap;\nimport java.util.HashSet;\nimport java.util.Random;\nimport java.util.Set;\n\n/*\n * Given a non-`null` `String` containing comma-separated values, write a method `detectDuplicates`\n * that returns `true` if the `String` includes duplicate values, and `false` otherwise.\n * Trim whitespace from all `String`s.\n */\n\n@Correct(name = \"String Duplicates\", author = \"challen@illinois.edu\", version = \"2022.2.0\")\n@Wrap\n@TemplateImports(paths = \"java.util.Map, java.util.HashMap\")\npublic class Question {\n boolean detectDuplicates(@NotNull String input) {\n Set values = new HashSet<>();\n for (String part : input.split(\",\")) {\n String current = part.trim();\n if (values.contains(current)) {\n return true;\n }\n values.add(current);\n }\n return false;\n }\n\n @RandomParameters\n private static String randomParameters(Random random) {\n String[] values = new String[random.nextInt(32) + 32];\n for (int i = 0; i < values.length; i++) {\n String current = Generators.randomAlphanumericString(random, 32);\n if (random.nextBoolean()) {\n values[i] = \" \" + current;\n } else {\n values[i] = current + \" \";\n }\n }\n if (random.nextBoolean()) {\n values[random.nextInt(values.length)] =\n new String(values[random.nextInt(values.length)].toCharArray());\n }\n return String.join(\",\", values);\n }\n}", + "contents": "import edu.illinois.cs.cs125.jeed.core.Features;\nimport edu.illinois.cs.cs125.jenisol.core.BoundComplexity;\nimport edu.illinois.cs.cs125.jenisol.core.FilterParameters;\nimport edu.illinois.cs.cs125.jenisol.core.SkipTest;\nimport edu.illinois.cs.cs125.questioner.lib.CheckFeatures;\nimport edu.illinois.cs.cs125.questioner.lib.Correct;\nimport edu.illinois.cs.cs125.questioner.lib.FeatureCheckException;\nimport edu.illinois.cs.cs125.questioner.lib.Wrap;\nimport edu.illinois.cs.cs125.questioner.lib.features.FeatureHelpers;\nimport java.util.ArrayList;\nimport java.util.List;\n\n/*\n * Test whether feature checking works.\n */\n\n@Correct(name = \"With Feature Check\", author = \"challen@illinois.edu\", version = \"2022.7.0\")\n@Wrap\npublic class Question {\n @FilterParameters\n private static void filterParameters(int range) {\n if (range < 0) {\n throw new SkipTest();\n }\n if (range > 1024) {\n throw new BoundComplexity();\n }\n }\n\n int sumTo(int range) {\n return (range * (range + 1)) / 2;\n }\n\n @CheckFeatures\n private static List checkFeatures(Features solution, Features submission) {\n if (FeatureHelpers.usesLoop(submission)) {\n throw new FeatureCheckException(\"Submission uses a loop\");\n }\n return new ArrayList<>();\n }\n}", "language": "java", - "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/stringduplicates/Question.java" + "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/testing/withfeaturecheck/Question.java" }, "correct": { "klass": "Question", - "contents": "boolean detectDuplicates(String input) {\n Set values = new HashSet<>();\n for (String part : input.split(\",\")) {\n String current = part.trim();\n if (values.contains(current)) {\n return true;\n }\n values.add(current);\n }\n return false;\n}", + "contents": "int sumTo(int range) {\n return (range * (range + 1)) / 2;\n}", "language": "java", - "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/stringduplicates/Question.java", - "complexity": 3, + "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/testing/withfeaturecheck/Question.java", + "complexity": 1, "features": { "featureMap": { - "LOCAL_VARIABLE_DECLARATIONS": 3, - "VARIABLE_ASSIGNMENTS": 2, - "IF_STATEMENTS": 1, - "FOR_LOOPS": 1, - "ENHANCED_FOR": 1, + "ARITHMETIC_OPERATORS": 3, "METHOD": 1, - "RETURN": 2, - "STRING": 4, - "NEW_KEYWORD": 1, - "TYPE_PARAMETERS": 1, - "DOT_NOTATION": 4, - "DOTTED_METHOD_CALL": 4 + "RETURN": 1 }, "importList": [], "typeList": [ - "boolean", - "String", - "Set" - ], - "identifierList": [ - "values", - "current" + "int" ], - "dottedMethodList": [ - "split", - "trim", - "contains", - "add" - ] + "identifierList": [], + "dottedMethodList": [] }, "lineCount": { - "source": 11, + "source": 3, "comment": 0, "blank": 0 }, @@ -1427,356 +1537,252 @@ "alternativeSolutions": [ { "klass": "Question", - "contents": "boolean detectDuplicates(String input) {\n Map values = new HashMap<>();\n for (String part : input.split(\",\")) {\n String current = part.trim();\n if (values.keySet().contains(current)) {\n return true;\n }\n values.put(current, true);\n }\n return false;\n}", - "language": "java", - "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/stringduplicates/correct/java/usesmap/Question.java", - "complexity": 3, - "features": { - "featureMap": { - "LOCAL_VARIABLE_DECLARATIONS": 3, - "VARIABLE_ASSIGNMENTS": 2, - "IF_STATEMENTS": 1, - "FOR_LOOPS": 1, - "ENHANCED_FOR": 1, - "METHOD": 1, - "RETURN": 2, - "STRING": 4, - "NEW_KEYWORD": 1, - "BOXING_CLASSES": 1, - "TYPE_PARAMETERS": 1, - "DOT_NOTATION": 5, - "DOTTED_METHOD_CALL": 5 - }, - "importList": [], - "typeList": [ - "boolean", - "String", - "Map", - "Boolean" - ], - "identifierList": [ - "values", - "current" - ], - "dottedMethodList": [ - "split", - "trim", - "contains", - "keySet", - "put" - ] - }, - "lineCount": { - "source": 11, - "comment": 0, - "blank": 0 - }, - "expectedDeadCount": 1 - }, - { - "klass": "Question", - "contents": "fun detectDuplicates(input: String): Boolean {\n val values = mutableSetOf()\n for (part in input.split(\",\")) {\n val current = part.trim()\n if (values.contains(current)) {\n return true\n }\n values.add(current)\n }\n return false\n}", + "contents": "fun sumTo(range: Int): Int {\n return range * (range + 1) / 2\n}", "language": "kotlin", - "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/stringduplicates/correct/kotlin/Question.kt", - "complexity": 3, + "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/testing/withfeaturecheck/correct/kotlin/Question.kt", + "complexity": 1, "features": { "featureMap": { - "LOCAL_VARIABLE_DECLARATIONS": 2, - "VARIABLE_ASSIGNMENTS": 2, - "IF_STATEMENTS": 1, - "FOR_LOOPS": 1, - "METHOD": 1, - "DOT_NOTATION": 4, - "DOTTED_METHOD_CALL": 4 + "METHOD": 1 }, "importList": [], "typeList": [], "identifierList": [], - "dottedMethodList": [ - "split", - "trim", - "contains", - "add" - ] + "dottedMethodList": [] }, "lineCount": { - "source": 11, + "source": 3, "comment": 0, "blank": 0 } } ], - "incorrect": [], - "common": [], - "javaTemplate": "import java.util.HashSet;\nimport java.util.Set;\nimport java.util.Map;\nimport java.util.HashMap;\n\npublic class Question {\n {{{ contents }}}\n}", - "kotlinTemplate": "import java.util.Map\nimport java.util.HashMap\n\nclass Question {\n {{{ contents }}}\n}", - "importWhitelist": [ - "java.util.Map", - "java.util.HashMap" + "incorrect": [ + { + "klass": "Question", + "contents": "int sumTo(int range) {\n int sum = 0;\n for (int i = 0; i <= range; i++) {\n sum += i;\n }\n return sum;\n}", + "reason": "FEATURES", + "language": "java", + "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/testing/withfeaturecheck/incorrect/java/usesloop/Question.java", + "starter": false, + "needed": true + }, + { + "klass": "Question", + "contents": "fun sumTo(range: Int): Int {\n var sum = 0\n (0..range).forEach { i ->\n sum += i\n }\n return sum\n}", + "reason": "FEATURES", + "language": "kotlin", + "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/testing/withfeaturecheck/incorrect/kotlin/usesloop/Question.kt", + "starter": false, + "needed": true + } ], + "common": [], + "javaTemplate": "public class Question {\n {{{ contents }}}\n}", + "kotlinTemplate": "class Question {\n {{{ contents }}}\n}", + "importWhitelist": [], "importBlacklist": [], - "slug": "string-duplicates", + "slug": "with-feature-check", "kotlinSolution": { "klass": "Question", - "contents": "fun detectDuplicates(input: String): Boolean {\n val values = mutableSetOf()\n for (part in input.split(\",\")) {\n val current = part.trim()\n if (values.contains(current)) {\n return true\n }\n values.add(current)\n }\n return false\n}", + "contents": "fun sumTo(range: Int): Int {\n return range * (range + 1) / 2\n}", "language": "kotlin", - "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/stringduplicates/correct/kotlin/Question.kt", - "complexity": 3, + "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/testing/withfeaturecheck/correct/kotlin/Question.kt", + "complexity": 1, "features": { "featureMap": { - "LOCAL_VARIABLE_DECLARATIONS": 2, - "VARIABLE_ASSIGNMENTS": 2, - "IF_STATEMENTS": 1, - "FOR_LOOPS": 1, - "METHOD": 1, - "DOT_NOTATION": 4, - "DOTTED_METHOD_CALL": 4 + "METHOD": 1 }, "importList": [], "typeList": [], "identifierList": [], - "dottedMethodList": [ - "split", - "trim", - "contains", - "add" - ] + "dottedMethodList": [] }, "lineCount": { - "source": 11, + "source": 3, "comment": 0, "blank": 0 } }, "hasKotlin": true, "published": { - "name": "String Duplicates", + "name": "With Feature Check", "type": "METHOD", - "path": "string-duplicates", + "path": "with-feature-check", "author": "challen@illinois.edu", - "version": "2022.2.0", - "packageName": "com.examples.stringduplicates", + "version": "2022.7.0", + "packageName": "com.examples.testing.withfeaturecheck", "languages": [ "java", "kotlin" ], "descriptions": { - "java": "

Given a non-null String containing comma-separated values, write a method detectDuplicates\nthat returns true if the String includes duplicate values, and false otherwise.\nTrim whitespace from all Strings.

", - "kotlin": "

Given a String containing comma-separated values, write a method detectDuplicates\nthat returns true if the String includes duplicate values, and false otherwise.\nTrim whitespace from all Strings.

" + "java": "

Test whether feature checking works.

", + "kotlin": "

For testing features.

" }, "complexity": { - "java": 3, - "kotlin": 3 + "java": 1, + "kotlin": 1 }, "features": { "java": { "featureMap": { - "LOCAL_VARIABLE_DECLARATIONS": 3, - "VARIABLE_ASSIGNMENTS": 2, - "IF_STATEMENTS": 1, - "FOR_LOOPS": 1, - "ENHANCED_FOR": 1, + "ARITHMETIC_OPERATORS": 3, "METHOD": 1, - "RETURN": 2, - "STRING": 4, - "NEW_KEYWORD": 1, - "TYPE_PARAMETERS": 1, - "DOT_NOTATION": 4, - "DOTTED_METHOD_CALL": 4 + "RETURN": 1 }, "importList": [], "typeList": [ - "boolean", - "String", - "Set" - ], - "identifierList": [ - "values", - "current" + "int" ], - "dottedMethodList": [ - "split", - "trim", - "contains", - "add" - ] + "identifierList": [], + "dottedMethodList": [] }, "kotlin": { "featureMap": { - "LOCAL_VARIABLE_DECLARATIONS": 2, - "VARIABLE_ASSIGNMENTS": 2, - "IF_STATEMENTS": 1, - "FOR_LOOPS": 1, - "METHOD": 1, - "DOT_NOTATION": 4, - "DOTTED_METHOD_CALL": 4 + "METHOD": 1 }, "importList": [], "typeList": [], "identifierList": [], - "dottedMethodList": [ - "split", - "trim", - "contains", - "add" - ] + "dottedMethodList": [] } }, "lineCounts": { "java": { - "source": 11, + "source": 3, "comment": 0, "blank": 0 }, "kotlin": { - "source": 11, + "source": 3, "comment": 0, "blank": 0 } }, - "templateImports": [ - "java.util.Map", - "java.util.HashMap" - ] + "templateImports": [] }, "fauxStatic": false }, - "Private Recursive Helper": { - "name": "Private Recursive Helper", - "type": "KLASS", + "Combine Minus Two": { + "name": "Combine Minus Two", + "type": "METHOD", "klass": "Question", "metadata": { - "contentHash": "d4b72ea3fce31f94f4e57e3685eef631", - "packageName": "com.examples.privaterecursivehelper", - "version": "2022.7.0", + "contentHash": "20cdf15b91970109fdef324f27e1cacf", + "packageName": "com.examples.combineminustwo", + "version": "2021.6.0", "author": "challen@illinois.edu", - "javaDescription": "

Testing question for recursion checks on private methods.

", - "usedFiles": [ - "/Users/challen/code/questioner-problems/src/main/java/com/examples/privaterecursivehelper/incorrect/java/iterative/Question.java" - ], + "javaDescription": "

Write a function combine that, given two String arguments, returns the second appended to the first.\nExcept you should omit the first two characters of each String.\nFor example, given Java and Kotlin, you would return vatlin.\nYou can assume that each String is of length at least two.

", + "usedFiles": [], "templateImports": [], "focused": false }, "annotatedControls": {}, "question": { "klass": "Question", - "contents": "import edu.illinois.cs.cs125.jenisol.core.FilterParameters;\nimport edu.illinois.cs.cs125.jenisol.core.SkipTest;\nimport edu.illinois.cs.cs125.questioner.lib.Correct;\n\n/*\n * Testing question for recursion checks on private methods.\n */\n\n@Correct(name = \"Private Recursive Helper\", version = \"2022.7.0\", author = \"challen@illinois.edu\")\npublic class Question {\n private static int rangeSumHelper(int range) {\n if (range == 0) {\n return 0;\n }\n return range + rangeSumHelper(range - 1);\n }\n\n @FilterParameters\n private static void filterRangeSum(int range) {\n if (range > 1024) {\n throw new SkipTest();\n }\n }\n\n public static int rangeSum(int range) {\n if (range < 0) {\n throw new IllegalArgumentException();\n }\n return rangeSumHelper(range);\n }\n}", + "contents": "import edu.illinois.cs.cs125.jenisol.core.FixedParameters;\nimport edu.illinois.cs.cs125.jenisol.core.RandomParameters;\nimport edu.illinois.cs.cs125.jenisol.core.Two;\nimport edu.illinois.cs.cs125.questioner.lib.Correct;\nimport edu.illinois.cs.cs125.questioner.lib.Generators;\nimport edu.illinois.cs.cs125.questioner.lib.Wrap;\nimport java.util.Arrays;\nimport java.util.List;\nimport java.util.Random;\n\n/*\n * Write a function `combine` that, given two `String` arguments, returns the second appended to the first.\n * Except you should omit the first two characters of each `String`.\n * For example, given `Java` and `Kotlin`, you would return `vatlin`.\n * You can assume that each `String` is of length at least two.\n */\n\n@Correct(name = \"Combine Minus Two\", author = \"challen@illinois.edu\", version = \"2021.6.0\")\n@Wrap\npublic class Question {\n String combine(String first, String second) {\n return first.substring(2) + second.substring(2);\n }\n\n @FixedParameters\n private static final List> FIXED =\n Arrays.asList(new Two<>(\"Java\", \"Kotlin\"), new Two<>(\"CS125\", \"CS124\"));\n\n @RandomParameters\n private static Two randomStrings(Random random) {\n String first = Generators.randomAlphanumericStringWithLength(random, random.nextInt(32) + 2);\n String second = Generators.randomAlphanumericStringWithLength(random, random.nextInt(32) + 2);\n return new Two<>(first, second);\n }\n}", "language": "java", - "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/privaterecursivehelper/Question.java" + "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/combineminustwo/Question.java" }, "correct": { "klass": "Question", - "contents": "public class Question {\n private static int rangeSumHelper(int range) {\n if (range == 0) {\n return 0;\n }\n return range + rangeSumHelper(range - 1);\n }\n\n public static int rangeSum(int range) {\n if (range < 0) {\n throw new IllegalArgumentException();\n }\n return rangeSumHelper(range);\n }\n}\n", + "contents": "String combine(String first, String second) {\n return first.substring(2) + second.substring(2);\n}", "language": "java", - "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/privaterecursivehelper/Question.java", - "complexity": 5, + "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/combineminustwo/Question.java", + "complexity": 1, "features": { "featureMap": { - "ARITHMETIC_OPERATORS": 2, - "COMPARISON_OPERATORS": 2, - "IF_STATEMENTS": 2, - "METHOD": 2, - "RETURN": 3, - "CLASS": 1, - "THROW": 1, - "NEW_KEYWORD": 1, - "VISIBILITY_MODIFIERS": 3, - "STATIC_METHOD": 2, - "RECURSION": 1 + "ARITHMETIC_OPERATORS": 1, + "METHOD": 1, + "RETURN": 1, + "STRING": 3, + "DOT_NOTATION": 2, + "DOTTED_METHOD_CALL": 2 }, "importList": [], "typeList": [ - "int" + "String" ], "identifierList": [], - "dottedMethodList": [] + "dottedMethodList": [ + "substring" + ] }, "lineCount": { - "source": 14, + "source": 3, "comment": 0, - "blank": 2 + "blank": 0 }, "expectedDeadCount": 1 }, "alternativeSolutions": [], - "incorrect": [ - { - "klass": "Question", - "contents": "public class Question {\n private static int rangeSumHelper(int range) {\n int sum = 0;\n for (int i = 0; i <= range; i++) {\n sum += i;\n }\n return sum;\n }\n\n public static int rangeSum(int range) {\n if (range < 0) {\n throw new IllegalArgumentException();\n }\n return rangeSumHelper(range);\n }\n}\n", - "reason": "RECURSION", - "language": "java", - "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/privaterecursivehelper/incorrect/java/iterative/Question.java", - "starter": false, - "needed": true - } - ], + "incorrect": [], "common": [], + "javaTemplate": "public class Question {\n {{{ contents }}}\n}", "importWhitelist": [], "importBlacklist": [], - "slug": "private-recursive-helper", + "slug": "combine-minus-two", "hasKotlin": false, "published": { - "name": "Private Recursive Helper", - "type": "KLASS", - "path": "private-recursive-helper", + "name": "Combine Minus Two", + "type": "METHOD", + "path": "combine-minus-two", "author": "challen@illinois.edu", - "version": "2022.7.0", - "packageName": "com.examples.privaterecursivehelper", + "version": "2021.6.0", + "packageName": "com.examples.combineminustwo", "languages": [ "java" ], "descriptions": { - "java": "

Testing question for recursion checks on private methods.

" + "java": "

Write a function combine that, given two String arguments, returns the second appended to the first.\nExcept you should omit the first two characters of each String.\nFor example, given Java and Kotlin, you would return vatlin.\nYou can assume that each String is of length at least two.

" }, "complexity": { - "java": 5 + "java": 1 }, "features": { "java": { "featureMap": { - "ARITHMETIC_OPERATORS": 2, - "COMPARISON_OPERATORS": 2, - "IF_STATEMENTS": 2, - "METHOD": 2, - "RETURN": 3, - "CLASS": 1, - "THROW": 1, - "NEW_KEYWORD": 1, - "VISIBILITY_MODIFIERS": 3, - "STATIC_METHOD": 2, - "RECURSION": 1 + "ARITHMETIC_OPERATORS": 1, + "METHOD": 1, + "RETURN": 1, + "STRING": 3, + "DOT_NOTATION": 2, + "DOTTED_METHOD_CALL": 2 }, "importList": [], "typeList": [ - "int" + "String" ], "identifierList": [], - "dottedMethodList": [] + "dottedMethodList": [ + "substring" + ] } }, "lineCounts": { "java": { - "source": 14, + "source": 3, "comment": 0, - "blank": 2 + "blank": 0 } }, "templateImports": [] }, "fauxStatic": false }, - "Maybe Recursive Factorial": { - "name": "Maybe Recursive Factorial", - "type": "KLASS", + "Fancy String Compare": { + "name": "Fancy String Compare", + "type": "METHOD", "klass": "Question", "metadata": { - "contentHash": "996c3cdb90539d435a2d1a2e2527cdc6", - "packageName": "com.examples.mayberecursivefactorial", - "version": "2022.7.0", + "contentHash": "238a3487d82ef1431fab06a22392a361", + "packageName": "com.examples.fancystringcompare", + "version": "2021.6.0", "author": "challen@illinois.edu", - "javaDescription": "

Write a class method that provides an implementation of factorial, accepting and returning long arguments.\nThrow an IllegalArgumentException on invalid inputs.\nYour implementation can be recursive or not.

", + "javaDescription": "

Write a method fancyCompare that takes two String arguments. If the two Strings are equal, return -1.\nOtherwise, return the length of the longer String.\nYou should assert that both inputs are not null.

", "usedFiles": [ - "/Users/challen/code/questioner-problems/src/main/java/com/examples/mayberecursivefactorial/correct/java/iterative/Question.java" + "/Users/challen/code/questioner-problems/src/main/java/com/examples/fancystringcompare/incorrect/badequals/Question.java" ], "templateImports": [], "focused": false @@ -1784,214 +1790,270 @@ "annotatedControls": {}, "question": { "klass": "Question", - "contents": "import edu.illinois.cs.cs125.jenisol.core.FixedParameters;\nimport edu.illinois.cs.cs125.jenisol.core.RandomParameters;\nimport edu.illinois.cs.cs125.questioner.lib.Correct;\nimport java.util.Arrays;\nimport java.util.List;\nimport java.util.Random;\n\n/*\n * Write a class method that provides an implementation of factorial, accepting and returning `long` arguments.\n * Throw an `IllegalArgumentException` on invalid inputs.\n * Your implementation can be recursive or not.\n */\n\n@Correct(name = \"Maybe Recursive Factorial\", version = \"2022.7.0\", author = \"challen@illinois.edu\")\npublic class Question {\n public static long factorial(long input) {\n if (input <= 0) { // mutate-disable-conditional-boundary\n throw new IllegalArgumentException();\n }\n if (input == 1) {\n return 1;\n }\n return input * factorial(input - 1);\n }\n\n @FixedParameters private static final List FIXED = Arrays.asList(-10L, -1L, 0L, 1L, 2L);\n\n @RandomParameters\n private static long randomParameters(Random random) {\n return random.nextInt(32);\n }\n}", + "contents": "import edu.illinois.cs.cs125.questioner.lib.Correct;\nimport edu.illinois.cs.cs125.questioner.lib.Wrap;\n\n/*\n * Write a method `fancyCompare` that takes two `String` arguments. If the two `String`s are equal, return -1.\n * Otherwise, return the length of the longer `String`.\n * You should `assert` that both inputs are not `null`.\n */\n\n@SuppressWarnings(\"ManualMinMaxCalculation\")\n@Correct(name = \"Fancy String Compare\", author = \"challen@illinois.edu\", version = \"2021.6.0\")\n@Wrap\npublic class Question {\n int fancyEquals(String first, String second) {\n assert first != null;\n assert second != null;\n if (first.equals(second)) {\n return -1;\n // mutate-disable-conditional-boundary\n // mutate-disable-modify-length-and-size\n } else if (first.length() > second.length()) {\n return first.length();\n } else {\n return second.length();\n }\n }\n}", "language": "java", - "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/mayberecursivefactorial/Question.java" + "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/fancystringcompare/Question.java" }, "correct": { "klass": "Question", - "contents": "public class Question {\n public static long factorial(long input) {\n if (input <= 0) { // mutate-disable-conditional-boundary\n throw new IllegalArgumentException();\n }\n if (input == 1) {\n return 1;\n }\n return input * factorial(input - 1);\n }\n}\n", + "contents": "int fancyEquals(String first, String second) {\n assert first != null;\n assert second != null;\n if (first.equals(second)) {\n return -1;\n // mutate-disable-conditional-boundary\n // mutate-disable-modify-length-and-size\n } else if (first.length() > second.length()) {\n return first.length();\n } else {\n return second.length();\n }\n}", "language": "java", - "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/mayberecursivefactorial/Question.java", - "complexity": 4, + "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/fancystringcompare/Question.java", + "complexity": 3, "features": { "featureMap": { - "ARITHMETIC_OPERATORS": 2, - "COMPARISON_OPERATORS": 2, - "IF_STATEMENTS": 2, + "COMPARISON_OPERATORS": 3, + "IF_STATEMENTS": 1, + "ELSE_STATEMENTS": 1, + "ELSE_IF": 1, "METHOD": 1, - "RETURN": 2, - "CLASS": 1, - "THROW": 1, - "NEW_KEYWORD": 1, - "VISIBILITY_MODIFIERS": 2, - "STATIC_METHOD": 1, - "RECURSION": 1 + "RETURN": 3, + "STRING": 2, + "NULL": 2, + "ASSERT": 2, + "DOT_NOTATION": 5, + "DOTTED_METHOD_CALL": 5 }, "importList": [], "typeList": [ - "long" + "int", + "String" ], "identifierList": [], - "dottedMethodList": [] + "dottedMethodList": [ + "equals", + "length" + ] }, "lineCount": { "source": 11, - "comment": 0, - "blank": 1 + "comment": 2, + "blank": 0 }, - "expectedDeadCount": 1 + "expectedDeadCount": 3 }, - "alternativeSolutions": [ + "alternativeSolutions": [], + "incorrect": [ { "klass": "Question", - "contents": "public class Question {\n public static long factorial(long input) {\n if (input <= 0) {\n throw new IllegalArgumentException();\n }\n long result = 1;\n for (long multiplier = 2; multiplier <= input; multiplier++) {\n result *= multiplier;\n }\n return result;\n }\n}\n", + "contents": "int fancyEquals(String first, String second) {\n assert first != null;\n assert second != null;\n if (first == second) {\n return -1;\n } else if (first.length() > second.length()) { // mutate-disable-conditional-boundary\n return first.length();\n } else {\n return second.length();\n }\n}", + "reason": "TEST", "language": "java", - "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/mayberecursivefactorial/correct/java/iterative/Question.java", - "complexity": 4, - "features": { - "featureMap": { - "LOCAL_VARIABLE_DECLARATIONS": 2, - "VARIABLE_ASSIGNMENTS": 2, - "VARIABLE_REASSIGNMENTS": 2, - "UNARY_OPERATORS": 1, - "ASSIGNMENT_OPERATORS": 1, - "COMPARISON_OPERATORS": 2, - "IF_STATEMENTS": 1, - "FOR_LOOPS": 1, - "METHOD": 1, - "RETURN": 1, - "CLASS": 1, - "THROW": 1, - "NEW_KEYWORD": 1, - "VISIBILITY_MODIFIERS": 2, - "STATIC_METHOD": 1 - }, - "importList": [], - "typeList": [ - "long" - ], - "identifierList": [ - "result", - "multiplier" - ], - "dottedMethodList": [] - }, - "lineCount": { - "source": 12, - "comment": 0, - "blank": 1 - }, - "expectedDeadCount": 1 + "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/fancystringcompare/incorrect/badequals/Question.java", + "starter": false, + "needed": true } ], - "incorrect": [], "common": [], + "javaTemplate": "public class Question {\n {{{ contents }}}\n}", "importWhitelist": [], "importBlacklist": [], - "slug": "maybe-recursive-factorial", + "slug": "fancy-string-compare", "hasKotlin": false, "published": { - "name": "Maybe Recursive Factorial", - "type": "KLASS", - "path": "maybe-recursive-factorial", + "name": "Fancy String Compare", + "type": "METHOD", + "path": "fancy-string-compare", "author": "challen@illinois.edu", - "version": "2022.7.0", - "packageName": "com.examples.mayberecursivefactorial", + "version": "2021.6.0", + "packageName": "com.examples.fancystringcompare", "languages": [ "java" ], "descriptions": { - "java": "

Write a class method that provides an implementation of factorial, accepting and returning long arguments.\nThrow an IllegalArgumentException on invalid inputs.\nYour implementation can be recursive or not.

" + "java": "

Write a method fancyCompare that takes two String arguments. If the two Strings are equal, return -1.\nOtherwise, return the length of the longer String.\nYou should assert that both inputs are not null.

" }, "complexity": { - "java": 4 + "java": 3 }, "features": { "java": { "featureMap": { - "ARITHMETIC_OPERATORS": 2, - "COMPARISON_OPERATORS": 2, - "IF_STATEMENTS": 2, + "COMPARISON_OPERATORS": 3, + "IF_STATEMENTS": 1, + "ELSE_STATEMENTS": 1, + "ELSE_IF": 1, "METHOD": 1, - "RETURN": 2, - "CLASS": 1, - "THROW": 1, - "NEW_KEYWORD": 1, - "VISIBILITY_MODIFIERS": 2, - "STATIC_METHOD": 1, - "RECURSION": 1 + "RETURN": 3, + "STRING": 2, + "NULL": 2, + "ASSERT": 2, + "DOT_NOTATION": 5, + "DOTTED_METHOD_CALL": 5 }, "importList": [], "typeList": [ - "long" + "int", + "String" ], "identifierList": [], - "dottedMethodList": [] + "dottedMethodList": [ + "equals", + "length" + ] } }, "lineCounts": { "java": { "source": 11, - "comment": 0, - "blank": 1 + "comment": 2, + "blank": 0 } }, "templateImports": [] }, "fauxStatic": false }, - "Add One Class": { - "name": "Add One Class", - "type": "KLASS", + "String Duplicates": { + "name": "String Duplicates", + "type": "METHOD", "klass": "Question", "metadata": { - "contentHash": "144cc102fd3530a84a5e30737e94336c", - "packageName": "com.examples.addoneclass", - "version": "2021.6.0", + "contentHash": "848fc37fe58894f89831bf5323eb8e78", + "packageName": "com.examples.stringduplicates", + "version": "2022.2.0", "author": "challen@illinois.edu", - "javaDescription": "

Write a class named Question with a single static method addOne that returns its int argument plus one.

", - "kotlinDescription": "

Write a function addOne that returns its Int argument plus one.

", + "javaDescription": "

Given a non-null String containing comma-separated values, write a method detectDuplicates\nthat returns true if the String includes duplicate values, and false otherwise.\nTrim whitespace from all Strings.

", + "kotlinDescription": "

Given a String containing comma-separated values, write a method detectDuplicates\nthat returns true if the String includes duplicate values, and false otherwise.\nTrim whitespace from all Strings.

", "usedFiles": [ - "/Users/challen/code/questioner-problems/src/main/java/com/examples/addoneclass/correct/kotlin/Question.kt" + "/Users/challen/code/questioner-problems/src/main/java/com/examples/stringduplicates/correct/java/usesmap/Question.java", + "/Users/challen/code/questioner-problems/src/main/java/com/examples/stringduplicates/correct/kotlin/Question.kt" + ], + "templateImports": [ + "java.util.Map", + "java.util.HashMap" ], - "templateImports": [], "focused": false }, "annotatedControls": {}, "question": { "klass": "Question", - "contents": "import edu.illinois.cs.cs125.questioner.lib.Correct;\n\n/*\n * Write a class named `Question` with a single `static` method `addOne` that returns its `int` argument plus one.\n */\n\n@Correct(name = \"Add One Class\", author = \"challen@illinois.edu\", version = \"2021.6.0\")\npublic class Question {\n public static int addOne(int value) {\n return value + 1;\n }\n}", + "contents": "import edu.illinois.cs.cs125.jenisol.core.NotNull;\nimport edu.illinois.cs.cs125.jenisol.core.RandomParameters;\nimport edu.illinois.cs.cs125.questioner.lib.Correct;\nimport edu.illinois.cs.cs125.questioner.lib.Generators;\nimport edu.illinois.cs.cs125.questioner.lib.TemplateImports;\nimport edu.illinois.cs.cs125.questioner.lib.Wrap;\nimport java.util.HashSet;\nimport java.util.Random;\nimport java.util.Set;\n\n/*\n * Given a non-`null` `String` containing comma-separated values, write a method `detectDuplicates`\n * that returns `true` if the `String` includes duplicate values, and `false` otherwise.\n * Trim whitespace from all `String`s.\n */\n\n@Correct(name = \"String Duplicates\", author = \"challen@illinois.edu\", version = \"2022.2.0\")\n@Wrap\n@TemplateImports(paths = \"java.util.Map, java.util.HashMap\")\npublic class Question {\n boolean detectDuplicates(@NotNull String input) {\n Set values = new HashSet<>();\n for (String part : input.split(\",\")) {\n String current = part.trim();\n if (values.contains(current)) {\n return true;\n }\n values.add(current);\n }\n return false;\n }\n\n @RandomParameters\n private static String randomParameters(Random random) {\n String[] values = new String[random.nextInt(32) + 32];\n for (int i = 0; i < values.length; i++) {\n String current = Generators.randomAlphanumericString(random, 32);\n if (random.nextBoolean()) {\n values[i] = \" \" + current;\n } else {\n values[i] = current + \" \";\n }\n }\n if (random.nextBoolean()) {\n values[random.nextInt(values.length)] =\n new String(values[random.nextInt(values.length)].toCharArray());\n }\n return String.join(\",\", values);\n }\n}", "language": "java", - "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/addoneclass/Question.java" + "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/stringduplicates/Question.java" }, "correct": { "klass": "Question", - "contents": "public class Question {\n public static int addOne(int value) {\n return value + 1;\n }\n}\n", + "contents": "boolean detectDuplicates(String input) {\n Set values = new HashSet<>();\n for (String part : input.split(\",\")) {\n String current = part.trim();\n if (values.contains(current)) {\n return true;\n }\n values.add(current);\n }\n return false;\n}", "language": "java", - "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/addoneclass/Question.java", - "complexity": 1, + "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/stringduplicates/Question.java", + "complexity": 3, "features": { "featureMap": { - "ARITHMETIC_OPERATORS": 1, + "LOCAL_VARIABLE_DECLARATIONS": 3, + "VARIABLE_ASSIGNMENTS": 2, + "IF_STATEMENTS": 1, + "FOR_LOOPS": 1, + "ENHANCED_FOR": 1, "METHOD": 1, - "RETURN": 1, - "CLASS": 1, - "VISIBILITY_MODIFIERS": 2, - "STATIC_METHOD": 1 + "RETURN": 2, + "STRING": 4, + "NEW_KEYWORD": 1, + "TYPE_PARAMETERS": 1, + "DOT_NOTATION": 4, + "DOTTED_METHOD_CALL": 4 }, "importList": [], "typeList": [ - "int" + "boolean", + "String", + "Set" ], - "identifierList": [], - "dottedMethodList": [] + "identifierList": [ + "values", + "current" + ], + "dottedMethodList": [ + "split", + "trim", + "contains", + "add" + ] }, "lineCount": { - "source": 5, + "source": 11, "comment": 0, - "blank": 1 + "blank": 0 }, "expectedDeadCount": 1 }, "alternativeSolutions": [ { - "klass": "QuestionKt", - "contents": "fun addOne(value: Int): Int {\n return value + 1\n}", + "klass": "Question", + "contents": "boolean detectDuplicates(String input) {\n Map values = new HashMap<>();\n for (String part : input.split(\",\")) {\n String current = part.trim();\n if (values.keySet().contains(current)) {\n return true;\n }\n values.put(current, true);\n }\n return false;\n}", + "language": "java", + "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/stringduplicates/correct/java/usesmap/Question.java", + "complexity": 3, + "features": { + "featureMap": { + "LOCAL_VARIABLE_DECLARATIONS": 3, + "VARIABLE_ASSIGNMENTS": 2, + "IF_STATEMENTS": 1, + "FOR_LOOPS": 1, + "ENHANCED_FOR": 1, + "METHOD": 1, + "RETURN": 2, + "STRING": 4, + "NEW_KEYWORD": 1, + "BOXING_CLASSES": 1, + "TYPE_PARAMETERS": 1, + "DOT_NOTATION": 5, + "DOTTED_METHOD_CALL": 5 + }, + "importList": [], + "typeList": [ + "boolean", + "String", + "Map", + "Boolean" + ], + "identifierList": [ + "values", + "current" + ], + "dottedMethodList": [ + "split", + "trim", + "contains", + "keySet", + "put" + ] + }, + "lineCount": { + "source": 11, + "comment": 0, + "blank": 0 + }, + "expectedDeadCount": 1 + }, + { + "klass": "Question", + "contents": "fun detectDuplicates(input: String): Boolean {\n val values = mutableSetOf()\n for (part in input.split(\",\")) {\n val current = part.trim()\n if (values.contains(current)) {\n return true\n }\n values.add(current)\n }\n return false\n}", "language": "kotlin", - "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/addoneclass/correct/kotlin/Question.kt", - "complexity": 1, + "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/stringduplicates/correct/kotlin/Question.kt", + "complexity": 3, "features": { "featureMap": { - "METHOD": 1 + "LOCAL_VARIABLE_DECLARATIONS": 2, + "VARIABLE_ASSIGNMENTS": 2, + "IF_STATEMENTS": 1, + "FOR_LOOPS": 1, + "METHOD": 1, + "DOT_NOTATION": 4, + "DOTTED_METHOD_CALL": 4 }, "importList": [], "typeList": [], "identifierList": [], - "dottedMethodList": [] + "dottedMethodList": [ + "split", + "trim", + "contains", + "add" + ] }, "lineCount": { - "source": 3, + "source": 11, "comment": 0, "blank": 0 } @@ -1999,180 +2061,225 @@ ], "incorrect": [], "common": [], - "importWhitelist": [], + "javaTemplate": "import java.util.HashSet;\nimport java.util.Set;\nimport java.util.Map;\nimport java.util.HashMap;\n\npublic class Question {\n {{{ contents }}}\n}", + "kotlinTemplate": "import java.util.Map\nimport java.util.HashMap\n\nclass Question {\n {{{ contents }}}\n}", + "importWhitelist": [ + "java.util.Map", + "java.util.HashMap" + ], "importBlacklist": [], - "slug": "add-one-class", + "slug": "string-duplicates", "kotlinSolution": { - "klass": "QuestionKt", - "contents": "fun addOne(value: Int): Int {\n return value + 1\n}", + "klass": "Question", + "contents": "fun detectDuplicates(input: String): Boolean {\n val values = mutableSetOf()\n for (part in input.split(\",\")) {\n val current = part.trim()\n if (values.contains(current)) {\n return true\n }\n values.add(current)\n }\n return false\n}", "language": "kotlin", - "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/addoneclass/correct/kotlin/Question.kt", - "complexity": 1, + "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/stringduplicates/correct/kotlin/Question.kt", + "complexity": 3, "features": { "featureMap": { - "METHOD": 1 + "LOCAL_VARIABLE_DECLARATIONS": 2, + "VARIABLE_ASSIGNMENTS": 2, + "IF_STATEMENTS": 1, + "FOR_LOOPS": 1, + "METHOD": 1, + "DOT_NOTATION": 4, + "DOTTED_METHOD_CALL": 4 }, "importList": [], "typeList": [], "identifierList": [], - "dottedMethodList": [] + "dottedMethodList": [ + "split", + "trim", + "contains", + "add" + ] }, "lineCount": { - "source": 3, + "source": 11, "comment": 0, "blank": 0 } }, "hasKotlin": true, "published": { - "name": "Add One Class", - "type": "KLASS", - "path": "add-one-class", + "name": "String Duplicates", + "type": "METHOD", + "path": "string-duplicates", "author": "challen@illinois.edu", - "version": "2021.6.0", - "packageName": "com.examples.addoneclass", + "version": "2022.2.0", + "packageName": "com.examples.stringduplicates", "languages": [ "java", "kotlin" ], "descriptions": { - "java": "

Write a class named Question with a single static method addOne that returns its int argument plus one.

", - "kotlin": "

Write a function addOne that returns its Int argument plus one.

" + "java": "

Given a non-null String containing comma-separated values, write a method detectDuplicates\nthat returns true if the String includes duplicate values, and false otherwise.\nTrim whitespace from all Strings.

", + "kotlin": "

Given a String containing comma-separated values, write a method detectDuplicates\nthat returns true if the String includes duplicate values, and false otherwise.\nTrim whitespace from all Strings.

" }, "complexity": { - "java": 1, - "kotlin": 1 + "java": 3, + "kotlin": 3 }, "features": { "java": { "featureMap": { - "ARITHMETIC_OPERATORS": 1, + "LOCAL_VARIABLE_DECLARATIONS": 3, + "VARIABLE_ASSIGNMENTS": 2, + "IF_STATEMENTS": 1, + "FOR_LOOPS": 1, + "ENHANCED_FOR": 1, "METHOD": 1, - "RETURN": 1, - "CLASS": 1, - "VISIBILITY_MODIFIERS": 2, - "STATIC_METHOD": 1 + "RETURN": 2, + "STRING": 4, + "NEW_KEYWORD": 1, + "TYPE_PARAMETERS": 1, + "DOT_NOTATION": 4, + "DOTTED_METHOD_CALL": 4 }, "importList": [], "typeList": [ - "int" + "boolean", + "String", + "Set" ], - "identifierList": [], - "dottedMethodList": [] + "identifierList": [ + "values", + "current" + ], + "dottedMethodList": [ + "split", + "trim", + "contains", + "add" + ] }, "kotlin": { "featureMap": { - "METHOD": 1 + "LOCAL_VARIABLE_DECLARATIONS": 2, + "VARIABLE_ASSIGNMENTS": 2, + "IF_STATEMENTS": 1, + "FOR_LOOPS": 1, + "METHOD": 1, + "DOT_NOTATION": 4, + "DOTTED_METHOD_CALL": 4 }, "importList": [], "typeList": [], "identifierList": [], - "dottedMethodList": [] + "dottedMethodList": [ + "split", + "trim", + "contains", + "add" + ] } }, "lineCounts": { "java": { - "source": 5, + "source": 11, "comment": 0, - "blank": 1 + "blank": 0 }, "kotlin": { - "source": 3, + "source": 11, "comment": 0, "blank": 0 } }, - "templateImports": [] + "templateImports": [ + "java.util.Map", + "java.util.HashMap" + ] }, "fauxStatic": false }, - "Cougar Feliform": { - "name": "Cougar Feliform", + "Private Recursive Helper": { + "name": "Private Recursive Helper", "type": "KLASS", - "klass": "Cougar", + "klass": "Question", "metadata": { - "contentHash": "858c7009ae6211d3f4f7f0bcff4d091c", - "packageName": "com.examples.cougarfeliform", - "version": "2021.7.0", + "contentHash": "d4b72ea3fce31f94f4e57e3685eef631", + "packageName": "com.examples.privaterecursivehelper", + "version": "2022.7.0", "author": "challen@illinois.edu", - "javaDescription": "

Create and complete the implementation of the Cougar class.\nYour class should be public, not final and not abstract, inherit from the Feliform class,\nand provide the following methods:

  1. Constructor that takes a int parameter speed and a second weight.\nCreates a new Cougar with the passed speed and weight.\nYou should call the Feliform constructor and pass it the String "cougar" to identify the type of this\nfeliform.
  2. Public instance method dangerousness that takes no arguments and returns an int.\nReturn the dangerousness of this cougar which equals its speed times its weight.
  3. Override public boolean equals(Object other).\nReturn true if other is a Cougar with the same speed and weight, and false otherwise.\nNote that other may be null or not a Housecat.

Finally, note that your class should not expose any of its internal state publicly.

", + "javaDescription": "

Testing question for recursion checks on private methods.

", "usedFiles": [ - "/Users/challen/code/questioner-problems/src/main/java/com/examples/cougarfeliform/Feliform.java" + "/Users/challen/code/questioner-problems/src/main/java/com/examples/privaterecursivehelper/incorrect/java/iterative/Question.java" ], "templateImports": [], "focused": false }, "annotatedControls": {}, "question": { - "klass": "Cougar", - "contents": "import edu.illinois.cs.cs125.jenisol.core.Both;\nimport edu.illinois.cs.cs125.jenisol.core.Limit;\nimport edu.illinois.cs.cs125.questioner.lib.Correct;\n\n/*\n * Create and complete the implementation of the `Cougar` class.\n * Your class should be public, not final and not abstract, inherit from the `Feliform` class,\n * and provide the following methods:\n *\n * 1. Constructor that takes a `int` parameter `speed` and a second `weight`.\n * Creates a new `Cougar` with the passed speed and weight.\n * You should call the `Feliform` constructor and pass it the `String` \"cougar\" to identify the type of this\n * feliform.\n * 1. Public instance method `dangerousness` that takes no arguments and returns an `int`.\n * Return the dangerousness of this cougar which equals its speed times its weight.\n * 1. Override `public boolean equals(Object other)`.\n * Return `true` if `other` is a `Cougar` with the same speed and weight, and `false` otherwise.\n * Note that `other` may be `null` or not a `Housecat`.\n *\n * Finally, note that your class should not expose any of its internal state publicly.\n */\n@Correct(name = \"Cougar Feliform\", version = \"2021.7.0\", author = \"challen@illinois.edu\")\npublic class Cougar extends Feliform {\n private final int speed;\n private final int weight;\n\n public Cougar(int setSpeed, int setWeight) {\n super(\"cougar\");\n speed = setSpeed;\n weight = setWeight;\n }\n\n @Override\n public int dangerousness() {\n return speed * weight;\n }\n\n @Override\n public boolean equals(Object o) {\n if (!(o instanceof Cougar housecat)) {\n return false;\n }\n return speed == housecat.speed && weight == housecat.weight;\n }\n\n @Both\n @Limit(1)\n public static String getType(Feliform feliform) {\n return feliform.getType();\n }\n}", + "klass": "Question", + "contents": "import edu.illinois.cs.cs125.jenisol.core.FilterParameters;\nimport edu.illinois.cs.cs125.jenisol.core.SkipTest;\nimport edu.illinois.cs.cs125.questioner.lib.Correct;\n\n/*\n * Testing question for recursion checks on private methods.\n */\n\n@Correct(name = \"Private Recursive Helper\", version = \"2022.7.0\", author = \"challen@illinois.edu\")\npublic class Question {\n private static int rangeSumHelper(int range) {\n if (range == 0) {\n return 0;\n }\n return range + rangeSumHelper(range - 1);\n }\n\n @FilterParameters\n private static void filterRangeSum(int range) {\n if (range > 1024) {\n throw new SkipTest();\n }\n }\n\n public static int rangeSum(int range) {\n if (range < 0) {\n throw new IllegalArgumentException();\n }\n return rangeSumHelper(range);\n }\n}", "language": "java", - "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/cougarfeliform/Cougar.java" + "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/privaterecursivehelper/Question.java" }, "correct": { - "klass": "Cougar", - "contents": "public class Cougar extends Feliform {\n private final int speed;\n private final int weight;\n\n public Cougar(int setSpeed, int setWeight) {\n super(\"cougar\");\n speed = setSpeed;\n weight = setWeight;\n }\n\n public int dangerousness() {\n return speed * weight;\n }\n\n public boolean equals(Object o) {\n if (!(o instanceof Cougar housecat)) {\n return false;\n }\n return speed == housecat.speed && weight == housecat.weight;\n }\n}\n", + "klass": "Question", + "contents": "public class Question {\n private static int rangeSumHelper(int range) {\n if (range == 0) {\n return 0;\n }\n return range + rangeSumHelper(range - 1);\n }\n\n public static int rangeSum(int range) {\n if (range < 0) {\n throw new IllegalArgumentException();\n }\n return rangeSumHelper(range);\n }\n}\n", "language": "java", - "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/cougarfeliform/Cougar.java", + "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/privaterecursivehelper/Question.java", "complexity": 5, "features": { "featureMap": { - "VARIABLE_REASSIGNMENTS": 2, - "ARITHMETIC_OPERATORS": 1, + "ARITHMETIC_OPERATORS": 2, "COMPARISON_OPERATORS": 2, - "LOGICAL_OPERATORS": 2, - "IF_STATEMENTS": 1, + "IF_STATEMENTS": 2, "METHOD": 2, "RETURN": 3, - "CONSTRUCTOR": 1, - "INSTANCEOF": 1, "CLASS": 1, - "EXTENDS": 1, - "SUPER": 1, - "VISIBILITY_MODIFIERS": 6, - "FINAL_FIELD": 2, - "DOT_NOTATION": 2, - "DOTTED_VARIABLE_ACCESS": 2 + "THROW": 1, + "NEW_KEYWORD": 1, + "VISIBILITY_MODIFIERS": 3, + "STATIC_METHOD": 2, + "RECURSION": 1 }, "importList": [], "typeList": [ - "Feliform", - "int", - "boolean", - "Object", - "Cougar" + "int" ], "identifierList": [], "dottedMethodList": [] }, "lineCount": { - "source": 18, + "source": 14, "comment": 0, - "blank": 4 + "blank": 2 }, - "expectedDeadCount": 0 + "expectedDeadCount": 1 }, "alternativeSolutions": [], - "incorrect": [], - "common": [ - "public abstract class Feliform {\n private final String type;\n\n public Feliform(String setType) {\n type = setType;\n }\n\n public String getType() {\n return type;\n }\n\n public abstract int dangerousness();\n}\n" + "incorrect": [ + { + "klass": "Question", + "contents": "public class Question {\n private static int rangeSumHelper(int range) {\n int sum = 0;\n for (int i = 0; i <= range; i++) {\n sum += i;\n }\n return sum;\n }\n\n public static int rangeSum(int range) {\n if (range < 0) {\n throw new IllegalArgumentException();\n }\n return rangeSumHelper(range);\n }\n}\n", + "reason": "RECURSION", + "language": "java", + "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/privaterecursivehelper/incorrect/java/iterative/Question.java", + "starter": false, + "needed": true + } ], + "common": [], "importWhitelist": [], "importBlacklist": [], - "slug": "cougar-feliform", + "slug": "private-recursive-helper", "hasKotlin": false, "published": { - "name": "Cougar Feliform", + "name": "Private Recursive Helper", "type": "KLASS", - "path": "cougar-feliform", + "path": "private-recursive-helper", "author": "challen@illinois.edu", - "version": "2021.7.0", - "packageName": "com.examples.cougarfeliform", + "version": "2022.7.0", + "packageName": "com.examples.privaterecursivehelper", "languages": [ "java" ], "descriptions": { - "java": "

Create and complete the implementation of the Cougar class.\nYour class should be public, not final and not abstract, inherit from the Feliform class,\nand provide the following methods:

  1. Constructor that takes a int parameter speed and a second weight.\nCreates a new Cougar with the passed speed and weight.\nYou should call the Feliform constructor and pass it the String "cougar" to identify the type of this\nfeliform.
  2. Public instance method dangerousness that takes no arguments and returns an int.\nReturn the dangerousness of this cougar which equals its speed times its weight.
  3. Override public boolean equals(Object other).\nReturn true if other is a Cougar with the same speed and weight, and false otherwise.\nNote that other may be null or not a Housecat.

Finally, note that your class should not expose any of its internal state publicly.

" + "java": "

Testing question for recursion checks on private methods.

" }, "complexity": { "java": 5 @@ -2180,30 +2287,21 @@ "features": { "java": { "featureMap": { - "VARIABLE_REASSIGNMENTS": 2, - "ARITHMETIC_OPERATORS": 1, + "ARITHMETIC_OPERATORS": 2, "COMPARISON_OPERATORS": 2, - "LOGICAL_OPERATORS": 2, - "IF_STATEMENTS": 1, + "IF_STATEMENTS": 2, "METHOD": 2, "RETURN": 3, - "CONSTRUCTOR": 1, - "INSTANCEOF": 1, "CLASS": 1, - "EXTENDS": 1, - "SUPER": 1, - "VISIBILITY_MODIFIERS": 6, - "FINAL_FIELD": 2, - "DOT_NOTATION": 2, - "DOTTED_VARIABLE_ACCESS": 2 + "THROW": 1, + "NEW_KEYWORD": 1, + "VISIBILITY_MODIFIERS": 3, + "STATIC_METHOD": 2, + "RECURSION": 1 }, "importList": [], "typeList": [ - "Feliform", - "int", - "boolean", - "Object", - "Cougar" + "int" ], "identifierList": [], "dottedMethodList": [] @@ -2211,121 +2309,184 @@ }, "lineCounts": { "java": { - "source": 18, + "source": 14, "comment": 0, - "blank": 4 + "blank": 2 } }, "templateImports": [] }, "fauxStatic": false }, - "Print Hello": { - "name": "Print Hello", - "type": "SNIPPET", + "Maybe Recursive Factorial": { + "name": "Maybe Recursive Factorial", + "type": "KLASS", "klass": "Question", "metadata": { - "contentHash": "3ad0744ce5defd4539f5b07fbda0cd9a", - "packageName": "com.examples.printhello", + "contentHash": "996c3cdb90539d435a2d1a2e2527cdc6", + "packageName": "com.examples.mayberecursivefactorial", "version": "2022.7.0", "author": "challen@illinois.edu", - "javaDescription": "

Print "Hello!" without the quotes.\nUsing to test support for @Limit annotations.

", - "usedFiles": [], + "javaDescription": "

Write a class method that provides an implementation of factorial, accepting and returning long arguments.\nThrow an IllegalArgumentException on invalid inputs.\nYour implementation can be recursive or not.

", + "usedFiles": [ + "/Users/challen/code/questioner-problems/src/main/java/com/examples/mayberecursivefactorial/correct/java/iterative/Question.java" + ], "templateImports": [], "focused": false }, "annotatedControls": {}, "question": { "klass": "Question", - "contents": "import edu.illinois.cs.cs125.jenisol.core.Limit;\nimport edu.illinois.cs.cs125.questioner.lib.Correct;\n\n/*\n * Print \"Hello!\" without the quotes.\n * Using to test support for @Limit annotations.\n */\n\n@Correct(name = \"Print Hello\", author = \"challen@illinois.edu\", version = \"2022.7.0\")\npublic class Question {\n @Limit(1)\n public static void printHello() {\n // TEMPLATE_START\n System.out.println(\"Hello!\");\n // TEMPLATE_END\n }\n}", + "contents": "import edu.illinois.cs.cs125.jenisol.core.FixedParameters;\nimport edu.illinois.cs.cs125.jenisol.core.RandomParameters;\nimport edu.illinois.cs.cs125.questioner.lib.Correct;\nimport java.util.Arrays;\nimport java.util.List;\nimport java.util.Random;\n\n/*\n * Write a class method that provides an implementation of factorial, accepting and returning `long` arguments.\n * Throw an `IllegalArgumentException` on invalid inputs.\n * Your implementation can be recursive or not.\n */\n\n@Correct(name = \"Maybe Recursive Factorial\", version = \"2022.7.0\", author = \"challen@illinois.edu\")\npublic class Question {\n public static long factorial(long input) {\n if (input <= 0) { // mutate-disable-conditional-boundary\n throw new IllegalArgumentException();\n }\n if (input == 1) {\n return 1;\n }\n return input * factorial(input - 1);\n }\n\n @FixedParameters private static final List FIXED = Arrays.asList(-10L, -1L, 0L, 1L, 2L);\n\n @RandomParameters\n private static long randomParameters(Random random) {\n return random.nextInt(32);\n }\n}", "language": "java", - "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/printhello/Question.java" + "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/mayberecursivefactorial/Question.java" }, "correct": { "klass": "Question", - "contents": "System.out.println(\"Hello!\");", + "contents": "public class Question {\n public static long factorial(long input) {\n if (input <= 0) { // mutate-disable-conditional-boundary\n throw new IllegalArgumentException();\n }\n if (input == 1) {\n return 1;\n }\n return input * factorial(input - 1);\n }\n}\n", "language": "java", - "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/printhello/Question.java", - "complexity": 1, + "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/mayberecursivefactorial/Question.java", + "complexity": 4, "features": { "featureMap": { - "PRINT_STATEMENTS": 1 + "ARITHMETIC_OPERATORS": 2, + "COMPARISON_OPERATORS": 2, + "IF_STATEMENTS": 2, + "METHOD": 1, + "RETURN": 2, + "CLASS": 1, + "THROW": 1, + "NEW_KEYWORD": 1, + "VISIBILITY_MODIFIERS": 2, + "STATIC_METHOD": 1, + "RECURSION": 1 }, "importList": [], - "typeList": [], + "typeList": [ + "long" + ], "identifierList": [], - "dottedMethodList": [ - "println" - ] + "dottedMethodList": [] }, "lineCount": { - "source": 1, + "source": 11, "comment": 0, - "blank": 0 + "blank": 1 }, "expectedDeadCount": 1 }, - "alternativeSolutions": [], + "alternativeSolutions": [ + { + "klass": "Question", + "contents": "public class Question {\n public static long factorial(long input) {\n if (input <= 0) {\n throw new IllegalArgumentException();\n }\n long result = 1;\n for (long multiplier = 2; multiplier <= input; multiplier++) {\n result *= multiplier;\n }\n return result;\n }\n}\n", + "language": "java", + "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/mayberecursivefactorial/correct/java/iterative/Question.java", + "complexity": 4, + "features": { + "featureMap": { + "LOCAL_VARIABLE_DECLARATIONS": 2, + "VARIABLE_ASSIGNMENTS": 2, + "VARIABLE_REASSIGNMENTS": 2, + "UNARY_OPERATORS": 1, + "ASSIGNMENT_OPERATORS": 1, + "COMPARISON_OPERATORS": 2, + "IF_STATEMENTS": 1, + "FOR_LOOPS": 1, + "METHOD": 1, + "RETURN": 1, + "CLASS": 1, + "THROW": 1, + "NEW_KEYWORD": 1, + "VISIBILITY_MODIFIERS": 2, + "STATIC_METHOD": 1 + }, + "importList": [], + "typeList": [ + "long" + ], + "identifierList": [ + "result", + "multiplier" + ], + "dottedMethodList": [] + }, + "lineCount": { + "source": 12, + "comment": 0, + "blank": 1 + }, + "expectedDeadCount": 1 + } + ], "incorrect": [], "common": [], - "javaTemplate": "public class Question {\n public static void printHello() {\n {{{ contents }}}\n }\n}\n", "importWhitelist": [], "importBlacklist": [], - "slug": "print-hello", + "slug": "maybe-recursive-factorial", "hasKotlin": false, "published": { - "name": "Print Hello", - "type": "SNIPPET", - "path": "print-hello", + "name": "Maybe Recursive Factorial", + "type": "KLASS", + "path": "maybe-recursive-factorial", "author": "challen@illinois.edu", "version": "2022.7.0", - "packageName": "com.examples.printhello", + "packageName": "com.examples.mayberecursivefactorial", "languages": [ "java" ], "descriptions": { - "java": "

Print "Hello!" without the quotes.\nUsing to test support for @Limit annotations.

" + "java": "

Write a class method that provides an implementation of factorial, accepting and returning long arguments.\nThrow an IllegalArgumentException on invalid inputs.\nYour implementation can be recursive or not.

" }, "complexity": { - "java": 1 + "java": 4 }, "features": { "java": { "featureMap": { - "PRINT_STATEMENTS": 1 + "ARITHMETIC_OPERATORS": 2, + "COMPARISON_OPERATORS": 2, + "IF_STATEMENTS": 2, + "METHOD": 1, + "RETURN": 2, + "CLASS": 1, + "THROW": 1, + "NEW_KEYWORD": 1, + "VISIBILITY_MODIFIERS": 2, + "STATIC_METHOD": 1, + "RECURSION": 1 }, "importList": [], - "typeList": [], + "typeList": [ + "long" + ], "identifierList": [], - "dottedMethodList": [ - "println" - ] + "dottedMethodList": [] } }, "lineCounts": { "java": { - "source": 1, + "source": 11, "comment": 0, - "blank": 0 + "blank": 1 } }, "templateImports": [] }, "fauxStatic": false }, - "Input Interleaving Test": { - "name": "Input Interleaving Test", + "Add One Class": { + "name": "Add One Class", "type": "KLASS", "klass": "Question", "metadata": { - "contentHash": "cb14dff3cc24c5564a60226ff7ced3f5", - "packageName": "com.examples.inputinterleavingtest", - "version": "2022.9.0", + "contentHash": "144cc102fd3530a84a5e30737e94336c", + "packageName": "com.examples.addoneclass", + "version": "2021.6.0", "author": "challen@illinois.edu", - "javaDescription": "

Testing STDIN generation and interleaving.

", - "kotlinDescription": "

Testing STDIN generation and interleaving. In Kotlin!

", + "javaDescription": "

Write a class named Question with a single static method addOne that returns its int argument plus one.

", + "kotlinDescription": "

Write a function addOne that returns its Int argument plus one.

", "usedFiles": [ - "/Users/challen/code/questioner-problems/src/main/java/com/examples/inputinterleavingtest/correct/kotlin/Question.kt" + "/Users/challen/code/questioner-problems/src/main/java/com/examples/addoneclass/correct/kotlin/Question.kt" ], "templateImports": [], "focused": false @@ -2333,88 +2494,59 @@ "annotatedControls": {}, "question": { "klass": "Question", - "contents": "import edu.illinois.cs.cs125.jenisol.core.EdgeType;\nimport edu.illinois.cs.cs125.jenisol.core.Limit;\nimport edu.illinois.cs.cs125.jenisol.core.ProvideSystemIn;\nimport edu.illinois.cs.cs125.jenisol.core.RandomType;\nimport edu.illinois.cs.cs125.jenisol.core.SimpleType;\nimport edu.illinois.cs.cs125.jenisol.core.generators.SystemIn;\nimport edu.illinois.cs.cs125.questioner.lib.Correct;\nimport java.util.Arrays;\nimport java.util.Random;\nimport java.util.Scanner;\n\n/*\n * Testing STDIN generation and interleaving.\n */\n\n@SuppressWarnings(\"StringOperationCanBeSimplified\")\n@Correct(name = \"Input Interleaving Test\", version = \"2022.9.0\", author = \"challen@illinois.edu\")\npublic class Question {\n @ProvideSystemIn\n @Limit(1)\n public static void echo() {\n System.out.println(\"Hello!\");\n Scanner scanner = new Scanner(System.in);\n String first = scanner.nextLine();\n System.out.println(\"First: \" + first);\n String second = scanner.nextLine();\n System.out.println(\"Second: \" + second);\n }\n\n @SimpleType\n private static final SystemIn[] SIMPLE =\n new SystemIn[] {new SystemIn(Arrays.asList(\"Test\", \"Me\"))};\n\n @EdgeType private static final SystemIn[] EDGE = new SystemIn[] {};\n\n @RandomType\n private static SystemIn randomInput(Random random) {\n return new SystemIn(\n Arrays.asList(new String(\"\" + random.nextInt()), new String(\"\" + random.nextInt())));\n }\n}", + "contents": "import edu.illinois.cs.cs125.questioner.lib.Correct;\n\n/*\n * Write a class named `Question` with a single `static` method `addOne` that returns its `int` argument plus one.\n */\n\n@Correct(name = \"Add One Class\", author = \"challen@illinois.edu\", version = \"2021.6.0\")\npublic class Question {\n public static int addOne(int value) {\n return value + 1;\n }\n}", "language": "java", - "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/inputinterleavingtest/Question.java" + "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/addoneclass/Question.java" }, "correct": { "klass": "Question", - "contents": "import java.util.Scanner;\n\npublic class Question {\n public static void echo() {\n System.out.println(\"Hello!\");\n Scanner scanner = new Scanner(System.in);\n String first = scanner.nextLine();\n System.out.println(\"First: \" + first);\n String second = scanner.nextLine();\n System.out.println(\"Second: \" + second);\n }\n}\n", + "contents": "public class Question {\n public static int addOne(int value) {\n return value + 1;\n }\n}\n", "language": "java", - "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/inputinterleavingtest/Question.java", + "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/addoneclass/Question.java", "complexity": 1, "features": { "featureMap": { - "LOCAL_VARIABLE_DECLARATIONS": 3, - "VARIABLE_ASSIGNMENTS": 3, - "ARITHMETIC_OPERATORS": 2, + "ARITHMETIC_OPERATORS": 1, "METHOD": 1, - "STRING": 2, + "RETURN": 1, "CLASS": 1, - "NEW_KEYWORD": 1, "VISIBILITY_MODIFIERS": 2, - "STATIC_METHOD": 1, - "IMPORT": 1, - "PRINT_STATEMENTS": 3, - "DOT_NOTATION": 3, - "DOTTED_METHOD_CALL": 2, - "DOTTED_VARIABLE_ACCESS": 1 + "STATIC_METHOD": 1 }, - "importList": [ - "java.util.Scanner" - ], + "importList": [], "typeList": [ - "Scanner", - "String" - ], - "identifierList": [ - "scanner", - "first", - "second" + "int" ], - "dottedMethodList": [ - "println", - "nextLine" - ] + "identifierList": [], + "dottedMethodList": [] }, "lineCount": { - "source": 11, + "source": 5, "comment": 0, - "blank": 2 + "blank": 1 }, "expectedDeadCount": 1 }, "alternativeSolutions": [ { "klass": "QuestionKt", - "contents": "import java.util.Scanner\n\n\nfun echo() {\n println(\"Hello!\")\n val scanner = Scanner(System.`in`)\n val first = scanner.nextLine()\n println(\"First: $first\")\n val second = scanner.nextLine()\n println(\"Second: $second\")\n}", + "contents": "fun addOne(value: Int): Int {\n return value + 1\n}", "language": "kotlin", - "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/inputinterleavingtest/correct/kotlin/Question.kt", + "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/addoneclass/correct/kotlin/Question.kt", "complexity": 1, "features": { "featureMap": { - "LOCAL_VARIABLE_DECLARATIONS": 3, - "VARIABLE_ASSIGNMENTS": 3, - "METHOD": 1, - "IMPORT": 1, - "PRINT_STATEMENTS": 3, - "DOT_NOTATION": 3, - "DOTTED_METHOD_CALL": 2, - "DOTTED_VARIABLE_ACCESS": 1 + "METHOD": 1 }, - "importList": [ - "java.util.Scanner" - ], + "importList": [], "typeList": [], "identifierList": [], - "dottedMethodList": [ - "nextLine" - ] + "dottedMethodList": [] }, "lineCount": { - "source": 9, + "source": 3, "comment": 0, - "blank": 2 + "blank": 0 } } ], @@ -2422,54 +2554,43 @@ "common": [], "importWhitelist": [], "importBlacklist": [], - "slug": "input-interleaving-test", + "slug": "add-one-class", "kotlinSolution": { "klass": "QuestionKt", - "contents": "import java.util.Scanner\n\n\nfun echo() {\n println(\"Hello!\")\n val scanner = Scanner(System.`in`)\n val first = scanner.nextLine()\n println(\"First: $first\")\n val second = scanner.nextLine()\n println(\"Second: $second\")\n}", + "contents": "fun addOne(value: Int): Int {\n return value + 1\n}", "language": "kotlin", - "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/inputinterleavingtest/correct/kotlin/Question.kt", + "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/addoneclass/correct/kotlin/Question.kt", "complexity": 1, "features": { "featureMap": { - "LOCAL_VARIABLE_DECLARATIONS": 3, - "VARIABLE_ASSIGNMENTS": 3, - "METHOD": 1, - "IMPORT": 1, - "PRINT_STATEMENTS": 3, - "DOT_NOTATION": 3, - "DOTTED_METHOD_CALL": 2, - "DOTTED_VARIABLE_ACCESS": 1 + "METHOD": 1 }, - "importList": [ - "java.util.Scanner" - ], + "importList": [], "typeList": [], "identifierList": [], - "dottedMethodList": [ - "nextLine" - ] + "dottedMethodList": [] }, "lineCount": { - "source": 9, + "source": 3, "comment": 0, - "blank": 2 + "blank": 0 } }, "hasKotlin": true, "published": { - "name": "Input Interleaving Test", + "name": "Add One Class", "type": "KLASS", - "path": "input-interleaving-test", + "path": "add-one-class", "author": "challen@illinois.edu", - "version": "2022.9.0", - "packageName": "com.examples.inputinterleavingtest", + "version": "2021.6.0", + "packageName": "com.examples.addoneclass", "languages": [ "java", "kotlin" ], "descriptions": { - "java": "

Testing STDIN generation and interleaving.

", - "kotlin": "

Testing STDIN generation and interleaving. In Kotlin!

" + "java": "

Write a class named Question with a single static method addOne that returns its int argument plus one.

", + "kotlin": "

Write a function addOne that returns its Int argument plus one.

" }, "complexity": { "java": 1, @@ -2478,206 +2599,286 @@ "features": { "java": { "featureMap": { - "LOCAL_VARIABLE_DECLARATIONS": 3, - "VARIABLE_ASSIGNMENTS": 3, - "ARITHMETIC_OPERATORS": 2, + "ARITHMETIC_OPERATORS": 1, "METHOD": 1, - "STRING": 2, + "RETURN": 1, + "CLASS": 1, + "VISIBILITY_MODIFIERS": 2, + "STATIC_METHOD": 1 + }, + "importList": [], + "typeList": [ + "int" + ], + "identifierList": [], + "dottedMethodList": [] + }, + "kotlin": { + "featureMap": { + "METHOD": 1 + }, + "importList": [], + "typeList": [], + "identifierList": [], + "dottedMethodList": [] + } + }, + "lineCounts": { + "java": { + "source": 5, + "comment": 0, + "blank": 1 + }, + "kotlin": { + "source": 3, + "comment": 0, + "blank": 0 + } + }, + "templateImports": [] + }, + "fauxStatic": false + }, + "Cougar Feliform": { + "name": "Cougar Feliform", + "type": "KLASS", + "klass": "Cougar", + "metadata": { + "contentHash": "858c7009ae6211d3f4f7f0bcff4d091c", + "packageName": "com.examples.cougarfeliform", + "version": "2021.7.0", + "author": "challen@illinois.edu", + "javaDescription": "

Create and complete the implementation of the Cougar class.\nYour class should be public, not final and not abstract, inherit from the Feliform class,\nand provide the following methods:

  1. Constructor that takes a int parameter speed and a second weight.\nCreates a new Cougar with the passed speed and weight.\nYou should call the Feliform constructor and pass it the String "cougar" to identify the type of this\nfeliform.
  2. Public instance method dangerousness that takes no arguments and returns an int.\nReturn the dangerousness of this cougar which equals its speed times its weight.
  3. Override public boolean equals(Object other).\nReturn true if other is a Cougar with the same speed and weight, and false otherwise.\nNote that other may be null or not a Housecat.

Finally, note that your class should not expose any of its internal state publicly.

", + "usedFiles": [ + "/Users/challen/code/questioner-problems/src/main/java/com/examples/cougarfeliform/Feliform.java" + ], + "templateImports": [], + "focused": false + }, + "annotatedControls": {}, + "question": { + "klass": "Cougar", + "contents": "import edu.illinois.cs.cs125.jenisol.core.Both;\nimport edu.illinois.cs.cs125.jenisol.core.Limit;\nimport edu.illinois.cs.cs125.questioner.lib.Correct;\n\n/*\n * Create and complete the implementation of the `Cougar` class.\n * Your class should be public, not final and not abstract, inherit from the `Feliform` class,\n * and provide the following methods:\n *\n * 1. Constructor that takes a `int` parameter `speed` and a second `weight`.\n * Creates a new `Cougar` with the passed speed and weight.\n * You should call the `Feliform` constructor and pass it the `String` \"cougar\" to identify the type of this\n * feliform.\n * 1. Public instance method `dangerousness` that takes no arguments and returns an `int`.\n * Return the dangerousness of this cougar which equals its speed times its weight.\n * 1. Override `public boolean equals(Object other)`.\n * Return `true` if `other` is a `Cougar` with the same speed and weight, and `false` otherwise.\n * Note that `other` may be `null` or not a `Housecat`.\n *\n * Finally, note that your class should not expose any of its internal state publicly.\n */\n@Correct(name = \"Cougar Feliform\", version = \"2021.7.0\", author = \"challen@illinois.edu\")\npublic class Cougar extends Feliform {\n private final int speed;\n private final int weight;\n\n public Cougar(int setSpeed, int setWeight) {\n super(\"cougar\");\n speed = setSpeed;\n weight = setWeight;\n }\n\n @Override\n public int dangerousness() {\n return speed * weight;\n }\n\n @Override\n public boolean equals(Object o) {\n if (!(o instanceof Cougar housecat)) {\n return false;\n }\n return speed == housecat.speed && weight == housecat.weight;\n }\n\n @Both\n @Limit(1)\n public static String getType(Feliform feliform) {\n return feliform.getType();\n }\n}", + "language": "java", + "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/cougarfeliform/Cougar.java" + }, + "correct": { + "klass": "Cougar", + "contents": "public class Cougar extends Feliform {\n private final int speed;\n private final int weight;\n\n public Cougar(int setSpeed, int setWeight) {\n super(\"cougar\");\n speed = setSpeed;\n weight = setWeight;\n }\n\n public int dangerousness() {\n return speed * weight;\n }\n\n public boolean equals(Object o) {\n if (!(o instanceof Cougar housecat)) {\n return false;\n }\n return speed == housecat.speed && weight == housecat.weight;\n }\n}\n", + "language": "java", + "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/cougarfeliform/Cougar.java", + "complexity": 5, + "features": { + "featureMap": { + "VARIABLE_REASSIGNMENTS": 2, + "ARITHMETIC_OPERATORS": 1, + "COMPARISON_OPERATORS": 2, + "LOGICAL_OPERATORS": 2, + "IF_STATEMENTS": 1, + "METHOD": 2, + "RETURN": 3, + "CONSTRUCTOR": 1, + "INSTANCEOF": 1, + "CLASS": 1, + "EXTENDS": 1, + "SUPER": 1, + "VISIBILITY_MODIFIERS": 6, + "FINAL_FIELD": 2, + "DOT_NOTATION": 2, + "DOTTED_VARIABLE_ACCESS": 2 + }, + "importList": [], + "typeList": [ + "Feliform", + "int", + "boolean", + "Object", + "Cougar" + ], + "identifierList": [], + "dottedMethodList": [] + }, + "lineCount": { + "source": 18, + "comment": 0, + "blank": 4 + }, + "expectedDeadCount": 0 + }, + "alternativeSolutions": [], + "incorrect": [], + "common": [ + "public abstract class Feliform {\n private final String type;\n\n public Feliform(String setType) {\n type = setType;\n }\n\n public String getType() {\n return type;\n }\n\n public abstract int dangerousness();\n}\n" + ], + "importWhitelist": [], + "importBlacklist": [], + "slug": "cougar-feliform", + "hasKotlin": false, + "published": { + "name": "Cougar Feliform", + "type": "KLASS", + "path": "cougar-feliform", + "author": "challen@illinois.edu", + "version": "2021.7.0", + "packageName": "com.examples.cougarfeliform", + "languages": [ + "java" + ], + "descriptions": { + "java": "

Create and complete the implementation of the Cougar class.\nYour class should be public, not final and not abstract, inherit from the Feliform class,\nand provide the following methods:

  1. Constructor that takes a int parameter speed and a second weight.\nCreates a new Cougar with the passed speed and weight.\nYou should call the Feliform constructor and pass it the String "cougar" to identify the type of this\nfeliform.
  2. Public instance method dangerousness that takes no arguments and returns an int.\nReturn the dangerousness of this cougar which equals its speed times its weight.
  3. Override public boolean equals(Object other).\nReturn true if other is a Cougar with the same speed and weight, and false otherwise.\nNote that other may be null or not a Housecat.

Finally, note that your class should not expose any of its internal state publicly.

" + }, + "complexity": { + "java": 5 + }, + "features": { + "java": { + "featureMap": { + "VARIABLE_REASSIGNMENTS": 2, + "ARITHMETIC_OPERATORS": 1, + "COMPARISON_OPERATORS": 2, + "LOGICAL_OPERATORS": 2, + "IF_STATEMENTS": 1, + "METHOD": 2, + "RETURN": 3, + "CONSTRUCTOR": 1, + "INSTANCEOF": 1, "CLASS": 1, - "NEW_KEYWORD": 1, - "VISIBILITY_MODIFIERS": 2, - "STATIC_METHOD": 1, - "IMPORT": 1, - "PRINT_STATEMENTS": 3, - "DOT_NOTATION": 3, - "DOTTED_METHOD_CALL": 2, - "DOTTED_VARIABLE_ACCESS": 1 + "EXTENDS": 1, + "SUPER": 1, + "VISIBILITY_MODIFIERS": 6, + "FINAL_FIELD": 2, + "DOT_NOTATION": 2, + "DOTTED_VARIABLE_ACCESS": 2 }, - "importList": [ - "java.util.Scanner" - ], + "importList": [], "typeList": [ - "Scanner", - "String" - ], - "identifierList": [ - "scanner", - "first", - "second" - ], - "dottedMethodList": [ - "println", - "nextLine" - ] - }, - "kotlin": { - "featureMap": { - "LOCAL_VARIABLE_DECLARATIONS": 3, - "VARIABLE_ASSIGNMENTS": 3, - "METHOD": 1, - "IMPORT": 1, - "PRINT_STATEMENTS": 3, - "DOT_NOTATION": 3, - "DOTTED_METHOD_CALL": 2, - "DOTTED_VARIABLE_ACCESS": 1 - }, - "importList": [ - "java.util.Scanner" + "Feliform", + "int", + "boolean", + "Object", + "Cougar" ], - "typeList": [], "identifierList": [], - "dottedMethodList": [ - "nextLine" - ] + "dottedMethodList": [] } }, "lineCounts": { "java": { - "source": 11, - "comment": 0, - "blank": 2 - }, - "kotlin": { - "source": 9, + "source": 18, "comment": 0, - "blank": 2 + "blank": 4 } }, "templateImports": [] }, "fauxStatic": false }, - "Test Constructor NotNull": { - "name": "Test Constructor NotNull", - "type": "KLASS", + "Print Hello": { + "name": "Print Hello", + "type": "SNIPPET", "klass": "Question", "metadata": { - "contentHash": "5cdd4a7677f73f34f915e08ec0f5f11b", - "packageName": "com.examples.withconstructornotnull", - "version": "2022.10.0", + "contentHash": "3ad0744ce5defd4539f5b07fbda0cd9a", + "packageName": "com.examples.printhello", + "version": "2022.7.0", "author": "challen@illinois.edu", - "javaDescription": "

Testing @NotNull annotation on constructor parameters.

", + "javaDescription": "

Print "Hello!" without the quotes.\nUsing to test support for @Limit annotations.

", "usedFiles": [], "templateImports": [], - "focused": true + "focused": false }, "annotatedControls": {}, "question": { "klass": "Question", - "contents": "import edu.illinois.cs.cs125.jenisol.core.NotNull;\nimport edu.illinois.cs.cs125.questioner.lib.Correct;\n\n/*\n * Testing @NotNull annotation on constructor parameters.\n */\n\n@Correct(name = \"Test Constructor NotNull\", version = \"2022.10.0\", author = \"challen@illinois.edu\", focused = true)\npublic class Question {\n private final int stringLength;\n\n public Question(@NotNull String value) {\n stringLength = value.length();\n }\n\n public int getStringLength() {\n return stringLength;\n }\n}", + "contents": "import edu.illinois.cs.cs125.jenisol.core.Limit;\nimport edu.illinois.cs.cs125.questioner.lib.Correct;\n\n/*\n * Print \"Hello!\" without the quotes.\n * Using to test support for @Limit annotations.\n */\n\n@Correct(name = \"Print Hello\", author = \"challen@illinois.edu\", version = \"2022.7.0\")\npublic class Question {\n @Limit(1)\n public static void printHello() {\n // TEMPLATE_START\n System.out.println(\"Hello!\");\n // TEMPLATE_END\n }\n}", "language": "java", - "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/withconstructornotnull/Question.java" + "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/printhello/Question.java" }, "correct": { "klass": "Question", - "contents": "public class Question {\n private final int stringLength;\n\n public Question(String value) {\n stringLength = value.length();\n }\n\n public int getStringLength() {\n return stringLength;\n }\n}\n", + "contents": "System.out.println(\"Hello!\");", "language": "java", - "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/withconstructornotnull/Question.java", - "complexity": 2, + "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/printhello/Question.java", + "complexity": 1, "features": { "featureMap": { - "VARIABLE_REASSIGNMENTS": 1, - "METHOD": 1, - "RETURN": 1, - "CONSTRUCTOR": 1, - "GETTER": 1, - "STRING": 1, - "CLASS": 1, - "VISIBILITY_MODIFIERS": 4, - "FINAL_FIELD": 1, - "DOT_NOTATION": 1, - "DOTTED_METHOD_CALL": 1 + "PRINT_STATEMENTS": 1 }, "importList": [], - "typeList": [ - "int", - "String" - ], + "typeList": [], "identifierList": [], "dottedMethodList": [ - "length" + "println" ] }, "lineCount": { - "source": 9, + "source": 1, "comment": 0, - "blank": 3 + "blank": 0 }, - "expectedDeadCount": 0 + "expectedDeadCount": 1 }, "alternativeSolutions": [], "incorrect": [], "common": [], + "javaTemplate": "public class Question {\n public static void printHello() {\n {{{ contents }}}\n }\n}\n", "importWhitelist": [], "importBlacklist": [], - "slug": "test-constructor-notnull", + "slug": "print-hello", "hasKotlin": false, "published": { - "name": "Test Constructor NotNull", - "type": "KLASS", - "path": "test-constructor-notnull", + "name": "Print Hello", + "type": "SNIPPET", + "path": "print-hello", "author": "challen@illinois.edu", - "version": "2022.10.0", - "packageName": "com.examples.withconstructornotnull", + "version": "2022.7.0", + "packageName": "com.examples.printhello", "languages": [ "java" ], "descriptions": { - "java": "

Testing @NotNull annotation on constructor parameters.

" + "java": "

Print "Hello!" without the quotes.\nUsing to test support for @Limit annotations.

" }, "complexity": { - "java": 2 + "java": 1 }, "features": { "java": { "featureMap": { - "VARIABLE_REASSIGNMENTS": 1, - "METHOD": 1, - "RETURN": 1, - "CONSTRUCTOR": 1, - "GETTER": 1, - "STRING": 1, - "CLASS": 1, - "VISIBILITY_MODIFIERS": 4, - "FINAL_FIELD": 1, - "DOT_NOTATION": 1, - "DOTTED_METHOD_CALL": 1 + "PRINT_STATEMENTS": 1 }, "importList": [], - "typeList": [ - "int", - "String" - ], + "typeList": [], "identifierList": [], "dottedMethodList": [ - "length" + "println" ] } }, "lineCounts": { "java": { - "source": 9, + "source": 1, "comment": 0, - "blank": 3 + "blank": 0 } }, "templateImports": [] }, "fauxStatic": false }, - "With Imports": { - "name": "With Imports", + "Input Interleaving Test": { + "name": "Input Interleaving Test", "type": "KLASS", "klass": "Question", "metadata": { - "contentHash": "28944ac134c1b61f898a4d9596831bb7", - "packageName": "com.examples.withimports", - "version": "2022.7.0", + "contentHash": "cb14dff3cc24c5564a60226ff7ced3f5", + "packageName": "com.examples.inputinterleavingtest", + "version": "2022.9.0", "author": "challen@illinois.edu", - "javaDescription": "

Example to test use of import statements.

", - "kotlinDescription": "

Test Kotlin top-level method with import statements.

", + "javaDescription": "

Testing STDIN generation and interleaving.

", + "kotlinDescription": "

Testing STDIN generation and interleaving. In Kotlin!

", "usedFiles": [ - "/Users/challen/code/questioner-problems/src/main/java/com/examples/withimports/correct/kotlin/Question.kt" + "/Users/challen/code/questioner-problems/src/main/java/com/examples/inputinterleavingtest/correct/kotlin/Question.kt" ], "templateImports": [], "focused": false @@ -2685,45 +2886,52 @@ "annotatedControls": {}, "question": { "klass": "Question", - "contents": "import edu.illinois.cs.cs125.questioner.lib.Correct;\nimport java.util.Arrays;\nimport java.util.List;\n\n/*\n * Example to test use of import statements.\n */\n\n@Correct(name = \"With Imports\", version = \"2022.7.0\", author = \"challen@illinois.edu\")\npublic class Question {\n public static List max(int first, int second) {\n return Arrays.asList(first, second);\n }\n}", + "contents": "import edu.illinois.cs.cs125.jenisol.core.EdgeType;\nimport edu.illinois.cs.cs125.jenisol.core.Limit;\nimport edu.illinois.cs.cs125.jenisol.core.ProvideSystemIn;\nimport edu.illinois.cs.cs125.jenisol.core.RandomType;\nimport edu.illinois.cs.cs125.jenisol.core.SimpleType;\nimport edu.illinois.cs.cs125.jenisol.core.generators.SystemIn;\nimport edu.illinois.cs.cs125.questioner.lib.Correct;\nimport java.util.Arrays;\nimport java.util.Random;\nimport java.util.Scanner;\n\n/*\n * Testing STDIN generation and interleaving.\n */\n\n@SuppressWarnings(\"StringOperationCanBeSimplified\")\n@Correct(name = \"Input Interleaving Test\", version = \"2022.9.0\", author = \"challen@illinois.edu\")\npublic class Question {\n @ProvideSystemIn\n @Limit(1)\n public static void echo() {\n System.out.println(\"Hello!\");\n Scanner scanner = new Scanner(System.in);\n String first = scanner.nextLine();\n System.out.println(\"First: \" + first);\n String second = scanner.nextLine();\n System.out.println(\"Second: \" + second);\n }\n\n @SimpleType\n private static final SystemIn[] SIMPLE =\n new SystemIn[] {new SystemIn(Arrays.asList(\"Test\", \"Me\"))};\n\n @EdgeType private static final SystemIn[] EDGE = new SystemIn[] {};\n\n @RandomType\n private static SystemIn randomInput(Random random) {\n return new SystemIn(\n Arrays.asList(new String(\"\" + random.nextInt()), new String(\"\" + random.nextInt())));\n }\n}", "language": "java", - "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/withimports/Question.java" + "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/inputinterleavingtest/Question.java" }, "correct": { "klass": "Question", - "contents": "import java.util.Arrays;\nimport java.util.List;\n\npublic class Question {\n public static List max(int first, int second) {\n return Arrays.asList(first, second);\n }\n}\n", + "contents": "import java.util.Scanner;\n\npublic class Question {\n public static void echo() {\n System.out.println(\"Hello!\");\n Scanner scanner = new Scanner(System.in);\n String first = scanner.nextLine();\n System.out.println(\"First: \" + first);\n String second = scanner.nextLine();\n System.out.println(\"Second: \" + second);\n }\n}\n", "language": "java", - "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/withimports/Question.java", + "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/inputinterleavingtest/Question.java", "complexity": 1, "features": { "featureMap": { + "LOCAL_VARIABLE_DECLARATIONS": 3, + "VARIABLE_ASSIGNMENTS": 3, + "ARITHMETIC_OPERATORS": 2, "METHOD": 1, - "RETURN": 1, + "STRING": 2, "CLASS": 1, + "NEW_KEYWORD": 1, "VISIBILITY_MODIFIERS": 2, "STATIC_METHOD": 1, - "IMPORT": 2, - "BOXING_CLASSES": 1, - "TYPE_PARAMETERS": 1, - "DOT_NOTATION": 1, - "DOTTED_METHOD_CALL": 1 + "IMPORT": 1, + "PRINT_STATEMENTS": 3, + "DOT_NOTATION": 3, + "DOTTED_METHOD_CALL": 2, + "DOTTED_VARIABLE_ACCESS": 1 }, "importList": [ - "java.util.Arrays", - "java.util.List" + "java.util.Scanner" ], "typeList": [ - "List", - "Integer", - "int" + "Scanner", + "String" + ], + "identifierList": [ + "scanner", + "first", + "second" ], - "identifierList": [], "dottedMethodList": [ - "asList" + "println", + "nextLine" ] }, "lineCount": { - "source": 7, + "source": 11, "comment": 0, "blank": 2 }, @@ -2732,28 +2940,32 @@ "alternativeSolutions": [ { "klass": "QuestionKt", - "contents": "import java.util.Arrays\n\n\nfun max(first: Int, second: Int): List {\n return Arrays.asList(first, second)\n}", + "contents": "import java.util.Scanner\n\n\nfun echo() {\n println(\"Hello!\")\n val scanner = Scanner(System.`in`)\n val first = scanner.nextLine()\n println(\"First: $first\")\n val second = scanner.nextLine()\n println(\"Second: $second\")\n}", "language": "kotlin", - "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/withimports/correct/kotlin/Question.kt", + "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/inputinterleavingtest/correct/kotlin/Question.kt", "complexity": 1, "features": { "featureMap": { + "LOCAL_VARIABLE_DECLARATIONS": 3, + "VARIABLE_ASSIGNMENTS": 3, "METHOD": 1, "IMPORT": 1, - "DOT_NOTATION": 1, - "DOTTED_METHOD_CALL": 1 + "PRINT_STATEMENTS": 3, + "DOT_NOTATION": 3, + "DOTTED_METHOD_CALL": 2, + "DOTTED_VARIABLE_ACCESS": 1 }, "importList": [ - "java.util.Arrays" + "java.util.Scanner" ], "typeList": [], "identifierList": [], "dottedMethodList": [ - "asList" + "nextLine" ] }, "lineCount": { - "source": 4, + "source": 9, "comment": 0, "blank": 2 } @@ -2763,50 +2975,54 @@ "common": [], "importWhitelist": [], "importBlacklist": [], - "slug": "with-imports", + "slug": "input-interleaving-test", "kotlinSolution": { "klass": "QuestionKt", - "contents": "import java.util.Arrays\n\n\nfun max(first: Int, second: Int): List {\n return Arrays.asList(first, second)\n}", + "contents": "import java.util.Scanner\n\n\nfun echo() {\n println(\"Hello!\")\n val scanner = Scanner(System.`in`)\n val first = scanner.nextLine()\n println(\"First: $first\")\n val second = scanner.nextLine()\n println(\"Second: $second\")\n}", "language": "kotlin", - "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/withimports/correct/kotlin/Question.kt", + "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/inputinterleavingtest/correct/kotlin/Question.kt", "complexity": 1, "features": { "featureMap": { + "LOCAL_VARIABLE_DECLARATIONS": 3, + "VARIABLE_ASSIGNMENTS": 3, "METHOD": 1, "IMPORT": 1, - "DOT_NOTATION": 1, - "DOTTED_METHOD_CALL": 1 + "PRINT_STATEMENTS": 3, + "DOT_NOTATION": 3, + "DOTTED_METHOD_CALL": 2, + "DOTTED_VARIABLE_ACCESS": 1 }, "importList": [ - "java.util.Arrays" + "java.util.Scanner" ], "typeList": [], "identifierList": [], "dottedMethodList": [ - "asList" + "nextLine" ] }, "lineCount": { - "source": 4, + "source": 9, "comment": 0, "blank": 2 } }, "hasKotlin": true, "published": { - "name": "With Imports", + "name": "Input Interleaving Test", "type": "KLASS", - "path": "with-imports", + "path": "input-interleaving-test", "author": "challen@illinois.edu", - "version": "2022.7.0", - "packageName": "com.examples.withimports", + "version": "2022.9.0", + "packageName": "com.examples.inputinterleavingtest", "languages": [ "java", "kotlin" ], "descriptions": { - "java": "

Example to test use of import statements.

", - "kotlin": "

Test Kotlin top-level method with import statements.

" + "java": "

Testing STDIN generation and interleaving.

", + "kotlin": "

Testing STDIN generation and interleaving. In Kotlin!

" }, "complexity": { "java": 1, @@ -2815,56 +3031,67 @@ "features": { "java": { "featureMap": { + "LOCAL_VARIABLE_DECLARATIONS": 3, + "VARIABLE_ASSIGNMENTS": 3, + "ARITHMETIC_OPERATORS": 2, "METHOD": 1, - "RETURN": 1, + "STRING": 2, "CLASS": 1, + "NEW_KEYWORD": 1, "VISIBILITY_MODIFIERS": 2, "STATIC_METHOD": 1, - "IMPORT": 2, - "BOXING_CLASSES": 1, - "TYPE_PARAMETERS": 1, - "DOT_NOTATION": 1, - "DOTTED_METHOD_CALL": 1 + "IMPORT": 1, + "PRINT_STATEMENTS": 3, + "DOT_NOTATION": 3, + "DOTTED_METHOD_CALL": 2, + "DOTTED_VARIABLE_ACCESS": 1 }, "importList": [ - "java.util.Arrays", - "java.util.List" + "java.util.Scanner" ], "typeList": [ - "List", - "Integer", - "int" + "Scanner", + "String" + ], + "identifierList": [ + "scanner", + "first", + "second" ], - "identifierList": [], "dottedMethodList": [ - "asList" + "println", + "nextLine" ] }, "kotlin": { "featureMap": { + "LOCAL_VARIABLE_DECLARATIONS": 3, + "VARIABLE_ASSIGNMENTS": 3, "METHOD": 1, "IMPORT": 1, - "DOT_NOTATION": 1, - "DOTTED_METHOD_CALL": 1 + "PRINT_STATEMENTS": 3, + "DOT_NOTATION": 3, + "DOTTED_METHOD_CALL": 2, + "DOTTED_VARIABLE_ACCESS": 1 }, "importList": [ - "java.util.Arrays" + "java.util.Scanner" ], "typeList": [], "identifierList": [], "dottedMethodList": [ - "asList" + "nextLine" ] } }, "lineCounts": { "java": { - "source": 7, + "source": 11, "comment": 0, "blank": 2 }, "kotlin": { - "source": 4, + "source": 9, "comment": 0, "blank": 2 } @@ -2873,136 +3100,19 @@ }, "fauxStatic": false }, - "Classroom Getters and Setters": { - "name": "Classroom Getters and Setters", - "type": "KLASS", - "klass": "Classroom", - "metadata": { - "contentHash": "37e98c13ef079c9e2170bed9775f06f0", - "packageName": "com.examples.withgettersandsetters", - "version": "2022.9.0", - "author": "challen@illinois.edu", - "javaDescription": "

Getter and setter testing.

", - "usedFiles": [], - "templateImports": [], - "focused": false - }, - "annotatedControls": {}, - "question": { - "klass": "Classroom", - "contents": "import edu.illinois.cs.cs125.questioner.lib.Correct;\n\n/*\n * Getter and setter testing.\n */\n\n@Correct(\n name = \"Classroom Getters and Setters\",\n version = \"2022.9.0\",\n author = \"challen@illinois.edu\")\npublic class Classroom {\n private final String name;\n private int capacity;\n\n public Classroom(String setName, int setEnrollment) {\n assert setEnrollment >= 0;\n assert setName != null;\n name = setName;\n capacity = setEnrollment;\n }\n\n public int getCapacity() {\n return capacity;\n }\n\n public void setCapacity(int setEnrollment) {\n assert setEnrollment >= 0;\n capacity = setEnrollment;\n }\n\n public String getName() {\n return name;\n }\n}", - "language": "java", - "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/withgettersandsetters/Classroom.java" - }, - "correct": { - "klass": "Classroom", - "contents": "public class Classroom {\n private final String name;\n private int capacity;\n\n public Classroom(String setName, int setEnrollment) {\n assert setEnrollment >= 0;\n assert setName != null;\n name = setName;\n capacity = setEnrollment;\n }\n\n public int getCapacity() {\n return capacity;\n }\n\n public void setCapacity(int setEnrollment) {\n assert setEnrollment >= 0;\n capacity = setEnrollment;\n }\n\n public String getName() {\n return name;\n }\n}\n", - "language": "java", - "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/withgettersandsetters/Classroom.java", - "complexity": 4, - "features": { - "featureMap": { - "VARIABLE_REASSIGNMENTS": 3, - "COMPARISON_OPERATORS": 3, - "METHOD": 3, - "RETURN": 2, - "CONSTRUCTOR": 1, - "GETTER": 2, - "SETTER": 1, - "STRING": 3, - "NULL": 1, - "CLASS": 1, - "ASSERT": 3, - "VISIBILITY_MODIFIERS": 7, - "FINAL_FIELD": 1 - }, - "importList": [], - "typeList": [ - "String", - "int" - ], - "identifierList": [], - "dottedMethodList": [] - }, - "lineCount": { - "source": 20, - "comment": 0, - "blank": 5 - }, - "expectedDeadCount": 4 - }, - "alternativeSolutions": [], - "incorrect": [], - "common": [], - "importWhitelist": [], - "importBlacklist": [], - "slug": "classroom-getters-and-setters", - "hasKotlin": false, - "published": { - "name": "Classroom Getters and Setters", - "type": "KLASS", - "path": "classroom-getters-and-setters", - "author": "challen@illinois.edu", - "version": "2022.9.0", - "packageName": "com.examples.withgettersandsetters", - "languages": [ - "java" - ], - "descriptions": { - "java": "

Getter and setter testing.

" - }, - "complexity": { - "java": 4 - }, - "features": { - "java": { - "featureMap": { - "VARIABLE_REASSIGNMENTS": 3, - "COMPARISON_OPERATORS": 3, - "METHOD": 3, - "RETURN": 2, - "CONSTRUCTOR": 1, - "GETTER": 2, - "SETTER": 1, - "STRING": 3, - "NULL": 1, - "CLASS": 1, - "ASSERT": 3, - "VISIBILITY_MODIFIERS": 7, - "FINAL_FIELD": 1 - }, - "importList": [], - "typeList": [ - "String", - "int" - ], - "identifierList": [], - "dottedMethodList": [] - } - }, - "lineCounts": { - "java": { - "source": 20, - "comment": 0, - "blank": 5 - } - }, - "templateImports": [] - }, - "fauxStatic": false - }, - "Test Empty Constructor": { - "name": "Test Empty Constructor", + "With Imports": { + "name": "With Imports", "type": "KLASS", "klass": "Question", "metadata": { - "contentHash": "e24f2c0cc57b8104384616c048448b96", - "packageName": "com.examples.withemptyconstructor", - "version": "2022.9.0", + "contentHash": "28944ac134c1b61f898a4d9596831bb7", + "packageName": "com.examples.withimports", + "version": "2022.7.0", "author": "challen@illinois.edu", - "javaDescription": "

Test to make sure we can parse the empty constructor.

", + "javaDescription": "

Example to test use of import statements.

", + "kotlinDescription": "

Test Kotlin top-level method with import statements.

", "usedFiles": [ - "/Users/challen/code/questioner-problems/src/main/java/com/examples/withemptyconstructor/correct/java/emptyconstructor/Question.java" + "/Users/challen/code/questioner-problems/src/main/java/com/examples/withimports/correct/kotlin/Question.kt" ], "templateImports": [], "focused": false @@ -3010,34 +3120,45 @@ "annotatedControls": {}, "question": { "klass": "Question", - "contents": "import edu.illinois.cs.cs125.questioner.lib.Correct;\n\n/*\n * Test to make sure we can parse the empty constructor.\n */\n\n@Correct(name = \"Test Empty Constructor\", version = \"2022.9.0\", author = \"challen@illinois.edu\")\npublic class Question {\n private int value = 0;\n\n int next() {\n return value++;\n }\n}", + "contents": "import edu.illinois.cs.cs125.questioner.lib.Correct;\nimport java.util.Arrays;\nimport java.util.List;\n\n/*\n * Example to test use of import statements.\n */\n\n@Correct(name = \"With Imports\", version = \"2022.7.0\", author = \"challen@illinois.edu\")\npublic class Question {\n public static List max(int first, int second) {\n return Arrays.asList(first, second);\n }\n}", "language": "java", - "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/withemptyconstructor/Question.java" + "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/withimports/Question.java" }, "correct": { "klass": "Question", - "contents": "public class Question {\n private int value = 0;\n\n int next() {\n return value++;\n }\n}\n", + "contents": "import java.util.Arrays;\nimport java.util.List;\n\npublic class Question {\n public static List max(int first, int second) {\n return Arrays.asList(first, second);\n }\n}\n", "language": "java", - "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/withemptyconstructor/Question.java", + "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/withimports/Question.java", "complexity": 1, "features": { "featureMap": { - "VARIABLE_REASSIGNMENTS": 1, - "UNARY_OPERATORS": 1, "METHOD": 1, "RETURN": 1, "CLASS": 1, - "VISIBILITY_MODIFIERS": 2 + "VISIBILITY_MODIFIERS": 2, + "STATIC_METHOD": 1, + "IMPORT": 2, + "BOXING_CLASSES": 1, + "TYPE_PARAMETERS": 1, + "DOT_NOTATION": 1, + "DOTTED_METHOD_CALL": 1 }, - "importList": [], + "importList": [ + "java.util.Arrays", + "java.util.List" + ], "typeList": [ + "List", + "Integer", "int" ], "identifierList": [], - "dottedMethodList": [] + "dottedMethodList": [ + "asList" + ] }, "lineCount": { - "source": 6, + "source": 7, "comment": 0, "blank": 2 }, @@ -3045,79 +3166,140 @@ }, "alternativeSolutions": [ { - "klass": "Question", - "contents": "public class Question {\n private int value;\n\n public Question() {\n value = 0;\n }\n\n int next() {\n return value++;\n }\n}\n", - "language": "java", - "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/withemptyconstructor/correct/java/emptyconstructor/Question.java", - "complexity": 2, + "klass": "QuestionKt", + "contents": "import java.util.Arrays\n\n\nfun max(first: Int, second: Int): List {\n return Arrays.asList(first, second)\n}", + "language": "kotlin", + "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/withimports/correct/kotlin/Question.kt", + "complexity": 1, "features": { "featureMap": { - "VARIABLE_REASSIGNMENTS": 2, - "UNARY_OPERATORS": 1, "METHOD": 1, - "RETURN": 1, - "CONSTRUCTOR": 1, - "CLASS": 1, - "VISIBILITY_MODIFIERS": 3 + "IMPORT": 1, + "DOT_NOTATION": 1, + "DOTTED_METHOD_CALL": 1 }, - "importList": [], - "typeList": [ - "int" + "importList": [ + "java.util.Arrays" ], + "typeList": [], "identifierList": [], - "dottedMethodList": [] + "dottedMethodList": [ + "asList" + ] }, "lineCount": { - "source": 9, + "source": 4, "comment": 0, - "blank": 3 + "blank": 2 + } + } + ], + "incorrect": [], + "common": [], + "importWhitelist": [], + "importBlacklist": [], + "slug": "with-imports", + "kotlinSolution": { + "klass": "QuestionKt", + "contents": "import java.util.Arrays\n\n\nfun max(first: Int, second: Int): List {\n return Arrays.asList(first, second)\n}", + "language": "kotlin", + "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/withimports/correct/kotlin/Question.kt", + "complexity": 1, + "features": { + "featureMap": { + "METHOD": 1, + "IMPORT": 1, + "DOT_NOTATION": 1, + "DOTTED_METHOD_CALL": 1 }, - "expectedDeadCount": 0 + "importList": [ + "java.util.Arrays" + ], + "typeList": [], + "identifierList": [], + "dottedMethodList": [ + "asList" + ] + }, + "lineCount": { + "source": 4, + "comment": 0, + "blank": 2 } - ], - "incorrect": [], - "common": [], - "importWhitelist": [], - "importBlacklist": [], - "slug": "test-empty-constructor", - "hasKotlin": false, + }, + "hasKotlin": true, "published": { - "name": "Test Empty Constructor", + "name": "With Imports", "type": "KLASS", - "path": "test-empty-constructor", + "path": "with-imports", "author": "challen@illinois.edu", - "version": "2022.9.0", - "packageName": "com.examples.withemptyconstructor", + "version": "2022.7.0", + "packageName": "com.examples.withimports", "languages": [ - "java" + "java", + "kotlin" ], "descriptions": { - "java": "

Test to make sure we can parse the empty constructor.

" + "java": "

Example to test use of import statements.

", + "kotlin": "

Test Kotlin top-level method with import statements.

" }, "complexity": { - "java": 1 + "java": 1, + "kotlin": 1 }, "features": { "java": { "featureMap": { - "VARIABLE_REASSIGNMENTS": 1, - "UNARY_OPERATORS": 1, "METHOD": 1, "RETURN": 1, "CLASS": 1, - "VISIBILITY_MODIFIERS": 2 + "VISIBILITY_MODIFIERS": 2, + "STATIC_METHOD": 1, + "IMPORT": 2, + "BOXING_CLASSES": 1, + "TYPE_PARAMETERS": 1, + "DOT_NOTATION": 1, + "DOTTED_METHOD_CALL": 1 }, - "importList": [], + "importList": [ + "java.util.Arrays", + "java.util.List" + ], "typeList": [ + "List", + "Integer", "int" ], "identifierList": [], - "dottedMethodList": [] + "dottedMethodList": [ + "asList" + ] + }, + "kotlin": { + "featureMap": { + "METHOD": 1, + "IMPORT": 1, + "DOT_NOTATION": 1, + "DOTTED_METHOD_CALL": 1 + }, + "importList": [ + "java.util.Arrays" + ], + "typeList": [], + "identifierList": [], + "dottedMethodList": [ + "asList" + ] } }, "lineCounts": { "java": { - "source": 6, + "source": 7, + "comment": 0, + "blank": 2 + }, + "kotlin": { + "source": 4, "comment": 0, "blank": 2 } @@ -3565,187 +3747,5 @@ "templateImports": [] }, "fauxStatic": false - }, - "With Feature Check": { - "name": "With Feature Check", - "type": "METHOD", - "klass": "Question", - "metadata": { - "contentHash": "f53448151d802ca1846e2f5c3475f44d", - "packageName": "com.examples.withfeaturecheck", - "version": "2022.7.0", - "author": "challen@illinois.edu", - "javaDescription": "

Test whether feature checking works.

", - "kotlinDescription": "

For testing features.

", - "usedFiles": [ - "/Users/challen/code/questioner-problems/src/main/java/com/examples/withfeaturecheck/incorrect/java/usesloop/Question.java", - "/Users/challen/code/questioner-problems/src/main/java/com/examples/withfeaturecheck/incorrect/kotlin/usesloop/Question.kt", - "/Users/challen/code/questioner-problems/src/main/java/com/examples/withfeaturecheck/correct/kotlin/Question.kt" - ], - "templateImports": [], - "focused": false - }, - "annotatedControls": {}, - "question": { - "klass": "Question", - "contents": "import edu.illinois.cs.cs125.jeed.core.Features;\nimport edu.illinois.cs.cs125.jenisol.core.BoundComplexity;\nimport edu.illinois.cs.cs125.jenisol.core.FilterParameters;\nimport edu.illinois.cs.cs125.jenisol.core.SkipTest;\nimport edu.illinois.cs.cs125.questioner.lib.CheckFeatures;\nimport edu.illinois.cs.cs125.questioner.lib.Correct;\nimport edu.illinois.cs.cs125.questioner.lib.FeatureCheckException;\nimport edu.illinois.cs.cs125.questioner.lib.Wrap;\nimport edu.illinois.cs.cs125.questioner.lib.features.FeatureHelpers;\nimport java.util.ArrayList;\nimport java.util.List;\n\n/*\n * Test whether feature checking works.\n */\n\n@Correct(name = \"With Feature Check\", author = \"challen@illinois.edu\", version = \"2022.7.0\")\n@Wrap\npublic class Question {\n @FilterParameters\n private static void filterParameters(int range) {\n if (range < 0) {\n throw new SkipTest();\n }\n if (range > 1024) {\n throw new BoundComplexity();\n }\n }\n\n int sumTo(int range) {\n return (range * (range + 1)) / 2;\n }\n\n @CheckFeatures\n private static List checkFeatures(Features solution, Features submission) {\n if (FeatureHelpers.usesLoop(submission)) {\n throw new FeatureCheckException(\"Submission uses a loop\");\n }\n return new ArrayList<>();\n }\n}", - "language": "java", - "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/withfeaturecheck/Question.java" - }, - "correct": { - "klass": "Question", - "contents": "int sumTo(int range) {\n return (range * (range + 1)) / 2;\n}", - "language": "java", - "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/withfeaturecheck/Question.java", - "complexity": 1, - "features": { - "featureMap": { - "ARITHMETIC_OPERATORS": 3, - "METHOD": 1, - "RETURN": 1 - }, - "importList": [], - "typeList": [ - "int" - ], - "identifierList": [], - "dottedMethodList": [] - }, - "lineCount": { - "source": 3, - "comment": 0, - "blank": 0 - }, - "expectedDeadCount": 1 - }, - "alternativeSolutions": [ - { - "klass": "Question", - "contents": "fun sumTo(range: Int): Int {\n return range * (range + 1) / 2\n}", - "language": "kotlin", - "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/withfeaturecheck/correct/kotlin/Question.kt", - "complexity": 1, - "features": { - "featureMap": { - "METHOD": 1 - }, - "importList": [], - "typeList": [], - "identifierList": [], - "dottedMethodList": [] - }, - "lineCount": { - "source": 3, - "comment": 0, - "blank": 0 - } - } - ], - "incorrect": [ - { - "klass": "Question", - "contents": "int sumTo(int range) {\n int sum = 0;\n for (int i = 0; i <= range; i++) {\n sum += i;\n }\n return sum;\n}", - "reason": "FEATURES", - "language": "java", - "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/withfeaturecheck/incorrect/java/usesloop/Question.java", - "starter": false, - "needed": true - }, - { - "klass": "Question", - "contents": "fun sumTo(range: Int): Int {\n var sum = 0\n (0..range).forEach { i ->\n sum += i\n }\n return sum\n}", - "reason": "FEATURES", - "language": "kotlin", - "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/withfeaturecheck/incorrect/kotlin/usesloop/Question.kt", - "starter": false, - "needed": true - } - ], - "common": [], - "javaTemplate": "public class Question {\n {{{ contents }}}\n}", - "kotlinTemplate": "class Question {\n {{{ contents }}}\n}", - "importWhitelist": [], - "importBlacklist": [], - "slug": "with-feature-check", - "kotlinSolution": { - "klass": "Question", - "contents": "fun sumTo(range: Int): Int {\n return range * (range + 1) / 2\n}", - "language": "kotlin", - "path": "/Users/challen/code/questioner-problems/src/main/java/com/examples/withfeaturecheck/correct/kotlin/Question.kt", - "complexity": 1, - "features": { - "featureMap": { - "METHOD": 1 - }, - "importList": [], - "typeList": [], - "identifierList": [], - "dottedMethodList": [] - }, - "lineCount": { - "source": 3, - "comment": 0, - "blank": 0 - } - }, - "hasKotlin": true, - "published": { - "name": "With Feature Check", - "type": "METHOD", - "path": "with-feature-check", - "author": "challen@illinois.edu", - "version": "2022.7.0", - "packageName": "com.examples.withfeaturecheck", - "languages": [ - "java", - "kotlin" - ], - "descriptions": { - "java": "

Test whether feature checking works.

", - "kotlin": "

For testing features.

" - }, - "complexity": { - "java": 1, - "kotlin": 1 - }, - "features": { - "java": { - "featureMap": { - "ARITHMETIC_OPERATORS": 3, - "METHOD": 1, - "RETURN": 1 - }, - "importList": [], - "typeList": [ - "int" - ], - "identifierList": [], - "dottedMethodList": [] - }, - "kotlin": { - "featureMap": { - "METHOD": 1 - }, - "importList": [], - "typeList": [], - "identifierList": [], - "dottedMethodList": [] - } - }, - "lineCounts": { - "java": { - "source": 3, - "comment": 0, - "blank": 0 - }, - "kotlin": { - "source": 3, - "comment": 0, - "blank": 0 - } - }, - "templateImports": [] - }, - "fauxStatic": false } } \ No newline at end of file diff --git a/plugin/build.gradle.kts b/plugin/build.gradle.kts index ded1ae2..357ff11 100644 --- a/plugin/build.gradle.kts +++ b/plugin/build.gradle.kts @@ -24,7 +24,7 @@ dependencies { implementation("com.github.slugify:slugify:3.0.2") implementation("org.apache.httpcomponents.client5:httpclient5-fluent:5.1.3") - testImplementation("io.kotest:kotest-runner-junit5:5.4.2") + testImplementation("io.kotest:kotest-runner-junit5:5.5.1") } tasks.compileKotlin { dependsOn(tasks.generateGrammarSource) diff --git a/server/build.gradle.kts b/server/build.gradle.kts index e037fbd..3b476b6 100644 --- a/server/build.gradle.kts +++ b/server/build.gradle.kts @@ -25,8 +25,8 @@ dependencies { implementation("org.mongodb:mongodb-driver:3.12.11") implementation("org.slf4j:slf4j-api:2.0.3") - implementation("ch.qos.logback:logback-classic:1.4.3") - implementation("io.github.microutils:kotlin-logging:3.0.0") + implementation("ch.qos.logback:logback-classic:1.4.4") + implementation("io.github.microutils:kotlin-logging:3.0.2") } task("createProperties") { doLast { diff --git a/server/src/main/resources/edu.illinois.cs.cs125.questioner.server.version b/server/src/main/resources/edu.illinois.cs.cs125.questioner.server.version index ead55ee..bbd5a11 100644 --- a/server/src/main/resources/edu.illinois.cs.cs125.questioner.server.version +++ b/server/src/main/resources/edu.illinois.cs.cs125.questioner.server.version @@ -1 +1 @@ -version=2022.10.2 \ No newline at end of file +version=2022.10.3 \ No newline at end of file