-
Notifications
You must be signed in to change notification settings - Fork 5
Haskell Syntax Test and Haskell Runtime Test for Common Error Clustering #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: commonerrors
Are you sure you want to change the base?
Changes from 25 commits
7e38df1
051b48a
bab09b9
580aafc
b2d66ff
f347855
35d7c95
d8c08be
92641b0
4a3f9b0
4376465
6f8a20c
6194b25
022f645
762b853
389035c
b9865a1
bcc716a
3f47574
a60dfe6
cdf93b3
ee20e7b
8e50e4d
76c7d6b
442748f
8716465
402f094
cded4cf
63825f7
97596a4
474b947
677b2d4
5bf8441
0ef83d9
bc44843
aab38fc
cb66082
fc6d40e
9e9a815
7f37f75
6eb0067
f1a7458
9bc3210
b22eb12
235106c
fa8799c
a73f8eb
21fc4c7
b750f35
95db938
085e422
55f217e
53a191f
4e6106e
2aced1f
4078a68
bcaf82c
bf76a20
179a56e
cb73c2e
b929062
975a2a6
37ef4a1
62d26e2
a8ade07
6a71005
4e5a006
0d89dc9
7cf187b
2751db8
063a0a4
c00b5c4
3b868a1
663bd90
c2cc6c5
6acde5e
6ba3589
12da235
624b0ea
a01d832
f3f76c8
4003f8e
3cbeef4
8e773be
13ad123
5465d33
b1327e7
24704be
390106b
9f6d7f0
6b84098
e21228c
1518302
a21b614
153de00
f708c7c
e503f1d
5c8bd61
315023e
0662488
0c44a58
bcc1eff
7036aa8
60eada5
407fc6d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| /* | ||
| * Copyright 2025 Sven Strickroth <[email protected]> | ||
| * Copyright 2025 Christian Wagner <[email protected]> | ||
| * | ||
| * This file is part of the GATE. | ||
| * | ||
| * GATE is free software: you can redistribute it and/or modify | ||
| * it under the terms of the GNU General Public License version 3 as | ||
| * published by the Free Software Foundation. | ||
| * | ||
| * GATE is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| * GNU General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU General Public License | ||
| * along with GATE. If not, see <http://www.gnu.org/licenses/>. | ||
| */ | ||
|
|
||
| package de.tuclausthal.submissioninterface.persistence.datamodel; | ||
|
|
||
| import de.tuclausthal.submissioninterface.testframework.tests.AbstractTest; | ||
| import jakarta.persistence.Entity; | ||
| import jakarta.persistence.Transient; | ||
|
|
||
|
|
||
| /** | ||
| * Haskell runtime test, extends the DockerTest by automatically generating haskell testcases and by clustering | ||
| * @author Christian Wagner | ||
| */ | ||
| @Entity | ||
| public class HaskellRuntimeTest extends DockerTest { | ||
| @Override | ||
| @Transient | ||
| public AbstractTest<DockerTest> getTestImpl() { | ||
| return new de.tuclausthal.submissioninterface.testframework.tests.impl.HaskellRuntimeTest(this); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| /* | ||
| * Copyright 2025 Sven Strickroth <[email protected]> | ||
| * Copyright 2025 Esat Avci <[email protected]> | ||
| * | ||
| * This file is part of the GATE. | ||
| * | ||
| * GATE is free software: you can redistribute it and/or modify | ||
| * it under the terms of the GNU General Public License version 3 as | ||
| * published by the Free Software Foundation. | ||
| * | ||
| * GATE is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| * GNU General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU General Public License | ||
| * along with GATE. If not, see <http://www.gnu.org/licenses/>. | ||
| */ | ||
| package de.tuclausthal.submissioninterface.persistence.datamodel; | ||
|
|
||
| import jakarta.persistence.Entity; | ||
| import jakarta.persistence.Transient; | ||
|
|
||
|
|
||
| import de.tuclausthal.submissioninterface.testframework.tests.AbstractTest; | ||
|
|
||
| @Entity | ||
| public class HaskellSyntaxTest extends DockerTest { | ||
| @Override | ||
| @Transient | ||
| public AbstractTest<DockerTest> getTestImpl() { | ||
| return new de.tuclausthal.submissioninterface.testframework.tests.impl.HaskellSyntaxTest(this); | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| /* | ||
| * Copyright 2025 Sven Strickroth <[email protected]> | ||
| * Copyright 2025 Christian Wagner <[email protected]> | ||
| * | ||
| * This file is part of the GATE. | ||
| * | ||
| * GATE is free software: you can redistribute it and/or modify | ||
| * it under the terms of the GNU General Public License version 3 as | ||
| * published by the Free Software Foundation. | ||
| * | ||
| * GATE is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| * GNU General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU General Public License | ||
| * along with GATE. If not, see <http://www.gnu.org/licenses/>. | ||
| */ | ||
|
|
||
| package de.tuclausthal.submissioninterface.servlets.controller; | ||
|
|
||
| import de.tuclausthal.submissioninterface.servlets.GATEController; | ||
| import jakarta.servlet.ServletException; | ||
| import jakarta.servlet.http.HttpServlet; | ||
| import jakarta.servlet.http.HttpServletRequest; | ||
| import jakarta.servlet.http.HttpServletResponse; | ||
|
|
||
| import java.io.IOException; | ||
| import java.io.Serial; | ||
|
|
||
| /** | ||
| * Controller-Servlet for clustering haskell submissions based on common errors (dynamic/runtime analysis). | ||
| * This servlet allows advisors to manage (add, edit, remove) test steps. | ||
| * | ||
| * @author Christian Wagner | ||
| */ | ||
| @GATEController | ||
| public class HaskellRuntimeTestManager extends HttpServlet { | ||
| @Serial | ||
| private static final long serialVersionUID = 1L; | ||
|
|
||
| @Override | ||
| public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { | ||
| getServletContext().getNamedDispatcher(DockerTestManager.class.getSimpleName()).forward(request, response); | ||
|
||
| } | ||
|
|
||
| @Override | ||
| public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { | ||
| getServletContext().getNamedDispatcher(DockerTestManager.class.getSimpleName()).forward(request, response); | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,6 +41,8 @@ | |
| import de.tuclausthal.submissioninterface.persistence.datamodel.CommentsMetricTest; | ||
| import de.tuclausthal.submissioninterface.persistence.datamodel.CompileTest; | ||
| import de.tuclausthal.submissioninterface.persistence.datamodel.DockerTest; | ||
| import de.tuclausthal.submissioninterface.persistence.datamodel.HaskellSyntaxTest; | ||
| import de.tuclausthal.submissioninterface.persistence.datamodel.HaskellRuntimeTest; | ||
| import de.tuclausthal.submissioninterface.persistence.datamodel.JUnitTest; | ||
| import de.tuclausthal.submissioninterface.persistence.datamodel.JavaAdvancedIOTest; | ||
| import de.tuclausthal.submissioninterface.persistence.datamodel.Participation; | ||
|
|
@@ -153,6 +155,28 @@ public void doPost(HttpServletRequest request, HttpServletResponse response) thr | |
| test.setPreparationShellCode(preparationcode.replaceAll("\r\n", "\n")); | ||
| session.getTransaction().commit(); | ||
| response.sendRedirect(Util.generateRedirectURL(DockerTestManager.class.getSimpleName() + "?testid=" + test.getId(), response)); | ||
| } else if ("saveNewTest".equals(request.getParameter("action")) && "haskellsyntax".equals(request.getParameter("type"))) { | ||
| session.beginTransaction(); | ||
| TestDAOIf testDAO = DAOFactory.TestDAOIf(session); | ||
| HaskellSyntaxTest test = testDAO.createHaskellSyntaxTest(task); | ||
|
|
||
| int timesRunnableByStudents = Util.parseInteger(request.getParameter("timesRunnableByStudents"), 0); | ||
| boolean tutortest = request.getParameter("tutortest") != null; | ||
| String title = request.getParameter("title"); | ||
| String description = request.getParameter("description"); | ||
|
|
||
| test.setTimesRunnableByStudents(timesRunnableByStudents); | ||
| test.setForTutors(tutortest); | ||
| test.setTestTitle(title); | ||
| test.setTestDescription(description); | ||
| test.setGiveDetailsToStudents(request.getParameter("giveDetailsToStudents") != null); | ||
| test.setTimeout(15); // falls du es trotzdem festlegen willst | ||
C8R15T14N marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| session.getTransaction().commit(); | ||
|
|
||
| // Zurück zur Aufgabenübersicht (wie bei CompileTest) | ||
| response.sendRedirect(Util.generateRedirectURL(TaskManager.class.getSimpleName() | ||
| + "?action=editTask&lecture=" + task.getTaskGroup().getLecture().getId() | ||
| + "&taskid=" + task.getTaskid(), response)); | ||
|
||
| } else if ("saveNewTest".equals(request.getParameter("action")) && "checklist".equals(request.getParameter("type"))) { | ||
| session.beginTransaction(); | ||
| TestDAOIf testDAO = DAOFactory.TestDAOIf(session); | ||
|
|
@@ -272,6 +296,27 @@ public void doPost(HttpServletRequest request, HttpServletResponse response) thr | |
| test.setGiveDetailsToStudents(request.getParameter("giveDetailsToStudents") != null); | ||
| session.getTransaction().commit(); | ||
| response.sendRedirect(Util.generateRedirectURL(TaskManager.class.getSimpleName() + "?action=editTask&lecture=" + task.getTaskGroup().getLecture().getId() + "&taskid=" + task.getTaskid(), response)); | ||
| } else if ("saveNewTest".equals(request.getParameter("action")) && "haskellruntime".equals(request.getParameter("type"))) { | ||
| // TODO@CHW: make sure all parameters accessed by request.getParameter() are defined in HaskellRuntimeTestManagerView | ||
|
|
||
| session.beginTransaction(); | ||
| TestDAOIf testDAO = DAOFactory.TestDAOIf(session); | ||
|
|
||
| HaskellRuntimeTest test = testDAO.createHaskellRuntimeTest(task); | ||
| test.setTimesRunnableByStudents(Util.parseInteger(request.getParameter("timesRunnableByStudents"), 0)); | ||
| test.setForTutors(request.getParameter("tutortest") != null); | ||
| test.setTestTitle(request.getParameter("title")); | ||
| test.setTestDescription(request.getParameter("description")); | ||
| test.setTimeout(Util.parseInteger(request.getParameter("timeout"), 15)); | ||
| test.setGiveDetailsToStudents(request.getParameter("giveDetailsToStudents") != null); | ||
| String preparationCode = request.getParameter("preparationcode"); | ||
| if (preparationCode == null) preparationCode = ""; | ||
| test.setPreparationShellCode( | ||
| preparationCode.replaceAll("\r\n", "\n") | ||
| ); | ||
|
|
||
| session.getTransaction().commit(); | ||
| response.sendRedirect(Util.generateRedirectURL(HaskellRuntimeTestManager.class.getSimpleName() + "?testid=" + test.getId(), response)); | ||
| } else if ("deleteTest".equals(request.getParameter("action"))) { | ||
| TestDAOIf testDAO = DAOFactory.TestDAOIf(session); | ||
| session.beginTransaction(); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.