diff --git a/.github/issue-labeler.yml b/.github/issue-labeler.yml index 34ca1e28321c..8fc424b1e785 100644 --- a/.github/issue-labeler.yml +++ b/.github/issue-labeler.yml @@ -111,7 +111,6 @@ programming: - build plan - code hint - \b(? -
LocalCIBuildJobQueueItem
id: String
name: String
buildAgentAddress: String
participationId: long
courseId: long
exerciseId: long
retryCount: int
priority: int
status: BuildJobResult
RepositoryInfo
repositoryName: String
repositoryType: RepositoryType
triggeredByPushTo: RepositoryType
assignmentRepositoryUri: String
testRepositoryUri: String
solutionRepositoryUri: String
auxiliaryRepositoryUris: String []
auxiliaryRepositoryCheckoutDirectories: String []
<<Enumeration>>
BuildJobResult
SUCCESSFUL
FAILED
CANCELLED
<<Enumeration>>
RepositoryType
TEMPLATE
SOLUTION
TESTS
AUXILIARY
USER
JobTimingInfo
submissionDate: ZonedDateTime
buildStartDate: ZonedDateTime
buildCompletionDate: ZonedDateTime
1
BuildConfig
buildScript: String
dockerImage: String
commitHash: String
commitHash: String
branch: String
programmingLanguage: ProgrammingLanguage
projectType: ProjectType
scaEnabled: boolean
sequentialTestRunsEnabled: boolean
testwiseCoverageEnabled: boolean
resultPaths: String []
1
1
\ No newline at end of file +
LocalCIBuildJobQueueItem
id: String
name: String
buildAgentAddress: String
participationId: long
courseId: long
exerciseId: long
retryCount: int
priority: int
status: BuildJobResult
RepositoryInfo
repositoryName: String
repositoryType: RepositoryType
triggeredByPushTo: RepositoryType
assignmentRepositoryUri: String
testRepositoryUri: String
solutionRepositoryUri: String
auxiliaryRepositoryUris: String []
auxiliaryRepositoryCheckoutDirectories: String []
<<Enumeration>>
BuildJobResult
SUCCESSFUL
FAILED
CANCELLED
<<Enumeration>>
RepositoryType
TEMPLATE
SOLUTION
TESTS
AUXILIARY
USER
JobTimingInfo
submissionDate: ZonedDateTime
buildStartDate: ZonedDateTime
buildCompletionDate: ZonedDateTime
1
BuildConfig
buildScript: String
dockerImage: String
commitHash: String
commitHash: String
branch: String
programmingLanguage: ProgrammingLanguage
projectType: ProjectType
scaEnabled: boolean
sequentialTestRunsEnabled: boolean
resultPaths: String []
1
1
diff --git a/docs/user/exercises/programming-exercise-features.inc b/docs/user/exercises/programming-exercise-features.inc index edf413fd5d99..9f43f5a1847f 100644 --- a/docs/user/exercises/programming-exercise-features.inc +++ b/docs/user/exercises/programming-exercise-features.inc @@ -52,41 +52,41 @@ Instructors can still use those templates to generate programming exercises and In case a feature has different support for different continuous integration systems, the table shows the differences between Local CI **(L)** and Jenkins **(J)**. (Note that Gitlab CI is experimental and therefore has a limited set of features which are not mentioned here to keep the overview simpler.) - +----------------------+----------------------+----------------------+---------------------+--------------+------------------------------------------+------------------------------+----------------------------+------------------------+ - | Programming Language | Sequential Test Runs | Static Code Analysis | Plagiarism Check | Package Name | Project Type | Solution Repository Checkout | Testwise Coverage Analysis | Auxiliary repositories | - +======================+======================+======================+=====================+==============+==========================================+==============================+============================+========================+ - | Java | yes | yes | yes | yes | Gradle, Maven, J: `DejaGnu`_ | no | J: yes; L: no | L: yes, J: no | - +----------------------+----------------------+----------------------+---------------------+--------------+------------------------------------------+------------------------------+----------------------------+------------------------+ - | Python | L: yes; J: no | no | yes | no | n/a | no | no | L: yes, J: no | - +----------------------+----------------------+----------------------+---------------------+--------------+------------------------------------------+------------------------------+----------------------------+------------------------+ - | C | no | L: yes; J: no | yes | no | FACT, GCC | no | no | L: yes, J: no | - +----------------------+----------------------+----------------------+---------------------+--------------+------------------------------------------+------------------------------+----------------------------+------------------------+ - | C (FACT framework) | no | L: yes; J: no | yes | no | n/a | no | no | L: yes, J: no | - +----------------------+----------------------+----------------------+---------------------+--------------+------------------------------------------+------------------------------+----------------------------+------------------------+ - | Haskell | L: yes; J: no | no | no | no | n/a | L: yes; J: no | no | L: yes, J: no | - +----------------------+----------------------+----------------------+---------------------+--------------+------------------------------------------+------------------------------+----------------------------+------------------------+ - | Kotlin | yes | no | yes | yes | n/a | no | J: yes; L: no | L: yes, J: no | - +----------------------+----------------------+----------------------+---------------------+--------------+------------------------------------------+------------------------------+----------------------------+------------------------+ - | VHDL | no | no | no | no | n/a | no | no | L: yes, J: no | - +----------------------+----------------------+----------------------+---------------------+--------------+------------------------------------------+------------------------------+----------------------------+------------------------+ - | Assembler | no | no | no | no | n/a | no | no | L: yes, J: no | - +----------------------+----------------------+----------------------+---------------------+--------------+------------------------------------------+------------------------------+----------------------------+------------------------+ - | Swift | no | yes | yes | yes | Plain (Xcode: not supported) | no | no | L: yes, J: no | - +----------------------+----------------------+----------------------+---------------------+--------------+------------------------------------------+------------------------------+----------------------------+------------------------+ - | OCaml | no | no | no | no | n/a | yes | no | L: yes, J: no | - +----------------------+----------------------+----------------------+---------------------+--------------+------------------------------------------+------------------------------+----------------------------+------------------------+ - | Rust | no | no | yes | no | n/a | no | no | L: yes, J: no | - +----------------------+----------------------+----------------------+---------------------+--------------+------------------------------------------+------------------------------+----------------------------+------------------------+ - | JavaScript | no | no | yes | no | n/a | no | no | L: yes, J: no | - +----------------------+----------------------+----------------------+---------------------+--------------+------------------------------------------+------------------------------+----------------------------+------------------------+ - | R | no | no | yes | no | n/a | no | no | L: yes, J: no | - +----------------------+----------------------+----------------------+---------------------+--------------+------------------------------------------+------------------------------+----------------------------+------------------------+ - | C++ | no | no | yes | no | n/a | no | no | L: yes, J: no | - +----------------------+----------------------+----------------------+---------------------+--------------+------------------------------------------+------------------------------+----------------------------+------------------------+ - | TypeScript | no | no | yes | no | n/a | no | no | L: yes, J: no | - +----------------------+----------------------+----------------------+---------------------+--------------+------------------------------------------+------------------------------+----------------------------+------------------------+ - | C# | no | no | yes | no | n/a | no | no | L: yes, J: no | - +----------------------+----------------------+----------------------+---------------------+--------------+------------------------------------------+------------------------------+----------------------------+------------------------+ + +----------------------+----------------------+----------------------+---------------------+--------------+------------------------------------------+------------------------------+------------------------+ + | Programming Language | Sequential Test Runs | Static Code Analysis | Plagiarism Check | Package Name | Project Type | Solution Repository Checkout | Auxiliary repositories | + +======================+======================+======================+=====================+==============+==========================================+==============================+========================+ + | Java | yes | yes | yes | yes | Gradle, Maven, J: `DejaGnu`_ | no | L: yes, J: no | + +----------------------+----------------------+----------------------+---------------------+--------------+------------------------------------------+------------------------------+------------------------+ + | Python | L: yes; J: no | no | yes | no | n/a | no | L: yes, J: no | + +----------------------+----------------------+----------------------+---------------------+--------------+------------------------------------------+------------------------------+------------------------+ + | C | no | L: yes; J: no | yes | no | FACT, GCC | no | L: yes, J: no | + +----------------------+----------------------+----------------------+---------------------+--------------+------------------------------------------+------------------------------+------------------------+ + | C (FACT framework) | no | L: yes; J: no | yes | no | n/a | no | L: yes, J: no | + +----------------------+----------------------+----------------------+---------------------+--------------+------------------------------------------+------------------------------+------------------------+ + | Haskell | L: yes; J: no | no | no | no | n/a | L: yes; J: no | L: yes, J: no | + +----------------------+----------------------+----------------------+---------------------+--------------+------------------------------------------+------------------------------+------------------------+ + | Kotlin | yes | no | yes | yes | n/a | no | L: yes, J: no | + +----------------------+----------------------+----------------------+---------------------+--------------+------------------------------------------+------------------------------+------------------------+ + | VHDL | no | no | no | no | n/a | no | L: yes, J: no | + +----------------------+----------------------+----------------------+---------------------+--------------+------------------------------------------+------------------------------+------------------------+ + | Assembler | no | no | no | no | n/a | no | L: yes, J: no | + +----------------------+----------------------+----------------------+---------------------+--------------+------------------------------------------+------------------------------+------------------------+ + | Swift | no | yes | yes | yes | Plain (Xcode: not supported) | no | L: yes, J: no | + +----------------------+----------------------+----------------------+---------------------+--------------+------------------------------------------+------------------------------+------------------------+ + | OCaml | no | no | no | no | n/a | yes | L: yes, J: no | + +----------------------+----------------------+----------------------+---------------------+--------------+------------------------------------------+------------------------------+------------------------+ + | Rust | no | no | yes | no | n/a | no | L: yes, J: no | + +----------------------+----------------------+----------------------+---------------------+--------------+------------------------------------------+------------------------------+------------------------+ + | JavaScript | no | no | yes | no | n/a | no | L: yes, J: no | + +----------------------+----------------------+----------------------+---------------------+--------------+------------------------------------------+------------------------------+------------------------+ + | R | no | no | yes | no | n/a | no | L: yes, J: no | + +----------------------+----------------------+----------------------+---------------------+--------------+------------------------------------------+------------------------------+------------------------+ + | C++ | no | no | yes | no | n/a | no | L: yes, J: no | + +----------------------+----------------------+----------------------+---------------------+--------------+------------------------------------------+------------------------------+------------------------+ + | TypeScript | no | no | yes | no | n/a | no | L: yes, J: no | + +----------------------+----------------------+----------------------+---------------------+--------------+------------------------------------------+------------------------------+------------------------+ + | C# | no | no | yes | no | n/a | no | L: yes, J: no | + +----------------------+----------------------+----------------------+---------------------+--------------+------------------------------------------+------------------------------+------------------------+ - *Sequential Test Runs*: ``Artemis`` can generate a build plan which first executes structural and then behavioral tests. This feature can help students to better concentrate on the immediate challenge at hand. - *Static Code Analysis*: ``Artemis`` can generate a build plan which additionally executes static code analysis tools. @@ -94,8 +94,6 @@ Instructors can still use those templates to generate programming exercises and - *Plagiarism Checks*: ``Artemis`` is able to automatically calculate the similarity between student submissions. A side-by-side view of similar submissions is available to confirm the plagiarism suspicion. - *Package Name*: A package name has to be provided - *Solution Repository Checkout*: Instructors are able to compare a student submission against a sample solution in the solution repository - - *Testwise Coverage Analysis*: ``Artemis`` can generate a build plan which additionally executes a testwise coverage analysis. - ``Artemis`` aggregates the recorded data into different metrics. This feature allows instructors to check which code in the solution submission is how often executed by the test cases. .. note:: Only some ``templates`` for ``LocalCI`` support ``Sequential Test Runs`` at the moment. @@ -103,9 +101,6 @@ Instructors can still use those templates to generate programming exercises and .. note:: Static Code Analysis for ``C`` exercises is only supported for ``LocalCI`` at the moment. -.. note:: - Testwise Coverage Analysis is currently not supported, but will be again supported in future versions. - .. note:: Instructors are still able to extend the generated programming exercises with additional features that are not available in one specific template. diff --git a/docs/user/exercises/programming-exercise-setup.inc b/docs/user/exercises/programming-exercise-setup.inc index 563f65f48361..b95420105763 100644 --- a/docs/user/exercises/programming-exercise-setup.inc +++ b/docs/user/exercises/programming-exercise-setup.inc @@ -106,9 +106,6 @@ Generate programming exercise - **Sequential Test Runs:** Activate this option to first run structural and then behavior tests. This feature allows students to better concentrate on the immediate challenge at hand. Not supported together with static code analysis. Cannot be changed after the exercise creation. - - **Record Testwise Coverage:** Activate this option to record the testwise coverage for the solution repository. - This is necessary when working with Hestia to generate code-based hints. - This option is only available for Java/Kotlin-exercises with non-sequential test runs. - **Customize Build Plan** Activate this option if you want to customize the build plan of your exercise. This feature is available for all programming languages, and works with LocalCI and Jenkins, Artemis provides templates for the build plan configuration. The build plan can also be customized after the exercise creation. diff --git a/jest.config.js b/jest.config.js index 8f3838cd5088..5a030f2024e8 100644 --- a/jest.config.js +++ b/jest.config.js @@ -99,7 +99,6 @@ module.exports = { 'src/main/webapp/app/exercises/file-upload/manage/file-upload-exercise-management.route.ts', 'src/main/webapp/app/exercises/modeling/manage/modeling-exercise.route.ts', 'src/main/webapp/app/exam/manage/exam-management.route.ts', - 'src/main/webapp/app/exercises/shared/exercise-hint/manage/exercise-hint.route.ts', 'src/main/webapp/app/core/config/prod.config.ts', ], coverageThreshold: { diff --git a/src/main/java/de/tum/cit/aet/artemis/assessment/domain/Feedback.java b/src/main/java/de/tum/cit/aet/artemis/assessment/domain/Feedback.java index de095b019216..c07579401ff0 100644 --- a/src/main/java/de/tum/cit/aet/artemis/assessment/domain/Feedback.java +++ b/src/main/java/de/tum/cit/aet/artemis/assessment/domain/Feedback.java @@ -79,7 +79,7 @@ public class Feedback extends DomainObject { * null if the feedback was not created by an automatic test case. */ @ManyToOne(fetch = FetchType.LAZY) - @JsonIgnoreProperties({ "tasks", "solutionEntries", "exercise", "coverageEntries" }) + @JsonIgnoreProperties({ "tasks", "exercise" }) private ProgrammingExerciseTestCase testCase; /** diff --git a/src/main/java/de/tum/cit/aet/artemis/buildagent/dto/BuildResult.java b/src/main/java/de/tum/cit/aet/artemis/buildagent/dto/BuildResult.java index f8fec009f4b9..f6fd15b1b115 100644 --- a/src/main/java/de/tum/cit/aet/artemis/buildagent/dto/BuildResult.java +++ b/src/main/java/de/tum/cit/aet/artemis/buildagent/dto/BuildResult.java @@ -3,7 +3,6 @@ import java.io.Serializable; import java.time.ZonedDateTime; import java.util.ArrayList; -import java.util.Collections; import java.util.List; import org.springframework.util.ObjectUtils; @@ -16,7 +15,6 @@ import de.tum.cit.aet.artemis.programming.dto.BuildJobDTOInterface; import de.tum.cit.aet.artemis.programming.dto.StaticCodeAnalysisReportDTO; import de.tum.cit.aet.artemis.programming.dto.TestCaseBaseDTO; -import de.tum.cit.aet.artemis.programming.service.ci.notification.dto.TestwiseCoverageReportDTO; /** * Represents all the information returned by the local CI system about a build. @@ -148,12 +146,6 @@ public List getStaticCodeAnalysisReports() { return staticCodeAnalysisReports; } - @Override - public List getTestwiseCoverageReports() { - // TODO LOCALVC_CI: Implement testwise coverage and return the reports here. - return Collections.emptyList(); - } - /** * Represents all the information returned by the local CI system about a job. * In the current implementation of local CI, there is always one job per build. diff --git a/src/main/java/de/tum/cit/aet/artemis/programming/domain/ProgrammingExerciseTestCaseType.java b/src/main/java/de/tum/cit/aet/artemis/programming/domain/ProgrammingExerciseTestCaseType.java index e181cd942c52..3996ca815ec5 100644 --- a/src/main/java/de/tum/cit/aet/artemis/programming/domain/ProgrammingExerciseTestCaseType.java +++ b/src/main/java/de/tum/cit/aet/artemis/programming/domain/ProgrammingExerciseTestCaseType.java @@ -14,7 +14,7 @@ public enum ProgrammingExerciseTestCaseType { */ BEHAVIORAL, /** - * Type for all programming exercises not supported by Hestia + * All other types */ DEFAULT, } diff --git a/src/main/java/de/tum/cit/aet/artemis/programming/dto/AbstractBuildResultNotificationDTO.java b/src/main/java/de/tum/cit/aet/artemis/programming/dto/AbstractBuildResultNotificationDTO.java index 9435fdf8e463..89c9dc705d65 100644 --- a/src/main/java/de/tum/cit/aet/artemis/programming/dto/AbstractBuildResultNotificationDTO.java +++ b/src/main/java/de/tum/cit/aet/artemis/programming/dto/AbstractBuildResultNotificationDTO.java @@ -11,7 +11,6 @@ import de.tum.cit.aet.artemis.exercise.domain.SubmissionType; import de.tum.cit.aet.artemis.programming.domain.build.BuildLogEntry; -import de.tum.cit.aet.artemis.programming.service.ci.notification.dto.TestwiseCoverageReportDTO; @JsonIgnoreProperties(ignoreUnknown = true) @JsonInclude(JsonInclude.Include.NON_EMPTY) @@ -71,11 +70,4 @@ else if (submissionType.equals(SubmissionType.TEST)) { * @return list of static code analysis reports. */ public abstract List getStaticCodeAnalysisReports(); - - /** - * Gets the test-wise coverage reports that are part of the build result. - * - * @return list of test-wise coverage reports. - */ - public abstract List getTestwiseCoverageReports(); } diff --git a/src/main/java/de/tum/cit/aet/artemis/programming/repository/ProgrammingExerciseRepository.java b/src/main/java/de/tum/cit/aet/artemis/programming/repository/ProgrammingExerciseRepository.java index 5106a95aa016..96c67b474e4a 100644 --- a/src/main/java/de/tum/cit/aet/artemis/programming/repository/ProgrammingExerciseRepository.java +++ b/src/main/java/de/tum/cit/aet/artemis/programming/repository/ProgrammingExerciseRepository.java @@ -311,11 +311,9 @@ default ProgrammingExercise findOneByProjectKeyOrThrow(String projectKey, boolea FROM ProgrammingExercise p LEFT JOIN FETCH p.testCases tc LEFT JOIN FETCH p.staticCodeAnalysisCategories - LEFT JOIN FETCH p.exerciseHints LEFT JOIN FETCH p.templateParticipation LEFT JOIN FETCH p.solutionParticipation LEFT JOIN FETCH p.auxiliaryRepositories - LEFT JOIN FETCH tc.solutionEntries LEFT JOIN FETCH p.buildConfig WHERE p.id = :exerciseId """) @@ -327,11 +325,9 @@ Optional findByIdWithEagerTestCasesStaticCodeAnalysisCatego FROM ProgrammingExercise p LEFT JOIN FETCH p.testCases tc LEFT JOIN FETCH p.staticCodeAnalysisCategories - LEFT JOIN FETCH p.exerciseHints LEFT JOIN FETCH p.templateParticipation LEFT JOIN FETCH p.solutionParticipation LEFT JOIN FETCH p.auxiliaryRepositories - LEFT JOIN FETCH tc.solutionEntries LEFT JOIN FETCH p.buildConfig WHERE p.id = :exerciseId """) @@ -343,11 +339,9 @@ Optional findByIdWithEagerBuildConfigTestCasesStaticCodeAna FROM ProgrammingExercise p LEFT JOIN FETCH p.testCases tc LEFT JOIN FETCH p.staticCodeAnalysisCategories - LEFT JOIN FETCH p.exerciseHints LEFT JOIN FETCH p.templateParticipation LEFT JOIN FETCH p.solutionParticipation LEFT JOIN FETCH p.auxiliaryRepositories - LEFT JOIN FETCH tc.solutionEntries LEFT JOIN FETCH p.buildConfig LEFT JOIN FETCH p.plagiarismDetectionConfig WHERE p.id = :exerciseId diff --git a/src/main/java/de/tum/cit/aet/artemis/programming/repository/ProgrammingExerciseTaskRepository.java b/src/main/java/de/tum/cit/aet/artemis/programming/repository/ProgrammingExerciseTaskRepository.java index 9e1050a4744a..ef567edf3fee 100644 --- a/src/main/java/de/tum/cit/aet/artemis/programming/repository/ProgrammingExerciseTaskRepository.java +++ b/src/main/java/de/tum/cit/aet/artemis/programming/repository/ProgrammingExerciseTaskRepository.java @@ -46,7 +46,6 @@ default List findByExerciseIdWithTestCaseAndSolutionEnt SELECT t FROM ProgrammingExerciseTask t LEFT JOIN FETCH t.testCases tc - LEFT JOIN FETCH tc.solutionEntries WHERE t.exercise.id = :exerciseId AND tc.exercise.id = :exerciseId """) @@ -62,17 +61,7 @@ default List findByExerciseIdWithTestCaseAndSolutionEnt SELECT t FROM ProgrammingExerciseTask t LEFT JOIN FETCH t.testCases tc - LEFT JOIN FETCH tc.solutionEntries WHERE t.exercise.id = :exerciseId """) Set findByExerciseIdWithTestCases(@Param("exerciseId") Long exerciseId); - - @Query(""" - SELECT pt - FROM ProgrammingExerciseTask pt - LEFT JOIN FETCH pt.exerciseHints h - LEFT JOIN FETCH pt.testCases tc - WHERE h.id = :codeHintId - """) - Optional findByCodeHintIdWithTestCases(@Param("codeHintId") Long codeHintId); } diff --git a/src/main/java/de/tum/cit/aet/artemis/programming/repository/ProgrammingExerciseTestCaseRepository.java b/src/main/java/de/tum/cit/aet/artemis/programming/repository/ProgrammingExerciseTestCaseRepository.java index 0ec309e45e8b..3924a5de856a 100644 --- a/src/main/java/de/tum/cit/aet/artemis/programming/repository/ProgrammingExerciseTestCaseRepository.java +++ b/src/main/java/de/tum/cit/aet/artemis/programming/repository/ProgrammingExerciseTestCaseRepository.java @@ -2,7 +2,6 @@ import static de.tum.cit.aet.artemis.core.config.Constants.PROFILE_CORE; -import java.util.Optional; import java.util.Set; import org.springframework.context.annotation.Profile; @@ -23,40 +22,6 @@ public interface ProgrammingExerciseTestCaseRepository extends ArtemisJpaReposit Set findByExerciseId(long exerciseId); - default ProgrammingExerciseTestCase findByIdWithExerciseElseThrow(long testCaseId) { - return getValueElseThrow(findByIdWithExercise(testCaseId), testCaseId); - } - - /** - * Returns the test case with the programming exercise - * - * @param testCaseId of the test case - * @return the test case with the programming exercise - */ - @Query(""" - SELECT tc - FROM ProgrammingExerciseTestCase tc - LEFT JOIN FETCH tc.exercise ex - WHERE tc.id = :testCaseId - """) - Optional findByIdWithExercise(@Param("testCaseId") long testCaseId); - - /** - * Returns all test cases with the associated solution entries for a programming exercise - * - * @param exerciseId of the exercise - * @param active status of the test case - * @return all test cases with the associated solution entries - */ - @Query(""" - SELECT DISTINCT tc - FROM ProgrammingExerciseTestCase tc - LEFT JOIN FETCH tc.solutionEntries se - WHERE tc.exercise.id = :exerciseId - AND tc.active = :active - """) - Set findByExerciseIdWithSolutionEntriesAndActive(@Param("exerciseId") long exerciseId, @Param("active") Boolean active); - Set findByExerciseIdAndActive(long exerciseId, Boolean active); /** diff --git a/src/main/java/de/tum/cit/aet/artemis/programming/service/ProgrammingLanguageFeature.java b/src/main/java/de/tum/cit/aet/artemis/programming/service/ProgrammingLanguageFeature.java index 88bee465e155..df07a8f6d5b3 100644 --- a/src/main/java/de/tum/cit/aet/artemis/programming/service/ProgrammingLanguageFeature.java +++ b/src/main/java/de/tum/cit/aet/artemis/programming/service/ProgrammingLanguageFeature.java @@ -13,6 +13,5 @@ */ @JsonInclude(JsonInclude.Include.NON_EMPTY) public record ProgrammingLanguageFeature(ProgrammingLanguage programmingLanguage, boolean sequentialTestRuns, boolean staticCodeAnalysis, boolean plagiarismCheckSupported, - boolean packageNameRequired, boolean checkoutSolutionRepositoryAllowed, List projectTypes, boolean testwiseCoverageAnalysisSupported, - boolean auxiliaryRepositoriesSupported) { + boolean packageNameRequired, boolean checkoutSolutionRepositoryAllowed, List projectTypes, boolean auxiliaryRepositoriesSupported) { } diff --git a/src/main/java/de/tum/cit/aet/artemis/programming/service/aeolus/AeolusTemplateService.java b/src/main/java/de/tum/cit/aet/artemis/programming/service/aeolus/AeolusTemplateService.java index 143338cb9a38..7970c67a26e8 100644 --- a/src/main/java/de/tum/cit/aet/artemis/programming/service/aeolus/AeolusTemplateService.java +++ b/src/main/java/de/tum/cit/aet/artemis/programming/service/aeolus/AeolusTemplateService.java @@ -127,7 +127,6 @@ private static Windfile readWindfile(String yaml) throws IOException { * @param projectType the project type for which the template file should be returned. If omitted, a default depending on the language will be used. * @param staticAnalysis whether the static analysis template should be used * @param sequentialRuns whether the sequential runs template should be used - * @param testCoverage whether the test coverage template should be used * @return the requested template as a {@link Windfile} object * @throws IOException if the file does not exist */ diff --git a/src/main/java/de/tum/cit/aet/artemis/programming/service/ci/notification/dto/TestResultsDTO.java b/src/main/java/de/tum/cit/aet/artemis/programming/service/ci/notification/dto/TestResultsDTO.java index cd029f5adf5e..ca80256c1f7c 100644 --- a/src/main/java/de/tum/cit/aet/artemis/programming/service/ci/notification/dto/TestResultsDTO.java +++ b/src/main/java/de/tum/cit/aet/artemis/programming/service/ci/notification/dto/TestResultsDTO.java @@ -41,8 +41,6 @@ public class TestResultsDTO extends AbstractBuildResultNotificationDTO { private final List staticCodeAnalysisReports; - private final List testwiseCoverageReport; - private final ZonedDateTime runDate; private final boolean isBuildSuccessful; @@ -54,7 +52,6 @@ public TestResultsDTO(@JsonProperty("successful") int successful, @JsonProperty( @JsonProperty("failures") int failures, @JsonProperty("fullName") String fullName, @JsonProperty("commits") @JsonSetter(nulls = Nulls.AS_EMPTY) List commits, @JsonProperty("results") @JsonSetter(nulls = Nulls.AS_EMPTY) List results, @JsonProperty("staticCodeAnalysisReports") @JsonSetter(nulls = Nulls.AS_EMPTY) List staticCodeAnalysisReports, - @JsonProperty("testwiseCoverageReport") @JsonSetter(nulls = Nulls.AS_EMPTY) List testwiseCoverageReport, @JsonProperty("runDate") ZonedDateTime runDate, @JsonProperty("isBuildSuccessful") boolean isBuildSuccessful, @JsonProperty("logs") @JsonSetter(nulls = Nulls.AS_EMPTY) List logs) { this.successful = successful; @@ -65,7 +62,6 @@ public TestResultsDTO(@JsonProperty("successful") int successful, @JsonProperty( this.commits = commits; this.results = results; this.staticCodeAnalysisReports = staticCodeAnalysisReports; - this.testwiseCoverageReport = testwiseCoverageReport; this.runDate = runDate; this.isBuildSuccessful = isBuildSuccessful; this.logs = logs; @@ -157,11 +153,6 @@ public List getStaticCodeAnalysisReports() { return staticCodeAnalysisReports; } - @Override - public List getTestwiseCoverageReports() { - return testwiseCoverageReport; - } - @Override public boolean hasArtifact() { // TODO: this is not available in Jenkins or GitLab CI yet diff --git a/src/main/java/de/tum/cit/aet/artemis/programming/service/ci/notification/dto/TestwiseCoverageReportDTO.java b/src/main/java/de/tum/cit/aet/artemis/programming/service/ci/notification/dto/TestwiseCoverageReportDTO.java deleted file mode 100644 index ef94ea89542f..000000000000 --- a/src/main/java/de/tum/cit/aet/artemis/programming/service/ci/notification/dto/TestwiseCoverageReportDTO.java +++ /dev/null @@ -1,115 +0,0 @@ -package de.tum.cit.aet.artemis.programming.service.ci.notification.dto; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -// TODO: convert to record -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_EMPTY) -public class TestwiseCoverageReportDTO implements Serializable { - - @JsonProperty("uniformPath") - private String uniformPath; - - @JsonProperty("duration") - private double duration; - - @JsonProperty("content") - private String content; - - @JsonProperty("paths") - private List coveredPathsPerTestDTOs = new ArrayList<>(); - - public String getUniformPath() { - return uniformPath; - } - - public void setUniformPath(String uniformPath) { - this.uniformPath = uniformPath; - } - - public double getDuration() { - return duration; - } - - public void setDuration(double duration) { - this.duration = duration; - } - - public String getContent() { - return content; - } - - public void setContent(String content) { - this.content = content; - } - - public List getCoveredPathsPerTestDTOs() { - return coveredPathsPerTestDTOs; - } - - public void setCoveredPathsPerTestDTOs(List coveredPathsPerTestDTOs) { - this.coveredPathsPerTestDTOs = coveredPathsPerTestDTOs; - } - - // TODO: convert to record - @JsonIgnoreProperties(ignoreUnknown = true) - @JsonInclude(JsonInclude.Include.NON_EMPTY) - public static final class CoveredPathsPerTestDTO implements Serializable { - - @JsonProperty("path") - private String path; - - @JsonProperty("files") - private List coveredFilesPerTestDTOs = new ArrayList<>(); - - public String getPath() { - return path; - } - - public void setPath(String path) { - this.path = path; - } - - public List getCoveredFilesPerTestDTOs() { - return coveredFilesPerTestDTOs; - } - - public void setCoveredFilesPerTestDTOs(List coveredFilesPerTestDTOs) { - this.coveredFilesPerTestDTOs = coveredFilesPerTestDTOs; - } - } - - // TODO: convert to record - @JsonIgnoreProperties(ignoreUnknown = true) - @JsonInclude(JsonInclude.Include.NON_EMPTY) - public static final class CoveredFilesPerTestDTO implements Serializable { - - @JsonProperty("fileName") - private String fileName; - - @JsonProperty("coveredLines") - private String coveredLinesWithRanges; - - public String getFileName() { - return fileName; - } - - public void setFileName(String fileName) { - this.fileName = fileName; - } - - public String getCoveredLinesWithRanges() { - return coveredLinesWithRanges; - } - - public void setCoveredLinesWithRanges(String coveredLinesWithRanges) { - this.coveredLinesWithRanges = coveredLinesWithRanges; - } - } -} diff --git a/src/main/java/de/tum/cit/aet/artemis/programming/service/gitlabci/GitLabCIProgrammingLanguageFeatureService.java b/src/main/java/de/tum/cit/aet/artemis/programming/service/gitlabci/GitLabCIProgrammingLanguageFeatureService.java index 0c71114e13bb..357cf05d97f8 100644 --- a/src/main/java/de/tum/cit/aet/artemis/programming/service/gitlabci/GitLabCIProgrammingLanguageFeatureService.java +++ b/src/main/java/de/tum/cit/aet/artemis/programming/service/gitlabci/GitLabCIProgrammingLanguageFeatureService.java @@ -23,9 +23,9 @@ public class GitLabCIProgrammingLanguageFeatureService extends ProgrammingLanguageFeatureService { public GitLabCIProgrammingLanguageFeatureService() { - programmingLanguageFeatures.put(EMPTY, new ProgrammingLanguageFeature(EMPTY, false, false, false, false, false, List.of(), false, false)); - programmingLanguageFeatures.put(JAVA, new ProgrammingLanguageFeature(JAVA, false, false, false, true, false, List.of(PLAIN_MAVEN, MAVEN_MAVEN), false, false)); - programmingLanguageFeatures.put(JAVASCRIPT, new ProgrammingLanguageFeature(JAVASCRIPT, false, false, true, false, false, List.of(), false, false)); - programmingLanguageFeatures.put(RUST, new ProgrammingLanguageFeature(RUST, false, false, true, false, false, List.of(), false, false)); + programmingLanguageFeatures.put(EMPTY, new ProgrammingLanguageFeature(EMPTY, false, false, false, false, false, List.of(), false)); + programmingLanguageFeatures.put(JAVA, new ProgrammingLanguageFeature(JAVA, false, false, false, true, false, List.of(PLAIN_MAVEN, MAVEN_MAVEN), false)); + programmingLanguageFeatures.put(JAVASCRIPT, new ProgrammingLanguageFeature(JAVASCRIPT, false, false, true, false, false, List.of(), false)); + programmingLanguageFeatures.put(RUST, new ProgrammingLanguageFeature(RUST, false, false, true, false, false, List.of(), false)); } } diff --git a/src/main/java/de/tum/cit/aet/artemis/programming/service/jenkins/JenkinsProgrammingLanguageFeatureService.java b/src/main/java/de/tum/cit/aet/artemis/programming/service/jenkins/JenkinsProgrammingLanguageFeatureService.java index 0a35810528af..0e4eb14d3307 100644 --- a/src/main/java/de/tum/cit/aet/artemis/programming/service/jenkins/JenkinsProgrammingLanguageFeatureService.java +++ b/src/main/java/de/tum/cit/aet/artemis/programming/service/jenkins/JenkinsProgrammingLanguageFeatureService.java @@ -36,20 +36,20 @@ public class JenkinsProgrammingLanguageFeatureService extends ProgrammingLanguag public JenkinsProgrammingLanguageFeatureService() { // Must be extended once a new programming language is added - programmingLanguageFeatures.put(EMPTY, new ProgrammingLanguageFeature(EMPTY, false, false, false, false, false, List.of(), false, false)); - programmingLanguageFeatures.put(C, new ProgrammingLanguageFeature(C, false, false, true, false, false, List.of(FACT, GCC), false, false)); - programmingLanguageFeatures.put(C_PLUS_PLUS, new ProgrammingLanguageFeature(C_PLUS_PLUS, false, false, true, false, false, List.of(), false, false)); - programmingLanguageFeatures.put(C_SHARP, new ProgrammingLanguageFeature(C_SHARP, false, false, true, false, false, List.of(), false, false)); - programmingLanguageFeatures.put(HASKELL, new ProgrammingLanguageFeature(HASKELL, false, false, false, false, true, List.of(), false, false)); + programmingLanguageFeatures.put(EMPTY, new ProgrammingLanguageFeature(EMPTY, false, false, false, false, false, List.of(), false)); + programmingLanguageFeatures.put(C, new ProgrammingLanguageFeature(C, false, false, true, false, false, List.of(FACT, GCC), false)); + programmingLanguageFeatures.put(C_PLUS_PLUS, new ProgrammingLanguageFeature(C_PLUS_PLUS, false, false, true, false, false, List.of(), false)); + programmingLanguageFeatures.put(C_SHARP, new ProgrammingLanguageFeature(C_SHARP, false, false, true, false, false, List.of(), false)); + programmingLanguageFeatures.put(HASKELL, new ProgrammingLanguageFeature(HASKELL, false, false, false, false, true, List.of(), false)); programmingLanguageFeatures.put(JAVA, - new ProgrammingLanguageFeature(JAVA, true, true, true, true, false, List.of(PLAIN_GRADLE, GRADLE_GRADLE, PLAIN_MAVEN, MAVEN_MAVEN, MAVEN_BLACKBOX), true, false)); - programmingLanguageFeatures.put(JAVASCRIPT, new ProgrammingLanguageFeature(JAVASCRIPT, false, false, true, false, false, List.of(), false, false)); - programmingLanguageFeatures.put(KOTLIN, new ProgrammingLanguageFeature(KOTLIN, true, false, true, true, false, List.of(), true, false)); - programmingLanguageFeatures.put(PYTHON, new ProgrammingLanguageFeature(PYTHON, false, false, true, false, false, List.of(), false, false)); - programmingLanguageFeatures.put(R, new ProgrammingLanguageFeature(R, false, false, true, false, false, List.of(), false, false)); - programmingLanguageFeatures.put(RUST, new ProgrammingLanguageFeature(RUST, false, false, true, false, false, List.of(), false, false)); + new ProgrammingLanguageFeature(JAVA, true, true, true, true, false, List.of(PLAIN_GRADLE, GRADLE_GRADLE, PLAIN_MAVEN, MAVEN_MAVEN, MAVEN_BLACKBOX), true)); + programmingLanguageFeatures.put(JAVASCRIPT, new ProgrammingLanguageFeature(JAVASCRIPT, false, false, true, false, false, List.of(), false)); + programmingLanguageFeatures.put(KOTLIN, new ProgrammingLanguageFeature(KOTLIN, true, false, true, true, false, List.of(), true)); + programmingLanguageFeatures.put(PYTHON, new ProgrammingLanguageFeature(PYTHON, false, false, true, false, false, List.of(), false)); + programmingLanguageFeatures.put(R, new ProgrammingLanguageFeature(R, false, false, true, false, false, List.of(), false)); + programmingLanguageFeatures.put(RUST, new ProgrammingLanguageFeature(RUST, false, false, true, false, false, List.of(), false)); // Jenkins is not supporting XCODE at the moment - programmingLanguageFeatures.put(SWIFT, new ProgrammingLanguageFeature(SWIFT, false, true, true, true, false, List.of(PLAIN), false, false)); - programmingLanguageFeatures.put(TYPESCRIPT, new ProgrammingLanguageFeature(TYPESCRIPT, false, false, true, false, false, List.of(), false, false)); + programmingLanguageFeatures.put(SWIFT, new ProgrammingLanguageFeature(SWIFT, false, true, true, true, false, List.of(PLAIN), false)); + programmingLanguageFeatures.put(TYPESCRIPT, new ProgrammingLanguageFeature(TYPESCRIPT, false, false, true, false, false, List.of(), false)); } } diff --git a/src/main/java/de/tum/cit/aet/artemis/programming/service/localci/LocalCIProgrammingLanguageFeatureService.java b/src/main/java/de/tum/cit/aet/artemis/programming/service/localci/LocalCIProgrammingLanguageFeatureService.java index e0486750422f..5e9e28c8465a 100644 --- a/src/main/java/de/tum/cit/aet/artemis/programming/service/localci/LocalCIProgrammingLanguageFeatureService.java +++ b/src/main/java/de/tum/cit/aet/artemis/programming/service/localci/LocalCIProgrammingLanguageFeatureService.java @@ -42,22 +42,22 @@ public class LocalCIProgrammingLanguageFeatureService extends ProgrammingLanguag public LocalCIProgrammingLanguageFeatureService() { // Must be extended once a new programming language is added - programmingLanguageFeatures.put(EMPTY, new ProgrammingLanguageFeature(EMPTY, false, false, false, false, false, List.of(), false, true)); - programmingLanguageFeatures.put(ASSEMBLER, new ProgrammingLanguageFeature(ASSEMBLER, false, false, false, false, false, List.of(), false, true)); - programmingLanguageFeatures.put(C, new ProgrammingLanguageFeature(C, false, true, true, false, false, List.of(FACT, GCC), false, true)); - programmingLanguageFeatures.put(C_PLUS_PLUS, new ProgrammingLanguageFeature(C_PLUS_PLUS, false, false, true, false, false, List.of(), false, true)); - programmingLanguageFeatures.put(C_SHARP, new ProgrammingLanguageFeature(C_SHARP, false, false, true, false, false, List.of(), false, true)); - programmingLanguageFeatures.put(HASKELL, new ProgrammingLanguageFeature(HASKELL, true, false, false, false, true, List.of(), false, true)); + programmingLanguageFeatures.put(EMPTY, new ProgrammingLanguageFeature(EMPTY, false, false, false, false, false, List.of(), false)); + programmingLanguageFeatures.put(ASSEMBLER, new ProgrammingLanguageFeature(ASSEMBLER, false, false, false, false, false, List.of(), false)); + programmingLanguageFeatures.put(C, new ProgrammingLanguageFeature(C, false, true, true, false, false, List.of(FACT, GCC), false)); + programmingLanguageFeatures.put(C_PLUS_PLUS, new ProgrammingLanguageFeature(C_PLUS_PLUS, false, false, true, false, false, List.of(), false)); + programmingLanguageFeatures.put(C_SHARP, new ProgrammingLanguageFeature(C_SHARP, false, false, true, false, false, List.of(), false)); + programmingLanguageFeatures.put(HASKELL, new ProgrammingLanguageFeature(HASKELL, true, false, false, false, true, List.of(), false)); programmingLanguageFeatures.put(JAVA, - new ProgrammingLanguageFeature(JAVA, true, true, true, true, false, List.of(PLAIN_GRADLE, GRADLE_GRADLE, PLAIN_MAVEN, MAVEN_MAVEN), false, true)); - programmingLanguageFeatures.put(JAVASCRIPT, new ProgrammingLanguageFeature(JAVASCRIPT, false, false, true, false, false, List.of(), false, true)); - programmingLanguageFeatures.put(KOTLIN, new ProgrammingLanguageFeature(KOTLIN, false, false, true, true, false, List.of(), false, true)); - programmingLanguageFeatures.put(OCAML, new ProgrammingLanguageFeature(OCAML, false, false, false, false, true, List.of(), false, true)); - programmingLanguageFeatures.put(PYTHON, new ProgrammingLanguageFeature(PYTHON, false, false, true, false, false, List.of(), false, true)); - programmingLanguageFeatures.put(R, new ProgrammingLanguageFeature(R, false, false, true, false, false, List.of(), false, true)); - programmingLanguageFeatures.put(RUST, new ProgrammingLanguageFeature(RUST, false, false, true, false, false, List.of(), false, true)); - programmingLanguageFeatures.put(SWIFT, new ProgrammingLanguageFeature(SWIFT, false, false, true, true, false, List.of(PLAIN), false, true)); - programmingLanguageFeatures.put(TYPESCRIPT, new ProgrammingLanguageFeature(TYPESCRIPT, false, false, true, false, false, List.of(), false, true)); - programmingLanguageFeatures.put(VHDL, new ProgrammingLanguageFeature(VHDL, false, false, false, false, false, List.of(), false, true)); + new ProgrammingLanguageFeature(JAVA, true, true, true, true, false, List.of(PLAIN_GRADLE, GRADLE_GRADLE, PLAIN_MAVEN, MAVEN_MAVEN), false)); + programmingLanguageFeatures.put(JAVASCRIPT, new ProgrammingLanguageFeature(JAVASCRIPT, false, false, true, false, false, List.of(), false)); + programmingLanguageFeatures.put(KOTLIN, new ProgrammingLanguageFeature(KOTLIN, false, false, true, true, false, List.of(), false)); + programmingLanguageFeatures.put(OCAML, new ProgrammingLanguageFeature(OCAML, false, false, false, false, true, List.of(), false)); + programmingLanguageFeatures.put(PYTHON, new ProgrammingLanguageFeature(PYTHON, false, false, true, false, false, List.of(), false)); + programmingLanguageFeatures.put(R, new ProgrammingLanguageFeature(R, false, false, true, false, false, List.of(), false)); + programmingLanguageFeatures.put(RUST, new ProgrammingLanguageFeature(RUST, false, false, true, false, false, List.of(), false)); + programmingLanguageFeatures.put(SWIFT, new ProgrammingLanguageFeature(SWIFT, false, false, true, true, false, List.of(PLAIN), false)); + programmingLanguageFeatures.put(TYPESCRIPT, new ProgrammingLanguageFeature(TYPESCRIPT, false, false, true, false, false, List.of(), false)); + programmingLanguageFeatures.put(VHDL, new ProgrammingLanguageFeature(VHDL, false, false, false, false, false, List.of(), false)); } } diff --git a/src/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseResource.java b/src/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseResource.java index 8c7ca22b589a..7eb1836abbc6 100644 --- a/src/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseResource.java +++ b/src/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseResource.java @@ -787,9 +787,7 @@ public ResponseEntity reEvaluateAndUpdateProgrammingExercis } /** - * DELETE programming-exercises/:exerciseId/tasks : Delete all tasks and solution entries for an existing ProgrammingExercise. - * Note: This endpoint exists only for testing purposes and will be removed at a later stage of the development of HESTIA - * (automatic generation of code hints for programming exercises in Java). + * DELETE programming-exercises/:exerciseId/tasks : Delete all tasks for an existing ProgrammingExercise. * * @param exerciseId of the exercise * @return the {@link ResponseEntity} with status {@code 204}, diff --git a/src/main/java/de/tum/cit/aet/artemis/programming/web/localci/AeolusTemplateResource.java b/src/main/java/de/tum/cit/aet/artemis/programming/web/localci/AeolusTemplateResource.java index 94126a43a378..2b681ea88cba 100644 --- a/src/main/java/de/tum/cit/aet/artemis/programming/web/localci/AeolusTemplateResource.java +++ b/src/main/java/de/tum/cit/aet/artemis/programming/web/localci/AeolusTemplateResource.java @@ -86,7 +86,6 @@ public ResponseEntity getAeolusTemplate(@PathVariable ProgrammingLanguag * @param projectType The project type for which the template file should be returned. If omitted, a default depending on the language will be used. * @param staticAnalysis Whether the static analysis template should be used * @param sequentialRuns Whether the sequential runs template should be used - * @param testCoverage Whether the test coverage template should be used * @return The requested file, or 404 if the file doesn't exist */ @GetMapping({ "template-scripts/{language}/{projectType}", "template-scripts/{language}" }) diff --git a/src/main/resources/templates/aeolus/java/plain_gradle_static_coverage.sh b/src/main/resources/templates/aeolus/java/plain_gradle_static_coverage.sh deleted file mode 100644 index ee2bfdea3d9b..000000000000 --- a/src/main/resources/templates/aeolus/java/plain_gradle_static_coverage.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bash -set -e -export AEOLUS_INITIAL_DIRECTORY=${PWD} -tests () { - echo '⚙️ executing tests' - chmod +x ./gradlew - ./gradlew clean test tiaTests --run-all-tests -} - -static_code_analysis () { - echo '⚙️ executing static_code_analysis' - ./gradlew check -x test -} - -final_aeolus_post_action () { - set +e # from now on, we don't exit on errors - echo '⚙️ executing final_aeolus_post_action' - cd "${AEOLUS_INITIAL_DIRECTORY}" - static_code_analysis -} - -main () { - if [[ "${1}" == "aeolus_sourcing" ]]; then - return 0 # just source to use the methods in the subshell, no execution - fi - local _script_name - _script_name=${BASH_SOURCE[0]:-$0} - trap final_aeolus_post_action EXIT - - cd "${AEOLUS_INITIAL_DIRECTORY}" - bash -c "source ${_script_name} aeolus_sourcing; tests" -} - -main "${@}" diff --git a/src/main/resources/templates/aeolus/java/plain_gradle_static_coverage.yaml b/src/main/resources/templates/aeolus/java/plain_gradle_static_coverage.yaml deleted file mode 100644 index d9d319f2e49f..000000000000 --- a/src/main/resources/templates/aeolus/java/plain_gradle_static_coverage.yaml +++ /dev/null @@ -1,29 +0,0 @@ -api: v0.0.1 -actions: - - name: tests - script: |- - chmod +x ./gradlew - ./gradlew clean test tiaTests --run-all-tests - runAlways: false - - name: static_code_analysis - script: ./gradlew check -x test - runAlways: true - results: - - name: spotbugs - path: target/spotbugsXml.xml - type: static-code-analysis - - name: checkstyle - path: target/checkstyle-result.xml - type: static-code-analysis - - name: pmd - path: target/pmd.xml - type: static-code-analysis - - name: pmd_cpd - path: target/cpd.xml - type: static-code-analysis - - name: testwiseCoverageReport - path: build/reports/testwise-coverage/tiaTests/tiaTests.json - type: testwise-coverage - - name: junit_**/test-results/test/*.xml - path: '**/test-results/test/*.xml' - type: junit diff --git a/src/main/resources/templates/aeolus/java/plain_maven_static_coverage.sh b/src/main/resources/templates/aeolus/java/plain_maven_static_coverage.sh deleted file mode 100644 index d74afc686999..000000000000 --- a/src/main/resources/templates/aeolus/java/plain_maven_static_coverage.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env bash -set -e -export AEOLUS_INITIAL_DIRECTORY=${PWD} -maven () { - echo '⚙️ executing maven' - mvn clean test -Pcoverage -} - -move_report_file () { - echo '⚙️ executing move_report_file' - mv target/tia/reports/*/testwise-coverage-*.json target/tia/reports/tiaTests.json -} - -maven_1 () { - echo '⚙️ executing maven_1' - mvn spotbugs:spotbugs checkstyle:checkstyle pmd:pmd pmd:cpd -} - -final_aeolus_post_action () { - set +e # from now on, we don't exit on errors - echo '⚙️ executing final_aeolus_post_action' - cd "${AEOLUS_INITIAL_DIRECTORY}" - maven_1 -} - -main () { - if [[ "${1}" == "aeolus_sourcing" ]]; then - return 0 # just source to use the methods in the subshell, no execution - fi - local _script_name - _script_name=${BASH_SOURCE[0]:-$0} - trap final_aeolus_post_action EXIT - - cd "${AEOLUS_INITIAL_DIRECTORY}" - bash -c "source ${_script_name} aeolus_sourcing; maven" - cd "${AEOLUS_INITIAL_DIRECTORY}" - bash -c "source ${_script_name} aeolus_sourcing; move_report_file" -} - -main "${@}" diff --git a/src/main/resources/templates/aeolus/java/plain_maven_static_coverage.yaml b/src/main/resources/templates/aeolus/java/plain_maven_static_coverage.yaml deleted file mode 100644 index 5017a23d8537..000000000000 --- a/src/main/resources/templates/aeolus/java/plain_maven_static_coverage.yaml +++ /dev/null @@ -1,30 +0,0 @@ -api: v0.0.1 -actions: - - name: maven - script: mvn clean test -Pcoverage - runAlways: false - - name: move_report_file - script: mv target/tia/reports/*/testwise-coverage-*.json target/tia/reports/tiaTests.json - runAlways: false - - name: maven - script: mvn spotbugs:spotbugs checkstyle:checkstyle pmd:pmd pmd:cpd - runAlways: true - results: - - name: spotbugs - path: target/spotbugsXml.xml - type: static-code-analysis - - name: checkstyle - path: target/checkstyle-result.xml - type: static-code-analysis - - name: pmd - path: target/pmd.xml - type: static-code-analysis - - name: pmd_cpd - path: target/cpd.xml - type: static-code-analysis - - name: testwiseCoverageReport - path: target/tia/reports/tiaTests.json - type: testwise-coverage - - name: junit - path: '**/target/surefire-reports/*.xml' - type: junit diff --git a/src/main/resources/templates/aeolus/kotlin/default_coverage.sh b/src/main/resources/templates/aeolus/kotlin/default_coverage.sh deleted file mode 100644 index 1840f600e00c..000000000000 --- a/src/main/resources/templates/aeolus/kotlin/default_coverage.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env bash -set -e -export AEOLUS_INITIAL_DIRECTORY=${PWD} -maven () { - echo '⚙️ executing maven' - mvn clean test -Pcoverage -} - -move_report_file () { - echo '⚙️ executing move_report_file' - mv target/tia/reports/*/testwise-coverage-*.json target/tia/reports/tiaTests.json -} - -main () { - if [[ "${1}" == "aeolus_sourcing" ]]; then - return 0 # just source to use the methods in the subshell, no execution - fi - local _script_name - _script_name=${BASH_SOURCE[0]:-$0} - cd "${AEOLUS_INITIAL_DIRECTORY}" - bash -c "source ${_script_name} aeolus_sourcing; maven" - cd "${AEOLUS_INITIAL_DIRECTORY}" - bash -c "source ${_script_name} aeolus_sourcing; move_report_file" -} - -main "${@}" diff --git a/src/main/resources/templates/aeolus/kotlin/default_coverage.yaml b/src/main/resources/templates/aeolus/kotlin/default_coverage.yaml deleted file mode 100644 index 5f2c972b6223..000000000000 --- a/src/main/resources/templates/aeolus/kotlin/default_coverage.yaml +++ /dev/null @@ -1,15 +0,0 @@ -api: v0.0.1 -actions: - - name: maven - script: mvn clean test -Pcoverage - runAlways: false - - name: move_report_file - script: mv target/tia/reports/*/testwise-coverage-*.json target/tia/reports/tiaTests.json - runAlways: false - results: - - name: testwiseCoverageReport - path: target/tia/reports/tiaTests.json - before: false - - name: junit - path: '**/target/surefire-reports/*.xml' - type: junit diff --git a/src/main/resources/templates/iris/hestia.hbs b/src/main/resources/templates/iris/hestia.hbs deleted file mode 100644 index 615534e452a7..000000000000 --- a/src/main/resources/templates/iris/hestia.hbs +++ /dev/null @@ -1,80 +0,0 @@ -{{#system~}}# Your task -You are an assistant to generate long and short descriptions for code hints. -Code hints are hints for programming exercises. -Code hints contain a part of the sample solution code that is needed to solve the exercise. -Code hints contain a short description of the code hint, which describes the purpose of the code hint. -Code hints contain a long description of the code hint, which describes the solution of the hint. -Code hints are made available to the student automatically if they have trouble solving the exercise. -The short description of the code hint is displayed to the student as soon as it is available. -The long description and solution code of the code hint is displayed to the student if they decide to use the code hint. -Your task is to generate the short and long description of a code hint. - -# Context -This is the context of the exercise and code hint that you can use to generate the short and long description. -## Programming exercise -Information about the programming exercise. -### Title -{{exercise.title}} -### Problem statement -```markdown -{{exercise.problemStatement}} -``` -## Code hint -Information about the code hint. -### Title -{{codeHint.title}} -### Solution code -{{#each codeHint.solutionEntries}} -#### {{this.filePath}} -{{#if (contains this "previousLine")}} -**Previous line:** {{this.previousLine}} -**Previous code:** -``` -{{this.previousCode}} -``` -{{/if}} -**New Line:** {{this.line}} -**New code:** -``` -{{this.code}} -``` -{{~/each}} - -## Previous attempts -These are the previous attempts at creating descriptions for this code hint. -The instructor did not like the previous attempts and wants you to generate new and different descriptions. -{{~/system}} -{{#if (contains session "messages")}} - {{#each session.messages}} - {{#if (equal this.sender "LLM")}} - {{#if (equal this.content[0].type "json")}} - {{#assistant~}} - **Short description:** - {{this.content[0].attributes.shortDescription}} - **Long description:** - {{this.content[0].attributes.longDescription}} - {{~/assistant}} - {{/if}} - {{#if (equal this.content[0].type "text")}} - {{#assistant~}} - {{this.content[0].textContent}} - {{~/assistant}} - {{/if}} - {{/if}} - {{~/each}} -{{/if}} -{{#system~}} - -# Your solution -Create your solution here. You can use any markdown you want -## Short description -{{~/system}} -{{#assistant~}} -{{gen 'shortDescription' temperature=0.2 max_tokens=100 stop="\\n"}} -{{~/assistant}} -{{#system~}} -## Long description -{{~/system}} -{{#assistant~}} -{{gen 'longDescription' temperature=0.2 max_tokens=1000}} -{{~/assistant}} diff --git a/src/main/resources/templates/java/maven_maven/test/projectTemplate/pom.xml b/src/main/resources/templates/java/maven_maven/test/projectTemplate/pom.xml index 997728be058b..93720b6f3aee 100644 --- a/src/main/resources/templates/java/maven_maven/test/projectTemplate/pom.xml +++ b/src/main/resources/templates/java/maven_maven/test/projectTemplate/pom.xml @@ -88,14 +88,6 @@ ${project.build.outputDirectory}/sun/ ${project.build.outputDirectory}/org/gradle/ ${project.build.outputDirectory}/worker/org/gradle/ - - ${project.build.outputDirectory}/com/squareup/ - ${project.build.outputDirectory}/com/teamscale/ - ${project.build.outputDirectory}/okhttp3/ - ${project.build.outputDirectory}/okio/ - ${project.build.outputDirectory}/retrofit2/ - ${project.build.outputDirectory}/shadow/ - @@ -180,54 +172,4 @@ - - - - coverage - - - com.teamscale - impacted-test-engine - 33.1.2 - - - - - - org.apache.maven.plugins - maven-surefire-plugin - 3.2.5 - - - okhttp3,com.teamscale,retrofit2,shadow,com.squareup,okio - - - - - com.teamscale - teamscale-maven-plugin - 33.1.2 - - http://localhost - dummy - ${exerciseNamePomXml}-Tests - dummy - testwise - - *${packageName}* - - - - - - prepare-tia-unit-test - - - - - - - - - diff --git a/src/main/resources/templates/java/test/gradle/projectTemplate/build.gradle b/src/main/resources/templates/java/test/gradle/projectTemplate/build.gradle index 97be1ab67bfd..b099c0b33b67 100644 --- a/src/main/resources/templates/java/test/gradle/projectTemplate/build.gradle +++ b/src/main/resources/templates/java/test/gradle/projectTemplate/build.gradle @@ -4,9 +4,7 @@ plugins { id 'pmd' id 'com.github.spotbugs' version '6.0.9' // %static-code-analysis-stop% - // %record-testwise-coverage-start% id 'com.teamscale' version '33.1.2' - // %record-testwise-coverage-stop% } apply plugin: 'java' @@ -97,14 +95,6 @@ def forbiddenPackageFolders = [ //(2) "$studentOutputDir/org/opentest4j/", "$studentOutputDir/sun/", "$studentOutputDir/worker/org/gradle/" - // %record-testwise-coverage-start% - ,"$studentOutputDir/com/teamscale/", - "$studentOutputDir/okhttp3/", - "$studentOutputDir/retrofit2/", - "$studentOutputDir/shadow/", - "$studentOutputDir/com/squareup/", - "$studentOutputDir/okio/" - // %record-testwise-coverage-stop% ] test { doFirst { //(1) @@ -178,20 +168,3 @@ pmd { } } // %static-code-analysis-stop% - - -// %record-testwise-coverage-start% -tasks.register('tiaTests', com.teamscale.TestImpacted) { - systemProperty "ares.security.trustedpackages", "okhttp3,com.teamscale,retrofit2,shadow,com.squareup,okio" - useJUnitPlatform() - filter { - excludeTestsMatching "AttributeTest" - excludeTestsMatching "ConstructorTest" - excludeTestsMatching "ClassTest" - excludeTestsMatching "MethodTest" - } - jacoco { - includes = ["${packageName}.*"] - } -} -// %record-testwise-coverage-stop% diff --git a/src/main/resources/templates/java/test/maven/projectTemplate/pom.xml b/src/main/resources/templates/java/test/maven/projectTemplate/pom.xml index c1a7d42fd3e8..24f9561bc6e9 100644 --- a/src/main/resources/templates/java/test/maven/projectTemplate/pom.xml +++ b/src/main/resources/templates/java/test/maven/projectTemplate/pom.xml @@ -83,14 +83,6 @@ ${project.build.outputDirectory}/sun/ ${project.build.outputDirectory}/org/gradle/ ${project.build.outputDirectory}/worker/org/gradle/ - - ${project.build.outputDirectory}/com/squareup/ - ${project.build.outputDirectory}/com/teamscale/ - ${project.build.outputDirectory}/okhttp3/ - ${project.build.outputDirectory}/okio/ - ${project.build.outputDirectory}/retrofit2/ - ${project.build.outputDirectory}/shadow/ - @@ -175,54 +167,4 @@ - - - - coverage - - - com.teamscale - impacted-test-engine - 33.1.2 - - - - - - org.apache.maven.plugins - maven-surefire-plugin - 3.2.5 - - - okhttp3,com.teamscale,retrofit2,shadow,com.squareup,okio - - - - - com.teamscale - teamscale-maven-plugin - 33.1.2 - - http://localhost - dummy - ${exerciseNamePomXml}-Tests - dummy - testwise - - *${packageName}* - - - - - - prepare-tia-unit-test - - - - - - - - - diff --git a/src/main/resources/templates/jenkins/java/gradle/regularRuns/pipeline.groovy b/src/main/resources/templates/jenkins/java/gradle/regularRuns/pipeline.groovy index b83202251c06..faff8d362c81 100644 --- a/src/main/resources/templates/jenkins/java/gradle/regularRuns/pipeline.groovy +++ b/src/main/resources/templates/jenkins/java/gradle/regularRuns/pipeline.groovy @@ -11,8 +11,6 @@ dockerImage = '#dockerImage' dockerFlags = '#dockerArgs' -isSolutionBuild = "${env.JOB_NAME}" ==~ /.+-SOLUTION$/ -isTestWiseCoverageEnabled = #testWiseCoverage && isSolutionBuild isStaticCodeAnalysisEnabled = #isStaticCodeAnalysisEnabled /** @@ -37,11 +35,7 @@ private void runTestSteps() { */ void test() { stage('Test') { - if (isTestWiseCoverageEnabled) { - sh './gradlew clean test tiaTests --run-all-tests' - } else { - sh './gradlew clean test' - } + sh './gradlew clean test' } } @@ -66,25 +60,12 @@ private void staticCodeAnalysis() { } } -private void collectTestwiseCoverageReport() { - catchError { - sh ''' - rm -rf testwiseCoverageReport - mkdir testwiseCoverageReport - mv build/reports/testwise-coverage/tiaTests/tiaTests.json testwiseCoverageReport/ - ''' - } -} - /** * Script of the post build tasks aggregating all JUnit files in $WORKSPACE/results. * * Called by Jenkins. */ void postBuildTasks() { - if (isTestWiseCoverageEnabled) { - collectTestwiseCoverageReport() - } sh ''' rm -rf results mkdir results diff --git a/src/main/resources/templates/jenkins/java/maven/regularRuns/pipeline.groovy b/src/main/resources/templates/jenkins/java/maven/regularRuns/pipeline.groovy index cb76cbb4ee84..6fd81b197ac1 100644 --- a/src/main/resources/templates/jenkins/java/maven/regularRuns/pipeline.groovy +++ b/src/main/resources/templates/jenkins/java/maven/regularRuns/pipeline.groovy @@ -11,8 +11,6 @@ dockerImage = '#dockerImage' dockerFlags = '#dockerArgs' -isSolutionBuild = "${env.JOB_NAME}" ==~ /.+-SOLUTION$/ -isTestwiseCoverageEnabled = #testWiseCoverage && isSolutionBuild isStaticCodeAnalysisEnabled = #isStaticCodeAnalysisEnabled /** @@ -37,11 +35,7 @@ private void runTestSteps() { */ private void test() { stage('Test') { - if (isTestwiseCoverageEnabled) { - sh 'mvn clean test -B -Pcoverage' - } else { - sh 'mvn clean test -B' - } + sh 'mvn clean test -B' } } @@ -66,25 +60,12 @@ private void staticCodeAnalysis() { } } -private void collectTestwiseCoverageReport() { - catchError { - sh ''' - rm -rf testwiseCoverageReport - mkdir testwiseCoverageReport - mv target/tia/reports/*/*.json testwiseCoverageReport/ - ''' - } -} - /** * Script of the post build tasks aggregating all JUnit files in $WORKSPACE/results. * * Called by Jenkins. */ void postBuildTasks() { - if (isTestwiseCoverageEnabled) { - collectTestwiseCoverageReport() - } sh ''' rm -rf results mkdir results diff --git a/src/main/resources/templates/jenkins/kotlin/regularRuns/pipeline.groovy b/src/main/resources/templates/jenkins/kotlin/regularRuns/pipeline.groovy index cb76cbb4ee84..6fd81b197ac1 100644 --- a/src/main/resources/templates/jenkins/kotlin/regularRuns/pipeline.groovy +++ b/src/main/resources/templates/jenkins/kotlin/regularRuns/pipeline.groovy @@ -11,8 +11,6 @@ dockerImage = '#dockerImage' dockerFlags = '#dockerArgs' -isSolutionBuild = "${env.JOB_NAME}" ==~ /.+-SOLUTION$/ -isTestwiseCoverageEnabled = #testWiseCoverage && isSolutionBuild isStaticCodeAnalysisEnabled = #isStaticCodeAnalysisEnabled /** @@ -37,11 +35,7 @@ private void runTestSteps() { */ private void test() { stage('Test') { - if (isTestwiseCoverageEnabled) { - sh 'mvn clean test -B -Pcoverage' - } else { - sh 'mvn clean test -B' - } + sh 'mvn clean test -B' } } @@ -66,25 +60,12 @@ private void staticCodeAnalysis() { } } -private void collectTestwiseCoverageReport() { - catchError { - sh ''' - rm -rf testwiseCoverageReport - mkdir testwiseCoverageReport - mv target/tia/reports/*/*.json testwiseCoverageReport/ - ''' - } -} - /** * Script of the post build tasks aggregating all JUnit files in $WORKSPACE/results. * * Called by Jenkins. */ void postBuildTasks() { - if (isTestwiseCoverageEnabled) { - collectTestwiseCoverageReport() - } sh ''' rm -rf results mkdir results diff --git a/src/main/resources/templates/kotlin/test/maven/projectTemplate/pom.xml b/src/main/resources/templates/kotlin/test/maven/projectTemplate/pom.xml index e278d59eb3d2..c1c04e44339e 100644 --- a/src/main/resources/templates/kotlin/test/maven/projectTemplate/pom.xml +++ b/src/main/resources/templates/kotlin/test/maven/projectTemplate/pom.xml @@ -138,14 +138,6 @@ ${project.build.outputDirectory}/sun/ ${project.build.outputDirectory}/org/gradle/ ${project.build.outputDirectory}/worker/org/gradle/ - - ${project.build.outputDirectory}/com/squareup/ - ${project.build.outputDirectory}/com/teamscale/ - ${project.build.outputDirectory}/okhttp3/ - ${project.build.outputDirectory}/okio/ - ${project.build.outputDirectory}/retrofit2/ - ${project.build.outputDirectory}/shadow/ - @@ -153,54 +145,4 @@ - - - - coverage - - - com.teamscale - impacted-test-engine - ${teamscale.version} - - - - - - org.apache.maven.plugins - maven-surefire-plugin - 3.2.5 - - - okhttp3,com.teamscale,retrofit2,shadow,com.squareup,okio - - - - - com.teamscale - teamscale-maven-plugin - ${teamscale.version} - - http://localhost - dummy - ${exerciseNamePomXml}-Tests - dummy - testwise - - *${packageName}* - - - - - - prepare-tia-unit-test - - - - - - - - - diff --git a/src/main/webapp/app/course/manage/course-management.module.ts b/src/main/webapp/app/course/manage/course-management.module.ts index 4788d338648d..180ddaeea833 100644 --- a/src/main/webapp/app/course/manage/course-management.module.ts +++ b/src/main/webapp/app/course/manage/course-management.module.ts @@ -20,7 +20,6 @@ import { ArtemisLectureModule } from 'app/lecture/lecture.module'; import { ArtemisTextExerciseManagementModule } from 'app/exercises/text/manage/text-exercise-management.module'; import { ArtemisDashboardsModule } from 'app/shared/dashboards/dashboards.module'; import { ArtemisParticipationModule } from 'app/exercises/shared/participation/participation.module'; -import { ArtemisExerciseHintManagementModule } from 'app/exercises/shared/exercise-hint/manage/exercise-hint-management.module'; import { ArtemisModelingExerciseManagementModule } from 'app/exercises/modeling/manage/modeling-exercise-management.module'; import { ArtemisCourseScoresModule } from 'app/course/course-scores/course-scores.module'; import { ArtemisExerciseScoresModule } from 'app/exercises/shared/exercise-scores/exercise-scores.module'; @@ -95,7 +94,6 @@ import { ArtemisMarkdownEditorModule } from 'app/shared/markdown-editor/markdown ArtemisModelingExerciseModule, ArtemisColorSelectorModule, ArtemisDashboardsModule, - ArtemisExerciseHintManagementModule, ArtemisParticipationModule, ArtemisComplaintsForTutorModule, ArtemisListOfComplaintsModule, diff --git a/src/main/webapp/app/course/manage/detail/course-detail.component.ts b/src/main/webapp/app/course/manage/detail/course-detail.component.ts index d61213a17626..04a13d8624a4 100644 --- a/src/main/webapp/app/course/manage/detail/course-detail.component.ts +++ b/src/main/webapp/app/course/manage/detail/course-detail.component.ts @@ -221,12 +221,6 @@ export class CourseDetailComponent implements OnInit, OnDestroy { data: { course: this.course, disabled: !this.isAdmin, subSettingsType: IrisSubSettingsType.CHAT }, }); } - // TODO: Enable in future PR - // details.push({ - // type: DetailType.ProgrammingIrisEnabled, - // title: 'artemisApp.iris.settings.subSettings.enabled.hesita', - // data: { course: this.course, disabled: !this.isAdmin, subSettingsType: this.HESTIA }, - // }); return irisDetails; } diff --git a/src/main/webapp/app/detail-overview-list/components/programming-diff-report-detail/programming-diff-report-detail.component.ts b/src/main/webapp/app/detail-overview-list/components/programming-diff-report-detail/programming-diff-report-detail.component.ts index 94fb86848f4f..46999aa24a27 100644 --- a/src/main/webapp/app/detail-overview-list/components/programming-diff-report-detail/programming-diff-report-detail.component.ts +++ b/src/main/webapp/app/detail-overview-list/components/programming-diff-report-detail/programming-diff-report-detail.component.ts @@ -3,12 +3,12 @@ import type { ProgrammingDiffReportDetail } from 'app/detail-overview-list/detai import { FeatureToggle } from 'app/shared/feature-toggle/feature-toggle.service'; import { ButtonSize, ButtonType, TooltipPlacement } from 'app/shared/components/button.component'; import { faCodeCompare } from '@fortawesome/free-solid-svg-icons'; -import { ProgrammingExerciseGitDiffReport } from 'app/entities/hestia/programming-exercise-git-diff-report.model'; -import { GitDiffReportModalComponent } from 'app/exercises/programming/hestia/git-diff-report/git-diff-report-modal.component'; +import { ProgrammingExerciseGitDiffReport } from 'app/entities/programming-exercise-git-diff-report.model'; +import { GitDiffReportModalComponent } from 'app/exercises/programming/git-diff-report/git-diff-report-modal.component'; import { ArtemisSharedComponentModule } from 'app/shared/components/shared-component.module'; import { ArtemisSharedModule } from 'app/shared/shared.module'; import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap'; -import { GitDiffLineStatComponent } from 'app/exercises/programming/hestia/git-diff-report/git-diff-line-stat.component'; +import { GitDiffLineStatComponent } from 'app/exercises/programming/git-diff-report/git-diff-line-stat.component'; @Component({ selector: 'jhi-programming-diff-report-detail', diff --git a/src/main/webapp/app/detail-overview-list/detail.model.ts b/src/main/webapp/app/detail-overview-list/detail.model.ts index b34f408ef435..995f32024195 100644 --- a/src/main/webapp/app/detail-overview-list/detail.model.ts +++ b/src/main/webapp/app/detail-overview-list/detail.model.ts @@ -5,7 +5,7 @@ import { SolutionProgrammingExerciseParticipation } from 'app/entities/participa import { ProgrammingExerciseInstructorRepositoryType } from 'app/exercises/programming/manage/services/programming-exercise.service'; import { AuxiliaryRepository } from 'app/entities/programming/programming-exercise-auxiliary-repository-model'; import { ProgrammingExerciseParticipationType } from 'app/entities/programming/programming-exercise-participation.model'; -import { ProgrammingExerciseGitDiffReport } from 'app/entities/hestia/programming-exercise-git-diff-report.model'; +import { ProgrammingExerciseGitDiffReport } from 'app/entities/programming-exercise-git-diff-report.model'; import { BuildLogStatisticsDTO } from 'app/entities/programming/build-log-statistics-dto'; import { DetailType } from 'app/detail-overview-list/detail-overview-list.component'; import { SafeHtml } from '@angular/platform-browser'; diff --git a/src/main/webapp/app/entities/hestia/code-hint-model.ts b/src/main/webapp/app/entities/hestia/code-hint-model.ts deleted file mode 100644 index 310a0a5839a2..000000000000 --- a/src/main/webapp/app/entities/hestia/code-hint-model.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { ExerciseHint } from 'app/entities/hestia/exercise-hint.model'; -import { ProgrammingExerciseSolutionEntry } from 'app/entities/hestia/programming-exercise-solution-entry.model'; - -export enum CodeHintGenerationStep { - GIT_DIFF, - COVERAGE, - SOLUTION_ENTRIES, - CODE_HINTS, -} -export class CodeHint extends ExerciseHint { - public solutionEntries?: ProgrammingExerciseSolutionEntry[]; -} diff --git a/src/main/webapp/app/entities/hestia/coverage-file-report.model.ts b/src/main/webapp/app/entities/hestia/coverage-file-report.model.ts deleted file mode 100644 index 03c3b278b6e6..000000000000 --- a/src/main/webapp/app/entities/hestia/coverage-file-report.model.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { BaseEntity } from 'app/shared/model/base-entity'; -import { TestwiseCoverageReportEntry } from 'app/entities/hestia/testwise-coverage-report-entry.model'; - -export class CoverageFileReport implements BaseEntity { - public id?: number; - - public filePath?: string; - public lineCount?: number; - public coveredLineCount?: number; - public testwiseCoverageEntries?: TestwiseCoverageReportEntry[]; - - constructor() {} -} diff --git a/src/main/webapp/app/entities/hestia/coverage-report.model.ts b/src/main/webapp/app/entities/hestia/coverage-report.model.ts deleted file mode 100644 index c60906c135d0..000000000000 --- a/src/main/webapp/app/entities/hestia/coverage-report.model.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { BaseEntity } from 'app/shared/model/base-entity'; -import { CoverageFileReport } from 'app/entities/hestia/coverage-file-report.model'; - -export class CoverageReport implements BaseEntity { - public id?: number; - - public fileReports?: CoverageFileReport[]; - public coveredLineRatio?: number; - - constructor() {} -} diff --git a/src/main/webapp/app/entities/hestia/exercise-hint.model.ts b/src/main/webapp/app/entities/hestia/exercise-hint.model.ts deleted file mode 100644 index fa61b885b7ec..000000000000 --- a/src/main/webapp/app/entities/hestia/exercise-hint.model.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { ProgrammingExercise } from 'app/entities/programming/programming-exercise.model'; -import { BaseEntity } from 'app/shared/model/base-entity'; -import { ProgrammingExerciseServerSideTask } from 'app/entities/hestia/programming-exercise-task.model'; - -export enum HintType { - TEXT = 'text', - CODE = 'code', -} - -export class ExerciseHint implements BaseEntity { - public id?: number; - public title?: string; - public description?: string; - public content?: string; - public exercise?: ProgrammingExercise; - public type?: HintType; - public programmingExerciseTask?: ProgrammingExerciseServerSideTask; - public displayThreshold?: number; - public currentUserRating?: number; -} diff --git a/src/main/webapp/app/entities/hestia/programming-exercise-solution-entry.model.ts b/src/main/webapp/app/entities/hestia/programming-exercise-solution-entry.model.ts deleted file mode 100644 index 9380ec858a4f..000000000000 --- a/src/main/webapp/app/entities/hestia/programming-exercise-solution-entry.model.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { BaseEntity } from 'app/shared/model/base-entity'; -import { ProgrammingExerciseTestCase } from 'app/entities/programming/programming-exercise-test-case.model'; -import { CodeHint } from 'app/entities/hestia/code-hint-model'; - -export class ProgrammingExerciseSolutionEntry implements BaseEntity { - id?: number; - filePath?: string; - previousLine?: number; - line?: number; - previousCode?: string; - code?: string; - testCase?: ProgrammingExerciseTestCase; - codeHint?: CodeHint; -} diff --git a/src/main/webapp/app/entities/hestia/testwise-coverage-report-entry.model.ts b/src/main/webapp/app/entities/hestia/testwise-coverage-report-entry.model.ts deleted file mode 100644 index 59234fffbcfe..000000000000 --- a/src/main/webapp/app/entities/hestia/testwise-coverage-report-entry.model.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { BaseEntity } from 'app/shared/model/base-entity'; -import { ProgrammingExerciseTestCase } from 'app/entities/programming/programming-exercise-test-case.model'; - -export class TestwiseCoverageReportEntry implements BaseEntity { - public id?: number; - - public startLine?: number; - public lineCount?: number; - public testCase?: ProgrammingExerciseTestCase; - - constructor() {} -} diff --git a/src/main/webapp/app/entities/hestia/programming-exercise-git-diff-entry.model.ts b/src/main/webapp/app/entities/programming-exercise-git-diff-entry.model.ts similarity index 100% rename from src/main/webapp/app/entities/hestia/programming-exercise-git-diff-entry.model.ts rename to src/main/webapp/app/entities/programming-exercise-git-diff-entry.model.ts diff --git a/src/main/webapp/app/entities/hestia/programming-exercise-git-diff-report.model.ts b/src/main/webapp/app/entities/programming-exercise-git-diff-report.model.ts similarity index 85% rename from src/main/webapp/app/entities/hestia/programming-exercise-git-diff-report.model.ts rename to src/main/webapp/app/entities/programming-exercise-git-diff-report.model.ts index 5fccf4e2f4aa..d688911d1ccd 100644 --- a/src/main/webapp/app/entities/hestia/programming-exercise-git-diff-report.model.ts +++ b/src/main/webapp/app/entities/programming-exercise-git-diff-report.model.ts @@ -1,6 +1,6 @@ import { ProgrammingExercise } from 'app/entities/programming/programming-exercise.model'; import { BaseEntity } from 'app/shared/model/base-entity'; -import { ProgrammingExerciseGitDiffEntry } from 'app/entities/hestia/programming-exercise-git-diff-entry.model'; +import { ProgrammingExerciseGitDiffEntry } from 'app/entities/programming-exercise-git-diff-entry.model'; export class ProgrammingExerciseGitDiffReport implements BaseEntity { public id?: number; diff --git a/src/main/webapp/app/entities/hestia/programming-exercise-task.model.ts b/src/main/webapp/app/entities/programming-exercise-task.model.ts similarity index 100% rename from src/main/webapp/app/entities/hestia/programming-exercise-task.model.ts rename to src/main/webapp/app/entities/programming-exercise-task.model.ts diff --git a/src/main/webapp/app/entities/programming/build-config.model.ts b/src/main/webapp/app/entities/programming/build-config.model.ts index dcae29ec591f..af71acf37afe 100644 --- a/src/main/webapp/app/entities/programming/build-config.model.ts +++ b/src/main/webapp/app/entities/programming/build-config.model.ts @@ -6,6 +6,5 @@ export class BuildConfig { public projectType?: string; public scaEnabled?: boolean; public sequentialTestRunsEnabled?: boolean; - public testwiseCoverageEnabled?: boolean; public resultPaths?: string[]; } diff --git a/src/main/webapp/app/entities/programming/programming-exercise-build.config.ts b/src/main/webapp/app/entities/programming/programming-exercise-build.config.ts index 55e5f5f487e2..d82e5f345c4d 100644 --- a/src/main/webapp/app/entities/programming/programming-exercise-build.config.ts +++ b/src/main/webapp/app/entities/programming/programming-exercise-build.config.ts @@ -11,11 +11,9 @@ export class ProgrammingExerciseBuildConfig { public timeoutSeconds?: number; public dockerFlags?: string; public windfile?: WindFile; - public testwiseCoverageEnabled?: boolean; public theiaImage?: string; constructor() { this.checkoutSolutionRepository = false; // default value - this.testwiseCoverageEnabled = false; // default value } } diff --git a/src/main/webapp/app/entities/programming/programming-exercise-test-case.model.ts b/src/main/webapp/app/entities/programming/programming-exercise-test-case.model.ts index 2d6822dc7ce4..5d43e28c7d16 100644 --- a/src/main/webapp/app/entities/programming/programming-exercise-test-case.model.ts +++ b/src/main/webapp/app/entities/programming/programming-exercise-test-case.model.ts @@ -1,6 +1,5 @@ import { ProgrammingExercise } from 'app/entities/programming/programming-exercise.model'; import { BaseEntity } from 'app/shared/model/base-entity'; -import { ProgrammingExerciseSolutionEntry } from 'app/entities/hestia/programming-exercise-solution-entry.model'; import { TestCaseStats } from './programming-exercise-test-case-statistics.model'; export enum Visibility { @@ -25,7 +24,6 @@ export class ProgrammingExerciseTestCase implements BaseEntity { visibility?: Visibility; exercise?: ProgrammingExercise; type?: ProgrammingExerciseTestCaseType; - solutionEntries?: ProgrammingExerciseSolutionEntry[]; // Utility information that is not actually part of the object stored on the server resultingPoints?: number; diff --git a/src/main/webapp/app/entities/programming/programming-exercise.model.ts b/src/main/webapp/app/entities/programming/programming-exercise.model.ts index 543d7f138bab..b8eab6807c3c 100644 --- a/src/main/webapp/app/entities/programming/programming-exercise.model.ts +++ b/src/main/webapp/app/entities/programming/programming-exercise.model.ts @@ -2,8 +2,7 @@ import { AssessmentType } from 'app/entities/assessment-type.model'; import { Course } from 'app/entities/course.model'; import { ExerciseGroup } from 'app/entities/exercise-group.model'; import { Exercise, ExerciseType, resetForImport } from 'app/entities/exercise.model'; -import { ExerciseHint } from 'app/entities/hestia/exercise-hint.model'; -import { ProgrammingExerciseGitDiffReport } from 'app/entities/hestia/programming-exercise-git-diff-report.model'; +import { ProgrammingExerciseGitDiffReport } from 'app/entities/programming-exercise-git-diff-report.model'; import { SolutionProgrammingExerciseParticipation } from 'app/entities/participation/solution-programming-exercise-participation.model'; import { TemplateProgrammingExerciseParticipation } from 'app/entities/participation/template-programming-exercise-participation.model'; import { BuildLogStatisticsDTO } from 'app/entities/programming/build-log-statistics-dto'; @@ -62,7 +61,6 @@ export class ProgrammingExercise extends Exercise { public showTestNamesToStudents?: boolean; public auxiliaryRepositories?: AuxiliaryRepository[]; public submissionPolicy?: SubmissionPolicy; - public exerciseHints?: ExerciseHint[]; public gitDiffReport?: ProgrammingExerciseGitDiffReport; public buildLogStatistics?: BuildLogStatisticsDTO; public buildConfig?: ProgrammingExerciseBuildConfig; @@ -125,8 +123,6 @@ export function copyBuildConfigFromExerciseJson(exerciseJson: ProgrammingExercis buildConfig.timeoutSeconds = exerciseJson.timeoutSeconds ?? 0; buildConfig.windfile = exerciseJson.windfile ?? undefined; buildConfig.buildScript = exerciseJson.buildScript ?? ''; - buildConfig.testwiseCoverageEnabled = exerciseJson.testwiseCoverageEnabled ?? false; buildConfig.dockerFlags = exerciseJson.dockerFlags ?? ''; - return buildConfig; } diff --git a/src/main/webapp/app/exam/manage/exam-management.module.ts b/src/main/webapp/app/exam/manage/exam-management.module.ts index ddc813cc21f6..936f33b585bb 100644 --- a/src/main/webapp/app/exam/manage/exam-management.module.ts +++ b/src/main/webapp/app/exam/manage/exam-management.module.ts @@ -71,7 +71,7 @@ import { ArtemisProgrammingExerciseModule } from 'app/exercises/programming/shar import { DetailModule } from 'app/detail-overview-list/detail.module'; import { ArtemisDurationFromSecondsPipe } from 'app/shared/pipes/artemis-duration-from-seconds.pipe'; import { NoDataComponent } from 'app/shared/no-data-component'; -import { GitDiffLineStatComponent } from 'app/exercises/programming/hestia/git-diff-report/git-diff-line-stat.component'; +import { GitDiffLineStatComponent } from 'app/exercises/programming/git-diff-report/git-diff-line-stat.component'; const ENTITY_STATES = [...examManagementState]; diff --git a/src/main/webapp/app/exam/manage/student-exams/student-exam-timeline/programming-exam-diff/programming-exercise-exam-diff.component.ts b/src/main/webapp/app/exam/manage/student-exams/student-exam-timeline/programming-exam-diff/programming-exercise-exam-diff.component.ts index 81a3f247a809..c3979797994f 100644 --- a/src/main/webapp/app/exam/manage/student-exams/student-exam-timeline/programming-exam-diff/programming-exercise-exam-diff.component.ts +++ b/src/main/webapp/app/exam/manage/student-exams/student-exam-timeline/programming-exam-diff/programming-exercise-exam-diff.component.ts @@ -3,7 +3,7 @@ import { ProgrammingExercise } from 'app/entities/programming/programming-exerci import { ProgrammingSubmission } from 'app/entities/programming/programming-submission.model'; import { FeatureToggle } from 'app/shared/feature-toggle/feature-toggle.service'; import { ButtonSize } from 'app/shared/components/button.component'; -import { GitDiffReportModalComponent } from 'app/exercises/programming/hestia/git-diff-report/git-diff-report-modal.component'; +import { GitDiffReportModalComponent } from 'app/exercises/programming/git-diff-report/git-diff-report-modal.component'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; import { ProgrammingExerciseService } from 'app/exercises/programming/manage/services/programming-exercise.service'; import { Exercise, IncludedInOverallScore } from 'app/entities/exercise.model'; @@ -11,7 +11,7 @@ import { ExamSubmissionComponent } from 'app/exam/participate/exercises/exam-sub import { Submission } from 'app/entities/submission.model'; import { ProgrammingExerciseStudentParticipation } from 'app/entities/participation/programming-exercise-student-participation.model'; import { faCodeCompare } from '@fortawesome/free-solid-svg-icons'; -import { ProgrammingExerciseGitDiffReport } from 'app/entities/hestia/programming-exercise-git-diff-report.model'; +import { ProgrammingExerciseGitDiffReport } from 'app/entities/programming-exercise-git-diff-report.model'; import { ExamPageComponent } from 'app/exam/participate/exercises/exam-page.component'; import { Observable, Subject, Subscription, debounceTime, take } from 'rxjs'; import { CachedRepositoryFilesService } from 'app/exercises/programming/manage/services/cached-repository-files.service'; diff --git a/src/main/webapp/app/exam/manage/student-exams/student-exam-timeline/student-exam-timeline.component.ts b/src/main/webapp/app/exam/manage/student-exams/student-exam-timeline/student-exam-timeline.component.ts index 70f4cfe76710..ac7f501a52d5 100644 --- a/src/main/webapp/app/exam/manage/student-exams/student-exam-timeline/student-exam-timeline.component.ts +++ b/src/main/webapp/app/exam/manage/student-exams/student-exam-timeline/student-exam-timeline.component.ts @@ -17,7 +17,7 @@ import { SubmissionVersionService } from 'app/exercises/shared/submission-versio import { ProgrammingExerciseExamDiffComponent } from 'app/exam/manage/student-exams/student-exam-timeline/programming-exam-diff/programming-exercise-exam-diff.component'; import { ProgrammingExerciseParticipationService } from 'app/exercises/programming/manage/services/programming-exercise-participation.service'; import { ExamPageComponent } from 'app/exam/participate/exercises/exam-page.component'; -import { ProgrammingExerciseGitDiffReport } from 'app/entities/hestia/programming-exercise-git-diff-report.model'; +import { ProgrammingExerciseGitDiffReport } from 'app/entities/programming-exercise-git-diff-report.model'; @Component({ selector: 'jhi-student-exam-timeline', diff --git a/src/main/webapp/app/exercises/programming/hestia/git-diff-report/git-diff-file-panel-title.component.html b/src/main/webapp/app/exercises/programming/git-diff-report/git-diff-file-panel-title.component.html similarity index 100% rename from src/main/webapp/app/exercises/programming/hestia/git-diff-report/git-diff-file-panel-title.component.html rename to src/main/webapp/app/exercises/programming/git-diff-report/git-diff-file-panel-title.component.html diff --git a/src/main/webapp/app/exercises/programming/hestia/git-diff-report/git-diff-file-panel-title.component.scss b/src/main/webapp/app/exercises/programming/git-diff-report/git-diff-file-panel-title.component.scss similarity index 100% rename from src/main/webapp/app/exercises/programming/hestia/git-diff-report/git-diff-file-panel-title.component.scss rename to src/main/webapp/app/exercises/programming/git-diff-report/git-diff-file-panel-title.component.scss diff --git a/src/main/webapp/app/exercises/programming/hestia/git-diff-report/git-diff-file-panel-title.component.ts b/src/main/webapp/app/exercises/programming/git-diff-report/git-diff-file-panel-title.component.ts similarity index 100% rename from src/main/webapp/app/exercises/programming/hestia/git-diff-report/git-diff-file-panel-title.component.ts rename to src/main/webapp/app/exercises/programming/git-diff-report/git-diff-file-panel-title.component.ts diff --git a/src/main/webapp/app/exercises/programming/hestia/git-diff-report/git-diff-file-panel.component.html b/src/main/webapp/app/exercises/programming/git-diff-report/git-diff-file-panel.component.html similarity index 100% rename from src/main/webapp/app/exercises/programming/hestia/git-diff-report/git-diff-file-panel.component.html rename to src/main/webapp/app/exercises/programming/git-diff-report/git-diff-file-panel.component.html diff --git a/src/main/webapp/app/exercises/programming/hestia/git-diff-report/git-diff-file-panel.component.scss b/src/main/webapp/app/exercises/programming/git-diff-report/git-diff-file-panel.component.scss similarity index 100% rename from src/main/webapp/app/exercises/programming/hestia/git-diff-report/git-diff-file-panel.component.scss rename to src/main/webapp/app/exercises/programming/git-diff-report/git-diff-file-panel.component.scss diff --git a/src/main/webapp/app/exercises/programming/hestia/git-diff-report/git-diff-file-panel.component.ts b/src/main/webapp/app/exercises/programming/git-diff-report/git-diff-file-panel.component.ts similarity index 90% rename from src/main/webapp/app/exercises/programming/hestia/git-diff-report/git-diff-file-panel.component.ts rename to src/main/webapp/app/exercises/programming/git-diff-report/git-diff-file-panel.component.ts index 9e01edae26b9..0417e9239618 100644 --- a/src/main/webapp/app/exercises/programming/hestia/git-diff-report/git-diff-file-panel.component.ts +++ b/src/main/webapp/app/exercises/programming/git-diff-report/git-diff-file-panel.component.ts @@ -1,9 +1,9 @@ import { ChangeDetectionStrategy, Component, ViewEncapsulation, computed, input, output } from '@angular/core'; -import { ProgrammingExerciseGitDiffEntry } from 'app/entities/hestia/programming-exercise-git-diff-entry.model'; +import { ProgrammingExerciseGitDiffEntry } from 'app/entities/programming-exercise-git-diff-entry.model'; import { faAngleDown, faAngleUp } from '@fortawesome/free-solid-svg-icons'; -import { GitDiffFilePanelTitleComponent } from 'app/exercises/programming/hestia/git-diff-report/git-diff-file-panel-title.component'; -import { GitDiffLineStatComponent } from 'app/exercises/programming/hestia/git-diff-report/git-diff-line-stat.component'; -import { GitDiffFileComponent } from 'app/exercises/programming/hestia/git-diff-report/git-diff-file.component'; +import { GitDiffFilePanelTitleComponent } from 'app/exercises/programming/git-diff-report/git-diff-file-panel-title.component'; +import { GitDiffLineStatComponent } from 'app/exercises/programming/git-diff-report/git-diff-line-stat.component'; +import { GitDiffFileComponent } from 'app/exercises/programming/git-diff-report/git-diff-file.component'; import { ArtemisSharedModule } from 'app/shared/shared.module'; @Component({ diff --git a/src/main/webapp/app/exercises/programming/hestia/git-diff-report/git-diff-file.component.html b/src/main/webapp/app/exercises/programming/git-diff-report/git-diff-file.component.html similarity index 100% rename from src/main/webapp/app/exercises/programming/hestia/git-diff-report/git-diff-file.component.html rename to src/main/webapp/app/exercises/programming/git-diff-report/git-diff-file.component.html diff --git a/src/main/webapp/app/exercises/programming/hestia/git-diff-report/git-diff-file.component.ts b/src/main/webapp/app/exercises/programming/git-diff-report/git-diff-file.component.ts similarity index 92% rename from src/main/webapp/app/exercises/programming/hestia/git-diff-report/git-diff-file.component.ts rename to src/main/webapp/app/exercises/programming/git-diff-report/git-diff-file.component.ts index 45456a115513..055875de5a6a 100644 --- a/src/main/webapp/app/exercises/programming/hestia/git-diff-report/git-diff-file.component.ts +++ b/src/main/webapp/app/exercises/programming/git-diff-report/git-diff-file.component.ts @@ -1,5 +1,5 @@ import { ChangeDetectionStrategy, Component, ViewEncapsulation, computed, effect, input, output, viewChild } from '@angular/core'; -import { ProgrammingExerciseGitDiffEntry } from 'app/entities/hestia/programming-exercise-git-diff-entry.model'; +import { ProgrammingExerciseGitDiffEntry } from 'app/entities/programming-exercise-git-diff-entry.model'; import { MonacoDiffEditorComponent } from 'app/shared/monaco-editor/monaco-diff-editor.component'; import { TranslateDirective } from 'app/shared/language/translate.directive'; diff --git a/src/main/webapp/app/exercises/programming/hestia/git-diff-report/git-diff-line-stat.component.html b/src/main/webapp/app/exercises/programming/git-diff-report/git-diff-line-stat.component.html similarity index 100% rename from src/main/webapp/app/exercises/programming/hestia/git-diff-report/git-diff-line-stat.component.html rename to src/main/webapp/app/exercises/programming/git-diff-report/git-diff-line-stat.component.html diff --git a/src/main/webapp/app/exercises/programming/hestia/git-diff-report/git-diff-line-stat.component.scss b/src/main/webapp/app/exercises/programming/git-diff-report/git-diff-line-stat.component.scss similarity index 100% rename from src/main/webapp/app/exercises/programming/hestia/git-diff-report/git-diff-line-stat.component.scss rename to src/main/webapp/app/exercises/programming/git-diff-report/git-diff-line-stat.component.scss diff --git a/src/main/webapp/app/exercises/programming/hestia/git-diff-report/git-diff-line-stat.component.ts b/src/main/webapp/app/exercises/programming/git-diff-report/git-diff-line-stat.component.ts similarity index 100% rename from src/main/webapp/app/exercises/programming/hestia/git-diff-report/git-diff-line-stat.component.ts rename to src/main/webapp/app/exercises/programming/git-diff-report/git-diff-line-stat.component.ts diff --git a/src/main/webapp/app/exercises/programming/hestia/git-diff-report/git-diff-report-modal.component.html b/src/main/webapp/app/exercises/programming/git-diff-report/git-diff-report-modal.component.html similarity index 100% rename from src/main/webapp/app/exercises/programming/hestia/git-diff-report/git-diff-report-modal.component.html rename to src/main/webapp/app/exercises/programming/git-diff-report/git-diff-report-modal.component.html diff --git a/src/main/webapp/app/exercises/programming/hestia/git-diff-report/git-diff-report-modal.component.ts b/src/main/webapp/app/exercises/programming/git-diff-report/git-diff-report-modal.component.ts similarity index 97% rename from src/main/webapp/app/exercises/programming/hestia/git-diff-report/git-diff-report-modal.component.ts rename to src/main/webapp/app/exercises/programming/git-diff-report/git-diff-report-modal.component.ts index 7684573f821f..96a16d6986ee 100644 --- a/src/main/webapp/app/exercises/programming/hestia/git-diff-report/git-diff-report-modal.component.ts +++ b/src/main/webapp/app/exercises/programming/git-diff-report/git-diff-report-modal.component.ts @@ -1,11 +1,11 @@ import { ChangeDetectionStrategy, Component, effect, inject, input, signal, untracked } from '@angular/core'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; -import { ProgrammingExerciseGitDiffReport } from 'app/entities/hestia/programming-exercise-git-diff-report.model'; +import { ProgrammingExerciseGitDiffReport } from 'app/entities/programming-exercise-git-diff-report.model'; import { ProgrammingExerciseService } from 'app/exercises/programming/manage/services/programming-exercise.service'; import { ProgrammingExerciseParticipationService } from 'app/exercises/programming/manage/services/programming-exercise-participation.service'; import { CachedRepositoryFilesService } from 'app/exercises/programming/manage/services/cached-repository-files.service'; import { firstValueFrom } from 'rxjs'; -import { GitDiffReportComponent } from 'app/exercises/programming/hestia/git-diff-report/git-diff-report.component'; +import { GitDiffReportComponent } from 'app/exercises/programming/git-diff-report/git-diff-report.component'; import { TranslateDirective } from 'app/shared/language/translate.directive'; @Component({ diff --git a/src/main/webapp/app/exercises/programming/hestia/git-diff-report/git-diff-report.component.html b/src/main/webapp/app/exercises/programming/git-diff-report/git-diff-report.component.html similarity index 100% rename from src/main/webapp/app/exercises/programming/hestia/git-diff-report/git-diff-report.component.html rename to src/main/webapp/app/exercises/programming/git-diff-report/git-diff-report.component.html diff --git a/src/main/webapp/app/exercises/programming/hestia/git-diff-report/git-diff-report.component.ts b/src/main/webapp/app/exercises/programming/git-diff-report/git-diff-report.component.ts similarity index 95% rename from src/main/webapp/app/exercises/programming/hestia/git-diff-report/git-diff-report.component.ts rename to src/main/webapp/app/exercises/programming/git-diff-report/git-diff-report.component.ts index cc916e5daf93..7edc4f32aaf3 100644 --- a/src/main/webapp/app/exercises/programming/hestia/git-diff-report/git-diff-report.component.ts +++ b/src/main/webapp/app/exercises/programming/git-diff-report/git-diff-report.component.ts @@ -1,12 +1,12 @@ import { ChangeDetectionStrategy, Component, computed, effect, input, signal, untracked } from '@angular/core'; -import { ProgrammingExerciseGitDiffReport } from 'app/entities/hestia/programming-exercise-git-diff-report.model'; -import { ProgrammingExerciseGitDiffEntry } from 'app/entities/hestia/programming-exercise-git-diff-entry.model'; +import { ProgrammingExerciseGitDiffReport } from 'app/entities/programming-exercise-git-diff-report.model'; +import { ProgrammingExerciseGitDiffEntry } from 'app/entities/programming-exercise-git-diff-entry.model'; import { faSpinner, faTableColumns } from '@fortawesome/free-solid-svg-icons'; import { ButtonSize, ButtonType, TooltipPlacement } from 'app/shared/components/button.component'; -import { GitDiffLineStatComponent } from 'app/exercises/programming/hestia/git-diff-report/git-diff-line-stat.component'; +import { GitDiffLineStatComponent } from 'app/exercises/programming/git-diff-report/git-diff-line-stat.component'; import { ArtemisSharedComponentModule } from 'app/shared/components/shared-component.module'; import { ArtemisSharedModule } from 'app/shared/shared.module'; -import { GitDiffFilePanelComponent } from 'app/exercises/programming/hestia/git-diff-report/git-diff-file-panel.component'; +import { GitDiffFilePanelComponent } from 'app/exercises/programming/git-diff-report/git-diff-file-panel.component'; interface DiffInformation { path: string; diff --git a/src/main/webapp/app/exercises/programming/hestia/generation-overview/code-hint-generation-overview/code-hint-generation-overview.component.html b/src/main/webapp/app/exercises/programming/hestia/generation-overview/code-hint-generation-overview/code-hint-generation-overview.component.html deleted file mode 100644 index 9a62ddda158b..000000000000 --- a/src/main/webapp/app/exercises/programming/hestia/generation-overview/code-hint-generation-overview/code-hint-generation-overview.component.html +++ /dev/null @@ -1,52 +0,0 @@ -

- -

-
-@if (isPerformedByStep?.size && currentStep !== undefined && exercise) { -
-
-
- @if (allowBehavioralEntryGeneration ? currentStep !== 0 : currentStep !== 2) { - - } -
-
- -
-
- @if (!isNextStepAvailable()) { - - } - @if (currentStep !== 3) { - - } -
-
-
- - @if (exercise) { - @if (allowBehavioralEntryGeneration) { - - } - @if (allowBehavioralEntryGeneration) { - - } - - - } -
-} diff --git a/src/main/webapp/app/exercises/programming/hestia/generation-overview/code-hint-generation-overview/code-hint-generation-overview.component.scss b/src/main/webapp/app/exercises/programming/hestia/generation-overview/code-hint-generation-overview/code-hint-generation-overview.component.scss deleted file mode 100644 index 2fa141c0b0d4..000000000000 --- a/src/main/webapp/app/exercises/programming/hestia/generation-overview/code-hint-generation-overview/code-hint-generation-overview.component.scss +++ /dev/null @@ -1,49 +0,0 @@ -.button-row { - & > button { - margin-right: 5px; - } -} - -.status-wrapper { - flex-grow: 3; -} - -.butonene-wr .btn[disabled] { - pointer-events: all !important; -} - -.mat-expansion-panel.code-hint-creation-expansion-panel-wrapper, -.mat-expansion-panel.code-hint-creation-expansion-panel-wrapper-header { - .mat-expansion-panel-header { - padding: 10px 10px 10px 0; - border-bottom: 1px solid rgba(0, 0, 0, 0.25); - } - - .mat-expansion-panel-header-title, - .mat-expansion-panel-header-description { - flex-basis: 0; - } - - .mat-expansion-panel-header-description { - justify-content: space-between; - align-items: center; - } -} - -/* prevent resizing of opened expansion panels */ -.mat-expansion-panel-spacing { - margin: 0; -} - -.mat-expansion-panel.code-hint-creation-expansion-panel-wrapper-header { - font-weight: bold; - cursor: default; - - .mat-expansion-panel-header { - border-bottom: 2px solid; - } -} - -.sort-icon { - cursor: pointer; -} diff --git a/src/main/webapp/app/exercises/programming/hestia/generation-overview/code-hint-generation-overview/code-hint-generation-overview.component.ts b/src/main/webapp/app/exercises/programming/hestia/generation-overview/code-hint-generation-overview/code-hint-generation-overview.component.ts deleted file mode 100644 index d039db390a19..000000000000 --- a/src/main/webapp/app/exercises/programming/hestia/generation-overview/code-hint-generation-overview/code-hint-generation-overview.component.ts +++ /dev/null @@ -1,95 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import { ActivatedRoute, Router } from '@angular/router'; -import { ProgrammingExercise } from 'app/entities/programming/programming-exercise.model'; -import { CoverageReport } from 'app/entities/hestia/coverage-report.model'; -import { ProgrammingExerciseSolutionEntry } from 'app/entities/hestia/programming-exercise-solution-entry.model'; -import { CodeHint, CodeHintGenerationStep } from 'app/entities/hestia/code-hint-model'; -import { ProgrammingExerciseGitDiffReport } from 'app/entities/hestia/programming-exercise-git-diff-report.model'; - -@Component({ - selector: 'jhi-code-hint-generation-overview', - templateUrl: './code-hint-generation-overview.component.html', - styleUrls: ['./code-hint-generation-overview.component.scss'], -}) -export class CodeHintGenerationOverviewComponent implements OnInit { - exercise?: ProgrammingExercise; - - currentStep: CodeHintGenerationStep; - isPerformedByStep: Map; - selectedSolutionEntries?: ProgrammingExerciseSolutionEntry[]; - - allowBehavioralEntryGeneration = false; - - readonly GenerationStep = CodeHintGenerationStep; - - constructor( - private route: ActivatedRoute, - private router: Router, - ) {} - - ngOnInit() { - this.route.data.subscribe(({ exercise }) => { - this.exercise = exercise; - // set all steps to unperformed initially - this.isPerformedByStep = new Map(); - this.isPerformedByStep.set(CodeHintGenerationStep.SOLUTION_ENTRIES, false); - this.isPerformedByStep.set(CodeHintGenerationStep.CODE_HINTS, false); - if (exercise.buildConfig?.testwiseCoverageEnabled) { - this.currentStep = CodeHintGenerationStep.GIT_DIFF; - this.allowBehavioralEntryGeneration = true; - this.isPerformedByStep.set(CodeHintGenerationStep.GIT_DIFF, false); - this.isPerformedByStep.set(CodeHintGenerationStep.COVERAGE, false); - } else { - this.currentStep = CodeHintGenerationStep.SOLUTION_ENTRIES; - } - }); - } - - setLatestPerformedStep(latestUpdatedStep: CodeHintGenerationStep) { - if (this.currentStep >= latestUpdatedStep) { - return; - } - const optionalEntry = Array.from(this.isPerformedByStep.entries()) - .filter((a) => a[1]) - .sort((a, b) => b[0] - a[0]) - .first(); - this.currentStep = optionalEntry === undefined ? this.currentStep : optionalEntry![0]; - } - - isNextStepAvailable(): boolean { - return this.isPerformedByStep.get(this.currentStep) ?? false; - } - - onNextStep() { - this.currentStep = this.currentStep + 1; - } - - onPreviousStep() { - this.currentStep = this.currentStep - 1; - } - - onStepChange(step: CodeHintGenerationStep) { - this.currentStep = step; - } - - onDiffReportLoaded(diffReport?: ProgrammingExerciseGitDiffReport) { - this.isPerformedByStep.set(CodeHintGenerationStep.GIT_DIFF, diffReport !== undefined); - this.setLatestPerformedStep(CodeHintGenerationStep.GIT_DIFF); - } - - onCoverageReportLoaded(coverageReport?: CoverageReport) { - this.isPerformedByStep.set(CodeHintGenerationStep.COVERAGE, coverageReport !== undefined); - this.setLatestPerformedStep(CodeHintGenerationStep.COVERAGE); - } - - onSolutionEntryChanges(entries?: ProgrammingExerciseSolutionEntry[]) { - this.selectedSolutionEntries = entries; - this.isPerformedByStep.set(CodeHintGenerationStep.SOLUTION_ENTRIES, entries !== undefined && entries!.length > 0); - this.setLatestPerformedStep(CodeHintGenerationStep.SOLUTION_ENTRIES); - } - - onCodeHintsLoaded(codeHints?: CodeHint[]) { - this.isPerformedByStep.set(CodeHintGenerationStep.CODE_HINTS, codeHints !== undefined && codeHints!.length > 0); - this.setLatestPerformedStep(CodeHintGenerationStep.CODE_HINTS); - } -} diff --git a/src/main/webapp/app/exercises/programming/hestia/generation-overview/code-hint-generation-overview/code-hint-generation-overview.module.ts b/src/main/webapp/app/exercises/programming/hestia/generation-overview/code-hint-generation-overview/code-hint-generation-overview.module.ts deleted file mode 100644 index a9d7088b56c9..000000000000 --- a/src/main/webapp/app/exercises/programming/hestia/generation-overview/code-hint-generation-overview/code-hint-generation-overview.module.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { NgModule } from '@angular/core'; -import { ArtemisSharedModule } from 'app/shared/shared.module'; -import { CodeHintGenerationStatusComponent } from '../code-hint-generation-status/code-hint-generation-status.component'; -import { SolutionEntryDetailsModalComponent } from '../solution-entry-details-modal/solution-entry-details-modal.component'; -import { ArtemisExerciseHintSharedModule } from 'app/exercises/shared/exercise-hint/shared/exercise-hint-shared.module'; -import { ArtemisSharedComponentModule } from 'app/shared/components/shared-component.module'; -import { DiffGenerationStepComponent } from '../steps/diff-generation-step/diff-generation-step.component'; -import { CoverageGenerationStepComponent } from '../steps/coverage-generation-step/coverage-generation-step.component'; -import { SolutionEntryGenerationStepComponent } from '../steps/solution-entry-generation-step/solution-entry-generation-step.component'; -import { CodeHintGenerationStepComponent } from '../steps/code-hint-generation-step/code-hint-generation-step.component'; -import { TestwiseCoverageReportModule } from 'app/exercises/programming/hestia/testwise-coverage-report/testwise-coverage-report.module'; -import { CodeHintGenerationOverviewComponent } from 'app/exercises/programming/hestia/generation-overview/code-hint-generation-overview/code-hint-generation-overview.component'; -import { RouterModule } from '@angular/router'; -import { ArtemisMarkdownModule } from 'app/shared/markdown.module'; -import { MatExpansionModule } from '@angular/material/expansion'; -import { CodeHintGenerationStatusStepComponent } from 'app/exercises/programming/hestia/generation-overview/code-hint-generation-status/code-hint-generation-status-step.component'; -import { ManualSolutionEntryCreationModalComponent } from '../manual-solution-entry-creation-modal/manual-solution-entry-creation-modal.component'; -import { GitDiffReportComponent } from 'app/exercises/programming/hestia/git-diff-report/git-diff-report.component'; - -@NgModule({ - imports: [ - RouterModule, - ArtemisSharedModule, - ArtemisExerciseHintSharedModule, - ArtemisSharedComponentModule, - TestwiseCoverageReportModule, - ArtemisMarkdownModule, - MatExpansionModule, - GitDiffReportComponent, - ], - declarations: [ - CodeHintGenerationStatusComponent, - SolutionEntryDetailsModalComponent, - DiffGenerationStepComponent, - CoverageGenerationStepComponent, - SolutionEntryGenerationStepComponent, - CodeHintGenerationStepComponent, - CodeHintGenerationOverviewComponent, - CodeHintGenerationStatusStepComponent, - ManualSolutionEntryCreationModalComponent, - ], - exports: [ - CodeHintGenerationStatusComponent, - SolutionEntryDetailsModalComponent, - DiffGenerationStepComponent, - CoverageGenerationStepComponent, - SolutionEntryGenerationStepComponent, - CodeHintGenerationStepComponent, - CodeHintGenerationOverviewComponent, - CodeHintGenerationStatusStepComponent, - ], -}) -export class ArtemisCodeHintGenerationOverviewModule {} diff --git a/src/main/webapp/app/exercises/programming/hestia/generation-overview/code-hint-generation-status/code-hint-generation-status-step.component.html b/src/main/webapp/app/exercises/programming/hestia/generation-overview/code-hint-generation-status/code-hint-generation-status-step.component.html deleted file mode 100644 index 0fb688bdaade..000000000000 --- a/src/main/webapp/app/exercises/programming/hestia/generation-overview/code-hint-generation-status/code-hint-generation-status-step.component.html +++ /dev/null @@ -1,14 +0,0 @@ -
-
- @if (isPerformed) { - - } - @if (!isPerformed) { - - } -
-
- Current step - -
-
diff --git a/src/main/webapp/app/exercises/programming/hestia/generation-overview/code-hint-generation-status/code-hint-generation-status-step.component.ts b/src/main/webapp/app/exercises/programming/hestia/generation-overview/code-hint-generation-status/code-hint-generation-status-step.component.ts deleted file mode 100644 index d46904d04367..000000000000 --- a/src/main/webapp/app/exercises/programming/hestia/generation-overview/code-hint-generation-status/code-hint-generation-status-step.component.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { Component, Input } from '@angular/core'; -import { faCheck, faDotCircle } from '@fortawesome/free-solid-svg-icons'; - -@Component({ - selector: 'jhi-code-hint-generation-status-step', - templateUrl: './code-hint-generation-status-step.component.html', - styleUrls: ['./code-hint-generation-status.component.scss'], -}) -export class CodeHintGenerationStatusStepComponent { - @Input() - currentlySelected: boolean; - - @Input() - isPerformed: boolean; - - @Input() - labelTranslationKey: string; - - @Input() - descriptionTranslationKey: string; - - faCheck = faCheck; - faDotCircle = faDotCircle; -} diff --git a/src/main/webapp/app/exercises/programming/hestia/generation-overview/code-hint-generation-status/code-hint-generation-status.component.html b/src/main/webapp/app/exercises/programming/hestia/generation-overview/code-hint-generation-status/code-hint-generation-status.component.html deleted file mode 100644 index 6cc22ad5429d..000000000000 --- a/src/main/webapp/app/exercises/programming/hestia/generation-overview/code-hint-generation-status/code-hint-generation-status.component.html +++ /dev/null @@ -1,45 +0,0 @@ -
- - @if (isPerformedByStep.get(GenerationStep.GIT_DIFF) !== undefined) { - - } - @if (isPerformedByStep.get(GenerationStep.GIT_DIFF) !== undefined) { -
- } - - @if (isPerformedByStep.get(GenerationStep.COVERAGE) !== undefined) { - - } - @if (isPerformedByStep.get(GenerationStep.COVERAGE) !== undefined) { -
- } - - -
- - -
diff --git a/src/main/webapp/app/exercises/programming/hestia/generation-overview/code-hint-generation-status/code-hint-generation-status.component.scss b/src/main/webapp/app/exercises/programming/hestia/generation-overview/code-hint-generation-status/code-hint-generation-status.component.scss deleted file mode 100644 index 5a790263e647..000000000000 --- a/src/main/webapp/app/exercises/programming/hestia/generation-overview/code-hint-generation-status/code-hint-generation-status.component.scss +++ /dev/null @@ -1,65 +0,0 @@ -.code-hint-generation-wrapper { - display: flex; - justify-content: space-between; - - .planned, - .finished, - .check { - color: var(--success); - } - - .unset { - color: var(--secondary); - } - - .current { - color: var(--warning); - } - - li { - display: list-item !important; - } - - .connector { - width: 100%; - min-width: 50px; - border-top: 2px solid; - margin-top: 1rem; - } -} - -.status-step { - width: 25px; - overflow-x: visible; - justify-content: flex-start; - display: flex; - flex-direction: column; - align-items: center; - - .status-step-content { - min-width: fit-content; - white-space: nowrap; - - .selected-label { - font-weight: bold; - } - } - - .header-icon { - z-index: 2; - font-size: 2em; - - & > fa-icon { - cursor: pointer; - background-color: var(--programming-exercise-instruction-step-wizard-card-header-background); - width: 30px; - height: 30px; - text-align: center; - padding: 6px 0; - font-size: 12px; - line-height: 1.428571429; - border-radius: 15px; - border-color: var(--programming-exercise-instruction-step-wizard-btn-border-color); - } - } -} diff --git a/src/main/webapp/app/exercises/programming/hestia/generation-overview/code-hint-generation-status/code-hint-generation-status.component.ts b/src/main/webapp/app/exercises/programming/hestia/generation-overview/code-hint-generation-status/code-hint-generation-status.component.ts deleted file mode 100644 index b0c31d9f9676..000000000000 --- a/src/main/webapp/app/exercises/programming/hestia/generation-overview/code-hint-generation-status/code-hint-generation-status.component.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { Component, EventEmitter, Input, Output } from '@angular/core'; -import { CodeHintGenerationStep } from 'app/entities/hestia/code-hint-model'; - -@Component({ - selector: 'jhi-code-hint-generation-status', - templateUrl: './code-hint-generation-status.component.html', - styleUrls: ['./code-hint-generation-status.component.scss'], -}) -export class CodeHintGenerationStatusComponent { - @Input() - currentStep: CodeHintGenerationStep; - - @Input() - isPerformedByStep: Map; - - @Output() - onStepChange = new EventEmitter(); - - readonly GenerationStep = CodeHintGenerationStep; - - constructor() {} - - onSelectStep(step: CodeHintGenerationStep) { - this.onStepChange.emit(step); - } -} diff --git a/src/main/webapp/app/exercises/programming/hestia/generation-overview/manual-solution-entry-creation-modal/manual-solution-entry-creation-modal.component.html b/src/main/webapp/app/exercises/programming/hestia/generation-overview/manual-solution-entry-creation-modal/manual-solution-entry-creation-modal.component.html deleted file mode 100644 index 842eb668da94..000000000000 --- a/src/main/webapp/app/exercises/programming/hestia/generation-overview/manual-solution-entry-creation-modal/manual-solution-entry-creation-modal.component.html +++ /dev/null @@ -1,43 +0,0 @@ -
- - -
diff --git a/src/main/webapp/app/exercises/programming/hestia/generation-overview/manual-solution-entry-creation-modal/manual-solution-entry-creation-modal.component.ts b/src/main/webapp/app/exercises/programming/hestia/generation-overview/manual-solution-entry-creation-modal/manual-solution-entry-creation-modal.component.ts deleted file mode 100644 index 0df03f1664b3..000000000000 --- a/src/main/webapp/app/exercises/programming/hestia/generation-overview/manual-solution-entry-creation-modal/manual-solution-entry-creation-modal.component.ts +++ /dev/null @@ -1,85 +0,0 @@ -import { Component, EventEmitter, OnDestroy, OnInit, ViewChild } from '@angular/core'; -import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; -import { Subject } from 'rxjs'; -import { ProgrammingExerciseTestCase } from 'app/entities/programming/programming-exercise-test-case.model'; -import { ProgrammingExerciseSolutionEntry } from 'app/entities/hestia/programming-exercise-solution-entry.model'; -import { ProgrammingExerciseService } from 'app/exercises/programming/manage/services/programming-exercise.service'; -import { CodeHint } from 'app/entities/hestia/code-hint-model'; -import { ProgrammingExerciseSolutionEntryService } from 'app/exercises/shared/exercise-hint/services/programming-exercise-solution-entry.service'; -import { SolutionEntryComponent } from 'app/exercises/shared/exercise-hint/shared/solution-entry.component'; - -@Component({ - selector: 'jhi-manual-solution-entry-creation-modal', - templateUrl: './manual-solution-entry-creation-modal.component.html', -}) -export class ManualSolutionEntryCreationModalComponent implements OnInit, OnDestroy { - @ViewChild('solutionEntryComponent', { static: false }) solutionEntryComponent: SolutionEntryComponent; - - solutionEntry = new ProgrammingExerciseSolutionEntry(); - - exerciseId: number; - codeHint?: CodeHint; - testCases?: ProgrammingExerciseTestCase[]; - onEntryCreated = new EventEmitter(); - - solutionRepositoryFileNames?: string[]; - - private dialogErrorSource = new Subject(); - dialogError$ = this.dialogErrorSource.asObservable(); - - constructor( - private activeModal: NgbActiveModal, - private exerciseService: ProgrammingExerciseService, - private solutionEntryService: ProgrammingExerciseSolutionEntryService, - ) { - this.solutionEntry.code = ''; - this.solutionEntry.line = 1; - } - - ngOnDestroy(): void { - this.dialogErrorSource.unsubscribe(); - } - - ngOnInit(): void { - this.solutionEntry.codeHint = this.codeHint; - // only load test cases if not set as an input - if (!this.testCases) { - this.exerciseService.getAllTestCases(this.exerciseId).subscribe({ - next: (testCases) => { - this.testCases = testCases; - }, - error: (error) => this.dialogErrorSource.error(error.message), - }); - } - this.exerciseService.getSolutionFileNames(this.exerciseId).subscribe({ - next: (fileNames) => { - this.solutionRepositoryFileNames = fileNames; - }, - error: (error) => this.dialogErrorSource.error(error.message), - }); - } - - /** - * Updates the solution entry editor to refer to the correct file path. - * In particular, this updates the syntax highlighting of the editor. - */ - onUpdateFilePath(): void { - this.solutionEntryComponent.setupEditor(); - } - - clear() { - this.activeModal.close(); - } - - onCreateEntry() { - // eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain - this.solutionEntryService.createSolutionEntry(this.exerciseId, this.solutionEntry?.testCase?.id!, this.solutionEntry).subscribe({ - next: (createdEntry) => { - this.dialogErrorSource.next(''); - this.onEntryCreated.emit(createdEntry); - this.activeModal.close(); - }, - error: (error) => this.dialogErrorSource.error(error.message), - }); - } -} diff --git a/src/main/webapp/app/exercises/programming/hestia/generation-overview/solution-entry-details-modal/solution-entry-details-modal.component.html b/src/main/webapp/app/exercises/programming/hestia/generation-overview/solution-entry-details-modal/solution-entry-details-modal.component.html deleted file mode 100644 index 721b53f675b1..000000000000 --- a/src/main/webapp/app/exercises/programming/hestia/generation-overview/solution-entry-details-modal/solution-entry-details-modal.component.html +++ /dev/null @@ -1,21 +0,0 @@ -
- - -
diff --git a/src/main/webapp/app/exercises/programming/hestia/generation-overview/solution-entry-details-modal/solution-entry-details-modal.component.ts b/src/main/webapp/app/exercises/programming/hestia/generation-overview/solution-entry-details-modal/solution-entry-details-modal.component.ts deleted file mode 100644 index 8e2dcbacb3ab..000000000000 --- a/src/main/webapp/app/exercises/programming/hestia/generation-overview/solution-entry-details-modal/solution-entry-details-modal.component.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { Component, OnDestroy } from '@angular/core'; -import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; -import { ProgrammingExerciseSolutionEntry } from 'app/entities/hestia/programming-exercise-solution-entry.model'; -import { Subject } from 'rxjs'; -import { ProgrammingExerciseSolutionEntryService } from 'app/exercises/shared/exercise-hint/services/programming-exercise-solution-entry.service'; - -@Component({ - selector: 'jhi-solution-entry-details-modal', - templateUrl: './solution-entry-details-modal.component.html', -}) -export class SolutionEntryDetailsModalComponent implements OnDestroy { - exerciseId: number; - solutionEntry: ProgrammingExerciseSolutionEntry; - isEditable: boolean; - - private dialogErrorSource = new Subject(); - dialogError$ = this.dialogErrorSource.asObservable(); - - constructor( - private activeModal: NgbActiveModal, - private solutionEntryService: ProgrammingExerciseSolutionEntryService, - ) {} - - ngOnDestroy(): void { - this.dialogErrorSource.unsubscribe(); - } - - clear() { - this.activeModal.close(); - } - - saveSolutionEntry() { - // eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain - this.solutionEntryService.updateSolutionEntry(this.exerciseId, this.solutionEntry.testCase?.id!, this.solutionEntry.id!, this.solutionEntry).subscribe({ - next: (updatedEntry) => { - this.solutionEntry = updatedEntry; - this.activeModal.close(); - }, - error: (error) => this.dialogErrorSource.error(error.message), - }); - } -} diff --git a/src/main/webapp/app/exercises/programming/hestia/generation-overview/steps/code-hint-generation-step/code-hint-generation-step.component.html b/src/main/webapp/app/exercises/programming/hestia/generation-overview/steps/code-hint-generation-step/code-hint-generation-step.component.html deleted file mode 100644 index 70538fa15b02..000000000000 --- a/src/main/webapp/app/exercises/programming/hestia/generation-overview/steps/code-hint-generation-step/code-hint-generation-step.component.html +++ /dev/null @@ -1,74 +0,0 @@ -@if (isLoading) { -
- -
-} @else { -
- @if (codeHints?.length) { - - - } @else { - - } -
- @if (codeHints?.length) { - - - - {{ 'artemisApp.codeHint.management.step4.title' | artemisTranslate }} - {{ 'artemisApp.codeHint.management.step4.task' | artemisTranslate }} - - - @for (codeHint of codeHints; track codeHint) { - - - - {{ codeHint.title }} - - - {{ codeHint?.programmingExerciseTask?.taskName }} - - -
- @if (codeHint?.solutionEntries) { -
- -
- } - -
-
- } -
- } @else { -
- -
- } -} diff --git a/src/main/webapp/app/exercises/programming/hestia/generation-overview/steps/code-hint-generation-step/code-hint-generation-step.component.ts b/src/main/webapp/app/exercises/programming/hestia/generation-overview/steps/code-hint-generation-step/code-hint-generation-step.component.ts deleted file mode 100644 index 59e8150e2fe8..000000000000 --- a/src/main/webapp/app/exercises/programming/hestia/generation-overview/steps/code-hint-generation-step/code-hint-generation-step.component.ts +++ /dev/null @@ -1,67 +0,0 @@ -import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; -import { ProgrammingExerciseService } from 'app/exercises/programming/manage/services/programming-exercise.service'; -import { CodeHint } from 'app/entities/hestia/code-hint-model'; -import { faWrench } from '@fortawesome/free-solid-svg-icons'; -import { ProgrammingExercise } from 'app/entities/programming/programming-exercise.model'; -import { CodeHintService } from 'app/exercises/shared/exercise-hint/services/code-hint.service'; -import { AlertService } from 'app/core/util/alert.service'; - -@Component({ - selector: 'jhi-code-hint-generation-step', - templateUrl: './code-hint-generation-step.component.html', - styleUrls: ['../../code-hint-generation-overview/code-hint-generation-overview.component.scss'], -}) -export class CodeHintGenerationStepComponent implements OnInit { - @Input() - exercise: ProgrammingExercise; - - @Output() - onCodeHintsLoaded = new EventEmitter(); - - isLoading = false; - codeHints?: CodeHint[]; - - faWrench = faWrench; - - constructor( - private exerciseService: ProgrammingExerciseService, - private codeHintService: CodeHintService, - private alertService: AlertService, - ) {} - - ngOnInit() { - this.isLoading = true; - this.exerciseService.getCodeHintsForExercise(this.exercise.id!).subscribe({ - next: (codeHints) => { - this.codeHints = codeHints; - this.onCodeHintsLoaded.emit(this.codeHints); - this.isLoading = false; - }, - error: (error) => { - this.isLoading = false; - this.alertService.error(error.message); - }, - }); - } - - generateCodeHints(deleteOldHints: boolean, buttonTranslationKey: string) { - this.isLoading = true; - // eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain - this.codeHintService.generateCodeHintsForExercise(this.exercise?.id!, deleteOldHints).subscribe({ - next: (generatedHints) => { - if (deleteOldHints) { - this.codeHints = generatedHints; - } else { - generatedHints.forEach((generatedHint) => this.codeHints?.push(generatedHint)); - } - this.onCodeHintsLoaded.emit(this.codeHints); - this.isLoading = false; - this.alertService.success('artemisApp.codeHint.management.step4.' + buttonTranslationKey + '.success'); - }, - error: (error) => { - this.isLoading = false; - this.alertService.error(error.message); - }, - }); - } -} diff --git a/src/main/webapp/app/exercises/programming/hestia/generation-overview/steps/coverage-generation-step/coverage-generation-step.component.html b/src/main/webapp/app/exercises/programming/hestia/generation-overview/steps/coverage-generation-step/coverage-generation-step.component.html deleted file mode 100644 index 421eb8140c86..000000000000 --- a/src/main/webapp/app/exercises/programming/hestia/generation-overview/steps/coverage-generation-step/coverage-generation-step.component.html +++ /dev/null @@ -1,13 +0,0 @@ -@if (isLoading) { -
- -
-} -@if (coverageReport && fileContentByPath) { - -} -@if (!(coverageReport || fileContentByPath)) { -
- -
-} diff --git a/src/main/webapp/app/exercises/programming/hestia/generation-overview/steps/coverage-generation-step/coverage-generation-step.component.ts b/src/main/webapp/app/exercises/programming/hestia/generation-overview/steps/coverage-generation-step/coverage-generation-step.component.ts deleted file mode 100644 index 0fdc47306615..000000000000 --- a/src/main/webapp/app/exercises/programming/hestia/generation-overview/steps/coverage-generation-step/coverage-generation-step.component.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; -import { CoverageReport } from 'app/entities/hestia/coverage-report.model'; -import { ProgrammingExerciseService } from 'app/exercises/programming/manage/services/programming-exercise.service'; -import { ProgrammingExercise } from 'app/entities/programming/programming-exercise.model'; -import { AlertService } from 'app/core/util/alert.service'; - -@Component({ - selector: 'jhi-coverage-generation-step', - templateUrl: './coverage-generation-step.component.html', - styleUrls: ['../../code-hint-generation-overview/code-hint-generation-overview.component.scss'], -}) -export class CoverageGenerationStepComponent implements OnInit { - @Input() - exercise: ProgrammingExercise; - - @Output() - onCoverageLoaded = new EventEmitter(); - - isLoading = false; - coverageReport?: CoverageReport; - fileContentByPath = new Map(); - - constructor( - private exerciseService: ProgrammingExerciseService, - private alertService: AlertService, - ) {} - - ngOnInit(): void { - this.isLoading = true; - this.exerciseService.getSolutionRepositoryTestFilesWithContent(this.exercise.id!).subscribe({ - next: (filesWithContent: Map) => { - this.exerciseService.getLatestFullTestwiseCoverageReport(this.exercise.id!).subscribe({ - next: (coverageReport) => { - this.isLoading = false; - this.onCoverageLoaded.emit(coverageReport); - this.coverageReport = coverageReport; - this.fileContentByPath = filesWithContent; - }, - error: (error) => { - this.isLoading = false; - this.alertService.error(error.message); - }, - }); - }, - }); - } -} diff --git a/src/main/webapp/app/exercises/programming/hestia/generation-overview/steps/diff-generation-step/diff-generation-step.component.html b/src/main/webapp/app/exercises/programming/hestia/generation-overview/steps/diff-generation-step/diff-generation-step.component.html deleted file mode 100644 index af31d173e0da..000000000000 --- a/src/main/webapp/app/exercises/programming/hestia/generation-overview/steps/diff-generation-step/diff-generation-step.component.html +++ /dev/null @@ -1,15 +0,0 @@ -@if (isLoading) { -
- -
-} -@if (!isLoading && gitDiffReport) { -
- -
-} -@if (!isLoading && !gitDiffReport) { -
- -
-} diff --git a/src/main/webapp/app/exercises/programming/hestia/generation-overview/steps/diff-generation-step/diff-generation-step.component.ts b/src/main/webapp/app/exercises/programming/hestia/generation-overview/steps/diff-generation-step/diff-generation-step.component.ts deleted file mode 100644 index 3903491a1477..000000000000 --- a/src/main/webapp/app/exercises/programming/hestia/generation-overview/steps/diff-generation-step/diff-generation-step.component.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; -import { ProgrammingExerciseService } from 'app/exercises/programming/manage/services/programming-exercise.service'; -import { ProgrammingExercise } from 'app/entities/programming/programming-exercise.model'; -import { AlertService } from 'app/core/util/alert.service'; -import { ProgrammingExerciseGitDiffReport } from 'app/entities/hestia/programming-exercise-git-diff-report.model'; - -@Component({ - selector: 'jhi-diff-generation-step', - templateUrl: './diff-generation-step.component.html', - styleUrls: ['../../code-hint-generation-overview/code-hint-generation-overview.component.scss'], -}) -export class DiffGenerationStepComponent implements OnInit { - @Input() - exercise: ProgrammingExercise; - - @Output() - onGitDiffLoaded = new EventEmitter(); - - isLoading = false; - gitDiffReport?: ProgrammingExerciseGitDiffReport; - templateFileContentByPath: Map; - solutionFileContentByPath: Map; - - constructor( - private exerciseService: ProgrammingExerciseService, - private alertService: AlertService, - ) {} - - ngOnInit() { - this.isLoading = true; - this.exerciseService.getDiffReport(this.exercise.id!).subscribe({ - next: (report) => { - this.gitDiffReport = report; - this.onGitDiffLoaded.emit(report); - this.exerciseService.getTemplateRepositoryTestFilesWithContent(this.exercise.id!).subscribe({ - next: (response: Map) => { - this.templateFileContentByPath = response; - this.isLoading = this.solutionFileContentByPath === undefined; - }, - }); - this.exerciseService.getSolutionRepositoryTestFilesWithContent(this.exercise.id!).subscribe({ - next: (response: Map) => { - this.solutionFileContentByPath = response; - this.isLoading = this.templateFileContentByPath === undefined; - }, - }); - }, - error: (error) => { - this.isLoading = false; - this.alertService.error(error.message); - }, - }); - } -} diff --git a/src/main/webapp/app/exercises/programming/hestia/generation-overview/steps/solution-entry-generation-step/solution-entry-generation-step.component.html b/src/main/webapp/app/exercises/programming/hestia/generation-overview/steps/solution-entry-generation-step/solution-entry-generation-step.component.html deleted file mode 100644 index 3e3b36f53456..000000000000 --- a/src/main/webapp/app/exercises/programming/hestia/generation-overview/steps/solution-entry-generation-step/solution-entry-generation-step.component.html +++ /dev/null @@ -1,97 +0,0 @@ -@if (isLoading) { -
- -
-} -
- - - @if (!!exercise?.buildConfig?.testwiseCoverageEnabled) { - - } - -
-
- - - - - - - - - - - - @for (entry of solutionEntries; track entry) { - - - - - - - - - } - -
- {{ 'artemisApp.programmingExerciseTestCase.testName' | artemisTranslate }} - - File Path - - -
{{ entry?.id }}{{ entry?.testCase?.testName }}{{ entry?.filePath }} - {{ - (entry.code?.split('\n')?.length! === 1 ? 'artemisApp.codeHint.lineOfCode' : 'artemisApp.codeHint.linesOfCode') - | artemisTranslate: { lines: entry.code?.split('\n')?.length! } - }} - {{ 'artemisApp.codeHint.entryAbbreviation.' + entry.testCase?.type?.toString()?.toLocaleLowerCase() | artemisTranslate }} -
- - - -
-
- @if (!solutionEntries?.length) { -
- -
- } -
diff --git a/src/main/webapp/app/exercises/programming/hestia/generation-overview/steps/solution-entry-generation-step/solution-entry-generation-step.component.ts b/src/main/webapp/app/exercises/programming/hestia/generation-overview/steps/solution-entry-generation-step/solution-entry-generation-step.component.ts deleted file mode 100644 index 5d4b3c68f675..000000000000 --- a/src/main/webapp/app/exercises/programming/hestia/generation-overview/steps/solution-entry-generation-step/solution-entry-generation-step.component.ts +++ /dev/null @@ -1,178 +0,0 @@ -import { Component, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angular/core'; -import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap'; -import { ProgrammingExerciseSolutionEntry } from 'app/entities/hestia/programming-exercise-solution-entry.model'; -import { SolutionEntryDetailsModalComponent } from 'app/exercises/programming/hestia/generation-overview/solution-entry-details-modal/solution-entry-details-modal.component'; -import { ProgrammingExerciseService } from 'app/exercises/programming/manage/services/programming-exercise.service'; -import { ProgrammingExerciseTestCaseType } from 'app/entities/programming/programming-exercise-test-case.model'; -import { ProgrammingExercise } from 'app/entities/programming/programming-exercise.model'; -import { AlertService } from 'app/core/util/alert.service'; -import { Subject } from 'rxjs'; -import { faSort, faSortDown, faSortUp, faTimes } from '@fortawesome/free-solid-svg-icons'; -import { CodeHintService } from 'app/exercises/shared/exercise-hint/services/code-hint.service'; -import { ManualSolutionEntryCreationModalComponent } from 'app/exercises/programming/hestia/generation-overview/manual-solution-entry-creation-modal/manual-solution-entry-creation-modal.component'; -import { SortingOrder } from 'app/shared/table/pageable-table'; -import { ProgrammingExerciseSolutionEntryService } from 'app/exercises/shared/exercise-hint/services/programming-exercise-solution-entry.service'; -import { ConfirmAutofocusModalComponent } from 'app/shared/components/confirm-autofocus-modal.component'; -import { ArtemisTranslatePipe } from 'app/shared/pipes/artemis-translate.pipe'; - -@Component({ - selector: 'jhi-solution-entry-generation-step', - templateUrl: './solution-entry-generation-step.component.html', - styleUrls: ['../../code-hint-generation-overview/code-hint-generation-overview.component.scss'], -}) -export class SolutionEntryGenerationStepComponent implements OnInit, OnDestroy { - @Input() - exercise: ProgrammingExercise; - - @Output() - onEntryUpdate = new EventEmitter(); - - isLoading: boolean; - solutionEntries: ProgrammingExerciseSolutionEntry[]; - faTimes = faTimes; - - testCaseSortOrder?: SortingOrder; - faSort = faSort; - faSortUp = faSortUp; - faSortDown = faSortDown; - - private dialogErrorSource = new Subject(); - dialogError$ = this.dialogErrorSource.asObservable(); - - readonly SortingOrder = SortingOrder; - - constructor( - private modalService: NgbModal, - private exerciseService: ProgrammingExerciseService, - private alertService: AlertService, - private artemisTranslatePipe: ArtemisTranslatePipe, - private codeHintService: CodeHintService, - private solutionEntryService: ProgrammingExerciseSolutionEntryService, - ) {} - - ngOnInit() { - this.isLoading = true; - this.solutionEntryService.getSolutionEntriesForExercise(this.exercise.id!).subscribe({ - next: (solutionEntries: ProgrammingExerciseSolutionEntry[]) => { - this.solutionEntries = solutionEntries; - this.isLoading = false; - this.onEntryUpdate.emit(this.solutionEntries); - }, - error: (error) => { - this.isLoading = false; - this.alertService.error(error.message); - }, - }); - } - - ngOnDestroy(): void { - this.dialogErrorSource.unsubscribe(); - } - - openSolutionEntryModal(solutionEntry: ProgrammingExerciseSolutionEntry, isEditable: boolean) { - const modalRef: NgbModalRef = this.modalService.open(SolutionEntryDetailsModalComponent as Component, { - size: 'lg', - backdrop: 'static', - }); - modalRef.componentInstance.exerciseId = this.exercise.id; - modalRef.componentInstance.solutionEntry = solutionEntry; - modalRef.componentInstance.isEditable = isEditable; - } - - openManualEntryCreationModal() { - const modalRef: NgbModalRef = this.modalService.open(ManualSolutionEntryCreationModalComponent as Component, { - size: 'lg', - backdrop: 'static', - }); - modalRef.componentInstance.exerciseId = this.exercise.id; - modalRef.componentInstance.onEntryCreated.subscribe((createdEntry: ProgrammingExerciseSolutionEntry) => { - this.solutionEntries.push(createdEntry); - this.onEntryUpdate.emit(this.solutionEntries); - }); - } - - onGenerateStructuralSolutionEntries() { - this.exerciseService.createStructuralSolutionEntries(this.exercise.id!).subscribe({ - next: (updatedStructuralEntries) => { - this.alertService.success('artemisApp.programmingExercise.createStructuralSolutionEntriesSuccess'); - // replace all structural entries - const result = this.removeSolutionEntriesOfTypeFromArray(this.solutionEntries, ProgrammingExerciseTestCaseType.STRUCTURAL); - Array.prototype.push.apply(result, updatedStructuralEntries); - this.solutionEntries = result; - this.testCaseSortOrder = undefined; - this.onEntryUpdate.emit(this.solutionEntries); - }, - error: (error) => this.alertService.error(error.message), - }); - } - - onGenerateBehavioralSolutionEntries() { - this.exerciseService.createBehavioralSolutionEntries(this.exercise.id!).subscribe({ - next: (updatedBehavioralEntries) => { - this.alertService.success('artemisApp.programmingExercise.createBehavioralSolutionEntriesSuccess'); - // replace all behavioral entries - const result = this.removeSolutionEntriesOfTypeFromArray(this.solutionEntries, ProgrammingExerciseTestCaseType.BEHAVIORAL); - Array.prototype.push.apply(result, updatedBehavioralEntries); - this.solutionEntries = result; - this.testCaseSortOrder = undefined; - this.onEntryUpdate.emit(this.solutionEntries); - }, - error: (error) => this.alertService.error(error.message), - }); - } - - openBulkDeletionModal() { - const modalRef = this.modalService.open(ConfirmAutofocusModalComponent, { keyboard: true, size: 'lg' }); - modalRef.componentInstance.title = 'artemisApp.codeHint.management.step3.deleteAllEntriesButton.title'; - modalRef.componentInstance.text = this.artemisTranslatePipe.transform('artemisApp.codeHint.management.step3.deleteAllEntriesButton.question'); - modalRef.result.then(() => { - this.deleteAllSolutionEntries(); - }); - } - - deleteAllSolutionEntries() { - // eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain - this.solutionEntryService.deleteAllSolutionEntriesForExercise(this.exercise?.id!).subscribe({ - next: () => { - this.solutionEntries = []; - this.onEntryUpdate.emit([]); - this.alertService.success('artemisApp.codeHint.management.step3.deleteAllEntriesButton.success'); - this.dialogErrorSource.next(''); - }, - error: (error) => this.dialogErrorSource.error(error.message), - }); - } - - deleteSolutionEntry(entry: ProgrammingExerciseSolutionEntry) { - // eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain - this.solutionEntryService.deleteSolutionEntry(this.exercise?.id!, entry.testCase?.id!, entry.id!).subscribe({ - next: () => { - this.solutionEntries = this.solutionEntries.filter((existingEntry) => entry !== existingEntry); - this.dialogErrorSource.next(''); - this.onEntryUpdate.emit(this.solutionEntries); - }, - error: (error) => this.dialogErrorSource.error(error.message), - }); - } - - changeTestCaseSortOrder() { - switch (this.testCaseSortOrder) { - case SortingOrder.ASCENDING: - this.solutionEntries = this.solutionEntries.reverse(); - this.testCaseSortOrder = SortingOrder.DESCENDING; - break; - case SortingOrder.DESCENDING: - this.solutionEntries = this.solutionEntries.reverse(); - this.testCaseSortOrder = SortingOrder.ASCENDING; - break; - case undefined: - // eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain - this.solutionEntries = this.solutionEntries.sort((a, b) => a.testCase?.testName!.localeCompare(b.testCase?.testName!)!); - this.testCaseSortOrder = SortingOrder.ASCENDING; - } - } - - private removeSolutionEntriesOfTypeFromArray(entries: ProgrammingExerciseSolutionEntry[], typeToRemove: ProgrammingExerciseTestCaseType) { - return entries.filter((entry) => entry.testCase?.type !== typeToRemove); - } -} diff --git a/src/main/webapp/app/exercises/programming/hestia/testwise-coverage-report/testwise-coverage-file.component.html b/src/main/webapp/app/exercises/programming/hestia/testwise-coverage-report/testwise-coverage-file.component.html deleted file mode 100644 index 3690bfdf0e3b..000000000000 --- a/src/main/webapp/app/exercises/programming/hestia/testwise-coverage-report/testwise-coverage-file.component.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - {{ fileName }} - - {{ proportionString }} - -
- -
-
diff --git a/src/main/webapp/app/exercises/programming/hestia/testwise-coverage-report/testwise-coverage-file.component.scss b/src/main/webapp/app/exercises/programming/hestia/testwise-coverage-report/testwise-coverage-file.component.scss deleted file mode 100644 index 915e18b1199e..000000000000 --- a/src/main/webapp/app/exercises/programming/hestia/testwise-coverage-report/testwise-coverage-file.component.scss +++ /dev/null @@ -1,20 +0,0 @@ -.mat-expansion-panel-header { - padding: 0; -} - -.mat-expansion-panel .mat-expansion-panel-body { - padding: 0 !important; -} - -.mat-expansion-panel-header-description { - flex-grow: 0; -} - -.mat-expansion-panel .mat-expansion-indicator::after { - margin-right: 2px !important; - margin-left: 2px !important; -} - -.covered-line-highlight { - background-color: var(--monaco-editor-test-coverage-highlight); -} diff --git a/src/main/webapp/app/exercises/programming/hestia/testwise-coverage-report/testwise-coverage-file.component.ts b/src/main/webapp/app/exercises/programming/hestia/testwise-coverage-report/testwise-coverage-file.component.ts deleted file mode 100644 index b9fc28de4fbf..000000000000 --- a/src/main/webapp/app/exercises/programming/hestia/testwise-coverage-report/testwise-coverage-file.component.ts +++ /dev/null @@ -1,91 +0,0 @@ -import { Component, Input, OnChanges, OnInit, SimpleChanges, ViewChild, ViewEncapsulation } from '@angular/core'; -import { CoverageFileReport } from 'app/entities/hestia/coverage-file-report.model'; -import { MonacoEditorComponent } from 'app/shared/monaco-editor/monaco-editor.component'; - -@Component({ - selector: 'jhi-testwise-coverage-file', - templateUrl: './testwise-coverage-file.component.html', - styleUrls: ['./testwise-coverage-file.component.scss'], - encapsulation: ViewEncapsulation.None, -}) -export class TestwiseCoverageFileComponent implements OnInit, OnChanges { - @Input() - fileContent: string; - - @Input() - fileName: string; - - @Input() - fileReport: CoverageFileReport; - - @ViewChild('editor', { static: true }) - editor: MonacoEditorComponent; - - proportionCoveredLines: number; - proportionString: string; - editorHeight: number = 20; - - static readonly COVERED_LINE_HIGHLIGHT_CLASS = 'covered-line-highlight'; - - ngOnInit(): void { - this.renderFile(); - this.editorHeight = this.editor.getContentHeight(); - } - - ngOnChanges(changes: SimpleChanges): void { - if (changes.fileReport || changes.fileContent) { - this.renderFile(); - } - } - - private aggregateCoveredLinesBlocks(fileReport: CoverageFileReport): Map { - const coveredLines = new Set(); - const entries = fileReport.testwiseCoverageEntries!; - // retrieve all covered line numbers - entries.forEach((entry) => { - this.getRangeArray(entry.startLine!, entry.lineCount!).forEach((line) => coveredLines.add(line)); - }); - - // build the blocks - const orderedLines = Array.from(coveredLines).sort(); - const startLineByLength = new Map(); - - // set the covered line ratio accordingly - this.proportionCoveredLines = orderedLines.length / this.fileReport!.lineCount!; - this.proportionString = `${(this.proportionCoveredLines * 100).toFixed(1)} %`; - - let index = 0; - while (index < orderedLines.length) { - const currentBlockStartLine = orderedLines[index]; - let currentBlockLength = 1; - let continueBlock = true; - - // count the length of the consecutive blocks - while (continueBlock && index < orderedLines.length) { - if (index + 1 === orderedLines.length) { - continueBlock = false; - } else if (orderedLines[index + 1] === orderedLines[index] + 1) { - currentBlockLength++; - } else { - continueBlock = false; - } - index++; - } - startLineByLength.set(currentBlockStartLine, currentBlockLength); - } - - return startLineByLength; - } - - private getRangeArray(startLine: number, lineCount: number): number[] { - return [...Array(lineCount).keys()].map((i) => i + startLine - 1); - } - - private renderFile() { - this.editor.changeModel(this.fileName, this.fileContent ?? ''); - this.editor.disposeLineHighlights(); - this.aggregateCoveredLinesBlocks(this.fileReport).forEach((blockLength, lineNumber) => { - this.editor.highlightLines(lineNumber + 1, lineNumber + blockLength, 'covered-line-highlight', 'covered-line-highlight'); - }); - } -} diff --git a/src/main/webapp/app/exercises/programming/hestia/testwise-coverage-report/testwise-coverage-report-modal.component.html b/src/main/webapp/app/exercises/programming/hestia/testwise-coverage-report/testwise-coverage-report-modal.component.html deleted file mode 100644 index 01e96e404923..000000000000 --- a/src/main/webapp/app/exercises/programming/hestia/testwise-coverage-report/testwise-coverage-report-modal.component.html +++ /dev/null @@ -1,11 +0,0 @@ -
- - -
diff --git a/src/main/webapp/app/exercises/programming/hestia/testwise-coverage-report/testwise-coverage-report-modal.component.ts b/src/main/webapp/app/exercises/programming/hestia/testwise-coverage-report/testwise-coverage-report-modal.component.ts deleted file mode 100644 index 2183198c8772..000000000000 --- a/src/main/webapp/app/exercises/programming/hestia/testwise-coverage-report/testwise-coverage-report-modal.component.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { Component, Input } from '@angular/core'; -import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; -import { CoverageReport } from 'app/entities/hestia/coverage-report.model'; - -@Component({ - selector: 'jhi-testwise-coverage-report-modal', - templateUrl: './testwise-coverage-report-modal.component.html', -}) -export class TestwiseCoverageReportModalComponent { - @Input() - report: CoverageReport; - - @Input() - fileContentByPath: Map; - - constructor(protected activeModal: NgbActiveModal) {} - - close(): void { - this.activeModal.dismiss(); - } -} diff --git a/src/main/webapp/app/exercises/programming/hestia/testwise-coverage-report/testwise-coverage-report.component.html b/src/main/webapp/app/exercises/programming/hestia/testwise-coverage-report/testwise-coverage-report.component.html deleted file mode 100644 index b16a1eccd579..000000000000 --- a/src/main/webapp/app/exercises/programming/hestia/testwise-coverage-report/testwise-coverage-report.component.html +++ /dev/null @@ -1,17 +0,0 @@ - -@for (entry of displayedTestCaseNames | keyvalue; track entry) { -
- - {{ entry.key }} -
-} -
-
-
-
-
-@for (entry of fileReportByFileName | keyvalue; track identifyCoverageFileComponent($index, entry)) { -
- -
-} diff --git a/src/main/webapp/app/exercises/programming/hestia/testwise-coverage-report/testwise-coverage-report.component.ts b/src/main/webapp/app/exercises/programming/hestia/testwise-coverage-report/testwise-coverage-report.component.ts deleted file mode 100644 index a5f6b75f05a7..000000000000 --- a/src/main/webapp/app/exercises/programming/hestia/testwise-coverage-report/testwise-coverage-report.component.ts +++ /dev/null @@ -1,75 +0,0 @@ -import { Component, Input, OnInit } from '@angular/core'; -import { CoverageReport } from 'app/entities/hestia/coverage-report.model'; -import { CoverageFileReport } from 'app/entities/hestia/coverage-file-report.model'; - -@Component({ - selector: 'jhi-testwise-coverage-report', - templateUrl: './testwise-coverage-report.component.html', -}) -export class TestwiseCoverageReportComponent implements OnInit { - @Input() - report: CoverageReport; - - @Input() - fileContentByPath: Map; - - displayedTestCaseNames: Map; - - fileReportByFileName: Map; - - constructor() {} - - ngOnInit(): void { - // initially display covered lines for all test cases - this.displayedTestCaseNames = new Map(); - // retrieve all test cases - const testCases = new Set( - this.report?.fileReports - ?.flatMap((report) => report) - .flatMap((fileReport) => fileReport.testwiseCoverageEntries) - .map((entry) => entry!.testCase), - ); - testCases.forEach((testCase) => this.displayedTestCaseNames.set(testCase!.testName!, true)); - - this.setReportsByFileName(); - } - - changeReportsBySelectedTestCases(testCaseName: string): void { - const selected = this.displayedTestCaseNames.get(testCaseName); - this.displayedTestCaseNames.set(testCaseName, !selected); - this.setReportsByFileName(); - } - - private setReportsByFileName(): void { - const result = new Map(); - // create the reports for all files, not only for files that have existing coverage data - this.fileContentByPath?.forEach((content, filePath) => { - // do not include non-java/kotlin files - if (!(filePath.endsWith('.java') || filePath.endsWith('.kt'))) { - return; - } - const matchingFileReport = this.report.fileReports?.filter((fileReport) => fileReport?.filePath === filePath)?.first(); - const copiedFileReport = new CoverageFileReport(); - copiedFileReport.filePath = filePath; - if (matchingFileReport) { - copiedFileReport.lineCount = matchingFileReport.lineCount; - copiedFileReport.coveredLineCount = matchingFileReport.coveredLineCount; - - // filter out entries for the current file report - copiedFileReport.testwiseCoverageEntries = matchingFileReport.testwiseCoverageEntries?.filter((entry) => - this.displayedTestCaseNames.get(entry.testCase!.testName!), - ); - } else { - copiedFileReport.lineCount = content.split('\n').length; - copiedFileReport.coveredLineCount = 0; - copiedFileReport.testwiseCoverageEntries = []; - } - result.set(filePath, copiedFileReport); - }); - this.fileReportByFileName = result; - } - - identifyCoverageFileComponent(index: number, item: any) { - return item.key; - } -} diff --git a/src/main/webapp/app/exercises/programming/hestia/testwise-coverage-report/testwise-coverage-report.module.ts b/src/main/webapp/app/exercises/programming/hestia/testwise-coverage-report/testwise-coverage-report.module.ts deleted file mode 100644 index c37bc7a255da..000000000000 --- a/src/main/webapp/app/exercises/programming/hestia/testwise-coverage-report/testwise-coverage-report.module.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { NgModule } from '@angular/core'; -import { ArtemisSharedModule } from 'app/shared/shared.module'; -import { TestwiseCoverageReportModalComponent } from 'app/exercises/programming/hestia/testwise-coverage-report/testwise-coverage-report-modal.component'; -import { TestwiseCoverageReportComponent } from 'app/exercises/programming/hestia/testwise-coverage-report/testwise-coverage-report.component'; -import { TestwiseCoverageFileComponent } from 'app/exercises/programming/hestia/testwise-coverage-report/testwise-coverage-file.component'; -import { MatExpansionModule } from '@angular/material/expansion'; -import { MonacoEditorComponent } from 'app/shared/monaco-editor/monaco-editor.component'; - -@NgModule({ - imports: [ArtemisSharedModule, MatExpansionModule, MonacoEditorComponent], - declarations: [TestwiseCoverageFileComponent, TestwiseCoverageReportComponent, TestwiseCoverageReportModalComponent], - exports: [TestwiseCoverageFileComponent, TestwiseCoverageReportModalComponent, TestwiseCoverageReportComponent], -}) -export class TestwiseCoverageReportModule {} diff --git a/src/main/webapp/app/exercises/programming/manage/grading/tasks/programming-exercise-grading-tasks-table.component.ts b/src/main/webapp/app/exercises/programming/manage/grading/tasks/programming-exercise-grading-tasks-table.component.ts index bd491c999df9..ec88a4dc9ae1 100644 --- a/src/main/webapp/app/exercises/programming/manage/grading/tasks/programming-exercise-grading-tasks-table.component.ts +++ b/src/main/webapp/app/exercises/programming/manage/grading/tasks/programming-exercise-grading-tasks-table.component.ts @@ -8,7 +8,7 @@ import { ProgrammingExerciseTask } from './programming-exercise-task'; import { Observable, Subject } from 'rxjs'; import { ProgrammingExerciseTestCase } from 'app/entities/programming/programming-exercise-test-case.model'; import { isExamExercise } from 'app/shared/util/utils'; -import { ProgrammingExerciseServerSideTask } from 'app/entities/hestia/programming-exercise-task.model'; +import { ProgrammingExerciseServerSideTask } from 'app/entities/programming-exercise-task.model'; type Sort = { by: 'name' | 'weight' | 'multiplier' | 'bonusPoints' | 'visibility' | 'resulting' | 'type'; diff --git a/src/main/webapp/app/exercises/programming/manage/grading/tasks/programming-exercise-task.service.ts b/src/main/webapp/app/exercises/programming/manage/grading/tasks/programming-exercise-task.service.ts index 5f45d551b476..3021e5e548f2 100644 --- a/src/main/webapp/app/exercises/programming/manage/grading/tasks/programming-exercise-task.service.ts +++ b/src/main/webapp/app/exercises/programming/manage/grading/tasks/programming-exercise-task.service.ts @@ -1,6 +1,6 @@ import { HttpClient, HttpErrorResponse } from '@angular/common/http'; import { Injectable } from '@angular/core'; -import { ProgrammingExerciseServerSideTask } from 'app/entities/hestia/programming-exercise-task.model'; +import { ProgrammingExerciseServerSideTask } from 'app/entities/programming-exercise-task.model'; import { Observable, catchError, of, tap } from 'rxjs'; import { Exercise } from 'app/entities/exercise.model'; import { ProgrammingExerciseTask } from 'app/exercises/programming/manage/grading/tasks/programming-exercise-task'; diff --git a/src/main/webapp/app/exercises/programming/manage/grading/tasks/programming-exercise-task.ts b/src/main/webapp/app/exercises/programming/manage/grading/tasks/programming-exercise-task.ts index 3a5844ddbb9e..101498cc8cf4 100644 --- a/src/main/webapp/app/exercises/programming/manage/grading/tasks/programming-exercise-task.ts +++ b/src/main/webapp/app/exercises/programming/manage/grading/tasks/programming-exercise-task.ts @@ -1,4 +1,4 @@ -import { ProgrammingExerciseServerSideTask } from 'app/entities/hestia/programming-exercise-task.model'; +import { ProgrammingExerciseServerSideTask } from 'app/entities/programming-exercise-task.model'; import { TestCaseStats } from 'app/entities/programming/programming-exercise-test-case-statistics.model'; import { ProgrammingExerciseTestCase, ProgrammingExerciseTestCaseType, Visibility } from 'app/entities/programming/programming-exercise-test-case.model'; diff --git a/src/main/webapp/app/exercises/programming/manage/programming-exercise-detail.component.html b/src/main/webapp/app/exercises/programming/manage/programming-exercise-detail.component.html index 95da3dea7a71..d3809ff3fdc8 100644 --- a/src/main/webapp/app/exercises/programming/manage/programming-exercise-detail.component.html +++ b/src/main/webapp/app/exercises/programming/manage/programming-exercise-detail.component.html @@ -40,15 +40,6 @@

{{ } - @if (programmingExercise.course && !isExamExercise) { - - - - - } @@ -134,27 +125,6 @@

{{ } - @if (programmingExercise.isAtLeastEditor) { - - @if ( - (programmingExercise.programmingLanguage === ProgrammingLanguage.JAVA || - programmingExercise.programmingLanguage === ProgrammingLanguage.KOTLIN) && - programmingExercise.buildConfig?.testwiseCoverageEnabled - ) { - - - - } - - } @if (programmingExercise.isAtLeastInstructor && !localVCEnabled) { - - } - @if (exercise?.id) { -
- - -
- } - -
- - -
- - - diff --git a/src/main/webapp/app/exercises/shared/exercise-hint/manage/exercise-hint-update.component.ts b/src/main/webapp/app/exercises/shared/exercise-hint/manage/exercise-hint-update.component.ts deleted file mode 100644 index 260aba7f73e9..000000000000 --- a/src/main/webapp/app/exercises/shared/exercise-hint/manage/exercise-hint-update.component.ts +++ /dev/null @@ -1,196 +0,0 @@ -import { Component, OnDestroy, OnInit } from '@angular/core'; -import { HttpResponse } from '@angular/common/http'; -import { ActivatedRoute } from '@angular/router'; -import { Observable, Subscription, filter, switchMap } from 'rxjs'; -import { AlertService } from 'app/core/util/alert.service'; -import { ExerciseHintService } from '../shared/exercise-hint.service'; -import { ArtemisNavigationUtilService } from 'app/utils/navigation.utils'; -import { faBan, faCircleNotch, faSave } from '@fortawesome/free-solid-svg-icons'; -import { ExerciseHint, HintType } from 'app/entities/hestia/exercise-hint.model'; -import { ProgrammingExerciseService } from 'app/exercises/programming/manage/services/programming-exercise.service'; -import { ProgrammingExerciseSolutionEntry } from 'app/entities/hestia/programming-exercise-solution-entry.model'; -import { ProgrammingExercise } from 'app/entities/programming/programming-exercise.model'; -import { ProgrammingExerciseServerSideTask } from 'app/entities/hestia/programming-exercise-task.model'; -import { ManualSolutionEntryCreationModalComponent } from 'app/exercises/programming/hestia/generation-overview/manual-solution-entry-creation-modal/manual-solution-entry-creation-modal.component'; -import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap'; -import { CodeHint } from 'app/entities/hestia/code-hint-model'; -import { CodeHintService } from 'app/exercises/shared/exercise-hint/services/code-hint.service'; -import { onError } from 'app/shared/util/global.utils'; -import { IrisSettingsService } from 'app/iris/settings/shared/iris-settings.service'; -import { IrisSettings } from 'app/entities/iris/settings/iris-settings.model'; -import { ProfileService } from 'app/shared/layouts/profiles/profile.service'; -import { ButtonType } from 'app/shared/components/button.component'; -import { PROFILE_IRIS } from 'app/app.constants'; -import { FormulaAction } from 'app/shared/monaco-editor/model/actions/formula.action'; -import { MarkdownEditorHeight } from 'app/shared/markdown-editor/monaco/markdown-editor-monaco.component'; - -const DEFAULT_DISPLAY_THRESHOLD = 3; - -@Component({ - selector: 'jhi-exercise-hint-update', - templateUrl: './exercise-hint-update.component.html', -}) -export class ExerciseHintUpdateComponent implements OnInit, OnDestroy { - MarkdownEditorHeight = MarkdownEditorHeight; - - courseId: number; - exercise: ProgrammingExercise; - exerciseHint = new ExerciseHint(); - solutionEntries: ProgrammingExerciseSolutionEntry[]; - - programmingExercise: ProgrammingExercise; - tasks: ProgrammingExerciseServerSideTask[]; - irisSettings?: IrisSettings; - - isSaving: boolean; - isGeneratingDescription: boolean; - paramSub: Subscription; - - domainActions = [new FormulaAction()]; - - // Icons - faCircleNotch = faCircleNotch; - faBan = faBan; - faSave = faSave; - - // Enums - readonly HintType = HintType; - readonly ButtonType = ButtonType; - - constructor( - private route: ActivatedRoute, - protected alertService: AlertService, - private modalService: NgbModal, - protected codeHintService: CodeHintService, - protected exerciseHintService: ExerciseHintService, - private programmingExerciseService: ProgrammingExerciseService, - private navigationUtilService: ArtemisNavigationUtilService, - protected irisSettingsService: IrisSettingsService, - private profileService: ProfileService, - ) {} - - /** - * Fetches the exercise from the server and assigns it on the exercise hint - */ - ngOnInit() { - this.paramSub = this.route.params.subscribe((params) => { - this.courseId = params['courseId']; - this.isSaving = false; - this.isGeneratingDescription = false; - }); - this.route.data.subscribe(({ exerciseHint, exercise }) => { - this.exercise = exercise; - exerciseHint.exercise = exercise; - this.exerciseHint = exerciseHint; - this.exerciseHint.displayThreshold = this.exerciseHint.displayThreshold ?? DEFAULT_DISPLAY_THRESHOLD; - - this.programmingExerciseService.getTasksAndTestsExtractedFromProblemStatement(this.exercise.id!).subscribe((tasks) => { - this.tasks = tasks; - - const selectedTask = this.tasks.find((task) => task.id === this.exerciseHint.programmingExerciseTask?.id); - if (selectedTask) { - this.exerciseHint.programmingExerciseTask = selectedTask; - } else if (tasks.length) { - this.exerciseHint.programmingExerciseTask = this.tasks[0]; - } - }); - - this.profileService - .getProfileInfo() - .pipe( - filter((profileInfo) => profileInfo?.activeProfiles?.includes(PROFILE_IRIS)), - switchMap(() => this.irisSettingsService.getCombinedExerciseSettings(this.exercise.id!)), - ) - .subscribe((settings) => { - this.irisSettings = settings; - }); - }); - } - - openManualEntryCreationModal() { - const codeHint = this.exerciseHint as CodeHint; - const testCasesForCurrentTask = codeHint.programmingExerciseTask?.testCases ?? []; - const modalRef: NgbModalRef = this.modalService.open(ManualSolutionEntryCreationModalComponent as Component, { size: 'lg', backdrop: 'static' }); - modalRef.componentInstance.exerciseId = this.exercise.id!; - modalRef.componentInstance.codeHint = codeHint; - modalRef.componentInstance.testCases = testCasesForCurrentTask; - modalRef.componentInstance.onEntryCreated.subscribe((createdEntry: ProgrammingExerciseSolutionEntry) => { - codeHint!.solutionEntries!.push(createdEntry); - }); - } - - /** - * Unsubscribes from the param subscription - */ - ngOnDestroy(): void { - if (this.paramSub) { - this.paramSub.unsubscribe(); - } - } - - /** - * Setter to update the exercise hint content - * @param newContent New value to set - */ - updateHintContent(newContent: string) { - this.exerciseHint.content = newContent; - } - - /** - * Navigate to the previous page when the user cancels the update process - * Returns to the detail page if there is no previous state and we edited an existing hint - * Returns to the overview page if there is no previous state and we created a new hint - */ - previousState() { - this.navigationUtilService.navigateBackWithOptional( - ['course-management', this.courseId.toString(), 'programming-exercises', this.exercise.id!.toString(), 'hints'], - this.exerciseHint.id?.toString(), - ); - } - - /** - * Saves the exercise hint by creating or updating it on the server - */ - save() { - this.isSaving = true; - if (this.exerciseHint.id !== undefined) { - this.subscribeToSaveResponse(this.exerciseHintService.update(this.exercise.id!, this.exerciseHint)); - } else { - this.subscribeToSaveResponse(this.exerciseHintService.create(this.exercise.id!, this.exerciseHint)); - } - } - - generateDescriptionForCodeHint() { - if (((this.exerciseHint as CodeHint).solutionEntries?.length ?? 0) === 0) { - return; - } - this.isGeneratingDescription = true; - this.codeHintService.generateDescriptionForCodeHint(this.exercise.id!, this.exerciseHint.id!).subscribe({ - next: (response) => { - this.exerciseHint.description = response.body!.description; - this.exerciseHint.content = response.body!.content; - this.isGeneratingDescription = false; - }, - error: (error) => { - this.isGeneratingDescription = false; - onError(this.alertService, error); - }, - }); - } - - protected subscribeToSaveResponse(result: Observable>) { - result.subscribe({ - next: () => this.onSaveSuccess(), - error: () => this.onSaveError(), - }); - } - - protected onSaveSuccess() { - this.isSaving = false; - this.previousState(); - } - - protected onSaveError() { - this.isSaving = false; - } -} diff --git a/src/main/webapp/app/exercises/shared/exercise-hint/manage/exercise-hint.component.html b/src/main/webapp/app/exercises/shared/exercise-hint/manage/exercise-hint.component.html deleted file mode 100644 index 59db6e86ff2f..000000000000 --- a/src/main/webapp/app/exercises/shared/exercise-hint/manage/exercise-hint.component.html +++ /dev/null @@ -1,110 +0,0 @@ -
-

- - @if (exercise?.programmingLanguage === ProgrammingLanguage.JAVA) { - - @if (containsCodeHints) { -
- - Manage Code Hints -
- } - @if (!containsCodeHints) { -
- - -
- } -
- } - - - - -

-
- @if (exerciseHints?.length === 0) { -
- -
- } - @if (exerciseHints && exerciseHints.length > 0) { -
- - - - - - - - - - - - @for (exerciseHint of exerciseHints; track trackId($index, exerciseHint)) { - - - - - - - - } - -
- {{ exerciseHint.id }} - - {{ exerciseHint.title }} -
- @if (exerciseHint.type === HintType.CODE && exerciseHint.exercise?.type === ExerciseType.PROGRAMMING) { - {{ 'artemisApp.codeHint.type' | artemisTranslate }} - } - @if (exerciseHint.type === HintType.TEXT && exerciseHint.exercise?.type === ExerciseType.PROGRAMMING) { - {{ 'artemisApp.exerciseHint.textHint' | artemisTranslate }} - } -
-
- -
- @if (exerciseHint.type === HintType.CODE) { -
- - {{ (exerciseHint | castToCodeHint).solutionEntries?.length ?? 0 }} - {{ - ((exerciseHint | castToCodeHint).solutionEntries?.length === 1 ? 'artemisApp.codeHint.entry' : 'artemisApp.codeHint.entries') - | artemisTranslate - }} - -
- } -
- {{ exerciseHint.exercise?.id }} - -
- - - - - - - - - -
-
-
- } -
diff --git a/src/main/webapp/app/exercises/shared/exercise-hint/manage/exercise-hint.component.ts b/src/main/webapp/app/exercises/shared/exercise-hint/manage/exercise-hint.component.ts deleted file mode 100644 index 3b542f17643b..000000000000 --- a/src/main/webapp/app/exercises/shared/exercise-hint/manage/exercise-hint.component.ts +++ /dev/null @@ -1,127 +0,0 @@ -import { Component, OnDestroy, OnInit } from '@angular/core'; -import { ActivatedRoute } from '@angular/router'; -import { HttpErrorResponse, HttpResponse } from '@angular/common/http'; -import { Subject, Subscription } from 'rxjs'; -import { filter, map } from 'rxjs/operators'; - -import { ExerciseHintService } from '../shared/exercise-hint.service'; -import { onError } from 'app/shared/util/global.utils'; -import { AlertService } from 'app/core/util/alert.service'; -import { EventManager } from 'app/core/util/event-manager.service'; -import { faArrowsRotate, faCode, faEye, faFont, faPlus, faTimes, faWrench } from '@fortawesome/free-solid-svg-icons'; -import { ExerciseHint, HintType } from 'app/entities/hestia/exercise-hint.model'; -import { ExerciseType } from 'app/entities/exercise.model'; -import { ProgrammingExercise, ProgrammingLanguage } from 'app/entities/programming/programming-exercise.model'; - -@Component({ - selector: 'jhi-exercise-hint', - templateUrl: './exercise-hint.component.html', -}) -export class ExerciseHintComponent implements OnInit, OnDestroy { - readonly HintType = HintType; - ExerciseType = ExerciseType; - exercise: ProgrammingExercise; - exerciseHints: ExerciseHint[]; - containsCodeHints: boolean; - eventSubscriber: Subscription; - - private dialogErrorSource = new Subject(); - dialogError$ = this.dialogErrorSource.asObservable(); - - paramSub: Subscription; - - // Icons - faPlus = faPlus; - faTimes = faTimes; - faEye = faEye; - faWrench = faWrench; - faText = faFont; - faCode = faCode; - faArrowsRotate = faArrowsRotate; - - readonly ProgrammingLanguage = ProgrammingLanguage; - - constructor( - private route: ActivatedRoute, - protected exerciseHintService: ExerciseHintService, - private alertService: AlertService, - protected eventManager: EventManager, - ) {} - - /** - * Subscribes to the route params to act on the currently selected exercise. - */ - ngOnInit() { - this.route.data.subscribe(({ exercise }) => { - this.exercise = exercise; - this.loadAllByExerciseId(); - this.registerChangeInExerciseHints(); - }); - } - - /** - * Unsubscribe from subscriptions - */ - ngOnDestroy() { - if (this.paramSub) { - this.paramSub.unsubscribe(); - } - this.eventManager.destroy(this.eventSubscriber); - this.dialogErrorSource.unsubscribe(); - } - - /** - * Load all exercise hints with the currently selected exerciseId (taken from route params). - */ - loadAllByExerciseId() { - this.exerciseHintService - .findByExerciseId(this.exercise.id!) - .pipe( - filter((res: HttpResponse) => res.ok), - map((res: HttpResponse) => res.body), - ) - .subscribe({ - next: (res: ExerciseHint[]) => { - this.exerciseHints = res; - this.containsCodeHints = this.exerciseHints?.some((hint) => hint.type === HintType.CODE); - }, - error: (res: HttpErrorResponse) => onError(this.alertService, res), - }); - } - - /** - * Returns the track id of an exercise hint - * @param index Index of the item - * @param item Item for which to get the id - */ - trackId(index: number, item: ExerciseHint) { - return item.id; - } - - /** - * (Re-)subscribe to the exercise hint list modification subscription - */ - registerChangeInExerciseHints() { - if (this.eventSubscriber) { - this.eventSubscriber.unsubscribe(); - } - this.eventSubscriber = this.eventManager.subscribe('exerciseHintListModification', () => this.loadAllByExerciseId()); - } - - /** - * Deletes exercise hint - * @param exerciseHintId the id of the exercise hint that we want to delete - */ - deleteExerciseHint(exerciseHintId: number) { - this.exerciseHintService.delete(this.exercise.id!, exerciseHintId).subscribe({ - next: () => { - this.eventManager.broadcast({ - name: 'exerciseHintListModification', - content: 'Deleted an exerciseHint', - }); - this.dialogErrorSource.next(''); - }, - error: (error: HttpErrorResponse) => this.dialogErrorSource.next(error.message), - }); - } -} diff --git a/src/main/webapp/app/exercises/shared/exercise-hint/manage/exercise-hint.route.ts b/src/main/webapp/app/exercises/shared/exercise-hint/manage/exercise-hint.route.ts deleted file mode 100644 index dd64cf79d51e..000000000000 --- a/src/main/webapp/app/exercises/shared/exercise-hint/manage/exercise-hint.route.ts +++ /dev/null @@ -1,96 +0,0 @@ -import { Injectable } from '@angular/core'; -import { HttpResponse } from '@angular/common/http'; -import { ActivatedRouteSnapshot, Resolve, Routes } from '@angular/router'; -import { UserRouteAccessService } from 'app/core/auth/user-route-access-service'; -import { of } from 'rxjs'; -import { filter, map } from 'rxjs/operators'; -import { ExerciseHintService } from '../shared/exercise-hint.service'; -import { ExerciseHintComponent } from './exercise-hint.component'; -import { ExerciseHintDetailComponent } from './exercise-hint-detail.component'; -import { ExerciseHint } from 'app/entities/hestia/exercise-hint.model'; -import { Authority } from 'app/shared/constants/authority.constants'; -import { exerciseTypes } from 'app/entities/exercise.model'; -import { ExerciseHintUpdateComponent } from 'app/exercises/shared/exercise-hint/manage/exercise-hint-update.component'; -import { ProgrammingExerciseResolve } from 'app/exercises/programming/manage/programming-exercise-management-routing.module'; - -@Injectable({ providedIn: 'root' }) -export class ExerciseHintResolve implements Resolve { - constructor(private service: ExerciseHintService) {} - - /** - * Resolves the route into an exercise hint id and fetches it from the server - * @param route Route which to resolve - */ - resolve(route: ActivatedRouteSnapshot) { - const exerciseId = route.params['exerciseId'] ? route.params['exerciseId'] : undefined; - const hintId = route.params['hintId'] ? route.params['hintId'] : undefined; - if (exerciseId && hintId) { - return this.service.find(exerciseId, hintId).pipe( - filter((response: HttpResponse) => response.ok), - map((exerciseHint: HttpResponse) => exerciseHint.body!), - ); - } - return of(new ExerciseHint()); - } -} - -export const exerciseHintRoute: Routes = [ - ...exerciseTypes.map((exerciseType) => { - return { - path: ':courseId/' + exerciseType + '-exercises/:exerciseId/exercise-hints/new', - component: ExerciseHintUpdateComponent, - resolve: { - exercise: ProgrammingExerciseResolve, - exerciseHint: ExerciseHintResolve, - }, - data: { - authorities: [Authority.EDITOR, Authority.INSTRUCTOR, Authority.ADMIN], - pageTitle: 'artemisApp.exerciseHint.home.title', - }, - canActivate: [UserRouteAccessService], - }; - }), - ...exerciseTypes.map((exerciseType) => { - return { - path: ':courseId/' + exerciseType + '-exercises/:exerciseId/exercise-hints/:hintId', - component: ExerciseHintDetailComponent, - resolve: { - exerciseHint: ExerciseHintResolve, - }, - data: { - authorities: [Authority.EDITOR, Authority.INSTRUCTOR, Authority.ADMIN], - pageTitle: 'artemisApp.exerciseHint.home.title', - }, - canActivate: [UserRouteAccessService], - }; - }), - ...exerciseTypes.map((exerciseType) => { - return { - path: ':courseId/' + exerciseType + '-exercises/:exerciseId/exercise-hints/:hintId/edit', - component: ExerciseHintUpdateComponent, - resolve: { - exercise: ProgrammingExerciseResolve, - exerciseHint: ExerciseHintResolve, - }, - data: { - authorities: [Authority.EDITOR, Authority.INSTRUCTOR, Authority.ADMIN], - pageTitle: 'artemisApp.exerciseHint.home.title', - }, - canActivate: [UserRouteAccessService], - }; - }), - ...exerciseTypes.map((exerciseType) => { - return { - path: ':courseId/' + exerciseType + '-exercises/:exerciseId/exercise-hints', - component: ExerciseHintComponent, - resolve: { - exercise: ProgrammingExerciseResolve, - }, - data: { - authorities: [Authority.EDITOR, Authority.INSTRUCTOR, Authority.ADMIN], - pageTitle: 'artemisApp.exerciseHint.home.title', - }, - canActivate: [UserRouteAccessService], - }; - }), -]; diff --git a/src/main/webapp/app/exercises/shared/exercise-hint/participate/exercise-hint-button-overlay.component.html b/src/main/webapp/app/exercises/shared/exercise-hint/participate/exercise-hint-button-overlay.component.html deleted file mode 100644 index 01e2077a3ae0..000000000000 --- a/src/main/webapp/app/exercises/shared/exercise-hint/participate/exercise-hint-button-overlay.component.html +++ /dev/null @@ -1,13 +0,0 @@ -
- @if (availableExerciseHints && activatedExerciseHints && availableExerciseHints.length + activatedExerciseHints.length > 0) { - - } -
diff --git a/src/main/webapp/app/exercises/shared/exercise-hint/participate/exercise-hint-button-overlay.component.scss b/src/main/webapp/app/exercises/shared/exercise-hint/participate/exercise-hint-button-overlay.component.scss deleted file mode 100644 index 98247be1b9c1..000000000000 --- a/src/main/webapp/app/exercises/shared/exercise-hint/participate/exercise-hint-button-overlay.component.scss +++ /dev/null @@ -1,20 +0,0 @@ -:host { - position: sticky; - bottom: 0; - left: 0; - z-index: 100; - overflow: hidden; - display: flex; - flex-direction: column; - align-items: flex-end; -} - -.btn { - box-shadow: none; -} - -.animated-button { - animation: 0.4s highlight; - animation-delay: 0.8s; - animation-iteration-count: 3; -} diff --git a/src/main/webapp/app/exercises/shared/exercise-hint/participate/exercise-hint-button-overlay.component.ts b/src/main/webapp/app/exercises/shared/exercise-hint/participate/exercise-hint-button-overlay.component.ts deleted file mode 100644 index 07e11494103b..000000000000 --- a/src/main/webapp/app/exercises/shared/exercise-hint/participate/exercise-hint-button-overlay.component.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { Component, EventEmitter, Input, Output } from '@angular/core'; -import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap'; -import { ExerciseHint } from 'app/entities/hestia/exercise-hint.model'; -import { faCircleQuestion } from '@fortawesome/free-solid-svg-icons'; -import { ExerciseHintStudentDialogComponent } from 'app/exercises/shared/exercise-hint/participate/exercise-hint-student-dialog.component'; -import cloneDeep from 'lodash-es/cloneDeep'; - -@Component({ - selector: 'jhi-exercise-hint-button-overlay', - templateUrl: './exercise-hint-button-overlay.component.html', - styleUrls: ['./exercise-hint-button-overlay.component.scss'], -}) -export class ExerciseHintButtonOverlayComponent { - @Input() - availableExerciseHints?: ExerciseHint[]; - @Input() - activatedExerciseHints?: ExerciseHint[]; - @Output() - onHintActivated = new EventEmitter(); - - faCircleQuestion = faCircleQuestion; - ngbModalRef?: NgbModalRef; - - constructor(private modalService: NgbModal) {} - - openModal() { - this.ngbModalRef = this.modalService.open(ExerciseHintStudentDialogComponent as Component, { size: 'lg', backdrop: 'static' }); - this.ngbModalRef.componentInstance.onHintActivated = this.onHintActivated; - // cloning is required that the lists not change while modal is open - this.ngbModalRef.componentInstance.activatedExerciseHints = cloneDeep(this.activatedExerciseHints!); - this.ngbModalRef.componentInstance.availableExerciseHints = cloneDeep(this.availableExerciseHints!); - this.ngbModalRef.result.then( - () => { - this.ngbModalRef = undefined; - }, - () => { - this.ngbModalRef = undefined; - }, - ); - } -} diff --git a/src/main/webapp/app/exercises/shared/exercise-hint/participate/exercise-hint-expandable.component.html b/src/main/webapp/app/exercises/shared/exercise-hint/participate/exercise-hint-expandable.component.html deleted file mode 100644 index 7dc825d8aa95..000000000000 --- a/src/main/webapp/app/exercises/shared/exercise-hint/participate/exercise-hint-expandable.component.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - -
-
{{ exerciseHint!.description }}
-
{{ exerciseHint!.programmingExerciseTask?.taskName }}
-
-
- - -
-
- - - - @if (isLoading) { -
-
- -
-
- } @else { -
- @if (exerciseHint?.content) { -
- } - @if (exerciseHint.type === HintType.CODE && (exerciseHint | castToCodeHint)?.solutionEntries) { -
- -
- } -
- How helpful was this hint? - -
-
- } -
diff --git a/src/main/webapp/app/exercises/shared/exercise-hint/participate/exercise-hint-expandable.component.scss b/src/main/webapp/app/exercises/shared/exercise-hint/participate/exercise-hint-expandable.component.scss deleted file mode 100644 index 0768618c0d5d..000000000000 --- a/src/main/webapp/app/exercises/shared/exercise-hint/participate/exercise-hint-expandable.component.scss +++ /dev/null @@ -1,31 +0,0 @@ -.mat-expansion-panel.exercise-hint-student-expansion-panel-wrapper { - .mat-expansion-panel-header { - padding: 10px 10px 10px 0; - font-weight: bold; - } - - .mat-expansion-panel-header-title { - flex-grow: 0; - } - - .mat-expansion-panel-header-description { - flex-grow: 3; - } - - .task-name { - font-size: 12px; - font-weight: 300; - } - - .mat-expansion-panel-body { - padding: 10px 0 0; - } - - .activated { - background-color: var(--info); - } - - .not_activated { - background-color: var(--success); - } -} diff --git a/src/main/webapp/app/exercises/shared/exercise-hint/participate/exercise-hint-expandable.component.ts b/src/main/webapp/app/exercises/shared/exercise-hint/participate/exercise-hint-expandable.component.ts deleted file mode 100644 index bc787e798f87..000000000000 --- a/src/main/webapp/app/exercises/shared/exercise-hint/participate/exercise-hint-expandable.component.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { Component, EventEmitter, Input, Output, ViewEncapsulation } from '@angular/core'; -import { faQuestionCircle } from '@fortawesome/free-solid-svg-icons'; - -import { ExerciseHint, HintType } from 'app/entities/hestia/exercise-hint.model'; -import { ExerciseHintResponse, ExerciseHintService } from 'app/exercises/shared/exercise-hint/shared/exercise-hint.service'; -import { StarRatingComponent } from 'app/exercises/shared/rating/star-rating/star-rating.component'; - -/** - * This component is a modal that shows the exercise's hints. - */ -@Component({ - selector: 'jhi-exercise-hint-expandable', - templateUrl: './exercise-hint-expandable.component.html', - styleUrls: ['./exercise-hint-expandable.component.scss'], - encapsulation: ViewEncapsulation.None, -}) -export class ExerciseHintExpandableComponent { - @Input() exerciseHint: ExerciseHint; - @Input() hasUsed: boolean; - @Output() - onHintActivated = new EventEmitter(); - - expanded = false; - isLoading = false; - - faQuestionCircle = faQuestionCircle; - - readonly HintType = HintType; - - constructor(private exerciseHintService: ExerciseHintService) {} - - displayHintContent() { - this.expanded = true; - - if (this.hasUsed) { - // the hint already contains the content - return; - } - - this.isLoading = true; - this.exerciseHintService.activateExerciseHint(this.exerciseHint!.exercise!.id!, this.exerciseHint!.id!).subscribe((res: ExerciseHintResponse) => { - this.exerciseHint = res.body!; - this.hasUsed = true; - this.isLoading = false; - this.onHintActivated.emit(this.exerciseHint); - }); - } - - collapseContent() { - this.expanded = false; - } - - onRate(event: { oldValue: number; newValue: number; starRating: StarRatingComponent }) { - this.exerciseHintService.rateExerciseHint(this.exerciseHint!.exercise!.id!, this.exerciseHint!.id!, event.newValue).subscribe(() => { - this.exerciseHint.currentUserRating = event.newValue; - }); - } -} diff --git a/src/main/webapp/app/exercises/shared/exercise-hint/participate/exercise-hint-participation.module.ts b/src/main/webapp/app/exercises/shared/exercise-hint/participate/exercise-hint-participation.module.ts deleted file mode 100644 index 3742abfc8de0..000000000000 --- a/src/main/webapp/app/exercises/shared/exercise-hint/participate/exercise-hint-participation.module.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { NgModule } from '@angular/core'; -import { MatExpansionModule } from '@angular/material/expansion'; -import { ArtemisSharedModule } from 'app/shared/shared.module'; -import { ExerciseHintStudentDialogComponent } from 'app/exercises/shared/exercise-hint/participate/exercise-hint-student-dialog.component'; -import { ArtemisMarkdownModule } from 'app/shared/markdown.module'; -import { ArtemisExerciseHintManagementModule } from 'app/exercises/shared/exercise-hint/manage/exercise-hint-management.module'; -import { ArtemisExerciseHintSharedModule } from 'app/exercises/shared/exercise-hint/shared/exercise-hint-shared.module'; -import { ExerciseHintExpandableComponent } from 'app/exercises/shared/exercise-hint/participate/exercise-hint-expandable.component'; -import { ExerciseHintButtonOverlayComponent } from 'app/exercises/shared/exercise-hint/participate/exercise-hint-button-overlay.component'; -import { RatingModule } from 'app/exercises/shared/rating/rating.module'; -import { ArtemisSharedComponentModule } from 'app/shared/components/shared-component.module'; - -@NgModule({ - imports: [ - ArtemisSharedModule, - ArtemisMarkdownModule, - ArtemisExerciseHintManagementModule, - ArtemisExerciseHintSharedModule, - RatingModule, - MatExpansionModule, - ArtemisSharedComponentModule, - ], - declarations: [ExerciseHintStudentDialogComponent, ExerciseHintExpandableComponent, ExerciseHintButtonOverlayComponent], - exports: [ExerciseHintStudentDialogComponent, ExerciseHintExpandableComponent, ExerciseHintExpandableComponent, ExerciseHintButtonOverlayComponent], -}) -export class ArtemisExerciseHintParticipationModule {} diff --git a/src/main/webapp/app/exercises/shared/exercise-hint/participate/exercise-hint-student-dialog.component.html b/src/main/webapp/app/exercises/shared/exercise-hint/participate/exercise-hint-student-dialog.component.html deleted file mode 100644 index 09c17845b507..000000000000 --- a/src/main/webapp/app/exercises/shared/exercise-hint/participate/exercise-hint-student-dialog.component.html +++ /dev/null @@ -1,32 +0,0 @@ - - diff --git a/src/main/webapp/app/exercises/shared/exercise-hint/participate/exercise-hint-student-dialog.component.ts b/src/main/webapp/app/exercises/shared/exercise-hint/participate/exercise-hint-student-dialog.component.ts deleted file mode 100644 index 4e5d174b28bd..000000000000 --- a/src/main/webapp/app/exercises/shared/exercise-hint/participate/exercise-hint-student-dialog.component.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { Component, EventEmitter, Input, Output } from '@angular/core'; -import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; -import { ExerciseHint } from 'app/entities/hestia/exercise-hint.model'; - -/** - * This component is a modal that shows the exercise's hints. - */ -@Component({ - selector: 'jhi-exercise-hint-student-dialog', - templateUrl: './exercise-hint-student-dialog.component.html', -}) -export class ExerciseHintStudentDialogComponent { - @Input() availableExerciseHints: ExerciseHint[]; - @Input() activatedExerciseHints: ExerciseHint[]; - @Output() - onHintActivated = new EventEmitter(); - - constructor(public activeModal: NgbActiveModal) {} - - /** - * Dismisses the modal - */ - clear() { - this.activeModal.dismiss('cancel'); - } -} diff --git a/src/main/webapp/app/exercises/shared/exercise-hint/participate/exercise-hint-student-dialog.scss b/src/main/webapp/app/exercises/shared/exercise-hint/participate/exercise-hint-student-dialog.scss deleted file mode 100644 index a077cc1f55cd..000000000000 --- a/src/main/webapp/app/exercises/shared/exercise-hint/participate/exercise-hint-student-dialog.scss +++ /dev/null @@ -1,4 +0,0 @@ -.hint-icon { - font-size: 1.5em; - cursor: pointer; -} diff --git a/src/main/webapp/app/exercises/shared/exercise-hint/services/code-hint-cast.pipe.ts b/src/main/webapp/app/exercises/shared/exercise-hint/services/code-hint-cast.pipe.ts deleted file mode 100644 index c648527cef38..000000000000 --- a/src/main/webapp/app/exercises/shared/exercise-hint/services/code-hint-cast.pipe.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Pipe, PipeTransform } from '@angular/core'; -import { CodeHint } from 'app/entities/hestia/code-hint-model'; -import { ExerciseHint } from 'app/entities/hestia/exercise-hint.model'; - -/** - * Pipe to transform an ExerciseHint into a CodeHint - */ -@Pipe({ - name: 'castToCodeHint', - pure: true, -}) -export class CastToCodeHintPipe implements PipeTransform { - transform(exerciseHint: ExerciseHint): CodeHint { - return exerciseHint as CodeHint; - } -} diff --git a/src/main/webapp/app/exercises/shared/exercise-hint/services/code-hint.service.ts b/src/main/webapp/app/exercises/shared/exercise-hint/services/code-hint.service.ts deleted file mode 100644 index 2796e41b9f2c..000000000000 --- a/src/main/webapp/app/exercises/shared/exercise-hint/services/code-hint.service.ts +++ /dev/null @@ -1,68 +0,0 @@ -import { Injectable } from '@angular/core'; -import { HttpClient, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -import { CodeHint } from 'app/entities/hestia/code-hint-model'; -import { createRequestOption } from 'app/shared/util/request.util'; - -export interface ICodeHintService { - /** - * Generates the code hints for a programming exercise - * @param exerciseId Id of the programming exercise - * @param deleteOldCodeHints Whether the old code hints should be deleted - */ - generateCodeHintsForExercise(exerciseId: number, deleteOldCodeHints: boolean): Observable; - - /** - * Generates the description for a code hint using Iris - * @param exerciseId of the programming exercise - * @param codeHintId of the code hint for which the description will be generated - */ - generateDescriptionForCodeHint(exerciseId: number, codeHintId: number): Observable>; - - /** - * Removes a programming exercise solution entry from a code hint - * @param exerciseId of the programming exercise - * @param codeHintId of the code hint from which the solution entry will be removed - * @param solutionEntryId of the solution entry to be removed - */ - removeSolutionEntryFromCodeHint(exerciseId: number, codeHintId: number, solutionEntryId: number): Observable>; -} - -@Injectable({ providedIn: 'root' }) -export class CodeHintService implements ICodeHintService { - public resourceUrl = 'api/programming-exercises'; - - constructor(protected http: HttpClient) {} - - /** - * Generates the code hints for a programming exercise - * @param exerciseId Id of the programming exercise - * @param deleteOldCodeHints Whether the old code hints should be deleted - */ - generateCodeHintsForExercise(exerciseId: number, deleteOldCodeHints: boolean): Observable { - const options = createRequestOption({ deleteOldCodeHints }); - return this.http.post(`${this.resourceUrl}/${exerciseId}/code-hints`, undefined, { - params: options, - }); - } - - /** - * Generates the description for a code hint using Iris - * @param exerciseId of the programming exercise - * @param codeHintId of the code hint for which the description will be generated - */ - generateDescriptionForCodeHint(exerciseId: number, codeHintId: number): Observable> { - return this.http.post(`${this.resourceUrl}/${exerciseId}/code-hints/${codeHintId}/generate-description`, undefined, { observe: 'response' }); - } - - /** - * Removes a programming exercise solution entry from a code hint. Only removes the linkage between, but does not - * delete the entry itself. - * @param exerciseId of the programming exercise - * @param codeHintId of the code hint from which the solution entry will be removed - * @param solutionEntryId of the solution entry to be removed - */ - removeSolutionEntryFromCodeHint(exerciseId: number, codeHintId: number, solutionEntryId: number): Observable> { - return this.http.delete(`${this.resourceUrl}/${exerciseId}/code-hints/${codeHintId}/solution-entries/${solutionEntryId}`, { observe: 'response' }); - } -} diff --git a/src/main/webapp/app/exercises/shared/exercise-hint/services/programming-exercise-solution-entry.service.ts b/src/main/webapp/app/exercises/shared/exercise-hint/services/programming-exercise-solution-entry.service.ts deleted file mode 100644 index 45af7c818acb..000000000000 --- a/src/main/webapp/app/exercises/shared/exercise-hint/services/programming-exercise-solution-entry.service.ts +++ /dev/null @@ -1,97 +0,0 @@ -import { Injectable } from '@angular/core'; -import { HttpClient } from '@angular/common/http'; -import { Observable } from 'rxjs'; -import { ProgrammingExerciseSolutionEntry } from 'app/entities/hestia/programming-exercise-solution-entry.model'; - -export interface IProgrammingExerciseSolutionEntryService { - /** - * Create a custom solution entry for a programming exercise and test case. - * @param exerciseId of the programming exercise - * @param testCaseId of the test case that the entry relates to - * @param entry the entry to be created - */ - createSolutionEntry(exerciseId: number, testCaseId: number, entry: ProgrammingExerciseSolutionEntry): Observable; - - /** - * Get all solution entries for a programming exercise. - * @param exerciseId of the programming exercise - */ - getSolutionEntriesForExercise(exerciseId: number): Observable; - - /** - * Update a solution entry and returns the updated entry. - * @param exerciseId of the programming exercise - * @param testCaseId of the test case - * @param solutionEntryId of the solution entry to update - * @param entry the entry to update - */ - updateSolutionEntry(exerciseId: number, testCaseId: number, solutionEntryId: number, entry: ProgrammingExerciseSolutionEntry): Observable; - - /** - * Delete a solution entry. - * @param exerciseId of the programming exercise - * @param testCaseId of the test case - * @param solutionEntryId of the solution entry to delete - */ - deleteSolutionEntry(exerciseId: number, testCaseId: number, solutionEntryId: number): Observable; - - /** - * Delete all solution entries for a programming exercise. - * @param exerciseId of the programming exercise - */ - deleteAllSolutionEntriesForExercise(exerciseId: number): Observable; -} - -@Injectable({ providedIn: 'root' }) -export class ProgrammingExerciseSolutionEntryService implements IProgrammingExerciseSolutionEntryService { - public resourceUrl = 'api/programming-exercises'; - - constructor(protected http: HttpClient) {} - - /** - * Create a custom solution entry for a programming exercise and test case. - * @param exerciseId of the programming exercise - * @param testCaseId of the test case that the entry relates to - * @param entry the entry to be created - */ - createSolutionEntry(exerciseId: number, testCaseId: number, entry: ProgrammingExerciseSolutionEntry): Observable { - return this.http.post(`${this.resourceUrl}/${exerciseId}/test-cases/${testCaseId}/solution-entries`, entry); - } - - /** - * Get all solution entries for a programming exercise. - * @param exerciseId of the programming exercise - */ - getSolutionEntriesForExercise(exerciseId: number): Observable { - return this.http.get(`${this.resourceUrl}/${exerciseId}/solution-entries`); - } - - /** - * Update a solution entry and returns the updated entry. - * @param exerciseId of the programming exercise - * @param testCaseId of the test case - * @param solutionEntryId of the solution entry to update - * @param entry the entry to update - */ - updateSolutionEntry(exerciseId: number, testCaseId: number, solutionEntryId: number, entry: ProgrammingExerciseSolutionEntry): Observable { - return this.http.put(`${this.resourceUrl}/${exerciseId}/test-cases/${testCaseId}/solution-entries/${solutionEntryId}`, entry); - } - - /** - * Delete a solution entry. - * @param exerciseId of the programming exercise - * @param testCaseId of the test case - * @param solutionEntryId of the solution entry to delete - */ - deleteSolutionEntry(exerciseId: number, testCaseId: number, solutionEntryId: number) { - return this.http.delete(`${this.resourceUrl}/${exerciseId}/test-cases/${testCaseId}/solution-entries/${solutionEntryId}`); - } - - /** - * Delete all solution entries for a programming exercise. - * @param exerciseId of the programming exercise - */ - deleteAllSolutionEntriesForExercise(exerciseId: number) { - return this.http.delete(`${this.resourceUrl}/${exerciseId}/solution-entries`); - } -} diff --git a/src/main/webapp/app/exercises/shared/exercise-hint/shared/code-hint-container.component.html b/src/main/webapp/app/exercises/shared/exercise-hint/shared/code-hint-container.component.html deleted file mode 100644 index d62c18f4e20e..000000000000 --- a/src/main/webapp/app/exercises/shared/exercise-hint/shared/code-hint-container.component.html +++ /dev/null @@ -1,25 +0,0 @@ -@for (solutionEntry of sortedSolutionEntries; track solutionEntry) { -
-
- - @if (enableEditing) { -
- -
- } -
-
-} -@if (!sortedSolutionEntries.length) { -
- -
-} diff --git a/src/main/webapp/app/exercises/shared/exercise-hint/shared/code-hint-container.component.ts b/src/main/webapp/app/exercises/shared/exercise-hint/shared/code-hint-container.component.ts deleted file mode 100644 index 8bd962711fdb..000000000000 --- a/src/main/webapp/app/exercises/shared/exercise-hint/shared/code-hint-container.component.ts +++ /dev/null @@ -1,68 +0,0 @@ -import { Component, Input, OnDestroy, OnInit } from '@angular/core'; -import { ActivatedRoute } from '@angular/router'; -import { Subject } from 'rxjs'; - -import { ProgrammingExerciseSolutionEntry } from 'app/entities/hestia/programming-exercise-solution-entry.model'; -import { CodeHint } from 'app/entities/hestia/code-hint-model'; -import { CodeHintService } from 'app/exercises/shared/exercise-hint/services/code-hint.service'; -import { faTimes } from '@fortawesome/free-solid-svg-icons'; - -/** - * Component containing the solution entries for a {@link CodeHint}. - * The entries are sorted by name (primary) and start line number (secondary) - */ -@Component({ - selector: 'jhi-code-hint-container', - templateUrl: './code-hint-container.component.html', -}) -export class CodeHintContainerComponent implements OnInit, OnDestroy { - @Input() - codeHint: CodeHint; - - @Input() - enableEditing = false; - - sortedSolutionEntries: ProgrammingExerciseSolutionEntry[]; - - private dialogErrorSource = new Subject(); - dialogError$ = this.dialogErrorSource.asObservable(); - - faTimes = faTimes; - - constructor( - protected route: ActivatedRoute, - private codeHintService: CodeHintService, - ) {} - - ngOnInit() { - this.setSortedSolutionEntriesForCodeHint(); - } - - ngOnDestroy(): void { - this.dialogErrorSource.unsubscribe(); - } - - setSortedSolutionEntriesForCodeHint() { - this.sortedSolutionEntries = - this.codeHint.solutionEntries?.sort((a, b) => { - return a.filePath?.localeCompare(b.filePath!) || a.line! - b.line!; - }) ?? []; - } - - /** - * Removes a solution entry from the code hint - * @param solutionEntryId of the solution entry to be removed - */ - removeEntryFromCodeHint(solutionEntryId: number) { - this.codeHintService.removeSolutionEntryFromCodeHint(this.codeHint.exercise!.id!, this.codeHint.id!, solutionEntryId).subscribe({ - next: () => { - this.sortedSolutionEntries = this.sortedSolutionEntries.filter((entry) => entry.id !== solutionEntryId); - this.codeHint.solutionEntries = this.sortedSolutionEntries; - this.dialogErrorSource.next(''); - }, - error: (error) => { - this.dialogErrorSource.next(error.message); - }, - }); - } -} diff --git a/src/main/webapp/app/exercises/shared/exercise-hint/shared/exercise-hint-shared.module.ts b/src/main/webapp/app/exercises/shared/exercise-hint/shared/exercise-hint-shared.module.ts deleted file mode 100644 index 08a2b1c8ee07..000000000000 --- a/src/main/webapp/app/exercises/shared/exercise-hint/shared/exercise-hint-shared.module.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { NgModule } from '@angular/core'; -import { ArtemisSharedModule } from 'app/shared/shared.module'; -import { CastToCodeHintPipe } from 'app/exercises/shared/exercise-hint/services/code-hint-cast.pipe'; -import { SolutionEntryComponent } from 'app/exercises/shared/exercise-hint/shared/solution-entry.component'; -import { CodeHintContainerComponent } from 'app/exercises/shared/exercise-hint/shared/code-hint-container.component'; -import { ArtemisMarkdownModule } from 'app/shared/markdown.module'; -import { MonacoEditorComponent } from 'app/shared/monaco-editor/monaco-editor.component'; - -@NgModule({ - imports: [ArtemisSharedModule, ArtemisMarkdownModule, MonacoEditorComponent], - declarations: [SolutionEntryComponent, CodeHintContainerComponent, CastToCodeHintPipe], - exports: [SolutionEntryComponent, CodeHintContainerComponent, CastToCodeHintPipe], -}) -export class ArtemisExerciseHintSharedModule {} diff --git a/src/main/webapp/app/exercises/shared/exercise-hint/shared/exercise-hint.service.ts b/src/main/webapp/app/exercises/shared/exercise-hint/shared/exercise-hint.service.ts deleted file mode 100644 index 88c29bef59a6..000000000000 --- a/src/main/webapp/app/exercises/shared/exercise-hint/shared/exercise-hint.service.ts +++ /dev/null @@ -1,179 +0,0 @@ -import { Injectable } from '@angular/core'; -import { HttpClient, HttpResponse } from '@angular/common/http'; -import { Observable, tap } from 'rxjs'; - -import { ExerciseService } from 'app/exercises/shared/exercise/exercise.service'; -import { ExerciseHint, HintType } from 'app/entities/hestia/exercise-hint.model'; -import { EntityTitleService, EntityType } from 'app/shared/layouts/navbar/entity-title.service'; - -export type ExerciseHintResponse = HttpResponse; - -export interface IExerciseHintService { - /** - * Creates an exercise hint - * @param exerciseId of the exercise - * @param exerciseHint Exercise hint to create - */ - create(exerciseId: number, exerciseHint: ExerciseHint): Observable; - - /** - * Updates an exercise hint - * @param exerciseId of the exercise - * @param exerciseHint Exercise hint to update - */ - update(exerciseId: number, exerciseHint: ExerciseHint): Observable; - - /** - * Deletes an exercise hint - * @param exerciseId Id of the exercise of which to delete the hint - * @param exerciseHintId Id of exercise hint to delete - */ - delete(exerciseId: number, exerciseHintId: number): Observable>; - - /** - * Finds an exercise hint - * @param exerciseId Id of the exercise of which to retrieve the hint - * @param exerciseHintId Id of exercise hint to find - */ - find(exerciseId: number, exerciseHintId: number): Observable; - - /** - * Finds all exercise hints by exercise id - * @param exerciseId Id of exercise - */ - findByExerciseId(exerciseId: number): Observable>; - - /** - * Gets all available exercise hints - * @param exerciseId Id of the exercise of which to retrieve all available exercise hints - */ - getAvailableExerciseHints(exerciseId: number): Observable>; - - /** - * Gets all activated exercise hints - * @param exerciseId Id of the exercise of which to retrieve all activated exercise hints - */ - getActivatedExerciseHints(exerciseId: number): Observable>; - - /** - * Activates an exercise hint for the current user - * @param exerciseId Id of the exercise - * @param exerciseHintId Id of the exercise hint - */ - activateExerciseHint(exerciseId: number, exerciseHintId: number): Observable; - - /** - * Activates an exercise hint for the current user - * @param exerciseId Id of the exercise - * @param exerciseHintId Id of the exercise hint - * @param ratingValue Value of the rating - */ - rateExerciseHint(exerciseId: number, exerciseHintId: number, ratingValue: number): Observable>; -} - -@Injectable({ providedIn: 'root' }) -export class ExerciseHintService implements IExerciseHintService { - public resourceUrl = 'api/programming-exercises'; - - constructor( - protected http: HttpClient, - private entityTitleService: EntityTitleService, - ) {} - - /** - * Creates an exercise hint - * @param exerciseId of the exercise - * @param exerciseHint Exercise hint to create - */ - create(exerciseId: number, exerciseHint: ExerciseHint): Observable { - exerciseHint.exercise = ExerciseService.convertExerciseDatesFromClient(exerciseHint.exercise!); - exerciseHint.type = HintType.TEXT; - if (exerciseHint.exercise.categories) { - exerciseHint.exercise.categories = ExerciseService.stringifyExerciseCategories(exerciseHint.exercise); - } - return this.http.post(`${this.resourceUrl}/${exerciseId}/exercise-hints`, exerciseHint, { observe: 'response' }); - } - - /** - * Updates an exercise hint - * @param exerciseId of the exercise - * @param exerciseHint Exercise hint to update - */ - update(exerciseId: number, exerciseHint: ExerciseHint): Observable { - exerciseHint.exercise = ExerciseService.convertExerciseDatesFromClient(exerciseHint.exercise!); - exerciseHint.exercise.categories = ExerciseService.stringifyExerciseCategories(exerciseHint.exercise); - return this.http.put(`${this.resourceUrl}/${exerciseId}/exercise-hints/${exerciseHint.id}`, exerciseHint, { observe: 'response' }); - } - - /** - * Deletes an exercise hint - * @param exerciseId Id of the exercise of which to delete the hint - * @param exerciseHintId Id of exercise hint to delete - */ - delete(exerciseId: number, exerciseHintId: number): Observable> { - return this.http.delete(`${this.resourceUrl}/${exerciseId}/exercise-hints/${exerciseHintId}`, { observe: 'response' }); - } - - /** - * Finds an exercise hint - * @param exerciseId Id of the exercise of which to retrieve the hint - * @param exerciseHintId Id of exercise hint to find - */ - find(exerciseId: number, exerciseHintId: number): Observable { - return this.http - .get(`${this.resourceUrl}/${exerciseId}/exercise-hints/${exerciseHintId}`, { observe: 'response' }) - .pipe(tap((res) => this.sendTitlesToEntityTitleService(res?.body, exerciseId))); - } - - /** - * Finds all exercise hints by exercise id - * Also fetches any relations. This currently only includes the submission entries of a code hint - * @param exerciseId Id of exercise - */ - findByExerciseId(exerciseId: number): Observable> { - return this.http - .get(`${this.resourceUrl}/${exerciseId}/exercise-hints`, { observe: 'response' }) - .pipe(tap((res) => res?.body?.forEach((hint) => this.sendTitlesToEntityTitleService(hint, exerciseId)))); - } - - /** - * Gets all available exercise hints - * @param exerciseId Id of the exercise of which to retrieve all available exercise hints - */ - getAvailableExerciseHints(exerciseId: number): Observable> { - return this.http.get(`${this.resourceUrl}/${exerciseId}/exercise-hints/available`, { observe: 'response' }); - } - - /** - * Gets all activated exercise hints - * @param exerciseId Id of the exercise of which to retrieve all activated exercise hints - */ - getActivatedExerciseHints(exerciseId: number): Observable> { - return this.http - .get(`${this.resourceUrl}/${exerciseId}/exercise-hints/activated`, { observe: 'response' }) - .pipe(tap((res) => res?.body?.forEach((hint) => this.sendTitlesToEntityTitleService(hint, exerciseId)))); - } - - /** - * Activates an exercise hint for the current user - * @param exerciseId Id of the exercise - * @param exerciseHintId Id of the exercise hint - */ - activateExerciseHint(exerciseId: number, exerciseHintId: number): Observable { - return this.http.post(`${this.resourceUrl}/${exerciseId}/exercise-hints/${exerciseHintId}/activate`, {}, { observe: 'response' }); - } - - /** - * Activates an exercise hint for the current user - * @param exerciseId Id of the exercise - * @param exerciseHintId Id of the exercise hint - * @param ratingValue Value of the rating - */ - rateExerciseHint(exerciseId: number, exerciseHintId: number, ratingValue: number): Observable> { - return this.http.post(`${this.resourceUrl}/${exerciseId}/exercise-hints/${exerciseHintId}/rating/${ratingValue}`, {}, { observe: 'response' }); - } - - private sendTitlesToEntityTitleService(hint: ExerciseHint | undefined | null, exerciseId: number) { - this.entityTitleService.setTitle(EntityType.HINT, [hint?.id, exerciseId], hint?.title); - } -} diff --git a/src/main/webapp/app/exercises/shared/exercise-hint/shared/solution-entry.component.html b/src/main/webapp/app/exercises/shared/exercise-hint/shared/solution-entry.component.html deleted file mode 100644 index 28a935fd18ff..000000000000 --- a/src/main/webapp/app/exercises/shared/exercise-hint/shared/solution-entry.component.html +++ /dev/null @@ -1,12 +0,0 @@ -
-
{{ solutionEntry.filePath }}
-
-
- -
diff --git a/src/main/webapp/app/exercises/shared/exercise-hint/shared/solution-entry.component.scss b/src/main/webapp/app/exercises/shared/exercise-hint/shared/solution-entry.component.scss deleted file mode 100644 index 5a51c7d082f5..000000000000 --- a/src/main/webapp/app/exercises/shared/exercise-hint/shared/solution-entry.component.scss +++ /dev/null @@ -1,3 +0,0 @@ -.solution-entry-editor { - border: 1px solid var(--border-color); -} diff --git a/src/main/webapp/app/exercises/shared/exercise-hint/shared/solution-entry.component.ts b/src/main/webapp/app/exercises/shared/exercise-hint/shared/solution-entry.component.ts deleted file mode 100644 index 314fce704776..000000000000 --- a/src/main/webapp/app/exercises/shared/exercise-hint/shared/solution-entry.component.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core'; -import { faTimes } from '@fortawesome/free-solid-svg-icons'; -import { ProgrammingExerciseSolutionEntry } from 'app/entities/hestia/programming-exercise-solution-entry.model'; -import { MonacoEditorComponent } from 'app/shared/monaco-editor/monaco-editor.component'; - -@Component({ - selector: 'jhi-solution-entry', - templateUrl: './solution-entry.component.html', - styleUrls: ['./solution-entry.component.scss'], -}) -export class SolutionEntryComponent implements OnInit { - @ViewChild('editor', { static: true }) - editor: MonacoEditorComponent; - - @Input() - solutionEntry: ProgrammingExerciseSolutionEntry; - @Input() - enableEditing: boolean; - - @Output() - onRemoveEntry: EventEmitter = new EventEmitter(); - - editorHeight = 20; - - protected readonly faTimes = faTimes; - - ngOnInit(): void { - this.setupEditor(); - } - - onEditorContentChange(value: string): void { - this.solutionEntry.code = value; - } - - onContentSizeChange(contentHeight: number): void { - this.editorHeight = contentHeight; - } - - setupEditor(): void { - const startLine = this.solutionEntry.line ?? 1; - this.editor.setStartLineNumber(startLine); - this.editor.changeModel(this.solutionEntry.filePath ?? 'file', this.solutionEntry.code ?? ''); - this.editor.layout(); - // We manually fetch the initial content height, as the editor does not provide it immediately - this.editorHeight = this.editor.getContentHeight(); - } -} diff --git a/src/main/webapp/app/exercises/shared/exercise/exercise.service.ts b/src/main/webapp/app/exercises/shared/exercise/exercise.service.ts index f3247bc26267..b377e0c20572 100644 --- a/src/main/webapp/app/exercises/shared/exercise/exercise.service.ts +++ b/src/main/webapp/app/exercises/shared/exercise/exercise.service.ts @@ -20,7 +20,6 @@ import { FileUploadExercise } from 'app/entities/file-upload-exercise.model'; import { ArtemisMarkdownService } from 'app/shared/markdown.service'; import { SafeHtml } from '@angular/platform-browser'; import { PlagiarismCaseInfo } from 'app/exercises/shared/plagiarism/types/PlagiarismCaseInfo'; -import { ExerciseHint } from 'app/entities/hestia/exercise-hint.model'; import { IrisExerciseSettings } from 'app/entities/iris/settings/iris-settings.model'; export type EntityResponseType = HttpResponse; @@ -38,8 +37,6 @@ export type ExerciseDetailsType = { exercise: Exercise; irisSettings?: IrisExerciseSettings; plagiarismCaseInfo?: PlagiarismCaseInfo; - availableExerciseHints?: ExerciseHint[]; - activatedExerciseHints?: ExerciseHint[]; }; export type CourseExistingExerciseDetailsType = { @@ -176,9 +173,6 @@ export class ExerciseService { if (res.body.exercise.posts === undefined) { res.body.exercise.posts = []; } - for (const hint of res.body.activatedExerciseHints ?? []) { - this.entityTitleService.setTitle(EntityType.HINT, [hint?.id, exerciseId], hint?.title); - } } return res; }), diff --git a/src/main/webapp/app/localvc/commit-details-view/commit-details-view.component.ts b/src/main/webapp/app/localvc/commit-details-view/commit-details-view.component.ts index 98ced261dc32..b147bd0892cd 100644 --- a/src/main/webapp/app/localvc/commit-details-view/commit-details-view.component.ts +++ b/src/main/webapp/app/localvc/commit-details-view/commit-details-view.component.ts @@ -1,5 +1,5 @@ import { Component, OnDestroy, OnInit } from '@angular/core'; -import { ProgrammingExerciseGitDiffReport } from 'app/entities/hestia/programming-exercise-git-diff-report.model'; +import { ProgrammingExerciseGitDiffReport } from 'app/entities/programming-exercise-git-diff-report.model'; import { ProgrammingExerciseService } from 'app/exercises/programming/manage/services/programming-exercise.service'; import { ProgrammingExerciseParticipationService } from 'app/exercises/programming/manage/services/programming-exercise-participation.service'; import { Subscription, throwError } from 'rxjs'; diff --git a/src/main/webapp/app/overview/exercise-details/course-exercise-details.component.html b/src/main/webapp/app/overview/exercise-details/course-exercise-details.component.html index 2bb6478e9300..390eaf8d0b58 100644 --- a/src/main/webapp/app/overview/exercise-details/course-exercise-details.component.html +++ b/src/main/webapp/app/overview/exercise-details/course-exercise-details.component.html @@ -190,12 +190,6 @@

@if (exercise.type === PROGRAMMING && !exercise.exerciseGroup && irisSettings?.irisChatSettings?.enabled) { } - @if (plagiarismCaseInfo?.verdict === PlagiarismVerdict.NO_PLAGIARISM) { diff --git a/src/main/webapp/app/overview/exercise-details/course-exercise-details.component.ts b/src/main/webapp/app/overview/exercise-details/course-exercise-details.component.ts index 330e469035a6..6b81fedc9ad0 100644 --- a/src/main/webapp/app/overview/exercise-details/course-exercise-details.component.ts +++ b/src/main/webapp/app/overview/exercise-details/course-exercise-details.component.ts @@ -30,11 +30,8 @@ import { Complaint } from 'app/entities/complaint.model'; import { SubmissionPolicy } from 'app/entities/submission-policy.model'; import { ArtemisMarkdownService } from 'app/shared/markdown.service'; import { IconDefinition, faAngleDown, faAngleUp, faBook, faEye, faFileSignature, faListAlt, faSignal, faTable, faWrench } from '@fortawesome/free-solid-svg-icons'; -import { ExerciseHintService } from 'app/exercises/shared/exercise-hint/shared/exercise-hint.service'; -import { ExerciseHint } from 'app/entities/hestia/exercise-hint.model'; import { PlagiarismVerdict } from 'app/exercises/shared/plagiarism/types/PlagiarismVerdict'; import { PlagiarismCaseInfo } from 'app/exercises/shared/plagiarism/types/PlagiarismCaseInfo'; -import { ResultService } from 'app/exercises/shared/result/result.service'; import { MAX_RESULT_HISTORY_LENGTH } from 'app/overview/result-history/result-history.component'; import { isCommunicationEnabled, isMessagingEnabled } from 'app/entities/course.model'; import { ExerciseCacheService } from 'app/exercises/shared/exercise/exercise-cache.service'; @@ -68,7 +65,6 @@ export class CourseExerciseDetailsComponent extends AbstractScienceComponent imp readonly MODELING = ExerciseType.MODELING; readonly TEXT = ExerciseType.TEXT; readonly FILE_UPLOAD = ExerciseType.FILE_UPLOAD; - readonly evaluateBadge = ResultService.evaluateBadge; readonly dayjs = dayjs; readonly ChatServiceMode = ChatServiceMode; @@ -99,8 +95,6 @@ export class CourseExerciseDetailsComponent extends AbstractScienceComponent imp submissionPolicy?: SubmissionPolicy; exampleSolutionCollapsed: boolean; plagiarismCaseInfo?: PlagiarismCaseInfo; - availableExerciseHints: ExerciseHint[]; - activatedExerciseHints: ExerciseHint[]; irisSettings?: IrisSettings; paramsSubscription: Subscription; profileSubscription?: Subscription; @@ -120,8 +114,6 @@ export class CourseExerciseDetailsComponent extends AbstractScienceComponent imp faWrench = faWrench; faTable = faTable; faListAlt = faListAlt; - faSignal = faSignal; - faFileSignature = faFileSignature; faAngleDown = faAngleDown; faAngleUp = faAngleUp; @@ -137,7 +129,6 @@ export class CourseExerciseDetailsComponent extends AbstractScienceComponent imp private quizExerciseService: QuizExerciseService, private complaintService: ComplaintService, private artemisMarkdown: ArtemisMarkdownService, - private exerciseHintService: ExerciseHintService, scienceService: ScienceService, ) { super(scienceService, ScienceEventType.EXERCISE__OPEN); @@ -209,8 +200,6 @@ export class CourseExerciseDetailsComponent extends AbstractScienceComponent imp this.irisSettings = newExerciseDetails.irisSettings; } }); - this.availableExerciseHints = newExerciseDetails.availableExerciseHints || []; - this.activatedExerciseHints = newExerciseDetails.activatedExerciseHints || []; } this.showIfExampleSolutionPresent(newExerciseDetails.exercise); @@ -331,25 +320,6 @@ export class CourseExerciseDetailsComponent extends AbstractScienceComponent imp } this.updateStudentParticipations(); this.mergeResultsAndSubmissionsForParticipations(); - - if (ExerciseType.PROGRAMMING === this.exercise?.type) { - this.exerciseHintService.getActivatedExerciseHints(this.exerciseId).subscribe((activatedRes?: HttpResponse) => { - this.activatedExerciseHints = activatedRes!.body!; - - this.exerciseHintService.getAvailableExerciseHints(this.exerciseId).subscribe((availableRes?: HttpResponse) => { - // filter out the activated hints from the available hints - this.availableExerciseHints = availableRes!.body!.filter( - (availableHint) => !this.activatedExerciseHints.some((activatedHint) => availableHint.id === activatedHint.id), - ); - const filteredAvailableExerciseHints = this.availableExerciseHints.filter((hint) => hint.displayThreshold !== 0); - if (filteredAvailableExerciseHints.length) { - this.alertService.info('artemisApp.exerciseHint.availableHintsAlertMessage', { - taskName: filteredAvailableExerciseHints.first()?.programmingExerciseTask?.taskName, - }); - } - }); - }); - } } }); } @@ -429,11 +399,6 @@ export class CourseExerciseDetailsComponent extends AbstractScienceComponent imp this.alertService.error(error); } - onHintActivated(exerciseHint: ExerciseHint) { - this.availableExerciseHints = this.availableExerciseHints.filter((hint) => hint.id !== exerciseHint.id); - this.activatedExerciseHints.push(exerciseHint); - } - /** * Used to change the boolean value for the example solution dropdown menu */ diff --git a/src/main/webapp/app/overview/exercise-details/course-exercise-details.module.ts b/src/main/webapp/app/overview/exercise-details/course-exercise-details.module.ts index 6c5664b7bff2..ec6495463ecc 100644 --- a/src/main/webapp/app/overview/exercise-details/course-exercise-details.module.ts +++ b/src/main/webapp/app/overview/exercise-details/course-exercise-details.module.ts @@ -25,7 +25,6 @@ import { SubmissionResultStatusModule } from 'app/overview/submission-result-sta import { LtiInitializerComponent } from 'app/overview/exercise-details/lti-initializer.component'; import { LtiInitializerModalComponent } from 'app/overview/exercise-details/lti-initializer-modal.component'; import { ArtemisProgrammingExerciseManagementModule } from 'app/exercises/programming/manage/programming-exercise-management.module'; -import { ArtemisExerciseHintParticipationModule } from 'app/exercises/shared/exercise-hint/participate/exercise-hint-participation.module'; import { ProblemStatementComponent } from 'app/overview/exercise-details/problem-statement/problem-statement.component'; import { ArtemisFeedbackModule } from 'app/exercises/shared/feedback/feedback.module'; import { ArtemisExerciseInfoModule } from 'app/exercises/shared/exercise-info/exercise-info.module'; @@ -69,7 +68,6 @@ const standaloneComponents = [ExerciseHeadersInformationComponent]; ArtemisMarkdownModule, SubmissionResultStatusModule, ArtemisProgrammingExerciseManagementModule, - ArtemisExerciseHintParticipationModule, ArtemisFeedbackModule, ArtemisExerciseInfoModule, IrisModule, diff --git a/src/main/webapp/app/shared/layouts/navbar/entity-title.service.ts b/src/main/webapp/app/shared/layouts/navbar/entity-title.service.ts index a50aab27ddc4..3ab54964001f 100644 --- a/src/main/webapp/app/shared/layouts/navbar/entity-title.service.ts +++ b/src/main/webapp/app/shared/layouts/navbar/entity-title.service.ts @@ -9,7 +9,6 @@ export enum EntityType { EXERCISE = 'EXERCISE', LECTURE = 'LECTURE', COMPETENCY = 'COMPETENCY', - HINT = 'HINT', DIAGRAM = 'DIAGRAM', ORGANIZATION = 'ORGANIZATION', EXAM = 'EXAM', @@ -120,9 +119,6 @@ export class EntityTitleService { case EntityType.COMPETENCY: resourceUrl += 'competencies'; break; - case EntityType.HINT: - resourceUrl += `programming-exercises/${ids[1]}/exercise-hints`; - break; case EntityType.DIAGRAM: resourceUrl += 'apollon-diagrams'; break; diff --git a/src/main/webapp/app/shared/layouts/navbar/navbar.component.ts b/src/main/webapp/app/shared/layouts/navbar/navbar.component.ts index cdf3bbb137ae..42ca6c3d619b 100644 --- a/src/main/webapp/app/shared/layouts/navbar/navbar.component.ts +++ b/src/main/webapp/app/shared/layouts/navbar/navbar.component.ts @@ -492,13 +492,6 @@ export class NavbarComponent implements OnInit, OnDestroy { case 'assessment-dashboard': this.addResolvedTitleAsCrumb(EntityType.EXERCISE, [Number(segment)], currentPath, segment); break; - case 'exercise-hints': - // obtain the exerciseId of the current path - // current path of form '/course-management/:courseId/exercises/:exerciseId/... - - const exerciseId = currentPath.split('/')[4]; - this.addResolvedTitleAsCrumb(EntityType.HINT, [Number(segment), Number(exerciseId)], currentPath, segment); - break; case 'apollon-diagrams': this.addResolvedTitleAsCrumb(EntityType.DIAGRAM, [Number(segment)], currentPath, segment); break; diff --git a/src/main/webapp/i18n/de/iris.json b/src/main/webapp/i18n/de/iris.json index 6d1200737895..390c7e863ffc 100644 --- a/src/main/webapp/i18n/de/iris.json +++ b/src/main/webapp/i18n/de/iris.json @@ -31,7 +31,6 @@ "title": "Vorlesungen Erfassung Einstellungen", "autoIngestOnAttachmentUpload": "Vorlesungen automatisch an Pyris senden" }, - "hestiaSettings": "Hestia Einstellungen", "competencyGenerationSettings": "Kompetenzgenerierung Einstellungen", "enabled-disabled": "Aktiviert/Deaktiviert", "enabledForCategories": "Automatisch aktivieren für Kategorien", @@ -57,8 +56,7 @@ "enabled": { "on": "Aktiviert", "off": "Deaktiviert", - "chat": "Iris Chat", - "hestia": "Hestia Integration" + "chat": "Iris Chat" }, "disabled": { "course": "IRIS ist in den Kurs-IRIS-Einstellungen deaktiviert", diff --git a/src/main/webapp/i18n/de/programmingExercise.json b/src/main/webapp/i18n/de/programmingExercise.json index 109036a5f9d6..0aa22a59d285 100644 --- a/src/main/webapp/i18n/de/programmingExercise.json +++ b/src/main/webapp/i18n/de/programmingExercise.json @@ -704,20 +704,9 @@ }, "withDependencies": "Mit beispielhafter Abhängigkeit", "withDependenciesTooltip": "Fügt dem generierten Projekt eine externe Apache commons-lang-Abhängigkeit als Beispiel dafür hinzu, wie Maven-Abhängigkeiten mit Artemis-Aufgaben verwendet werden sollten.", - "recordTestwiseCoverage": "Testbasierte Code-Abdeckung aufzeichnen", - "recordTestwiseCoverageTooltip": "Durch Aktivierung dieser Option wird die testbasierte Code-Abdeckung für das Lösungs-Repository aufgezeichnet. Diese Option ist nur für Java/Kotlin-Aufgaben mit nicht-sequentiellen Testläufen verfügbar.", "customizeBuildPlansWithAeolusTooltip": "Aktiviere diese Option, um das Docker Image und das Build Skript anzupassen, das auf Artemis für jede Einreichung in einem Docker Container ausgeführt wird.", "customizeBuildPlansTooltip": "Aktiviere diese Option, um das Docker Image und das Build Skript anzupassen, das auf Artemis für jede Einreichung in einem Docker Container ausgeführt wird.", "coveredLineRatio": "Anteil Test-Abgedeckter Zeilen", - "testwiseCoverageReport": { - "button": "Testbasierte Code-Abdeckung anzeigen", - "tooltip": "Zeigt die testbasierte Code-Abdeckung für das Lösungs-Repository.", - "title": "Testbasierte Code-Abdeckung", - "404": "Testbasierte Code-Abdeckung wurde noch nicht generiert. Bitte pushe etwas in die Lösungs- oder Test-Repositories um den Report zu erstellen.", - "selectTests": "Wähle die Tests aus, für die die Test-abgedeckten Zeilen markiert werden:", - "filePath": "Datei-Pfad", - "coveredLines": "Abgedeckte Zeilen" - }, "buildLogStatistics": { "title": "Durchschnittliche Statistiken der Build-Logs", "numberOfBuilds": "# Builds", diff --git a/src/main/webapp/i18n/en/iris.json b/src/main/webapp/i18n/en/iris.json index f0e4072441be..729564756aa4 100644 --- a/src/main/webapp/i18n/en/iris.json +++ b/src/main/webapp/i18n/en/iris.json @@ -31,7 +31,6 @@ "title": "Lecture Ingestion Settings", "autoIngestOnAttachmentUpload": "Send Lectures To Pyris Automatically" }, - "hestiaSettings": "Hestia Settings", "competencyGenerationSettings": "Competency Generation Settings", "enabled-disabled": "Enabled/Disabled", "enabledForCategories": "Automatically enable for categories", @@ -57,8 +56,7 @@ "enabled": { "on": "Enabled", "off": "Disabled", - "chat": "Iris Chat", - "hestia": "Hestia Integration" + "chat": "Iris Chat" }, "disabled": { "course": "IRIS is disabled in course IRIS settings", diff --git a/src/main/webapp/i18n/en/programmingExercise.json b/src/main/webapp/i18n/en/programmingExercise.json index 4835223da235..47ca1d85d4b3 100644 --- a/src/main/webapp/i18n/en/programmingExercise.json +++ b/src/main/webapp/i18n/en/programmingExercise.json @@ -703,20 +703,9 @@ }, "withDependencies": "With exemplary dependency", "withDependenciesTooltip": "Adds an external Apache commons-lang dependency to the generated project as an example how Maven dependencies should be used with Artemis exercises.", - "recordTestwiseCoverage": "Record Testwise Coverage", - "recordTestwiseCoverageTooltip": "Activate this option to record the testwise coverage for the solution repository. This option is only available for Java/Kotlin-exercises with non-sequential test runs.", "customizeBuildPlansWithAeolusTooltip": "Activate this option to customize the docker image and build plan which is executed on Artemis for each submission in a Docker container.", "customizeBuildPlansTooltip": "Activate this option to customize the docker image and build plan which is executed on Artemis for each submission in a Docker container.", "coveredLineRatio": "Ratio Test-Covered Lines", - "testwiseCoverageReport": { - "button": "Show testwise coverage", - "tooltip": "Shows the testwise coverage for the solution repository.", - "title": "Testwise Coverage", - "404": "Testwise Coverage has not been generated yet. Please do a push to the solution or test repository to generate the report.", - "selectTests": "Select the tests for which the covered lines are marked:", - "filePath": "File Path", - "coveredLines": "Covered Lines" - }, "buildLogStatistics": { "title": "Average build log statistics", "numberOfBuilds": "# Builds", diff --git a/src/test/java/de/tum/cit/aet/artemis/buildagent/service/BuildResultTest.java b/src/test/java/de/tum/cit/aet/artemis/buildagent/service/BuildResultTest.java index b7ad99348575..fc9bc5a7727a 100644 --- a/src/test/java/de/tum/cit/aet/artemis/buildagent/service/BuildResultTest.java +++ b/src/test/java/de/tum/cit/aet/artemis/buildagent/service/BuildResultTest.java @@ -12,8 +12,6 @@ class BuildResultTest extends AbstractSpringIntegrationLocalCILocalVCTest { @Test void testUnsupportedMethods() { BuildResult buildResult = new BuildResult(null, null, null, true, null, null, null); - assertThat(buildResult.extractBuildLogs()).isEmpty(); - assertThat(buildResult.getTestwiseCoverageReports()).isEmpty(); } } diff --git a/src/test/java/de/tum/cit/aet/artemis/plagiarism/PlagiarismDetectionServiceTest.java b/src/test/java/de/tum/cit/aet/artemis/plagiarism/PlagiarismDetectionServiceTest.java index 2c2f971a37a9..560a74a893c7 100644 --- a/src/test/java/de/tum/cit/aet/artemis/plagiarism/PlagiarismDetectionServiceTest.java +++ b/src/test/java/de/tum/cit/aet/artemis/plagiarism/PlagiarismDetectionServiceTest.java @@ -93,7 +93,7 @@ void shouldExecuteChecksForProgrammingExercise() throws IOException, ExitExcepti .thenReturn(programmingPlagiarismResult); // and - var programmingLanguageFeature = new ProgrammingLanguageFeature(null, false, false, true, false, false, emptyList(), false, false); + var programmingLanguageFeature = new ProgrammingLanguageFeature(null, false, false, true, false, false, emptyList(), false); when(programmingLanguageFeatureService.getProgrammingLanguageFeatures(any())).thenReturn(programmingLanguageFeature); // when @@ -107,7 +107,7 @@ void shouldExecuteChecksForProgrammingExercise() throws IOException, ExitExcepti void shouldThrowExceptionOnUnsupportedProgrammingLanguage() { // given var programmingExercise = new ProgrammingExercise(); - var programmingLanguageFeature = new ProgrammingLanguageFeature(null, false, false, false, false, false, emptyList(), false, false); + var programmingLanguageFeature = new ProgrammingLanguageFeature(null, false, false, false, false, false, emptyList(), false); when(programmingLanguageFeatureService.getProgrammingLanguageFeatures(any())).thenReturn(programmingLanguageFeature); // expect @@ -125,7 +125,7 @@ void shouldExecuteChecksWithJplagReportForProgrammingExercise() throws Programmi .thenReturn(zipFile); // and - var programmingLanguageFeature = new ProgrammingLanguageFeature(null, false, false, true, false, false, emptyList(), false, false); + var programmingLanguageFeature = new ProgrammingLanguageFeature(null, false, false, true, false, false, emptyList(), false); when(programmingLanguageFeatureService.getProgrammingLanguageFeatures(any())).thenReturn(programmingLanguageFeature); // when @@ -139,7 +139,7 @@ void shouldExecuteChecksWithJplagReportForProgrammingExercise() throws Programmi void shouldThrowExceptionOnUnsupportedProgrammingLanguageForChecksWithJplagReport() { // given var programmingExercise = new ProgrammingExercise(); - var programmingLanguageFeature = new ProgrammingLanguageFeature(null, false, false, false, false, false, emptyList(), false, false); + var programmingLanguageFeature = new ProgrammingLanguageFeature(null, false, false, false, false, false, emptyList(), false); when(programmingLanguageFeatureService.getProgrammingLanguageFeatures(any())).thenReturn(programmingLanguageFeature); // expect diff --git a/src/test/java/de/tum/cit/aet/artemis/programming/ProgrammingExerciseIntegrationTestService.java b/src/test/java/de/tum/cit/aet/artemis/programming/ProgrammingExerciseIntegrationTestService.java index 63f5623f7c9e..2c2adfcc7e23 100644 --- a/src/test/java/de/tum/cit/aet/artemis/programming/ProgrammingExerciseIntegrationTestService.java +++ b/src/test/java/de/tum/cit/aet/artemis/programming/ProgrammingExerciseIntegrationTestService.java @@ -1531,7 +1531,7 @@ void updateTestCases_asInstrutor() throws Exception { testCasesResponse.forEach(testCase -> testCase.setExercise(programmingExercise)); final var testCasesInDB = programmingExerciseTestCaseRepository.findByExerciseId(programmingExercise.getId()); - assertThat(new HashSet<>(testCasesResponse)).usingRecursiveFieldByFieldElementComparatorIgnoringFields("exercise", "tasks", "solutionEntries", "coverageEntries") + assertThat(new HashSet<>(testCasesResponse)).usingRecursiveFieldByFieldElementComparatorIgnoringFields("exercise", "tasks") .containsExactlyInAnyOrderElementsOf(testCasesInDB); assertThat(testCasesResponse).allSatisfy(testCase -> { assertThat(testCase.isAfterDueDate()).isTrue(); diff --git a/src/test/java/de/tum/cit/aet/artemis/programming/ProgrammingExerciseServiceIntegrationTest.java b/src/test/java/de/tum/cit/aet/artemis/programming/ProgrammingExerciseServiceIntegrationTest.java index f4044d759b0c..1f0f094f10b2 100644 --- a/src/test/java/de/tum/cit/aet/artemis/programming/ProgrammingExerciseServiceIntegrationTest.java +++ b/src/test/java/de/tum/cit/aet/artemis/programming/ProgrammingExerciseServiceIntegrationTest.java @@ -77,7 +77,7 @@ void importProgrammingExerciseBasis_baseReferencesGotCloned() { final var newTestCaseIDs = newlyImported.getTestCases().stream().map(ProgrammingExerciseTestCase::getId).collect(Collectors.toSet()); assertThat(newlyImported.getTestCases()).hasSameSizeAs(programmingExercise.getTestCases()); assertThat(programmingExercise.getTestCases()).noneMatch(testCase -> newTestCaseIDs.contains(testCase.getId())); - assertThat(programmingExercise.getTestCases()).usingRecursiveFieldByFieldElementComparatorIgnoringFields("id", "exercise", "tasks", "solutionEntries", "coverageEntries") + assertThat(programmingExercise.getTestCases()).usingRecursiveFieldByFieldElementComparatorIgnoringFields("id", "exercise", "tasks") .containsExactlyInAnyOrderElementsOf(newlyImported.getTestCases()); final var newStaticCodeAnalysisCategoriesIDs = newlyImported.getStaticCodeAnalysisCategories().stream().map(StaticCodeAnalysisCategory::getId).collect(Collectors.toSet()); assertThat(newlyImported.getStaticCodeAnalysisCategories()).hasSameSizeAs(programmingExercise.getStaticCodeAnalysisCategories()); diff --git a/src/test/java/de/tum/cit/aet/artemis/programming/ProgrammingExerciseTemplateIntegrationTest.java b/src/test/java/de/tum/cit/aet/artemis/programming/ProgrammingExerciseTemplateIntegrationTest.java index 524e8ea2c20e..1244f782f744 100644 --- a/src/test/java/de/tum/cit/aet/artemis/programming/ProgrammingExerciseTemplateIntegrationTest.java +++ b/src/test/java/de/tum/cit/aet/artemis/programming/ProgrammingExerciseTemplateIntegrationTest.java @@ -237,18 +237,6 @@ private Stream languageTypeBuilder() { } argumentBuilder.add(Arguments.of(language, projectType, false)); } - - if (languageFeatures.testwiseCoverageAnalysisSupported()) { - if (projectTypes.isEmpty()) { - argumentBuilder.add(Arguments.of(language, null, true)); - } - for (ProjectType projectType : projectTypes) { - if (projectType == ProjectType.MAVEN_BLACKBOX) { - continue; - } - argumentBuilder.add(Arguments.of(language, projectType, true)); - } - } } return argumentBuilder.build(); } diff --git a/src/test/java/de/tum/cit/aet/artemis/programming/service/connectors/jenkins/build_plan/JenkinsPipelineScriptCreatorTest.java b/src/test/java/de/tum/cit/aet/artemis/programming/service/connectors/jenkins/build_plan/JenkinsPipelineScriptCreatorTest.java index d19bc4d1398e..a6bfdccc28de 100644 --- a/src/test/java/de/tum/cit/aet/artemis/programming/service/connectors/jenkins/build_plan/JenkinsPipelineScriptCreatorTest.java +++ b/src/test/java/de/tum/cit/aet/artemis/programming/service/connectors/jenkins/build_plan/JenkinsPipelineScriptCreatorTest.java @@ -47,9 +47,7 @@ void testBuildPlanCreation() { void testReplacements() { jenkinsPipelineScriptCreator.createBuildPlanForExercise(programmingExercise); BuildPlan buildPlan = buildPlanRepository.findByProgrammingExercises_IdWithProgrammingExercises(programmingExercise.getId()).orElseThrow(); - assertThat(buildPlan.getBuildPlan()).doesNotContain("#isStaticCodeAnalysisEnabled", "#testWiseCoverage", "#dockerImage", "#dockerArgs") - // testwise coverage is disabled in the dummy exercise - .contains("isTestwiseCoverageEnabled = false && isSolutionBuild"); + assertThat(buildPlan.getBuildPlan()).doesNotContain("#isStaticCodeAnalysisEnabled", "#dockerImage", "#dockerArgs").contains("isSolutionBuild"); } @Test diff --git a/src/test/java/de/tum/cit/aet/artemis/programming/test_repository/ProgrammingExerciseTaskTestRepository.java b/src/test/java/de/tum/cit/aet/artemis/programming/test_repository/ProgrammingExerciseTaskTestRepository.java index bfcee183e86c..8da13dec7aa4 100644 --- a/src/test/java/de/tum/cit/aet/artemis/programming/test_repository/ProgrammingExerciseTaskTestRepository.java +++ b/src/test/java/de/tum/cit/aet/artemis/programming/test_repository/ProgrammingExerciseTaskTestRepository.java @@ -1,16 +1,10 @@ package de.tum.cit.aet.artemis.programming.test_repository; -import java.util.Optional; import java.util.Set; -import jakarta.validation.constraints.NotNull; - import org.springframework.context.annotation.Primary; -import org.springframework.data.jpa.repository.Query; -import org.springframework.data.repository.query.Param; import org.springframework.stereotype.Repository; -import de.tum.cit.aet.artemis.core.exception.EntityNotFoundException; import de.tum.cit.aet.artemis.programming.domain.ProgrammingExerciseTask; import de.tum.cit.aet.artemis.programming.repository.ProgrammingExerciseTaskRepository; @@ -22,31 +16,4 @@ public interface ProgrammingExerciseTaskTestRepository extends ProgrammingExerciseTaskRepository { Set findByExerciseId(Long exerciseId); - - /** - * Gets a task with its programming exercise, test cases and solution entries of the test cases - * - * @param entryId The id of the task - * @return The task with the given ID if found - * @throws EntityNotFoundException If no task with the given ID was found - */ - @NotNull - default ProgrammingExerciseTask findByIdWithTestCaseAndSolutionEntriesElseThrow(long entryId) throws EntityNotFoundException { - return getValueElseThrow(findByIdWithTestCaseAndSolutionEntries(entryId), entryId); - } - - /** - * Gets a task with its programming exercise, test cases and solution entries of the test cases - * - * @param entryId The id of the task - * @return The task with the given ID - */ - @Query(""" - SELECT t - FROM ProgrammingExerciseTask t - LEFT JOIN FETCH t.testCases tc - LEFT JOIN FETCH tc.solutionEntries - WHERE t.id = :entryId - """) - Optional findByIdWithTestCaseAndSolutionEntries(@Param("entryId") long entryId); } diff --git a/src/test/java/de/tum/cit/aet/artemis/programming/test_repository/ProgrammingExerciseTestCaseTestRepository.java b/src/test/java/de/tum/cit/aet/artemis/programming/test_repository/ProgrammingExerciseTestCaseTestRepository.java index da42f6d383d3..b56c34de117c 100644 --- a/src/test/java/de/tum/cit/aet/artemis/programming/test_repository/ProgrammingExerciseTestCaseTestRepository.java +++ b/src/test/java/de/tum/cit/aet/artemis/programming/test_repository/ProgrammingExerciseTestCaseTestRepository.java @@ -1,11 +1,8 @@ package de.tum.cit.aet.artemis.programming.test_repository; import java.util.Optional; -import java.util.Set; import org.springframework.context.annotation.Primary; -import org.springframework.data.jpa.repository.Query; -import org.springframework.data.repository.query.Param; import org.springframework.stereotype.Repository; import de.tum.cit.aet.artemis.programming.domain.ProgrammingExerciseTestCase; @@ -16,18 +13,4 @@ public interface ProgrammingExerciseTestCaseTestRepository extends ProgrammingExerciseTestCaseRepository { Optional findByExerciseIdAndTestName(long exerciseId, String testName); - - /** - * Returns all test cases with the associated solution entries for a programming exercise - * - * @param exerciseId of the exercise - * @return all test cases with the associated solution entries - */ - @Query(""" - SELECT DISTINCT tc - FROM ProgrammingExerciseTestCase tc - LEFT JOIN FETCH tc.solutionEntries se - WHERE tc.exercise.id = :exerciseId - """) - Set findByExerciseIdWithSolutionEntries(@Param("exerciseId") long exerciseId); } diff --git a/src/test/java/de/tum/cit/aet/artemis/programming/test_repository/ProgrammingExerciseTestRepository.java b/src/test/java/de/tum/cit/aet/artemis/programming/test_repository/ProgrammingExerciseTestRepository.java index 19c04aac1ffa..5a3de5a65aa1 100644 --- a/src/test/java/de/tum/cit/aet/artemis/programming/test_repository/ProgrammingExerciseTestRepository.java +++ b/src/test/java/de/tum/cit/aet/artemis/programming/test_repository/ProgrammingExerciseTestRepository.java @@ -30,17 +30,13 @@ public interface ProgrammingExerciseTestRepository extends ProgrammingExerciseRe LEFT JOIN FETCH p.templateParticipation LEFT JOIN FETCH p.solutionParticipation LEFT JOIN FETCH p.exampleSubmissions - LEFT JOIN FETCH p.exerciseHints eh - LEFT JOIN FETCH eh.solutionEntries LEFT JOIN FETCH p.tutorParticipations LEFT JOIN FETCH p.posts LEFT JOIN FETCH p.testCases tc - LEFT JOIN FETCH tc.solutionEntries LEFT JOIN FETCH p.staticCodeAnalysisCategories LEFT JOIN FETCH p.auxiliaryRepositories LEFT JOIN FETCH p.tasks t LEFT JOIN FETCH t.testCases - LEFT JOIN FETCH t.exerciseHints LEFT JOIN FETCH p.plagiarismDetectionConfig LEFT JOIN FETCH p.buildConfig WHERE p.id = :exerciseId diff --git a/src/test/java/de/tum/cit/aet/artemis/programming/util/ProgrammingExerciseFactory.java b/src/test/java/de/tum/cit/aet/artemis/programming/util/ProgrammingExerciseFactory.java index f705239b8d63..7764a2370fb6 100644 --- a/src/test/java/de/tum/cit/aet/artemis/programming/util/ProgrammingExerciseFactory.java +++ b/src/test/java/de/tum/cit/aet/artemis/programming/util/ProgrammingExerciseFactory.java @@ -234,7 +234,7 @@ public static TestResultsDTO generateTestResultDTO(String fullName, String repoN final var staticCodeAnalysisReports = enableStaticAnalysisReports ? generateStaticCodeAnalysisReports(programmingLanguage) : new ArrayList(); return new TestResultsDTO(successfulTestNames.size(), 0, 0, failedTestNames.size(), fullName, commits != null && !commits.isEmpty() ? commits : List.of(commitDTO), - List.of(testSuiteDto != null ? testSuiteDto : testSuite), staticCodeAnalysisReports, List.of(), buildRunDate != null ? buildRunDate : now(), false, logs); + List.of(testSuiteDto != null ? testSuiteDto : testSuite), staticCodeAnalysisReports, buildRunDate != null ? buildRunDate : now(), false, logs); } /** diff --git a/src/test/java/de/tum/cit/aet/artemis/programming/util/ProgrammingExerciseResultTestService.java b/src/test/java/de/tum/cit/aet/artemis/programming/util/ProgrammingExerciseResultTestService.java index 04f2af81482f..77acdd5acbef 100644 --- a/src/test/java/de/tum/cit/aet/artemis/programming/util/ProgrammingExerciseResultTestService.java +++ b/src/test/java/de/tum/cit/aet/artemis/programming/util/ProgrammingExerciseResultTestService.java @@ -280,8 +280,7 @@ public void shouldUpdateTestCasesAndResultScoreFromSolutionParticipationResult(A // test1 - test3 already exist, test4 should be newly created now. // All tests must have active = true since they are now used in the new solution result - assertThat(testCases).usingRecursiveFieldByFieldElementComparatorIgnoringFields("exercise", "id", "tasks", "solutionEntries", "coverageEntries") - .containsExactlyInAnyOrderElementsOf(expectedTestCases); + assertThat(testCases).usingRecursiveFieldByFieldElementComparatorIgnoringFields("exercise", "id", "tasks").containsExactlyInAnyOrderElementsOf(expectedTestCases); assertThat(result).isNotNull(); if (withFailedTest) { diff --git a/src/test/java/de/tum/cit/aet/artemis/programming/util/ProgrammingExerciseTestService.java b/src/test/java/de/tum/cit/aet/artemis/programming/util/ProgrammingExerciseTestService.java index 7ef916f1d6bb..2cf1119b1d09 100644 --- a/src/test/java/de/tum/cit/aet/artemis/programming/util/ProgrammingExerciseTestService.java +++ b/src/test/java/de/tum/cit/aet/artemis/programming/util/ProgrammingExerciseTestService.java @@ -864,8 +864,7 @@ public void importExercise_created(ProgrammingLanguage programmingLanguage, bool var sourceTestCaseIds = sourceExercise.getTestCases().stream().map(ProgrammingExerciseTestCase::getId).collect(Collectors.toSet()); assertThat(importedTestCaseIds).doesNotContainAnyElementsOf(sourceTestCaseIds); assertThat(importedExercise.getTestCases()).usingRecursiveFieldByFieldElementComparator() - .usingRecursiveFieldByFieldElementComparatorIgnoringFields("id", "exercise", "tasks", "solutionEntries", "coverageEntries") - .containsExactlyInAnyOrderElementsOf(sourceExercise.getTestCases()); + .usingRecursiveFieldByFieldElementComparatorIgnoringFields("id", "exercise", "tasks").containsExactlyInAnyOrderElementsOf(sourceExercise.getTestCases()); // Assert creation of new build plan ids assertThat(importedExercise.getSolutionParticipation().getBuildPlanId()).isNotBlank().isNotEqualTo(sourceExercise.getSolutionParticipation().getBuildPlanId()); @@ -1216,8 +1215,7 @@ public void importProgrammingExerciseAsPartOfExamImport() throws Exception { var sourceTestCaseIds = sourceExercise.getTestCases().stream().map(ProgrammingExerciseTestCase::getId).toList(); assertThat(importedTestCaseIds).doesNotContainAnyElementsOf(sourceTestCaseIds); assertThat(importedExercise.getTestCases()).usingRecursiveFieldByFieldElementComparator() - .usingRecursiveFieldByFieldElementComparatorIgnoringFields("id", "exercise", "tasks", "solutionEntries", "coverageEntries") - .containsExactlyInAnyOrderElementsOf(sourceExercise.getTestCases()); + .usingRecursiveFieldByFieldElementComparatorIgnoringFields("id", "exercise", "tasks").containsExactlyInAnyOrderElementsOf(sourceExercise.getTestCases()); } // TEST diff --git a/src/test/javascript/spec/component/code-editor/code-editor-student-container.component.spec.ts b/src/test/javascript/spec/component/code-editor/code-editor-student-container.component.spec.ts index abe6ded99d34..2fef51c01555 100644 --- a/src/test/javascript/spec/component/code-editor/code-editor-student-container.component.spec.ts +++ b/src/test/javascript/spec/component/code-editor/code-editor-student-container.component.spec.ts @@ -10,7 +10,6 @@ import { MockProgrammingExerciseParticipationService } from '../../helpers/mocks import { GuidedTourService } from 'app/guided-tour/guided-tour.service'; import { SubmissionPolicyService } from 'app/exercises/programming/manage/services/submission-policy.service'; import { AlertService } from 'app/core/util/alert.service'; -import { ExerciseHintService } from 'app/exercises/shared/exercise-hint/shared/exercise-hint.service'; import { of } from 'rxjs'; import { ProgrammingExerciseStudentParticipation } from 'app/entities/participation/programming-exercise-student-participation.model'; import { ActivatedRoute } from '@angular/router'; @@ -43,7 +42,6 @@ describe('CodeEditorStudentContainerComponent', () => { MockProvider(GuidedTourService), MockProvider(SubmissionPolicyService), MockProvider(AlertService), - MockProvider(ExerciseHintService), ], }) .compileComponents() diff --git a/src/test/javascript/spec/component/exam/manage/programming-exam-diff.component.spec.ts b/src/test/javascript/spec/component/exam/manage/programming-exam-diff.component.spec.ts index 3a0d9d6e640c..ed85aa75ceb7 100644 --- a/src/test/javascript/spec/component/exam/manage/programming-exam-diff.component.spec.ts +++ b/src/test/javascript/spec/component/exam/manage/programming-exam-diff.component.spec.ts @@ -6,12 +6,12 @@ import { MockComponent, MockPipe } from 'ng-mocks'; import { ProgrammingExerciseService } from 'app/exercises/programming/manage/services/programming-exercise.service'; import { ProgrammingExercise } from 'app/entities/programming/programming-exercise.model'; import { of } from 'rxjs'; -import { ProgrammingExerciseGitDiffReport } from 'app/entities/hestia/programming-exercise-git-diff-report.model'; +import { ProgrammingExerciseGitDiffReport } from '../../../../../../main/webapp/app/entities/programming-exercise-git-diff-report.model'; import { ArtemisTranslatePipe } from 'app/shared/pipes/artemis-translate.pipe'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; import { MockNgbModalService } from '../../../helpers/mocks/service/mock-ngb-modal.service'; -import { GitDiffReportModalComponent } from 'app/exercises/programming/hestia/git-diff-report/git-diff-report-modal.component'; -import { ProgrammingExerciseGitDiffEntry } from 'app/entities/hestia/programming-exercise-git-diff-entry.model'; +import { GitDiffReportModalComponent } from '../../../../../../main/webapp/app/exercises/programming/git-diff-report/git-diff-report-modal.component'; +import { ProgrammingExerciseGitDiffEntry } from '../../../../../../main/webapp/app/entities/programming-exercise-git-diff-entry.model'; import { IncludedInScoreBadgeComponent } from 'app/exercises/shared/exercise-headers/included-in-score-badge.component'; import { CachedRepositoryFilesService } from 'app/exercises/programming/manage/services/cached-repository-files.service'; diff --git a/src/test/javascript/spec/component/exercise-hint/manage/exercise-hint-detail.component.spec.ts b/src/test/javascript/spec/component/exercise-hint/manage/exercise-hint-detail.component.spec.ts deleted file mode 100644 index bbc956f3715d..000000000000 --- a/src/test/javascript/spec/component/exercise-hint/manage/exercise-hint-detail.component.spec.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { ActivatedRoute } from '@angular/router'; -import { of } from 'rxjs'; - -import { ExerciseHintDetailComponent } from 'app/exercises/shared/exercise-hint/manage/exercise-hint-detail.component'; -import { ArtemisTestModule } from '../../../test.module'; -import { ExerciseHint } from 'app/entities/hestia/exercise-hint.model'; - -describe('ExerciseHint Management Detail Component', () => { - let comp: ExerciseHintDetailComponent; - let fixture: ComponentFixture; - const exerciseHint = new ExerciseHint(); - exerciseHint.id = 123; - const route = { data: of({ exerciseHint }), params: of({ exerciseId: 1 }) } as any as ActivatedRoute; - - beforeEach(() => { - TestBed.configureTestingModule({ - imports: [ArtemisTestModule], - declarations: [ExerciseHintDetailComponent], - providers: [{ provide: ActivatedRoute, useValue: route }], - }) - .overrideTemplate(ExerciseHintDetailComponent, '') - .compileComponents(); - fixture = TestBed.createComponent(ExerciseHintDetailComponent); - comp = fixture.componentInstance; - }); - - describe('onInit', () => { - it('should call load all on init', () => { - // WHEN - comp.ngOnInit(); - - // THEN - expect(comp.exerciseHint).toEqual(expect.objectContaining({ id: 123 })); - }); - }); -}); diff --git a/src/test/javascript/spec/component/exercise-hint/manage/exercise-hint-update.component.spec.ts b/src/test/javascript/spec/component/exercise-hint/manage/exercise-hint-update.component.spec.ts deleted file mode 100644 index fe8282591d2b..000000000000 --- a/src/test/javascript/spec/component/exercise-hint/manage/exercise-hint-update.component.spec.ts +++ /dev/null @@ -1,239 +0,0 @@ -import { ComponentFixture, TestBed, fakeAsync, flush, tick } from '@angular/core/testing'; -import { FormBuilder, FormsModule } from '@angular/forms'; -import { of } from 'rxjs'; -import { HttpResponse } from '@angular/common/http'; - -import { ExerciseHintUpdateComponent } from 'app/exercises/shared/exercise-hint/manage/exercise-hint-update.component'; -import { ArtemisTestModule } from '../../../test.module'; -import { TranslateService } from '@ngx-translate/core'; -import { MockComponent, MockProvider } from 'ng-mocks'; -import { HelpIconComponent } from 'app/shared/components/help-icon.component'; -import { ExerciseHintService } from 'app/exercises/shared/exercise-hint/shared/exercise-hint.service'; -import { ExerciseHint } from 'app/entities/hestia/exercise-hint.model'; -import { ActivatedRoute } from '@angular/router'; -import { ProgrammingExerciseService } from 'app/exercises/programming/manage/services/programming-exercise.service'; -import { ProgrammingExerciseServerSideTask } from 'app/entities/hestia/programming-exercise-task.model'; -import { ProgrammingExerciseTestCase } from 'app/entities/programming/programming-exercise-test-case.model'; -import { ProgrammingExercise, ProgrammingLanguage } from 'app/entities/programming/programming-exercise.model'; -import { CodeHint } from 'app/entities/hestia/code-hint-model'; -import { CodeHintService } from 'app/exercises/shared/exercise-hint/services/code-hint.service'; -import { ProfileService } from 'app/shared/layouts/profiles/profile.service'; -import { MockProfileService } from '../../../helpers/mocks/service/mock-profile.service'; -import { IrisSettingsService } from 'app/iris/settings/shared/iris-settings.service'; -import { IrisSettings } from 'app/entities/iris/settings/iris-settings.model'; -import { ProfileInfo } from 'app/shared/layouts/profiles/profile-info.model'; -import { ProgrammingExerciseSolutionEntry } from 'app/entities/hestia/programming-exercise-solution-entry.model'; -import { PROFILE_IRIS } from 'app/app.constants'; -import { MarkdownEditorMonacoComponent } from 'app/shared/markdown-editor/monaco/markdown-editor-monaco.component'; - -describe('ExerciseHint Management Update Component', () => { - let comp: ExerciseHintUpdateComponent; - let fixture: ComponentFixture; - let service: ExerciseHintService; - let codeHintService: CodeHintService; - let programmingExerciseService: ProgrammingExerciseService; - - const task1 = new ProgrammingExerciseServerSideTask(); - task1.id = 1; - task1.taskName = 'Task 1'; - task1.testCases = [new ProgrammingExerciseTestCase(), new ProgrammingExerciseTestCase()]; - - const task2 = new ProgrammingExerciseServerSideTask(); - task2.id = 2; - task2.taskName = 'Task 2'; - task2.testCases = [new ProgrammingExerciseTestCase(), new ProgrammingExerciseTestCase()]; - - const programmingExercise = new ProgrammingExercise(undefined, undefined); - programmingExercise.id = 15; - - const exerciseHint = new ExerciseHint(); - const route = { data: of({ exerciseHint, exercise: programmingExercise }), params: of({ courseId: 12 }) } as any as ActivatedRoute; - - beforeEach(fakeAsync(() => { - TestBed.configureTestingModule({ - imports: [ArtemisTestModule, FormsModule], - declarations: [ExerciseHintUpdateComponent, MockComponent(MarkdownEditorMonacoComponent), MockComponent(HelpIconComponent)], - providers: [ - FormBuilder, - MockProvider(ProgrammingExerciseService), - MockProvider(ExerciseHintService), - MockProvider(TranslateService), - MockProvider(IrisSettingsService), - MockProfileService, - { provide: ActivatedRoute, useValue: route }, - ], - }) - .compileComponents() - .then(() => { - fixture = TestBed.createComponent(ExerciseHintUpdateComponent); - comp = fixture.componentInstance; - - service = TestBed.inject(ExerciseHintService); - codeHintService = TestBed.inject(CodeHintService); - programmingExerciseService = TestBed.inject(ProgrammingExerciseService); - flush(); - }); - })); - - afterEach(() => { - exerciseHint.programmingExerciseTask = undefined; - jest.restoreAllMocks(); - }); - - it('should load params and data onInit', () => { - const exercise = new ProgrammingExercise(undefined, undefined); - exercise.programmingLanguage = ProgrammingLanguage.JAVA; - exercise.id = 15; - - comp.ngOnInit(); - - expect(comp.exercise?.id).toBe(15); - expect(comp.exerciseHint).toEqual(exerciseHint); - expect(comp.courseId).toBe(12); - }); - - it('should load and set tasks for exercise hint', fakeAsync(() => { - exerciseHint.id = 4; - comp.exerciseHint = exerciseHint; - const getTasksSpy = jest.spyOn(programmingExerciseService, 'getTasksAndTestsExtractedFromProblemStatement').mockReturnValue(of([task1, task2])); - comp.exerciseHint.programmingExerciseTask = task2; - - comp.ngOnInit(); - - expect(getTasksSpy).toHaveBeenCalledOnce(); - expect(getTasksSpy).toHaveBeenCalledWith(15); - tick(); - expect(comp.tasks).toEqual([task1, task2]); - expect(comp.exerciseHint.programmingExerciseTask).toEqual(task2); - })); - - it('should load and set first tasks to exercise hint', fakeAsync(() => { - comp.exerciseHint = exerciseHint; - const getTasksSpy = jest.spyOn(programmingExerciseService, 'getTasksAndTestsExtractedFromProblemStatement').mockReturnValue(of([task1, task2])); - - comp.ngOnInit(); - - expect(getTasksSpy).toHaveBeenCalledOnce(); - expect(getTasksSpy).toHaveBeenCalledWith(15); - tick(); - expect(comp.tasks).toEqual([task1, task2]); - expect(comp.exerciseHint.programmingExerciseTask).toEqual(task1); - })); - - it('should update description and content using iris', fakeAsync(() => { - // GIVEN - const codeHint1 = new CodeHint(); - codeHint1.id = 123; - codeHint1.programmingExerciseTask = task2; - codeHint1.solutionEntries = [new ProgrammingExerciseSolutionEntry()]; - const codeHint2 = new CodeHint(); - codeHint2.id = 123; - codeHint2.programmingExerciseTask = task2; - codeHint2.content = 'Hello Content'; - codeHint2.description = 'Hello Description'; - - jest.spyOn(codeHintService, 'generateDescriptionForCodeHint').mockReturnValue(of(new HttpResponse({ body: codeHint2 }))); - comp.exerciseHint = codeHint1; - comp.courseId = 1; - comp.exercise = programmingExercise; - - // WHEN - comp.generateDescriptionForCodeHint(); - tick(); - - // THEN - expect(codeHintService.generateDescriptionForCodeHint).toHaveBeenCalledWith(15, 123); - expect(comp.isGeneratingDescription).toBeFalse(); - expect(comp.exerciseHint.content).toBe('Hello Content'); - expect(comp.exerciseHint.description).toBe('Hello Description'); - })); - - it.each<[string[]]>([[[]], [[PROFILE_IRIS]]])( - 'should load iris settings only if profile iris is active', - fakeAsync((activeProfiles: string[]) => { - // Mock getProfileInfo to return activeProfiles - const profileService = TestBed.inject(ProfileService); - jest.spyOn(profileService, 'getProfileInfo').mockReturnValue(of({ activeProfiles } as any as ProfileInfo)); - - // Mock getTasksAndTestsExtractedFromProblemStatement - jest.spyOn(programmingExerciseService, 'getTasksAndTestsExtractedFromProblemStatement').mockReturnValue(of([])); - - const fakeSettings = {} as any as IrisSettings; - - // Mock getCombinedProgrammingExerciseSettings - const irisSettingsService = TestBed.inject(IrisSettingsService); - const getCombinedProgrammingExerciseSettingsSpy = jest.spyOn(irisSettingsService, 'getCombinedExerciseSettings').mockReturnValue(of(fakeSettings)); - - // Run ngOnInit - comp.ngOnInit(); - tick(); - - if (activeProfiles.includes(PROFILE_IRIS)) { - // Should have called getCombinedProgrammingExerciseSettings if 'iris' is active - expect(getCombinedProgrammingExerciseSettingsSpy).toHaveBeenCalledOnce(); - expect(comp.irisSettings).toBe(fakeSettings); - } else { - // Should not have called getCombinedProgrammingExerciseSettings if 'iris' is not active - expect(getCombinedProgrammingExerciseSettingsSpy).not.toHaveBeenCalled(); - expect(comp.irisSettings).toBeUndefined(); - } - }), - ); - - it('should generate descriptions', () => { - const codeHint = new CodeHint(); - codeHint.id = 123; - codeHint.programmingExerciseTask = task2; - codeHint.solutionEntries = [new ProgrammingExerciseSolutionEntry()]; - - comp.exerciseHint = codeHint; - comp.courseId = 1; - comp.exercise = programmingExercise; - - const generateDescSpy = jest.spyOn(codeHintService, 'generateDescriptionForCodeHint'); - - comp.generateDescriptionForCodeHint(); - - expect(generateDescSpy).toHaveBeenCalledOnce(); - expect(generateDescSpy).toHaveBeenCalledWith(15, 123); - }); - - describe('save', () => { - it('should call update service on save for existing entity', fakeAsync(() => { - // GIVEN - const entity = new ExerciseHint(); - entity.id = 123; - entity.programmingExerciseTask = task2; - jest.spyOn(service, 'update').mockReturnValue(of(new HttpResponse({ body: entity }))); - comp.exerciseHint = entity; - comp.courseId = 1; - comp.exercise = programmingExercise; - - // WHEN - comp.save(); - tick(); // simulate async - - // THEN - expect(service.update).toHaveBeenCalledWith(15, entity); - expect(comp.isSaving).toBeFalse(); - })); - - it('should call create service on save for new entity', fakeAsync(() => { - // GIVEN - const entity = new ExerciseHint(); - entity.programmingExerciseTask = task2; - jest.spyOn(service, 'create').mockReturnValue(of(new HttpResponse({ body: entity }))); - comp.exerciseHint = entity; - comp.courseId = 1; - comp.exercise = programmingExercise; - - // WHEN - comp.save(); - tick(); // simulate async - - // THEN - expect(service.create).toHaveBeenCalledWith(15, entity); - expect(comp.isSaving).toBeFalse(); - })); - }); -}); diff --git a/src/test/javascript/spec/component/exercise-hint/manage/exercise-hint.component.spec.ts b/src/test/javascript/spec/component/exercise-hint/manage/exercise-hint.component.spec.ts deleted file mode 100644 index b7b531efa5a8..000000000000 --- a/src/test/javascript/spec/component/exercise-hint/manage/exercise-hint.component.spec.ts +++ /dev/null @@ -1,90 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { of } from 'rxjs'; -import { HttpHeaders, HttpResponse } from '@angular/common/http'; -import { ActivatedRoute } from '@angular/router'; - -import { ExerciseHintComponent } from 'app/exercises/shared/exercise-hint/manage/exercise-hint.component'; -import { ArtemisTestModule } from '../../../test.module'; -import { ExerciseHint } from 'app/entities/hestia/exercise-hint.model'; -import { ExerciseHintService } from 'app/exercises/shared/exercise-hint/shared/exercise-hint.service'; -import { MockActivatedRoute } from '../../../helpers/mocks/activated-route/mock-activated-route'; -import { EventManager } from 'app/core/util/event-manager.service'; -import { ProgrammingExercise } from 'app/entities/programming/programming-exercise.model'; - -describe('ExerciseHint Management Component', () => { - let comp: ExerciseHintComponent; - let fixture: ComponentFixture; - let service: ExerciseHintService; - let eventManager: EventManager; - - const programmingExercise = new ProgrammingExercise(undefined, undefined); - programmingExercise.id = 15; - - beforeEach(() => { - TestBed.configureTestingModule({ - imports: [ArtemisTestModule], - declarations: [ExerciseHintComponent], - providers: [{ provide: ActivatedRoute, useValue: new MockActivatedRoute({ exerciseId: 15, exercise: programmingExercise }) }], - }) - .compileComponents() - .then(() => { - fixture = TestBed.createComponent(ExerciseHintComponent); - comp = fixture.componentInstance; - service = TestBed.inject(ExerciseHintService); - eventManager = TestBed.inject(EventManager); - }); - }); - - afterEach(() => { - jest.restoreAllMocks(); - }); - - it('should call load all on init with exerciseId from route', () => { - // GIVEN - const headers = new HttpHeaders().append('link', 'link;link'); - const hint = new ExerciseHint(); - hint.id = 123; - - jest.spyOn(service, 'findByExerciseId').mockReturnValue( - of( - new HttpResponse({ - body: [hint], - headers, - }), - ), - ); - - // WHEN - comp.ngOnInit(); - - // THEN - expect(service.findByExerciseId).toHaveBeenCalledOnce(); - expect(service.findByExerciseId).toHaveBeenCalledWith(15); - expect(comp.exerciseHints[0]).toEqual(expect.objectContaining({ id: 123 })); - }); - - it('should invoke hint deletion', () => { - const deleteHintMock = jest.spyOn(service, 'delete').mockReturnValue(of({} as HttpResponse)); - const broadcastSpy = jest.spyOn(eventManager, 'broadcast'); - const exerciseHint = new ExerciseHint(); - exerciseHint.id = 123; - comp.exerciseHints = [exerciseHint]; - comp.exercise = programmingExercise; - - comp.deleteExerciseHint(123); - - expect(deleteHintMock).toHaveBeenCalledOnce(); - expect(deleteHintMock).toHaveBeenCalledWith(15, 123); - expect(broadcastSpy).toHaveBeenCalledOnce(); - expect(broadcastSpy).toHaveBeenCalledWith({ - name: 'exerciseHintListModification', - content: 'Deleted an exerciseHint', - }); - }); - - it('should track item id', () => { - const exerciseHint = new ExerciseHint(); - exerciseHint.id = 1; - expect(comp.trackId(0, exerciseHint)).toBe(1); - }); -}); diff --git a/src/test/javascript/spec/component/exercise-hint/participate/exercise-hint-button-overlay.component.spec.ts b/src/test/javascript/spec/component/exercise-hint/participate/exercise-hint-button-overlay.component.spec.ts deleted file mode 100644 index 005b1c67b1a6..000000000000 --- a/src/test/javascript/spec/component/exercise-hint/participate/exercise-hint-button-overlay.component.spec.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap'; - -import { ArtemisTestModule } from '../../../test.module'; -import { ExerciseHintButtonOverlayComponent } from 'app/exercises/shared/exercise-hint/participate/exercise-hint-button-overlay.component'; -import { ExerciseHint } from 'app/entities/hestia/exercise-hint.model'; -import { MockNgbModalService } from '../../../helpers/mocks/service/mock-ngb-modal.service'; -import { ExerciseHintStudentDialogComponent } from 'app/exercises/shared/exercise-hint/participate/exercise-hint-student-dialog.component'; - -describe('Exercise Hint Button Overlay Component', () => { - let comp: ExerciseHintButtonOverlayComponent; - let fixture: ComponentFixture; - - let modalService: NgbModal; - - const availableExerciseHint = new ExerciseHint(); - availableExerciseHint.id = 1; - const activatedExerciseHint = new ExerciseHint(); - activatedExerciseHint.id = 2; - - beforeEach(() => { - TestBed.configureTestingModule({ - imports: [ArtemisTestModule], - providers: [{ provide: NgbModal, useClass: MockNgbModalService }], - }) - .compileComponents() - .then(() => { - fixture = TestBed.createComponent(ExerciseHintButtonOverlayComponent); - comp = fixture.componentInstance; - - modalService = TestBed.inject(NgbModal); - - comp.availableExerciseHints = [availableExerciseHint]; - comp.activatedExerciseHints = [activatedExerciseHint]; - }); - }); - - afterEach(() => { - jest.restoreAllMocks(); - }); - - it('should open modal with exercise hints', () => { - const componentInstance = { availableExerciseHints: [], activatedExerciseHints: [] }; - const result = new Promise((resolve) => resolve(true)); - const openModalSpy = jest.spyOn(modalService, 'open').mockReturnValue({ - componentInstance, - result, - }); - - comp.openModal(); - - expect(openModalSpy).toHaveBeenCalledOnce(); - expect(openModalSpy).toHaveBeenCalledWith(ExerciseHintStudentDialogComponent, { size: 'lg', backdrop: 'static' }); - expect(componentInstance.availableExerciseHints).toEqual([availableExerciseHint]); - expect(componentInstance.activatedExerciseHints).toEqual([activatedExerciseHint]); - }); -}); diff --git a/src/test/javascript/spec/component/exercise-hint/participate/exercise-hint-expandable.component.spec.ts b/src/test/javascript/spec/component/exercise-hint/participate/exercise-hint-expandable.component.spec.ts deleted file mode 100644 index 0dbdd2699087..000000000000 --- a/src/test/javascript/spec/component/exercise-hint/participate/exercise-hint-expandable.component.spec.ts +++ /dev/null @@ -1,82 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { of } from 'rxjs'; -import { TranslateService } from '@ngx-translate/core'; -import { MockModule, MockPipe } from 'ng-mocks'; -import { HttpResponse } from '@angular/common/http'; -import { MatExpansionModule } from '@angular/material/expansion'; - -import { ArtemisTestModule } from '../../../test.module'; -import { ExerciseHint } from 'app/entities/hestia/exercise-hint.model'; -import { ExerciseHintResponse, ExerciseHintService } from 'app/exercises/shared/exercise-hint/shared/exercise-hint.service'; -import { ExerciseHintExpandableComponent } from 'app/exercises/shared/exercise-hint/participate/exercise-hint-expandable.component'; -import { ProgrammingExercise } from 'app/entities/programming/programming-exercise.model'; -import { StarRatingComponent } from 'app/exercises/shared/rating/star-rating/star-rating.component'; -import { ArtemisTranslatePipe } from 'app/shared/pipes/artemis-translate.pipe'; -import { MockTranslateService } from '../../../helpers/mocks/service/mock-translate.service'; -import { CastToCodeHintPipe } from 'app/exercises/shared/exercise-hint/services/code-hint-cast.pipe'; - -describe('Exercise Hint Expandable Component', () => { - let comp: ExerciseHintExpandableComponent; - let fixture: ComponentFixture; - - let service: ExerciseHintService; - - const exercise = new ProgrammingExercise(undefined, undefined); - exercise.id = 1; - const availableExerciseHint = new ExerciseHint(); - availableExerciseHint.id = 2; - availableExerciseHint.exercise = exercise; - - beforeEach(() => { - TestBed.configureTestingModule({ - imports: [ArtemisTestModule, MockModule(MatExpansionModule)], - declarations: [ExerciseHintExpandableComponent, MockPipe(ArtemisTranslatePipe), StarRatingComponent, CastToCodeHintPipe], - providers: [{ provide: TranslateService, useClass: MockTranslateService }], - }) - .compileComponents() - .then(() => { - fixture = TestBed.createComponent(ExerciseHintExpandableComponent); - comp = fixture.componentInstance; - - service = TestBed.inject(ExerciseHintService); - comp.exerciseHint = availableExerciseHint; - }); - }); - - afterEach(() => { - jest.restoreAllMocks(); - }); - - it('should load available exercise hint content', () => { - const activateHintSpy = jest.spyOn(service, 'activateExerciseHint').mockReturnValue(of({ body: availableExerciseHint } as ExerciseHintResponse)); - comp.displayHintContent(); - expect(activateHintSpy).toHaveBeenCalledOnce(); - expect(activateHintSpy).toHaveBeenCalledWith(1, 2); - expect(comp.expanded).toBeTrue(); - expect(comp.isLoading).toBeFalse(); - expect(comp.hasUsed).toBeTrue(); - expect(comp.exerciseHint).toEqual(availableExerciseHint); - }); - - it('should not load content when hint has already been used', () => { - comp.hasUsed = true; - const activateHintSpy = jest.spyOn(service, 'activateExerciseHint').mockReturnValue(of({ body: availableExerciseHint } as ExerciseHintResponse)); - comp.displayHintContent(); - expect(activateHintSpy).not.toHaveBeenCalled(); - }); - - it('should collapse exercise hint content', () => { - comp.collapseContent(); - expect(comp.expanded).toBeFalse(); - }); - - it('should rate exercise hint', () => { - const rateSpy = jest.spyOn(service, 'rateExerciseHint').mockReturnValue(of({} as HttpResponse)); - comp.exerciseHint = availableExerciseHint; - comp.onRate({ oldValue: 0, newValue: 4, starRating: new StarRatingComponent() }); - - expect(rateSpy).toHaveBeenCalledOnce(); - expect(rateSpy).toHaveBeenCalledWith(1, 2, 4); - expect(comp.exerciseHint.currentUserRating).toBe(4); - }); -}); diff --git a/src/test/javascript/spec/component/exercise-hint/shared/code-hint-container.component.spec.ts b/src/test/javascript/spec/component/exercise-hint/shared/code-hint-container.component.spec.ts deleted file mode 100644 index d7852f272f21..000000000000 --- a/src/test/javascript/spec/component/exercise-hint/shared/code-hint-container.component.spec.ts +++ /dev/null @@ -1,91 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { ArtemisTestModule } from '../../../test.module'; -import { CodeHintContainerComponent } from 'app/exercises/shared/exercise-hint/shared/code-hint-container.component'; -import { CodeHint } from 'app/entities/hestia/code-hint-model'; -import { ProgrammingExerciseSolutionEntry } from 'app/entities/hestia/programming-exercise-solution-entry.model'; -import { ProgrammingExercise } from 'app/entities/programming/programming-exercise.model'; -import { CodeHintService } from 'app/exercises/shared/exercise-hint/services/code-hint.service'; - -describe('ExerciseHint Management Component', () => { - let comp: CodeHintContainerComponent; - let fixture: ComponentFixture; - - let service: CodeHintService; - - beforeEach(() => { - TestBed.configureTestingModule({ - imports: [ArtemisTestModule], - declarations: [CodeHintContainerComponent], - }) - .compileComponents() - .then(() => { - fixture = TestBed.createComponent(CodeHintContainerComponent); - comp = fixture.componentInstance; - - service = TestBed.inject(CodeHintService); - }); - }); - - afterEach(() => { - jest.restoreAllMocks(); - }); - - it('should sort solution entries by file name', () => { - const solutionEntry1 = new ProgrammingExerciseSolutionEntry(); - solutionEntry1.line = 1; - solutionEntry1.filePath = 'b'; - const solutionEntry2 = new ProgrammingExerciseSolutionEntry(); - solutionEntry2.line = 1; - solutionEntry2.filePath = 'a'; - const codeHint = new CodeHint(); - codeHint.solutionEntries = [solutionEntry1, solutionEntry2]; - - comp.codeHint = codeHint; - - comp.ngOnInit(); - expect(comp.sortedSolutionEntries).toEqual([solutionEntry2, solutionEntry1]); - }); - - it('should sort solution entries for same file name but different line', () => { - const solutionEntry1 = new ProgrammingExerciseSolutionEntry(); - solutionEntry1.line = 3; - solutionEntry1.filePath = 'a'; - const solutionEntry2 = new ProgrammingExerciseSolutionEntry(); - solutionEntry2.line = 2; - solutionEntry2.filePath = 'a'; - const codeHint = new CodeHint(); - codeHint.solutionEntries = [solutionEntry1, solutionEntry2]; - - comp.codeHint = codeHint; - - comp.ngOnInit(); - expect(comp.sortedSolutionEntries).toEqual([solutionEntry2, solutionEntry1]); - }); - - it('should remove solution entry', () => { - const solutionEntry1 = new ProgrammingExerciseSolutionEntry(); - solutionEntry1.line = 3; - solutionEntry1.filePath = 'a'; - solutionEntry1.id = 1; - const solutionEntry2 = new ProgrammingExerciseSolutionEntry(); - solutionEntry2.line = 2; - solutionEntry2.filePath = 'a'; - - const exercise = new ProgrammingExercise(undefined, undefined); - exercise.id = 2; - - const codeHint = new CodeHint(); - codeHint.solutionEntries = [solutionEntry1, solutionEntry2]; - codeHint.exercise = exercise; - codeHint.id = 3; - - comp.codeHint = codeHint; - - const removeEntrySpy = jest.spyOn(service, 'removeSolutionEntryFromCodeHint'); - - comp.removeEntryFromCodeHint(solutionEntry1.id); - - expect(removeEntrySpy).toHaveBeenCalledOnce(); - expect(removeEntrySpy).toHaveBeenCalledWith(2, 3, 1); - }); -}); diff --git a/src/test/javascript/spec/component/exercise-hint/shared/solution-entry.component.spec.ts b/src/test/javascript/spec/component/exercise-hint/shared/solution-entry.component.spec.ts deleted file mode 100644 index 4b6bc884a62e..000000000000 --- a/src/test/javascript/spec/component/exercise-hint/shared/solution-entry.component.spec.ts +++ /dev/null @@ -1,55 +0,0 @@ -import { ArtemisTestModule } from '../../../test.module'; -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { ArtemisTranslatePipe } from 'app/shared/pipes/artemis-translate.pipe'; -import { MockComponent, MockPipe } from 'ng-mocks'; -import { SolutionEntryComponent } from 'app/exercises/shared/exercise-hint/shared/solution-entry.component'; -import { ProgrammingExerciseSolutionEntry } from 'app/entities/hestia/programming-exercise-solution-entry.model'; -import { MonacoEditorComponent } from 'app/shared/monaco-editor/monaco-editor.component'; - -describe('Solution Entry Component', () => { - let comp: SolutionEntryComponent; - let fixture: ComponentFixture; - let solutionEntry: ProgrammingExerciseSolutionEntry; - - beforeEach(() => { - TestBed.configureTestingModule({ - imports: [ArtemisTestModule], - declarations: [SolutionEntryComponent, MockComponent(MonacoEditorComponent), MockPipe(ArtemisTranslatePipe)], - }).compileComponents(); - fixture = TestBed.createComponent(SolutionEntryComponent); - comp = fixture.componentInstance; - - comp.solutionEntry = new ProgrammingExerciseSolutionEntry(); - comp.solutionEntry.id = 123; - comp.solutionEntry.filePath = '/src/de/Test.java'; - comp.solutionEntry.line = 1; - comp.solutionEntry.code = 'ABC'; - - solutionEntry = comp.solutionEntry; - }); - - afterEach(() => { - jest.restoreAllMocks(); - }); - - it('should correctly setup editors', () => { - const setStartLineNumberStub = jest.spyOn(comp.editor, 'setStartLineNumber').mockImplementation(); - const changeModelStub = jest.spyOn(comp.editor, 'changeModel').mockImplementation(); - fixture.detectChanges(); - - expect(setStartLineNumberStub).toHaveBeenCalledExactlyOnceWith(solutionEntry.line); - expect(changeModelStub).toHaveBeenCalledExactlyOnceWith(solutionEntry.filePath, solutionEntry.code); - }); - - it('should update the editor height', () => { - const contentHeight = 123; - comp.onContentSizeChange(contentHeight); - expect(comp.editorHeight).toEqual(contentHeight); - }); - - it('should update the solution entry code', () => { - const newCode = 'DEF'; - comp.onEditorContentChange(newCode); - expect(comp.solutionEntry.code).toEqual(newCode); - }); -}); diff --git a/src/test/javascript/spec/component/hestia/git-diff-report/git-diff-file-panel-title.component.spec.ts b/src/test/javascript/spec/component/git-diff-report/git-diff-file-panel-title.component.spec.ts similarity index 89% rename from src/test/javascript/spec/component/hestia/git-diff-report/git-diff-file-panel-title.component.spec.ts rename to src/test/javascript/spec/component/git-diff-report/git-diff-file-panel-title.component.spec.ts index 86380ebed0a7..292f65f903cd 100644 --- a/src/test/javascript/spec/component/hestia/git-diff-report/git-diff-file-panel-title.component.spec.ts +++ b/src/test/javascript/spec/component/git-diff-report/git-diff-file-panel-title.component.spec.ts @@ -1,6 +1,6 @@ -import { ArtemisTestModule } from '../../../test.module'; +import { ArtemisTestModule } from '../../test.module'; import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { GitDiffFilePanelTitleComponent } from 'app/exercises/programming/hestia/git-diff-report/git-diff-file-panel-title.component'; +import { GitDiffFilePanelTitleComponent } from '../../../../../main/webapp/app/exercises/programming/git-diff-report/git-diff-file-panel-title.component'; describe('GitDiffFilePanelTitleComponent', () => { let comp: GitDiffFilePanelTitleComponent; diff --git a/src/test/javascript/spec/component/hestia/git-diff-report/git-diff-file-panel.component.spec.ts b/src/test/javascript/spec/component/git-diff-report/git-diff-file-panel.component.spec.ts similarity index 85% rename from src/test/javascript/spec/component/hestia/git-diff-report/git-diff-file-panel.component.spec.ts rename to src/test/javascript/spec/component/git-diff-report/git-diff-file-panel.component.spec.ts index 26627dba3e8f..e62d3af1f108 100644 --- a/src/test/javascript/spec/component/hestia/git-diff-report/git-diff-file-panel.component.spec.ts +++ b/src/test/javascript/spec/component/git-diff-report/git-diff-file-panel.component.spec.ts @@ -1,13 +1,13 @@ -import { ArtemisTestModule } from '../../../test.module'; +import { ArtemisTestModule } from '../../test.module'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MockComponent, MockDirective } from 'ng-mocks'; -import { GitDiffLineStatComponent } from 'app/exercises/programming/hestia/git-diff-report/git-diff-line-stat.component'; -import { ProgrammingExerciseGitDiffEntry } from 'app/entities/hestia/programming-exercise-git-diff-entry.model'; -import { GitDiffFilePanelComponent } from 'app/exercises/programming/hestia/git-diff-report/git-diff-file-panel.component'; +import { GitDiffLineStatComponent } from '../../../../../main/webapp/app/exercises/programming/git-diff-report/git-diff-line-stat.component'; +import { ProgrammingExerciseGitDiffEntry } from '../../../../../main/webapp/app/entities/programming-exercise-git-diff-entry.model'; +import { GitDiffFilePanelComponent } from '../../../../../main/webapp/app/exercises/programming/git-diff-report/git-diff-file-panel.component'; import { NgbAccordionBody, NgbAccordionButton, NgbAccordionCollapse, NgbAccordionDirective, NgbAccordionHeader, NgbAccordionItem } from '@ng-bootstrap/ng-bootstrap'; -import { GitDiffFileComponent } from 'app/exercises/programming/hestia/git-diff-report/git-diff-file.component'; -import { GitDiffFilePanelTitleComponent } from 'app/exercises/programming/hestia/git-diff-report/git-diff-file-panel-title.component'; -import { MonacoDiffEditorComponent } from '../../../../../../main/webapp/app/shared/monaco-editor/monaco-diff-editor.component'; +import { GitDiffFileComponent } from '../../../../../main/webapp/app/exercises/programming/git-diff-report/git-diff-file.component'; +import { GitDiffFilePanelTitleComponent } from '../../../../../main/webapp/app/exercises/programming/git-diff-report/git-diff-file-panel-title.component'; +import { MonacoDiffEditorComponent } from '../../../../../main/webapp/app/shared/monaco-editor/monaco-diff-editor.component'; describe('GitDiffFilePanelComponent', () => { let comp: GitDiffFilePanelComponent; diff --git a/src/test/javascript/spec/component/hestia/git-diff-report/git-diff-file.component.spec.ts b/src/test/javascript/spec/component/git-diff-report/git-diff-file.component.spec.ts similarity index 83% rename from src/test/javascript/spec/component/hestia/git-diff-report/git-diff-file.component.spec.ts rename to src/test/javascript/spec/component/git-diff-report/git-diff-file.component.spec.ts index 17007596e8a8..2eef960038b3 100644 --- a/src/test/javascript/spec/component/hestia/git-diff-report/git-diff-file.component.spec.ts +++ b/src/test/javascript/spec/component/git-diff-report/git-diff-file.component.spec.ts @@ -1,8 +1,8 @@ -import { ArtemisTestModule } from '../../../test.module'; +import { ArtemisTestModule } from '../../test.module'; import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { GitDiffFileComponent } from 'app/exercises/programming/hestia/git-diff-report/git-diff-file.component'; -import { MockResizeObserver } from '../../../helpers/mocks/service/mock-resize-observer'; -import { MonacoDiffEditorComponent } from '../../../../../../main/webapp/app/shared/monaco-editor/monaco-diff-editor.component'; +import { GitDiffFileComponent } from '../../../../../main/webapp/app/exercises/programming/git-diff-report/git-diff-file.component'; +import { MockResizeObserver } from '../../helpers/mocks/service/mock-resize-observer'; +import { MonacoDiffEditorComponent } from '../../../../../main/webapp/app/shared/monaco-editor/monaco-diff-editor.component'; function getDiffEntryWithPaths(previousFilePath?: string, filePath?: string) { return { diff --git a/src/test/javascript/spec/component/hestia/git-diff-report/git-diff-line-stat.component.spec.ts b/src/test/javascript/spec/component/git-diff-report/git-diff-line-stat.component.spec.ts similarity index 81% rename from src/test/javascript/spec/component/hestia/git-diff-report/git-diff-line-stat.component.spec.ts rename to src/test/javascript/spec/component/git-diff-report/git-diff-line-stat.component.spec.ts index 2ea540371804..dafced43bada 100644 --- a/src/test/javascript/spec/component/hestia/git-diff-report/git-diff-line-stat.component.spec.ts +++ b/src/test/javascript/spec/component/git-diff-report/git-diff-line-stat.component.spec.ts @@ -1,7 +1,7 @@ -import { ArtemisTestModule } from '../../../test.module'; +import { ArtemisTestModule } from '../../test.module'; import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { GitDiffLineStatComponent } from 'app/exercises/programming/hestia/git-diff-report/git-diff-line-stat.component'; -import { ArtemisTranslatePipe } from 'app/shared/pipes/artemis-translate.pipe'; +import { GitDiffLineStatComponent } from '../../../../../main/webapp/app/exercises/programming/git-diff-report/git-diff-line-stat.component'; +import { ArtemisTranslatePipe } from '../../../../../main/webapp/app/shared/pipes/artemis-translate.pipe'; import { MockPipe } from 'ng-mocks'; describe('GitDiffLineStatComponent', () => { diff --git a/src/test/javascript/spec/component/hestia/git-diff-report/git-diff-modal.component.spec.ts b/src/test/javascript/spec/component/git-diff-report/git-diff-modal.component.spec.ts similarity index 91% rename from src/test/javascript/spec/component/hestia/git-diff-report/git-diff-modal.component.spec.ts rename to src/test/javascript/spec/component/git-diff-report/git-diff-modal.component.spec.ts index 7fc9a8693d0e..e2da096b0e41 100644 --- a/src/test/javascript/spec/component/hestia/git-diff-report/git-diff-modal.component.spec.ts +++ b/src/test/javascript/spec/component/git-diff-report/git-diff-modal.component.spec.ts @@ -1,13 +1,13 @@ -import { GitDiffReportComponent } from 'app/exercises/programming/hestia/git-diff-report/git-diff-report.component'; -import { ArtemisTestModule } from '../../../test.module'; -import { ArtemisTranslatePipe } from 'app/shared/pipes/artemis-translate.pipe'; +import { GitDiffReportComponent } from '../../../../../main/webapp/app/exercises/programming/git-diff-report/git-diff-report.component'; +import { ArtemisTestModule } from '../../test.module'; +import { ArtemisTranslatePipe } from '../../../../../main/webapp/app/shared/pipes/artemis-translate.pipe'; import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { GitDiffReportModalComponent } from 'app/exercises/programming/hestia/git-diff-report/git-diff-report-modal.component'; -import { ProgrammingExerciseService } from 'app/exercises/programming/manage/services/programming-exercise.service'; +import { GitDiffReportModalComponent } from '../../../../../main/webapp/app/exercises/programming/git-diff-report/git-diff-report-modal.component'; +import { ProgrammingExerciseService } from '../../../../../main/webapp/app/exercises/programming/manage/services/programming-exercise.service'; import { of, throwError } from 'rxjs'; -import { ProgrammingExerciseParticipationService } from 'app/exercises/programming/manage/services/programming-exercise-participation.service'; +import { ProgrammingExerciseParticipationService } from '../../../../../main/webapp/app/exercises/programming/manage/services/programming-exercise-participation.service'; import { MockComponent, MockPipe } from 'ng-mocks'; -import { ProgrammingExerciseGitDiffReport } from 'app/entities/hestia/programming-exercise-git-diff-report.model'; +import { ProgrammingExerciseGitDiffReport } from '../../../../../main/webapp/app/entities/programming-exercise-git-diff-report.model'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; describe('GitDiffReportModalComponent', () => { diff --git a/src/test/javascript/spec/component/hestia/git-diff-report/git-diff-report.component.spec.ts b/src/test/javascript/spec/component/git-diff-report/git-diff-report.component.spec.ts similarity index 90% rename from src/test/javascript/spec/component/hestia/git-diff-report/git-diff-report.component.spec.ts rename to src/test/javascript/spec/component/git-diff-report/git-diff-report.component.spec.ts index 143c150edc57..8e8a531d3a1b 100644 --- a/src/test/javascript/spec/component/hestia/git-diff-report/git-diff-report.component.spec.ts +++ b/src/test/javascript/spec/component/git-diff-report/git-diff-report.component.spec.ts @@ -1,13 +1,13 @@ -import { ArtemisTestModule } from '../../../test.module'; +import { ArtemisTestModule } from '../../test.module'; import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { ArtemisTranslatePipe } from 'app/shared/pipes/artemis-translate.pipe'; +import { ArtemisTranslatePipe } from '../../../../../main/webapp/app/shared/pipes/artemis-translate.pipe'; import { MockComponent, MockPipe } from 'ng-mocks'; -import { GitDiffLineStatComponent } from 'app/exercises/programming/hestia/git-diff-report/git-diff-line-stat.component'; -import { GitDiffReportComponent } from 'app/exercises/programming/hestia/git-diff-report/git-diff-report.component'; -import { ProgrammingExerciseGitDiffReport } from 'app/entities/hestia/programming-exercise-git-diff-report.model'; -import { ProgrammingExerciseGitDiffEntry } from 'app/entities/hestia/programming-exercise-git-diff-entry.model'; -import { NgbTooltipMocksModule } from '../../../helpers/mocks/directive/ngbTooltipMocks.module'; -import { GitDiffFilePanelComponent } from 'app/exercises/programming/hestia/git-diff-report/git-diff-file-panel.component'; +import { GitDiffLineStatComponent } from '../../../../../main/webapp/app/exercises/programming/git-diff-report/git-diff-line-stat.component'; +import { GitDiffReportComponent } from '../../../../../main/webapp/app/exercises/programming/git-diff-report/git-diff-report.component'; +import { ProgrammingExerciseGitDiffReport } from '../../../../../main/webapp/app/entities/programming-exercise-git-diff-report.model'; +import { ProgrammingExerciseGitDiffEntry } from '../../../../../main/webapp/app/entities/programming-exercise-git-diff-entry.model'; +import { NgbTooltipMocksModule } from '../../helpers/mocks/directive/ngbTooltipMocks.module'; +import { GitDiffFilePanelComponent } from '../../../../../main/webapp/app/exercises/programming/git-diff-report/git-diff-file-panel.component'; describe('ProgrammingExerciseGitDiffReport Component', () => { let comp: GitDiffReportComponent; diff --git a/src/test/javascript/spec/component/hestia/generation-overview/code-hint-generation-overview.component.spec.ts b/src/test/javascript/spec/component/hestia/generation-overview/code-hint-generation-overview.component.spec.ts deleted file mode 100644 index 360a08238306..000000000000 --- a/src/test/javascript/spec/component/hestia/generation-overview/code-hint-generation-overview.component.spec.ts +++ /dev/null @@ -1,176 +0,0 @@ -import { ArtemisTestModule } from '../../../test.module'; -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { ProgrammingExercise } from 'app/entities/programming/programming-exercise.model'; -import { CodeHint, CodeHintGenerationStep } from 'app/entities/hestia/code-hint-model'; -import { CodeHintGenerationOverviewComponent } from 'app/exercises/programming/hestia/generation-overview/code-hint-generation-overview/code-hint-generation-overview.component'; -import { MockActivatedRoute } from '../../../helpers/mocks/activated-route/mock-activated-route'; -import { ActivatedRoute } from '@angular/router'; -import { CoverageReport } from 'app/entities/hestia/coverage-report.model'; -import { ProgrammingExerciseSolutionEntry } from 'app/entities/hestia/programming-exercise-solution-entry.model'; -import { ProgrammingExerciseGitDiffReport } from 'app/entities/hestia/programming-exercise-git-diff-report.model'; - -describe('CodeHintGenerationOverview Component', () => { - let comp: CodeHintGenerationOverviewComponent; - let fixture: ComponentFixture; - - const exercise = new ProgrammingExercise(undefined, undefined); - exercise.id = 1; - exercise.buildConfig!.testwiseCoverageEnabled = true; - - let latestStepSpy: jest.SpyInstance; - - beforeEach(() => { - TestBed.configureTestingModule({ - imports: [ArtemisTestModule], - declarations: [CodeHintGenerationOverviewComponent], - providers: [{ provide: ActivatedRoute, useValue: new MockActivatedRoute({ exercise }) }], - }).compileComponents(); - fixture = TestBed.createComponent(CodeHintGenerationOverviewComponent); - comp = fixture.componentInstance; - - latestStepSpy = jest.spyOn(comp, 'setLatestPerformedStep'); - }); - - afterEach(() => { - jest.restoreAllMocks(); - }); - - it('should set all step status on init', () => { - comp.ngOnInit(); - - const expectedStatus = new Map(); - expectedStatus.set(CodeHintGenerationStep.GIT_DIFF, false); - expectedStatus.set(CodeHintGenerationStep.COVERAGE, false); - expectedStatus.set(CodeHintGenerationStep.SOLUTION_ENTRIES, false); - expectedStatus.set(CodeHintGenerationStep.CODE_HINTS, false); - - expect(comp.isPerformedByStep).toEqual(expectedStatus); - expect(comp.allowBehavioralEntryGeneration).toBeTrue(); - expect(comp.currentStep).toEqual(CodeHintGenerationStep.GIT_DIFF); - }); - - it('should set next step as current step', () => { - comp.currentStep = CodeHintGenerationStep.GIT_DIFF; - comp.onNextStep(); - expect(comp.currentStep).toBe(CodeHintGenerationStep.COVERAGE); - }); - - it('should set previous step as current step', () => { - comp.currentStep = CodeHintGenerationStep.COVERAGE; - comp.onPreviousStep(); - expect(comp.currentStep).toBe(CodeHintGenerationStep.GIT_DIFF); - }); - - it('should check if next step is available', () => { - const expectedStatus = new Map(); - comp.isPerformedByStep = expectedStatus; - comp.currentStep = CodeHintGenerationStep.GIT_DIFF; - expectedStatus.set(CodeHintGenerationStep.GIT_DIFF, false); - - let isAvailable = comp.isNextStepAvailable(); - expect(isAvailable).toBeFalse(); - - expectedStatus.set(CodeHintGenerationStep.GIT_DIFF, true); - - isAvailable = comp.isNextStepAvailable(); - expect(isAvailable).toBeTrue(); - }); - - it('should set specific step as current step', () => { - comp.currentStep = CodeHintGenerationStep.GIT_DIFF; - comp.onStepChange(CodeHintGenerationStep.COVERAGE); - expect(comp.currentStep).toBe(CodeHintGenerationStep.COVERAGE); - }); - - it('should update diff step status', () => { - latestStepSpy.mockReturnValue(undefined); - comp.isPerformedByStep = new Map(); - comp.onDiffReportLoaded(undefined); - - expect(latestStepSpy).toHaveBeenCalledOnce(); - expect(latestStepSpy).toHaveBeenCalledWith(CodeHintGenerationStep.GIT_DIFF); - expect(comp.isPerformedByStep.get(CodeHintGenerationStep.GIT_DIFF)).toBeFalse(); - - comp.onDiffReportLoaded(new ProgrammingExerciseGitDiffReport()); - expect(latestStepSpy).toHaveBeenCalledTimes(2); - expect(latestStepSpy).toHaveBeenNthCalledWith(2, CodeHintGenerationStep.GIT_DIFF); - expect(comp.isPerformedByStep.get(CodeHintGenerationStep.GIT_DIFF)).toBeTrue(); - }); - - it('should update coverage step status', () => { - latestStepSpy.mockReturnValue(undefined); - comp.isPerformedByStep = new Map(); - comp.onCoverageReportLoaded(undefined); - - expect(latestStepSpy).toHaveBeenCalledOnce(); - expect(latestStepSpy).toHaveBeenCalledWith(CodeHintGenerationStep.COVERAGE); - expect(comp.isPerformedByStep.get(CodeHintGenerationStep.COVERAGE)).toBeFalse(); - - comp.onCoverageReportLoaded(new CoverageReport()); - expect(latestStepSpy).toHaveBeenCalledTimes(2); - expect(latestStepSpy).toHaveBeenNthCalledWith(2, CodeHintGenerationStep.COVERAGE); - expect(comp.isPerformedByStep.get(CodeHintGenerationStep.COVERAGE)).toBeTrue(); - }); - - it('should update solution entry step status', () => { - latestStepSpy.mockReturnValue(undefined); - comp.isPerformedByStep = new Map(); - comp.onSolutionEntryChanges(undefined); - - expect(latestStepSpy).toHaveBeenCalledOnce(); - expect(latestStepSpy).toHaveBeenCalledWith(CodeHintGenerationStep.SOLUTION_ENTRIES); - expect(comp.isPerformedByStep.get(CodeHintGenerationStep.SOLUTION_ENTRIES)).toBeFalse(); - - comp.onSolutionEntryChanges([]); - expect(latestStepSpy).toHaveBeenCalledTimes(2); - expect(latestStepSpy).toHaveBeenNthCalledWith(2, CodeHintGenerationStep.SOLUTION_ENTRIES); - expect(comp.isPerformedByStep.get(CodeHintGenerationStep.SOLUTION_ENTRIES)).toBeFalse(); - - comp.onSolutionEntryChanges([new ProgrammingExerciseSolutionEntry()]); - expect(latestStepSpy).toHaveBeenCalledTimes(3); - expect(latestStepSpy).toHaveBeenNthCalledWith(3, CodeHintGenerationStep.SOLUTION_ENTRIES); - expect(comp.isPerformedByStep.get(CodeHintGenerationStep.SOLUTION_ENTRIES)).toBeTrue(); - }); - - it('should update code hint step status', () => { - latestStepSpy.mockReturnValue(undefined); - comp.isPerformedByStep = new Map(); - comp.onCodeHintsLoaded(undefined); - - expect(latestStepSpy).toHaveBeenCalledOnce(); - expect(latestStepSpy).toHaveBeenCalledWith(CodeHintGenerationStep.CODE_HINTS); - expect(comp.isPerformedByStep.get(CodeHintGenerationStep.CODE_HINTS)).toBeFalse(); - - comp.onCodeHintsLoaded([]); - expect(latestStepSpy).toHaveBeenCalledTimes(2); - expect(latestStepSpy).toHaveBeenNthCalledWith(2, CodeHintGenerationStep.CODE_HINTS); - expect(comp.isPerformedByStep.get(CodeHintGenerationStep.CODE_HINTS)).toBeFalse(); - - comp.onCodeHintsLoaded([new CodeHint()]); - expect(latestStepSpy).toHaveBeenCalledTimes(3); - expect(latestStepSpy).toHaveBeenNthCalledWith(3, CodeHintGenerationStep.CODE_HINTS); - expect(comp.isPerformedByStep.get(CodeHintGenerationStep.CODE_HINTS)).toBeTrue(); - }); - - it('should not update latest performed step for update on previous step', () => { - comp.currentStep = CodeHintGenerationStep.SOLUTION_ENTRIES; - comp.isPerformedByStep = new Map(); - comp.isPerformedByStep.set(CodeHintGenerationStep.SOLUTION_ENTRIES, true); - - comp.isPerformedByStep.set(CodeHintGenerationStep.GIT_DIFF, true); - comp.setLatestPerformedStep(CodeHintGenerationStep.GIT_DIFF); - - expect(comp.currentStep).toBe(CodeHintGenerationStep.SOLUTION_ENTRIES); - }); - - it('should select latest performed step for update on later step', () => { - comp.currentStep = CodeHintGenerationStep.GIT_DIFF; - comp.isPerformedByStep = new Map(); - comp.isPerformedByStep.set(CodeHintGenerationStep.GIT_DIFF, true); - - comp.isPerformedByStep.set(CodeHintGenerationStep.SOLUTION_ENTRIES, true); - comp.setLatestPerformedStep(CodeHintGenerationStep.SOLUTION_ENTRIES); - - expect(comp.currentStep).toBe(CodeHintGenerationStep.SOLUTION_ENTRIES); - }); -}); diff --git a/src/test/javascript/spec/component/hestia/generation-overview/code-hint-generation-status.component.spec.ts b/src/test/javascript/spec/component/hestia/generation-overview/code-hint-generation-status.component.spec.ts deleted file mode 100644 index 7e0443998f36..000000000000 --- a/src/test/javascript/spec/component/hestia/generation-overview/code-hint-generation-status.component.spec.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { ArtemisTestModule } from '../../../test.module'; -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { CodeHintGenerationStep } from 'app/entities/hestia/code-hint-model'; -import { CodeHintGenerationStatusComponent } from 'app/exercises/programming/hestia/generation-overview/code-hint-generation-status/code-hint-generation-status.component'; - -describe('CodeHintGenerationStatus Component', () => { - let comp: CodeHintGenerationStatusComponent; - let fixture: ComponentFixture; - - beforeEach(() => { - TestBed.configureTestingModule({ - imports: [ArtemisTestModule], - }).compileComponents(); - fixture = TestBed.createComponent(CodeHintGenerationStatusComponent); - comp = fixture.componentInstance; - }); - - afterEach(() => { - jest.restoreAllMocks(); - }); - - it('should select step', () => { - const stepChangeSpy = jest.spyOn(comp.onStepChange, 'emit'); - comp.onSelectStep(CodeHintGenerationStep.GIT_DIFF); - expect(stepChangeSpy).toHaveBeenCalledOnce(); - expect(stepChangeSpy).toHaveBeenCalledWith(CodeHintGenerationStep.GIT_DIFF); - }); -}); diff --git a/src/test/javascript/spec/component/hestia/generation-overview/code-hint-generation-step.component.spec.ts b/src/test/javascript/spec/component/hestia/generation-overview/code-hint-generation-step.component.spec.ts deleted file mode 100644 index f0e9e9999233..000000000000 --- a/src/test/javascript/spec/component/hestia/generation-overview/code-hint-generation-step.component.spec.ts +++ /dev/null @@ -1,69 +0,0 @@ -import { ArtemisTestModule } from '../../../test.module'; -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { of } from 'rxjs'; -import { CodeHintGenerationStepComponent } from 'app/exercises/programming/hestia/generation-overview/steps/code-hint-generation-step/code-hint-generation-step.component'; -import { ProgrammingExerciseService } from 'app/exercises/programming/manage/services/programming-exercise.service'; -import { ProgrammingExercise } from 'app/entities/programming/programming-exercise.model'; -import { CodeHintService } from 'app/exercises/shared/exercise-hint/services/code-hint.service'; -import { CodeHint } from 'app/entities/hestia/code-hint-model'; - -describe('CodeHintGenerationStep Component', () => { - let comp: CodeHintGenerationStepComponent; - let fixture: ComponentFixture; - - let exerciseService: ProgrammingExerciseService; - let codeHintService: CodeHintService; - - let onHintsLoadedSpy: jest.SpyInstance; - - let exercise: ProgrammingExercise; - let codeHints: CodeHint[]; - - beforeEach(() => { - TestBed.configureTestingModule({ - imports: [ArtemisTestModule], - }).compileComponents(); - fixture = TestBed.createComponent(CodeHintGenerationStepComponent); - comp = fixture.componentInstance; - - exerciseService = TestBed.inject(ProgrammingExerciseService); - codeHintService = TestBed.inject(CodeHintService); - - onHintsLoadedSpy = jest.spyOn(comp.onCodeHintsLoaded, 'emit'); - - exercise = new ProgrammingExercise(undefined, undefined); - exercise.id = 1; - comp.exercise = exercise; - - codeHints = [new CodeHint(), new CodeHint()]; - }); - - afterEach(() => { - jest.restoreAllMocks(); - }); - - it('should load all code hints on init', () => { - const loadHintsSpy = jest.spyOn(exerciseService, 'getCodeHintsForExercise').mockReturnValue(of(codeHints)); - - comp.ngOnInit(); - - expect(loadHintsSpy).toHaveBeenCalledOnce(); - expect(loadHintsSpy).toHaveBeenCalledWith(1); - expect(comp.codeHints).toEqual(codeHints); - expect(comp.isLoading).toBeFalse(); - expect(onHintsLoadedSpy).toHaveBeenCalledOnce(); - }); - - it('should generate code hints', () => { - const generateHintsSpy = jest.spyOn(codeHintService, 'generateCodeHintsForExercise').mockReturnValue(of(codeHints)); - - comp.generateCodeHints(true, 'recreateHintsButton'); - - expect(generateHintsSpy).toHaveBeenCalledOnce(); - expect(generateHintsSpy).toHaveBeenCalledWith(1, true); - expect(comp.codeHints).toEqual(codeHints); - expect(comp.isLoading).toBeFalse(); - expect(onHintsLoadedSpy).toHaveBeenCalledOnce(); - expect(onHintsLoadedSpy).toHaveBeenCalledWith(codeHints); - }); -}); diff --git a/src/test/javascript/spec/component/hestia/generation-overview/coverage-generation-step.component.spec.ts b/src/test/javascript/spec/component/hestia/generation-overview/coverage-generation-step.component.spec.ts deleted file mode 100644 index cda7ed0c1f60..000000000000 --- a/src/test/javascript/spec/component/hestia/generation-overview/coverage-generation-step.component.spec.ts +++ /dev/null @@ -1,65 +0,0 @@ -import { ArtemisTestModule } from '../../../test.module'; -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { of } from 'rxjs'; -import { ProgrammingExerciseService } from 'app/exercises/programming/manage/services/programming-exercise.service'; -import { ProgrammingExercise } from 'app/entities/programming/programming-exercise.model'; -import { CoverageGenerationStepComponent } from 'app/exercises/programming/hestia/generation-overview/steps/coverage-generation-step/coverage-generation-step.component'; -import { CoverageReport } from 'app/entities/hestia/coverage-report.model'; - -describe('CoverageGenerationStep Component', () => { - let comp: CoverageGenerationStepComponent; - let fixture: ComponentFixture; - - let exerciseService: ProgrammingExerciseService; - - let onCoverageLoadedSpy: jest.SpyInstance; - - let exercise: ProgrammingExercise; - let fileContentByPath: Map; - let coverageReport: CoverageReport; - - beforeEach(() => { - TestBed.configureTestingModule({ - imports: [ArtemisTestModule], - }).compileComponents(); - fixture = TestBed.createComponent(CoverageGenerationStepComponent); - comp = fixture.componentInstance; - - exerciseService = TestBed.inject(ProgrammingExerciseService); - - onCoverageLoadedSpy = jest.spyOn(comp.onCoverageLoaded, 'emit'); - - exercise = new ProgrammingExercise(undefined, undefined); - exercise.id = 1; - comp.exercise = exercise; - - fileContentByPath = new Map(); - fileContentByPath.set('A.java', 'abc'); - fileContentByPath.set('B.java', 'def'); - - coverageReport = new CoverageReport(); - coverageReport.id = 2; - }); - - afterEach(() => { - jest.restoreAllMocks(); - }); - - it('should load all code hints on init', () => { - const loadFilesSpy = jest.spyOn(exerciseService, 'getSolutionRepositoryTestFilesWithContent').mockReturnValue(of(fileContentByPath)); - const loadReportSpy = jest.spyOn(exerciseService, 'getLatestFullTestwiseCoverageReport').mockReturnValue(of(coverageReport)); - - comp.ngOnInit(); - - expect(loadFilesSpy).toHaveBeenCalledOnce(); - expect(loadFilesSpy).toHaveBeenCalledWith(1); - expect(loadReportSpy).toHaveBeenCalledOnce(); - expect(loadReportSpy).toHaveBeenCalledWith(1); - - expect(comp.fileContentByPath).toEqual(fileContentByPath); - expect(comp.coverageReport).toEqual(coverageReport); - expect(comp.isLoading).toBeFalse(); - expect(onCoverageLoadedSpy).toHaveBeenCalledOnce(); - expect(onCoverageLoadedSpy).toHaveBeenCalledWith(coverageReport); - }); -}); diff --git a/src/test/javascript/spec/component/hestia/generation-overview/diff-generation-step.component.spec.ts b/src/test/javascript/spec/component/hestia/generation-overview/diff-generation-step.component.spec.ts deleted file mode 100644 index 6d9f4cca6346..000000000000 --- a/src/test/javascript/spec/component/hestia/generation-overview/diff-generation-step.component.spec.ts +++ /dev/null @@ -1,67 +0,0 @@ -import { ArtemisTestModule } from '../../../test.module'; -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { of } from 'rxjs'; -import { ProgrammingExerciseService } from 'app/exercises/programming/manage/services/programming-exercise.service'; -import { ProgrammingExercise } from 'app/entities/programming/programming-exercise.model'; -import { DiffGenerationStepComponent } from 'app/exercises/programming/hestia/generation-overview/steps/diff-generation-step/diff-generation-step.component'; -import { ProgrammingExerciseGitDiffReport } from 'app/entities/hestia/programming-exercise-git-diff-report.model'; - -describe('DiffGenerationStep Component', () => { - let comp: DiffGenerationStepComponent; - let fixture: ComponentFixture; - - let exerciseService: ProgrammingExerciseService; - - let onGitDiffLoadedSpy: jest.SpyInstance; - - let exercise: ProgrammingExercise; - let fileContentByPath: Map; - let gitDiffReport: ProgrammingExerciseGitDiffReport; - - beforeEach(() => { - TestBed.configureTestingModule({ - imports: [ArtemisTestModule], - }).compileComponents(); - fixture = TestBed.createComponent(DiffGenerationStepComponent); - comp = fixture.componentInstance; - - exerciseService = TestBed.inject(ProgrammingExerciseService); - - onGitDiffLoadedSpy = jest.spyOn(comp.onGitDiffLoaded, 'emit'); - - exercise = new ProgrammingExercise(undefined, undefined); - exercise.id = 1; - comp.exercise = exercise; - - fileContentByPath = new Map(); - fileContentByPath.set('A.java', 'abc'); - fileContentByPath.set('B.java', 'def'); - - gitDiffReport = new ProgrammingExerciseGitDiffReport(); - gitDiffReport.programmingExercise = exercise; - }); - - afterEach(() => { - jest.restoreAllMocks(); - }); - - it('should load all code hints on init', () => { - const loadTemplateFilesSpy = jest.spyOn(exerciseService, 'getTemplateRepositoryTestFilesWithContent').mockReturnValue(of(fileContentByPath)); - const loadSolutionFilesSpy = jest.spyOn(exerciseService, 'getSolutionRepositoryTestFilesWithContent').mockReturnValue(of(fileContentByPath)); - const loadReportSpy = jest.spyOn(exerciseService, 'getDiffReport').mockReturnValue(of(gitDiffReport)); - - comp.ngOnInit(); - - expect(loadTemplateFilesSpy).toHaveBeenCalledOnce(); - expect(loadTemplateFilesSpy).toHaveBeenCalledWith(1); - expect(loadSolutionFilesSpy).toHaveBeenCalledOnce(); - expect(loadSolutionFilesSpy).toHaveBeenCalledWith(1); - expect(loadReportSpy).toHaveBeenCalledOnce(); - expect(loadReportSpy).toHaveBeenCalledWith(1); - - expect(comp.gitDiffReport).toEqual(gitDiffReport); - expect(comp.isLoading).toBeFalse(); - expect(onGitDiffLoadedSpy).toHaveBeenCalledOnce(); - expect(onGitDiffLoadedSpy).toHaveBeenCalledWith(gitDiffReport); - }); -}); diff --git a/src/test/javascript/spec/component/hestia/generation-overview/manual-solution-entry-creation-modal.component.spec.ts b/src/test/javascript/spec/component/hestia/generation-overview/manual-solution-entry-creation-modal.component.spec.ts deleted file mode 100644 index 9720294dde47..000000000000 --- a/src/test/javascript/spec/component/hestia/generation-overview/manual-solution-entry-creation-modal.component.spec.ts +++ /dev/null @@ -1,97 +0,0 @@ -import { ArtemisTestModule } from '../../../test.module'; -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { ManualSolutionEntryCreationModalComponent } from 'app/exercises/programming/hestia/generation-overview/manual-solution-entry-creation-modal/manual-solution-entry-creation-modal.component'; -import { ProgrammingExerciseService } from 'app/exercises/programming/manage/services/programming-exercise.service'; -import { ProgrammingExerciseSolutionEntryService } from 'app/exercises/shared/exercise-hint/services/programming-exercise-solution-entry.service'; -import { ProgrammingExerciseTestCase } from 'app/entities/programming/programming-exercise-test-case.model'; -import { of } from 'rxjs'; -import { ProgrammingExerciseSolutionEntry } from 'app/entities/hestia/programming-exercise-solution-entry.model'; -import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; -import { SolutionEntryComponent } from 'app/exercises/shared/exercise-hint/shared/solution-entry.component'; -import { MockComponent } from 'ng-mocks'; - -describe('ManualSolutionEntryCreationModal Component', () => { - let comp: ManualSolutionEntryCreationModalComponent; - let fixture: ComponentFixture; - - let exerciseService: ProgrammingExerciseService; - let solutionEntryService: ProgrammingExerciseSolutionEntryService; - let modalService: NgbActiveModal; - - let testCases: ProgrammingExerciseTestCase[]; - const solutionFiles = ['A.java', 'B.java']; - - let testCaseSpy: jest.SpyInstance; - let getFileNamesSpy: jest.SpyInstance; - - beforeEach(() => { - TestBed.configureTestingModule({ - imports: [ArtemisTestModule], - declarations: [ManualSolutionEntryCreationModalComponent, MockComponent(SolutionEntryComponent)], - }).compileComponents(); - fixture = TestBed.createComponent(ManualSolutionEntryCreationModalComponent); - comp = fixture.componentInstance; - - exerciseService = TestBed.inject(ProgrammingExerciseService); - solutionEntryService = TestBed.inject(ProgrammingExerciseSolutionEntryService); - modalService = TestBed.inject(NgbActiveModal); - - const testCase1 = new ProgrammingExerciseTestCase(); - testCase1.id = 2; - const testCase2 = new ProgrammingExerciseTestCase(); - testCase2.id = 3; - testCases = [testCase1, testCase2]; - testCaseSpy = jest.spyOn(exerciseService, 'getAllTestCases').mockReturnValue(of(testCases)); - - getFileNamesSpy = jest.spyOn(exerciseService, 'getSolutionFileNames').mockReturnValue(of(solutionFiles)); - - comp.exerciseId = 1; - }); - - afterEach(() => { - jest.restoreAllMocks(); - }); - - it('should load test cases and files on init', () => { - comp.ngOnInit(); - - expect(testCaseSpy).toHaveBeenCalledOnce(); - expect(testCaseSpy).toHaveBeenCalledWith(1); - expect(comp.testCases).toEqual(testCases); - expect(getFileNamesSpy).toHaveBeenCalledOnce(); - expect(getFileNamesSpy).toHaveBeenCalledWith(1); - expect(comp.solutionRepositoryFileNames).toEqual(solutionFiles); - }); - - it('should create manual entry', () => { - const entryToCreate = new ProgrammingExerciseSolutionEntry(); - entryToCreate.testCase = testCases[0]; - comp.solutionEntry = entryToCreate; - - const createdEntry = new ProgrammingExerciseSolutionEntry(); - createdEntry.id = 4; - const createSpy = jest.spyOn(solutionEntryService, 'createSolutionEntry').mockReturnValue(of(createdEntry)); - const createdEmitterSpy = jest.spyOn(comp.onEntryCreated, 'emit'); - const closedSpy = jest.spyOn(modalService, 'close'); - - comp.onCreateEntry(); - - expect(createSpy).toHaveBeenCalledOnce(); - expect(createSpy).toHaveBeenCalledWith(1, 2, entryToCreate); - expect(createdEmitterSpy).toHaveBeenCalledOnce(); - expect(createdEmitterSpy).toHaveBeenCalledWith(createdEntry); - expect(closedSpy).toHaveBeenCalledOnce(); - }); - - it('should close modal', () => { - const closedSpy = jest.spyOn(modalService, 'close'); - comp.clear(); - expect(closedSpy).toHaveBeenCalledOnce(); - }); - - it('should setup editor when file path changes', () => { - comp.solutionEntryComponent = { setupEditor: jest.fn() } as unknown as SolutionEntryComponent; - comp.onUpdateFilePath(); - expect(comp.solutionEntryComponent.setupEditor).toHaveBeenCalledOnce(); - }); -}); diff --git a/src/test/javascript/spec/component/hestia/generation-overview/solution-entry-details-modal.component.spec.ts b/src/test/javascript/spec/component/hestia/generation-overview/solution-entry-details-modal.component.spec.ts deleted file mode 100644 index 7852a6aa8f5f..000000000000 --- a/src/test/javascript/spec/component/hestia/generation-overview/solution-entry-details-modal.component.spec.ts +++ /dev/null @@ -1,62 +0,0 @@ -import { ArtemisTestModule } from '../../../test.module'; -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { ProgrammingExerciseSolutionEntryService } from 'app/exercises/shared/exercise-hint/services/programming-exercise-solution-entry.service'; -import { ProgrammingExerciseTestCase } from 'app/entities/programming/programming-exercise-test-case.model'; -import { of } from 'rxjs'; -import { ProgrammingExerciseSolutionEntry } from 'app/entities/hestia/programming-exercise-solution-entry.model'; -import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; -import { SolutionEntryDetailsModalComponent } from 'app/exercises/programming/hestia/generation-overview/solution-entry-details-modal/solution-entry-details-modal.component'; - -describe('SolutionEntryDetailsModal Component', () => { - let comp: SolutionEntryDetailsModalComponent; - let fixture: ComponentFixture; - - let solutionEntryService: ProgrammingExerciseSolutionEntryService; - let modalService: NgbActiveModal; - - let solutionEntry: ProgrammingExerciseSolutionEntry; - - beforeEach(() => { - TestBed.configureTestingModule({ - imports: [ArtemisTestModule], - }).compileComponents(); - fixture = TestBed.createComponent(SolutionEntryDetailsModalComponent); - comp = fixture.componentInstance; - - solutionEntryService = TestBed.inject(ProgrammingExerciseSolutionEntryService); - modalService = TestBed.inject(NgbActiveModal); - - comp.exerciseId = 1; - - const testCase = new ProgrammingExerciseTestCase(); - testCase.id = 2; - - solutionEntry = new ProgrammingExerciseSolutionEntry(); - solutionEntry.id = 3; - solutionEntry.testCase = testCase; - - comp.solutionEntry = solutionEntry; - }); - - afterEach(() => { - jest.restoreAllMocks(); - }); - - it('should create manual entry', () => { - const updateSpy = jest.spyOn(solutionEntryService, 'updateSolutionEntry').mockReturnValue(of(solutionEntry)); - const closedSpy = jest.spyOn(modalService, 'close'); - - comp.saveSolutionEntry(); - - expect(updateSpy).toHaveBeenCalledOnce(); - expect(updateSpy).toHaveBeenCalledWith(1, 2, 3, solutionEntry); - expect(closedSpy).toHaveBeenCalledOnce(); - expect(comp.solutionEntry).toEqual(solutionEntry); - }); - - it('should close modal', () => { - const closedSpy = jest.spyOn(modalService, 'close'); - comp.clear(); - expect(closedSpy).toHaveBeenCalledOnce(); - }); -}); diff --git a/src/test/javascript/spec/component/hestia/generation-overview/solution-entry-generation-step.component.spec.ts b/src/test/javascript/spec/component/hestia/generation-overview/solution-entry-generation-step.component.spec.ts deleted file mode 100644 index 9e4ff7118bc9..000000000000 --- a/src/test/javascript/spec/component/hestia/generation-overview/solution-entry-generation-step.component.spec.ts +++ /dev/null @@ -1,210 +0,0 @@ -import { ArtemisTestModule } from '../../../test.module'; -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { Observable, of } from 'rxjs'; -import { ProgrammingExerciseService } from 'app/exercises/programming/manage/services/programming-exercise.service'; -import { ProgrammingExercise } from 'app/entities/programming/programming-exercise.model'; -import { SolutionEntryGenerationStepComponent } from 'app/exercises/programming/hestia/generation-overview/steps/solution-entry-generation-step/solution-entry-generation-step.component'; -import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap'; -import { AlertService } from 'app/core/util/alert.service'; -import { ProgrammingExerciseSolutionEntryService } from 'app/exercises/shared/exercise-hint/services/programming-exercise-solution-entry.service'; -import { ProgrammingExerciseSolutionEntry } from 'app/entities/hestia/programming-exercise-solution-entry.model'; -import { ArtemisTranslatePipe } from 'app/shared/pipes/artemis-translate.pipe'; -import { MockComponent, MockPipe, MockProvider } from 'ng-mocks'; -import { EventEmitter } from '@angular/core'; -import { ProgrammingExerciseTestCase, ProgrammingExerciseTestCaseType } from 'app/entities/programming/programming-exercise-test-case.model'; -import { SortingOrder } from 'app/shared/table/pageable-table'; -import { HelpIconComponent } from 'app/shared/components/help-icon.component'; - -describe('SolutionEntryGenerationStep Component', () => { - let comp: SolutionEntryGenerationStepComponent; - let fixture: ComponentFixture; - - let exerciseService: ProgrammingExerciseService; - let modalService: NgbModal; - let alertService: AlertService; - let solutionEntryService: ProgrammingExerciseSolutionEntryService; - - let onEntryUpdatedSpy: jest.SpyInstance; - - let exercise: ProgrammingExercise; - let entry1: ProgrammingExerciseSolutionEntry; - let entry2: ProgrammingExerciseSolutionEntry; - let solutionEntries: ProgrammingExerciseSolutionEntry[]; - - beforeEach(() => { - TestBed.configureTestingModule({ - imports: [ArtemisTestModule], - declarations: [SolutionEntryGenerationStepComponent, MockPipe(ArtemisTranslatePipe), MockComponent(HelpIconComponent)], - providers: [MockProvider(NgbModal), MockProvider(AlertService), MockProvider(ArtemisTranslatePipe)], - }).compileComponents(); - fixture = TestBed.createComponent(SolutionEntryGenerationStepComponent); - comp = fixture.componentInstance; - - exerciseService = TestBed.inject(ProgrammingExerciseService); - modalService = TestBed.inject(NgbModal); - alertService = TestBed.inject(AlertService); - solutionEntryService = TestBed.inject(ProgrammingExerciseSolutionEntryService); - - onEntryUpdatedSpy = jest.spyOn(comp.onEntryUpdate, 'emit'); - - exercise = new ProgrammingExercise(undefined, undefined); - exercise.id = 1; - comp.exercise = exercise; - comp.solutionEntries = []; - - entry1 = new ProgrammingExerciseSolutionEntry(); - entry1.id = 2; - const testCase1 = new ProgrammingExerciseTestCase(); - testCase1.id = 4; - testCase1.type = ProgrammingExerciseTestCaseType.STRUCTURAL; - testCase1.testName = 'test1'; - entry1.testCase = testCase1; - - entry2 = new ProgrammingExerciseSolutionEntry(); - entry2.id = 3; - const testCase2 = new ProgrammingExerciseTestCase(); - testCase2.id = 5; - testCase2.type = ProgrammingExerciseTestCaseType.BEHAVIORAL; - testCase2.testName = 'test2'; - entry2.testCase = testCase2; - - solutionEntries = [entry1, entry2]; - }); - - afterEach(() => { - jest.restoreAllMocks(); - }); - - it('should load all solution entries on init', () => { - const loadEntriesSpy = jest.spyOn(solutionEntryService, 'getSolutionEntriesForExercise').mockReturnValue(of(solutionEntries)); - - comp.ngOnInit(); - - expect(loadEntriesSpy).toHaveBeenCalledOnce(); - expect(loadEntriesSpy).toHaveBeenCalledWith(1); - expect(comp.solutionEntries).toEqual(solutionEntries); - expect(comp.isLoading).toBeFalse(); - expect(onEntryUpdatedSpy).toHaveBeenCalledOnce(); - expect(onEntryUpdatedSpy).toHaveBeenCalledWith(solutionEntries); - }); - - it('should open editable solution entry details modal', () => { - const mockModal = { - result: Promise.resolve(), - componentInstance: {}, - } as NgbModalRef; - const openSpy = jest.spyOn(modalService, 'open').mockReturnValue(mockModal); - - comp.openSolutionEntryModal(entry1, true); - - expect(openSpy).toHaveBeenCalledOnce(); - expect(mockModal.componentInstance.exerciseId).toBe(1); - expect(mockModal.componentInstance.solutionEntry).toEqual(entry1); - expect(mockModal.componentInstance.isEditable).toBeTrue(); - }); - - it('should open manual solution entry creation modal', () => { - const mockModal = { - result: Promise.resolve(), - componentInstance: {}, - } as NgbModalRef; - const emitter = new EventEmitter(); - mockModal.componentInstance.onEntryCreated = emitter; - - const openSpy = jest.spyOn(modalService, 'open').mockReturnValue(mockModal); - - comp.openManualEntryCreationModal(); - - expect(openSpy).toHaveBeenCalledOnce(); - expect(mockModal.componentInstance.exerciseId).toBe(1); - - emitter.emit(entry1); - expect(comp.solutionEntries).toHaveLength(1); - expect(comp.solutionEntries).toContain(entry1); - }); - - it('should generate structural solution entries', () => { - const generateSpy = jest.spyOn(exerciseService, 'createStructuralSolutionEntries').mockReturnValue(of([entry1])); - const successSpy = jest.spyOn(alertService, 'success'); - // only one behavioral entry - comp.solutionEntries = [entry2]; - - comp.onGenerateStructuralSolutionEntries(); - - expect(generateSpy).toHaveBeenCalledOnce(); - expect(generateSpy).toHaveBeenCalledWith(1); - expect(successSpy).toHaveBeenCalledOnce(); - expect(comp.solutionEntries).toContainAllValues([entry1, entry2]); - expect(comp.testCaseSortOrder).toBeUndefined(); - expect(onEntryUpdatedSpy).toHaveBeenCalledOnce(); - expect(onEntryUpdatedSpy).toHaveBeenCalledWith([entry2, entry1]); - }); - - it('should generate behavioral solution entries', () => { - const generateSpy = jest.spyOn(exerciseService, 'createBehavioralSolutionEntries').mockReturnValue(of([entry2])); - const successSpy = jest.spyOn(alertService, 'success'); - // only one structural entry - comp.solutionEntries = [entry1]; - - comp.onGenerateBehavioralSolutionEntries(); - - expect(generateSpy).toHaveBeenCalledOnce(); - expect(generateSpy).toHaveBeenCalledWith(1); - expect(successSpy).toHaveBeenCalledOnce(); - expect(comp.solutionEntries).toContainAllValues([entry1, entry2]); - expect(comp.testCaseSortOrder).toBeUndefined(); - expect(onEntryUpdatedSpy).toHaveBeenCalledOnce(); - expect(onEntryUpdatedSpy).toHaveBeenCalledWith(solutionEntries); - }); - - it('should delete all solution entries', () => { - const deleteAllSpy = jest.spyOn(solutionEntryService, 'deleteAllSolutionEntriesForExercise').mockReturnValue(new Observable((s) => s.next())); - comp.deleteAllSolutionEntries(); - - expect(deleteAllSpy).toHaveBeenCalledOnce(); - expect(deleteAllSpy).toHaveBeenCalledWith(1); - expect(comp.solutionEntries).toHaveLength(0); - expect(onEntryUpdatedSpy).toHaveBeenCalledOnce(); - expect(onEntryUpdatedSpy).toHaveBeenCalledWith([]); - }); - - it('should delete individual solution entry', () => { - const deleteIndividualSpy = jest.spyOn(solutionEntryService, 'deleteSolutionEntry').mockReturnValue(new Observable((s) => s.next())); - comp.solutionEntries = solutionEntries; - - comp.deleteSolutionEntry(entry1); - - expect(deleteIndividualSpy).toHaveBeenCalledOnce(); - expect(deleteIndividualSpy).toHaveBeenCalledWith(1, 4, 2); - expect(onEntryUpdatedSpy).toHaveBeenCalledOnce(); - expect(onEntryUpdatedSpy).toHaveBeenCalledWith([entry2]); - expect(comp.solutionEntries).toEqual([entry2]); - }); - - it('should sort tests ascending from no order', () => { - comp.solutionEntries = [entry2, entry1]; - comp.changeTestCaseSortOrder(); - expect(comp.solutionEntries).toEqual([entry1, entry2]); - expect(comp.testCaseSortOrder).toBe(SortingOrder.ASCENDING); - }); - - it('should sort tests descending from ascending', () => { - comp.testCaseSortOrder = SortingOrder.ASCENDING; - comp.solutionEntries = [entry1, entry2]; - - comp.changeTestCaseSortOrder(); - - expect(comp.solutionEntries).toEqual([entry2, entry1]); - expect(comp.testCaseSortOrder).toBe(SortingOrder.DESCENDING); - }); - - it('should sort tests ascending from descending', () => { - comp.testCaseSortOrder = SortingOrder.DESCENDING; - comp.solutionEntries = [entry2, entry1]; - - comp.changeTestCaseSortOrder(); - - expect(comp.solutionEntries).toEqual([entry1, entry2]); - expect(comp.testCaseSortOrder).toBe(SortingOrder.ASCENDING); - }); -}); diff --git a/src/test/javascript/spec/component/hestia/testwise-coverage-report/testwise-coverage-file.component.spec.ts b/src/test/javascript/spec/component/hestia/testwise-coverage-report/testwise-coverage-file.component.spec.ts deleted file mode 100644 index a35ac8f46b3b..000000000000 --- a/src/test/javascript/spec/component/hestia/testwise-coverage-report/testwise-coverage-file.component.spec.ts +++ /dev/null @@ -1,116 +0,0 @@ -import { ArtemisTestModule } from '../../../test.module'; -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { TestwiseCoverageFileComponent } from 'app/exercises/programming/hestia/testwise-coverage-report/testwise-coverage-file.component'; -import { ProgrammingExerciseTestCase } from 'app/entities/programming/programming-exercise-test-case.model'; -import { TestwiseCoverageReportEntry } from 'app/entities/hestia/testwise-coverage-report-entry.model'; -import { CoverageFileReport } from 'app/entities/hestia/coverage-file-report.model'; -import { MatExpansionModule } from '@angular/material/expansion'; -import { MockComponent } from 'ng-mocks'; -import { MonacoEditorComponent } from 'app/shared/monaco-editor/monaco-editor.component'; - -describe('TestwiseCoverageFile Component', () => { - let comp: TestwiseCoverageFileComponent; - let fixture: ComponentFixture; - let reportEntry1: TestwiseCoverageReportEntry; - let reportEntry2: TestwiseCoverageReportEntry; - let fileReport: CoverageFileReport; - - beforeEach(() => { - TestBed.configureTestingModule({ - imports: [ArtemisTestModule, MatExpansionModule, NoopAnimationsModule], - declarations: [TestwiseCoverageFileComponent, MockComponent(MonacoEditorComponent)], - }) - .compileComponents() - .then(() => { - fixture = TestBed.createComponent(TestwiseCoverageFileComponent); - comp = fixture.componentInstance; - - const testCase1 = { - id: 1, - testName: 'testBubbleSort()', - } as ProgrammingExerciseTestCase; - const testCase2 = { - id: 2, - testName: 'testBubbleSortForSmallLists()', - } as ProgrammingExerciseTestCase; - - reportEntry1 = { - id: 1, - startLine: 4, - lineCount: 2, - testCase: testCase1, - } as TestwiseCoverageReportEntry; - reportEntry2 = { - id: 2, - startLine: 7, - lineCount: 2, - testCase: testCase2, - } as TestwiseCoverageReportEntry; - - fileReport = { - id: 1, - lineCount: 10, - filePath: 'src/de/tum/in/ase/BubbleSort.java', - coveredLineCount: 5, - testwiseCoverageEntries: [reportEntry1, reportEntry2], - } as CoverageFileReport; - comp.fileContent = '\n\n\n\n\n\n\n\n\nlast'; - comp.fileName = 'src/de/tum/in/ase/BubbleSort.java'; - comp.fileReport = fileReport; - }); - }); - - afterEach(() => { - jest.restoreAllMocks(); - }); - - it('should initially create and add all ranges correctly', () => { - const highlightLinesSpy = jest.spyOn(comp.editor, 'highlightLines'); - - comp.ngOnInit(); - - expect(highlightLinesSpy).toHaveBeenCalledTimes(2); - expect(highlightLinesSpy).toHaveBeenCalledWith( - 4, - 5, - TestwiseCoverageFileComponent.COVERED_LINE_HIGHLIGHT_CLASS, - TestwiseCoverageFileComponent.COVERED_LINE_HIGHLIGHT_CLASS, - ); - expect(highlightLinesSpy).toHaveBeenCalledWith( - 7, - 8, - TestwiseCoverageFileComponent.COVERED_LINE_HIGHLIGHT_CLASS, - TestwiseCoverageFileComponent.COVERED_LINE_HIGHLIGHT_CLASS, - ); - }); - - it('should calculate covered line ratio correctly', () => { - comp.fileReport.testwiseCoverageEntries = [reportEntry1]; - comp.ngOnInit(); - expect(comp.proportionCoveredLines).toBe(0.2); - expect(comp.proportionString).toBe('20.0 %'); - }); - - it('should update on input coverage data changes', () => { - comp.fileReport.testwiseCoverageEntries = [reportEntry1, reportEntry2]; - comp.ngOnInit(); - expect(comp.proportionCoveredLines).toBe(0.4); - expect(comp.proportionString).toBe('40.0 %'); - - const highlightLinesSpy = jest.spyOn(comp.editor, 'highlightLines'); - - fileReport.testwiseCoverageEntries = [reportEntry1]; - comp.fileReport = fileReport; - fixture.detectChanges(); - - expect(comp.proportionCoveredLines).toBe(0.2); - expect(comp.proportionString).toBe('20.0 %'); - expect(highlightLinesSpy).toHaveBeenCalledExactlyOnceWith( - 4, - 5, - TestwiseCoverageFileComponent.COVERED_LINE_HIGHLIGHT_CLASS, - TestwiseCoverageFileComponent.COVERED_LINE_HIGHLIGHT_CLASS, - ); - }); -}); diff --git a/src/test/javascript/spec/component/hestia/testwise-coverage-report/testwise-coverage-report.component.spec.ts b/src/test/javascript/spec/component/hestia/testwise-coverage-report/testwise-coverage-report.component.spec.ts deleted file mode 100644 index 1c2e97853b5b..000000000000 --- a/src/test/javascript/spec/component/hestia/testwise-coverage-report/testwise-coverage-report.component.spec.ts +++ /dev/null @@ -1,133 +0,0 @@ -import { ArtemisTestModule } from '../../../test.module'; -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { TestwiseCoverageReportComponent } from 'app/exercises/programming/hestia/testwise-coverage-report/testwise-coverage-report.component'; -import { CoverageReport } from 'app/entities/hestia/coverage-report.model'; -import { CoverageFileReport } from 'app/entities/hestia/coverage-file-report.model'; -import { ProgrammingExerciseTestCase } from 'app/entities/programming/programming-exercise-test-case.model'; -import { TestwiseCoverageReportEntry } from 'app/entities/hestia/testwise-coverage-report-entry.model'; - -describe('TestwiseCoverageReport Component', () => { - let comp: TestwiseCoverageReportComponent; - let fixture: ComponentFixture; - - let report: CoverageReport; - let reportEntries: TestwiseCoverageReportEntry[]; - let fileReports: CoverageFileReport[]; - let fileContentByName: Map; - - beforeEach(() => { - TestBed.configureTestingModule({ - imports: [ArtemisTestModule], - declarations: [TestwiseCoverageReportComponent], - }) - .compileComponents() - .then(() => { - fixture = TestBed.createComponent(TestwiseCoverageReportComponent); - comp = fixture.componentInstance; - - const testCase1 = { - id: 1, - testName: 'testBubbleSort()', - } as ProgrammingExerciseTestCase; - const testCase2 = { - id: 2, - testName: 'testBubbleSortForSmallLists()', - } as ProgrammingExerciseTestCase; - const testCase3 = { - id: 3, - testName: 'testMergeSort()', - } as ProgrammingExerciseTestCase; - - const reportEntry1 = { - id: 1, - startLine: 4, - lineCount: 2, - testCase: testCase1, - } as TestwiseCoverageReportEntry; - const reportEntry2 = { - id: 2, - startLine: 7, - lineCount: 2, - testCase: testCase2, - } as TestwiseCoverageReportEntry; - const reportEntry3 = { - id: 3, - startLine: 1, - lineCount: 2, - testCase: testCase3, - } as TestwiseCoverageReportEntry; - reportEntries = [reportEntry1, reportEntry2, reportEntry3]; - - fileReports = [ - { - filePath: 'src/de/tum/in/ase/BubbleSort.java', - lineCount: 10, - coveredLineCount: 5, - testwiseCoverageEntries: [reportEntry1, reportEntry2], - } as CoverageFileReport, - { - filePath: 'src/de/tum/in/ase/MergeSort.java', - lineCount: 2, - coveredLineCount: 1, - testwiseCoverageEntries: [reportEntry3], - } as CoverageFileReport, - ]; - - report = { - id: 1, - fileReports, - coveredLineRatio: 0.5, - } as CoverageReport; - comp.report = report; - - fileContentByName = new Map(); - // file with 10 lines, 4 covered - fileContentByName.set( - 'src/de/tum/in/ase/BubbleSort.java', - 'package de.tum.in.ase;\n\ncovered\ncovered\nuncovered\ncovered\ncovered\nuncovered\nuncovered\nuncovered', - ); - // file with 2 lines, 2 covered - fileContentByName.set('src/de/tum/in/ase/MergeSort.java', 'covered\ncovered'); - comp.fileContentByPath = fileContentByName; - - comp.ngOnInit(); - }); - }); - - it('should initially display coverage for all test cases', () => { - const expectedMap = new Map(); - expectedMap.set('testBubbleSort()', true); - expectedMap.set('testBubbleSortForSmallLists()', true); - expectedMap.set('testMergeSort()', true); - - expect(comp.displayedTestCaseNames.size).toBe(3); - expect(comp.displayedTestCaseNames).toEqual(expectedMap); - }); - - it('should set file report by file name with for all test cases', () => { - const expectedMap = new Map(); - expectedMap.set('src/de/tum/in/ase/BubbleSort.java', fileReports[0]); - expectedMap.set('src/de/tum/in/ase/MergeSort.java', fileReports[1]); - - expect(comp.fileReportByFileName).toEqual(expectedMap); - }); - - it('should filter coverage file reports for test case', () => { - comp.changeReportsBySelectedTestCases('testBubbleSort()'); - expect(comp.displayedTestCaseNames.get('testBubbleSort()')).toBeFalse(); - expect(comp.fileReportByFileName.size).toBe(2); - expect(comp.fileReportByFileName.get('src/de/tum/in/ase/BubbleSort.java')?.testwiseCoverageEntries).toEqual([reportEntries[1]]); - }); - - it('should create empty file report if no report exists for file', () => { - comp.fileContentByPath.set('notexisting.java', '\n\n'); - comp.ngOnInit(); - - expect(comp.fileReportByFileName.get('notexisting.java')).toEqual({ - lineCount: 3, - coveredLineCount: 0, - filePath: 'notexisting.java', - testwiseCoverageEntries: [], - } as CoverageFileReport); - }); -}); diff --git a/src/test/javascript/spec/component/localci/build-agents/build-agent-details.component.spec.ts b/src/test/javascript/spec/component/localci/build-agents/build-agent-details.component.spec.ts index 0b14d136c97c..f34b35e43cba 100644 --- a/src/test/javascript/spec/component/localci/build-agents/build-agent-details.component.spec.ts +++ b/src/test/javascript/spec/component/localci/build-agents/build-agent-details.component.spec.ts @@ -61,7 +61,6 @@ describe('BuildAgentDetailsComponent', () => { projectType: 'Maven', scaEnabled: false, sequentialTestRunsEnabled: false, - testwiseCoverageEnabled: false, resultPaths: [], }; diff --git a/src/test/javascript/spec/component/localci/build-agents/build-agent-summary.component.spec.ts b/src/test/javascript/spec/component/localci/build-agents/build-agent-summary.component.spec.ts index f71ad2c8d920..3e4bd2482c0d 100644 --- a/src/test/javascript/spec/component/localci/build-agents/build-agent-summary.component.spec.ts +++ b/src/test/javascript/spec/component/localci/build-agents/build-agent-summary.component.spec.ts @@ -58,7 +58,6 @@ describe('BuildAgentSummaryComponent', () => { projectType: 'Maven', scaEnabled: false, sequentialTestRunsEnabled: false, - testwiseCoverageEnabled: false, resultPaths: [], }; diff --git a/src/test/javascript/spec/component/localci/build-agents/build-agents.service.spec.ts b/src/test/javascript/spec/component/localci/build-agents/build-agents.service.spec.ts index 18b9f0135b83..69fb9bca2acd 100644 --- a/src/test/javascript/spec/component/localci/build-agents/build-agents.service.spec.ts +++ b/src/test/javascript/spec/component/localci/build-agents/build-agents.service.spec.ts @@ -42,7 +42,6 @@ describe('BuildAgentsService', () => { projectType: 'Maven', scaEnabled: false, sequentialTestRunsEnabled: false, - testwiseCoverageEnabled: false, resultPaths: [], }; diff --git a/src/test/javascript/spec/component/localci/build-queue/build-queue.component.spec.ts b/src/test/javascript/spec/component/localci/build-queue/build-queue.component.spec.ts index 4c53661e99d4..b22a67ee3f15 100644 --- a/src/test/javascript/spec/component/localci/build-queue/build-queue.component.spec.ts +++ b/src/test/javascript/spec/component/localci/build-queue/build-queue.component.spec.ts @@ -89,7 +89,6 @@ describe('BuildQueueComponent', () => { projectType: 'Maven', scaEnabled: false, sequentialTestRunsEnabled: false, - testwiseCoverageEnabled: false, resultPaths: [], }, }, @@ -125,7 +124,6 @@ describe('BuildQueueComponent', () => { projectType: 'Maven', scaEnabled: false, sequentialTestRunsEnabled: false, - testwiseCoverageEnabled: false, resultPaths: [], }, }, @@ -163,7 +161,6 @@ describe('BuildQueueComponent', () => { projectType: 'Maven', scaEnabled: false, sequentialTestRunsEnabled: false, - testwiseCoverageEnabled: false, resultPaths: [], }, }, @@ -199,7 +196,6 @@ describe('BuildQueueComponent', () => { projectType: 'Maven', scaEnabled: false, sequentialTestRunsEnabled: false, - testwiseCoverageEnabled: false, resultPaths: [], }, }, diff --git a/src/test/javascript/spec/component/localci/build-queue/build-queue.service.spec.ts b/src/test/javascript/spec/component/localci/build-queue/build-queue.service.spec.ts index 73b4ac460f63..16a2d81d37ed 100644 --- a/src/test/javascript/spec/component/localci/build-queue/build-queue.service.spec.ts +++ b/src/test/javascript/spec/component/localci/build-queue/build-queue.service.spec.ts @@ -80,7 +80,6 @@ describe('BuildQueueService', () => { buildConfig.projectType = 'type1'; buildConfig.scaEnabled = false; buildConfig.sequentialTestRunsEnabled = false; - buildConfig.testwiseCoverageEnabled = false; buildConfig.resultPaths = ['path1']; elem1.id = '1'; diff --git a/src/test/javascript/spec/component/localvc/commit-details-view.component.spec.ts b/src/test/javascript/spec/component/localvc/commit-details-view.component.spec.ts index fb964f7ea127..7625253cc587 100644 --- a/src/test/javascript/spec/component/localvc/commit-details-view.component.spec.ts +++ b/src/test/javascript/spec/component/localvc/commit-details-view.component.spec.ts @@ -12,10 +12,10 @@ import { MockComponent, MockPipe } from 'ng-mocks'; import { CommitDetailsViewComponent } from 'app/localvc/commit-details-view/commit-details-view.component'; import { ProgrammingExerciseService } from 'app/exercises/programming/manage/services/programming-exercise.service'; import { MockProgrammingExerciseService } from '../../helpers/mocks/service/mock-programming-exercise.service'; -import { ProgrammingExerciseGitDiffReport } from 'app/entities/hestia/programming-exercise-git-diff-report.model'; +import { ProgrammingExerciseGitDiffReport } from '../../../../../main/webapp/app/entities/programming-exercise-git-diff-report.model'; import { ArtemisTranslatePipe } from 'app/shared/pipes/artemis-translate.pipe'; import { ArtemisDatePipe } from 'app/shared/pipes/artemis-date.pipe'; -import { GitDiffReportComponent } from 'app/exercises/programming/hestia/git-diff-report/git-diff-report.component'; +import { GitDiffReportComponent } from '../../../../../main/webapp/app/exercises/programming/git-diff-report/git-diff-report.component'; import { ProgrammingExercise } from 'app/entities/programming/programming-exercise.model'; import { HttpResponse } from '@angular/common/http'; diff --git a/src/test/javascript/spec/component/overview/exercise-details/course-exercise-details.component.spec.ts b/src/test/javascript/spec/component/overview/exercise-details/course-exercise-details.component.spec.ts index 4f2a2c9b8331..cfe00096d639 100644 --- a/src/test/javascript/spec/component/overview/exercise-details/course-exercise-details.component.spec.ts +++ b/src/test/javascript/spec/component/overview/exercise-details/course-exercise-details.component.spec.ts @@ -59,7 +59,6 @@ import { LockRepositoryPolicy } from 'app/entities/submission-policy.model'; import { PlagiarismCasesService } from 'app/course/plagiarism-cases/shared/plagiarism-cases.service'; import { PlagiarismVerdict } from 'app/exercises/shared/plagiarism/types/PlagiarismVerdict'; import { AlertService } from 'app/core/util/alert.service'; -import { ExerciseHintButtonOverlayComponent } from 'app/exercises/shared/exercise-hint/participate/exercise-hint-button-overlay.component'; import { ProgrammingExerciseExampleSolutionRepoDownloadComponent } from 'app/exercises/programming/shared/actions/programming-exercise-example-solution-repo-download.component'; import { ResetRepoButtonComponent } from 'app/shared/components/reset-repo-button/reset-repo-button.component'; import { ProblemStatementComponent } from 'app/overview/exercise-details/problem-statement/problem-statement.component'; @@ -71,7 +70,6 @@ import { ScienceService } from 'app/shared/science/science.service'; import { MockScienceService } from '../../../helpers/mocks/service/mock-science-service'; import { ScienceEventType } from 'app/shared/science/science.model'; import { PROFILE_IRIS } from 'app/app.constants'; -import { ExerciseHintService } from 'app/exercises/shared/exercise-hint/shared/exercise-hint.service'; import { CourseInformationSharingConfiguration } from 'app/entities/course.model'; import { provideHttpClient } from '@angular/common/http'; @@ -80,15 +78,12 @@ describe('CourseExerciseDetailsComponent', () => { let fixture: ComponentFixture; let profileService: ProfileService; let exerciseService: ExerciseService; - let exerciseHintService: ExerciseHintService; let teamService: TeamService; let participationService: ParticipationService; let participationWebsocketService: ParticipationWebsocketService; let complaintService: ComplaintService; let getProfileInfoMock: jest.SpyInstance; let getExerciseDetailsMock: jest.SpyInstance; - let getActivatedExerciseHintsMock: jest.SpyInstance; - let getAvailableExerciseHintsMock: jest.SpyInstance; let mergeStudentParticipationMock: jest.SpyInstance; let subscribeForParticipationChangesMock: jest.SpyInstance; let participationWebsockerBehaviourSubject: BehaviorSubject; @@ -152,7 +147,6 @@ describe('CourseExerciseDetailsComponent', () => { MockComponent(ResultHistoryComponent), MockComponent(ResultComponent), MockComponent(ComplaintsStudentViewComponent), - MockComponent(ExerciseHintButtonOverlayComponent), MockComponent(ProgrammingExerciseExampleSolutionRepoDownloadComponent), MockComponent(ProblemStatementComponent), MockComponent(ResetRepoButtonComponent), @@ -189,7 +183,6 @@ describe('CourseExerciseDetailsComponent', () => { MockProvider(PlagiarismCasesService), MockProvider(AlertService), MockProvider(IrisSettingsService), - MockProvider(ExerciseHintService), ], }) .compileComponents() @@ -231,10 +224,6 @@ describe('CourseExerciseDetailsComponent', () => { scienceService = TestBed.inject(ScienceService); logEventStub = jest.spyOn(scienceService, 'logEvent'); - exerciseHintService = TestBed.inject(ExerciseHintService); - getActivatedExerciseHintsMock = jest.spyOn(exerciseHintService, 'getActivatedExerciseHints'); - getAvailableExerciseHintsMock = jest.spyOn(exerciseHintService, 'getAvailableExerciseHints'); - participationService = TestBed.inject(ParticipationService); mergeStudentParticipationMock = jest.spyOn(participationService, 'mergeStudentParticipations'); }); @@ -335,16 +324,6 @@ describe('CourseExerciseDetailsComponent', () => { expect(comp.exampleSolutionCollapsed).toBeFalse(); }); - it('should activate hint', () => { - comp.availableExerciseHints = [{ id: 1 }, { id: 2 }]; - comp.activatedExerciseHints = []; - - const activatedHint = comp.availableExerciseHints[0]; - comp.onHintActivated(activatedHint); - expect(comp.availableExerciseHints).not.toContain(activatedHint); - expect(comp.activatedExerciseHints).toContain(activatedHint); - }); - it('should sort results by completion date in ascending order', () => { const result1 = { completionDate: dayjs().subtract(2, 'days') } as Result; const result2 = { completionDate: dayjs().subtract(1, 'day') } as Result; @@ -432,16 +411,9 @@ describe('CourseExerciseDetailsComponent', () => { const newParticipation = { ...participation, submissions: [submission, { id: submissionId + 1 }] }; - getActivatedExerciseHintsMock.mockReturnValue(of({ body: [] })); - getAvailableExerciseHintsMock.mockReturnValue(of({ body: [] })); mergeStudentParticipationMock.mockReturnValue([newParticipation]); participationWebsockerBehaviourSubject.next({ ...newParticipation, exercise: programmingExercise, results: [] }); - - tick(); - - expect(getActivatedExerciseHintsMock).toHaveBeenCalledOnce(); - expect(getAvailableExerciseHintsMock).toHaveBeenCalledOnce(); })); it.each<[string[]]>([[[]], [[PROFILE_IRIS]]])( diff --git a/src/test/javascript/spec/component/programming-diff-report-detail.component.spec.ts b/src/test/javascript/spec/component/programming-diff-report-detail.component.spec.ts index 9f1940740640..9c0ede8c5141 100644 --- a/src/test/javascript/spec/component/programming-diff-report-detail.component.spec.ts +++ b/src/test/javascript/spec/component/programming-diff-report-detail.component.spec.ts @@ -1,7 +1,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; import { MockNgbModalService } from '../helpers/mocks/service/mock-ngb-modal.service'; -import { ProgrammingExerciseGitDiffReport } from 'app/entities/hestia/programming-exercise-git-diff-report.model'; +import { ProgrammingExerciseGitDiffReport } from '../../../../main/webapp/app/entities/programming-exercise-git-diff-report.model'; import { ProgrammingDiffReportDetailComponent } from 'app/detail-overview-list/components/programming-diff-report-detail/programming-diff-report-detail.component'; import { TranslateService } from '@ngx-translate/core'; import { MockTranslateService } from '../helpers/mocks/service/mock-translate.service'; diff --git a/src/test/javascript/spec/component/programming-exercise/programming-exercise-custom-aeolus-build-plan.component.spec.ts b/src/test/javascript/spec/component/programming-exercise/programming-exercise-custom-aeolus-build-plan.component.spec.ts index 005fa8fdd41a..c1882b341c37 100644 --- a/src/test/javascript/spec/component/programming-exercise/programming-exercise-custom-aeolus-build-plan.component.spec.ts +++ b/src/test/javascript/spec/component/programming-exercise/programming-exercise-custom-aeolus-build-plan.component.spec.ts @@ -179,7 +179,6 @@ describe('ProgrammingExercise Aeolus Custom Build Plan', () => { comp.projectType = programmingExercise.projectType; comp.sequentialTestRuns = programmingExercise.buildConfig?.sequentialTestRuns; comp.staticCodeAnalysisEnabled = programmingExercise.staticCodeAnalysisEnabled; - comp.testwiseCoverageEnabled = programmingExercise.buildConfig?.testwiseCoverageEnabled; expect(comp.shouldReloadTemplate()).toBeFalse(); }); @@ -188,7 +187,6 @@ describe('ProgrammingExercise Aeolus Custom Build Plan', () => { comp.projectType = ProjectType.PLAIN_GRADLE; comp.sequentialTestRuns = programmingExercise.buildConfig?.sequentialTestRuns; comp.staticCodeAnalysisEnabled = true; - comp.testwiseCoverageEnabled = true; expect(comp.shouldReloadTemplate()).toBeTrue(); }); @@ -214,7 +212,6 @@ describe('ProgrammingExercise Aeolus Custom Build Plan', () => { comp.projectType = undefined; comp.sequentialTestRuns = undefined; comp.staticCodeAnalysisEnabled = undefined; - comp.testwiseCoverageEnabled = undefined; comp.programmingExerciseCreationConfig = programmingExerciseCreationConfigMock; comp.programmingExerciseCreationConfig.customBuildPlansSupported = PROFILE_AEOLUS; comp.loadAeolusTemplate(); @@ -222,7 +219,6 @@ describe('ProgrammingExercise Aeolus Custom Build Plan', () => { expect(comp.projectType).toBe(programmingExercise.projectType); expect(comp.sequentialTestRuns).toBe(programmingExercise.buildConfig?.sequentialTestRuns); expect(comp.staticCodeAnalysisEnabled).toBe(programmingExercise.staticCodeAnalysisEnabled); - expect(comp.testwiseCoverageEnabled).toBe(programmingExercise.buildConfig?.testwiseCoverageEnabled); }); it('should not call loadAeolusTemplate', () => { diff --git a/src/test/javascript/spec/component/programming-exercise/programming-exercise-custom-build-plan.component.spec.ts b/src/test/javascript/spec/component/programming-exercise/programming-exercise-custom-build-plan.component.spec.ts index a02862b32a59..2e9e9b841e50 100644 --- a/src/test/javascript/spec/component/programming-exercise/programming-exercise-custom-build-plan.component.spec.ts +++ b/src/test/javascript/spec/component/programming-exercise/programming-exercise-custom-build-plan.component.spec.ts @@ -98,7 +98,6 @@ describe('ProgrammingExercise Custom Build Plan', () => { comp.projectType = programmingExercise.projectType; comp.sequentialTestRuns = programmingExercise.buildConfig?.sequentialTestRuns; comp.staticCodeAnalysisEnabled = programmingExercise.staticCodeAnalysisEnabled; - comp.testwiseCoverageEnabled = programmingExercise.buildConfig?.testwiseCoverageEnabled; expect(comp.shouldReloadTemplate()).toBeFalse(); }); @@ -107,7 +106,6 @@ describe('ProgrammingExercise Custom Build Plan', () => { comp.projectType = ProjectType.PLAIN_GRADLE; comp.sequentialTestRuns = programmingExercise.buildConfig?.sequentialTestRuns; comp.staticCodeAnalysisEnabled = true; - comp.testwiseCoverageEnabled = true; expect(comp.shouldReloadTemplate()).toBeTrue(); }); @@ -133,7 +131,6 @@ describe('ProgrammingExercise Custom Build Plan', () => { comp.projectType = undefined; comp.sequentialTestRuns = undefined; comp.staticCodeAnalysisEnabled = undefined; - comp.testwiseCoverageEnabled = undefined; comp.programmingExerciseCreationConfig = programmingExerciseCreationConfigMock; comp.programmingExerciseCreationConfig.customBuildPlansSupported = PROFILE_LOCALCI; comp.loadAeolusTemplate(); @@ -141,7 +138,6 @@ describe('ProgrammingExercise Custom Build Plan', () => { expect(comp.projectType).toBe(programmingExercise.projectType); expect(comp.sequentialTestRuns).toBe(programmingExercise.buildConfig?.sequentialTestRuns); expect(comp.staticCodeAnalysisEnabled).toBe(programmingExercise.staticCodeAnalysisEnabled); - expect(comp.testwiseCoverageEnabled).toBe(programmingExercise.buildConfig?.testwiseCoverageEnabled); }); it('should not call loadAeolusTemplate', () => { diff --git a/src/test/javascript/spec/component/programming-exercise/programming-exercise-detail.component.spec.ts b/src/test/javascript/spec/component/programming-exercise/programming-exercise-detail.component.spec.ts index f355ba91a806..3cfee5c3084c 100644 --- a/src/test/javascript/spec/component/programming-exercise/programming-exercise-detail.component.spec.ts +++ b/src/test/javascript/spec/component/programming-exercise/programming-exercise-detail.component.spec.ts @@ -22,7 +22,6 @@ import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; import { MockSyncStorage } from '../../helpers/mocks/service/mock-sync-storage.service'; import { LocalStorageService, SessionStorageService } from 'ngx-webstorage'; import { MockProgrammingExerciseGradingService } from '../../helpers/mocks/service/mock-programming-exercise-grading.service'; -import { ProgrammingExerciseSolutionEntry } from 'app/entities/hestia/programming-exercise-solution-entry.model'; import { TemplateProgrammingExerciseParticipation } from 'app/entities/participation/template-programming-exercise-participation.model'; import { SolutionProgrammingExerciseParticipation } from 'app/entities/participation/solution-programming-exercise-participation.model'; import { HttpResponse } from '@angular/common/http'; @@ -32,8 +31,7 @@ import { ProgrammingLanguageFeatureService, } from 'app/exercises/programming/shared/service/programming-language-feature/programming-language-feature.service'; import { MockRouter } from '../../helpers/mocks/mock-router'; -import { BuildConfig } from '../../../../../main/webapp/app/entities/programming/build-config.model'; -import { ProgrammingExerciseGitDiffReport } from 'app/entities/hestia/programming-exercise-git-diff-report.model'; +import { ProgrammingExerciseGitDiffReport } from '../../../../../main/webapp/app/entities/programming-exercise-git-diff-report.model'; import { BuildLogStatisticsDTO } from 'app/entities/programming/build-log-statistics-dto'; import { SubmissionPolicyService } from '../../../../../main/webapp/app/exercises/programming/manage/services/submission-policy.service'; @@ -64,9 +62,6 @@ describe('ProgrammingExerciseDetailComponent', () => { solutionParticipation: { id: 2, } as SolutionProgrammingExerciseParticipation, - buildConfig: { - testwiseCoverageEnabled: true, - } as BuildConfig, } as ProgrammingExercise; const exerciseStatistics = { @@ -163,7 +158,6 @@ describe('ProgrammingExerciseDetailComponent', () => { it('should reload on participation change', fakeAsync(() => { const loadDiffSpy = jest.spyOn(comp, 'loadGitDiffReport'); jest.spyOn(exerciseService, 'getLatestResult').mockReturnValue({ successful: true }); - jest.spyOn(exerciseService, 'getLatestFullTestwiseCoverageReport').mockReturnValue(of({ coveredLineRatio: 0.5 })); comp.programmingExercise = mockProgrammingExercise; comp.programmingExerciseBuildConfig = mockProgrammingExercise.buildConfig; comp.onParticipationChange(); diff --git a/src/test/javascript/spec/component/programming-exercise/programming-exercise-update.component.spec.ts b/src/test/javascript/spec/component/programming-exercise/programming-exercise-update.component.spec.ts index 3e49d0bd49ff..d81b798a1188 100644 --- a/src/test/javascript/spec/component/programming-exercise/programming-exercise-update.component.spec.ts +++ b/src/test/javascript/spec/component/programming-exercise/programming-exercise-update.component.spec.ts @@ -196,7 +196,6 @@ describe('ProgrammingExerciseUpdateComponent', () => { packageNameRequired: true, checkoutSolutionRepositoryAllowed: true, projectTypes: [ProjectType.PLAIN_MAVEN, ProjectType.MAVEN_MAVEN], - testwiseCoverageAnalysisSupported: true, auxiliaryRepositoriesSupported: true, } as ProgrammingLanguageFeature); }); @@ -1194,7 +1193,6 @@ describe('ProgrammingExerciseUpdateComponent', () => { tick(); expect(comp.programmingExercise.staticCodeAnalysisEnabled).toBeFalse(); - expect(comp.programmingExercise.buildConfig?.testwiseCoverageEnabled).toBeFalse(); })); it('should disable options for java dejagnu project type and re-enable them after changing back to maven or gradle', fakeAsync(() => { @@ -1202,19 +1200,15 @@ describe('ProgrammingExerciseUpdateComponent', () => { getFeaturesStub.mockImplementation((language: ProgrammingLanguage) => getProgrammingLanguageFeature(language)); comp.selectedProjectType = ProjectType.MAVEN_BLACKBOX; expect(comp.sequentialTestRunsAllowed).toBeFalse(); - expect(comp.testwiseCoverageAnalysisSupported).toBeFalse(); comp.selectedProjectType = ProjectType.MAVEN_MAVEN; expect(comp.sequentialTestRunsAllowed).toBeTrue(); - expect(comp.testwiseCoverageAnalysisSupported).toBeTrue(); comp.selectedProjectType = ProjectType.MAVEN_BLACKBOX; expect(comp.sequentialTestRunsAllowed).toBeFalse(); - expect(comp.testwiseCoverageAnalysisSupported).toBeFalse(); comp.selectedProjectType = ProjectType.GRADLE_GRADLE; expect(comp.sequentialTestRunsAllowed).toBeTrue(); - expect(comp.testwiseCoverageAnalysisSupported).toBeTrue(); })); }); @@ -1391,7 +1385,6 @@ const getProgrammingLanguageFeature = (programmingLanguage: ProgrammingLanguage) packageNameRequired: true, checkoutSolutionRepositoryAllowed: false, projectTypes: [ProjectType.PLAIN, ProjectType.XCODE], - testwiseCoverageAnalysisSupported: false, auxiliaryRepositoriesSupported: true, } as ProgrammingLanguageFeature; case ProgrammingLanguage.JAVA: @@ -1403,7 +1396,6 @@ const getProgrammingLanguageFeature = (programmingLanguage: ProgrammingLanguage) packageNameRequired: true, checkoutSolutionRepositoryAllowed: true, projectTypes: [ProjectType.PLAIN_MAVEN, ProjectType.MAVEN_MAVEN], - testwiseCoverageAnalysisSupported: true, auxiliaryRepositoriesSupported: true, } as ProgrammingLanguageFeature; case ProgrammingLanguage.HASKELL: @@ -1414,7 +1406,6 @@ const getProgrammingLanguageFeature = (programmingLanguage: ProgrammingLanguage) plagiarismCheckSupported: false, packageNameRequired: false, checkoutSolutionRepositoryAllowed: true, - testwiseCoverageAnalysisSupported: false, auxiliaryRepositoriesSupported: true, } as ProgrammingLanguageFeature; case ProgrammingLanguage.C: @@ -1426,7 +1417,6 @@ const getProgrammingLanguageFeature = (programmingLanguage: ProgrammingLanguage) packageNameRequired: false, checkoutSolutionRepositoryAllowed: true, projectTypes: [ProjectType.FACT, ProjectType.GCC], - testwiseCoverageAnalysisSupported: false, auxiliaryRepositoriesSupported: true, } as ProgrammingLanguageFeature; default: diff --git a/src/test/javascript/spec/component/programming-exercise/update-components/programming-exercise-creation-config-mock.ts b/src/test/javascript/spec/component/programming-exercise/update-components/programming-exercise-creation-config-mock.ts index 0b99443e2f99..cc9e7a13842e 100644 --- a/src/test/javascript/spec/component/programming-exercise/update-components/programming-exercise-creation-config-mock.ts +++ b/src/test/javascript/spec/component/programming-exercise/update-components/programming-exercise-creation-config-mock.ts @@ -52,7 +52,6 @@ export const programmingExerciseCreationConfigMock: ProgrammingExerciseCreationC staticCodeAnalysisAllowed: false, supportedLanguages: [], templateParticipationResultLoaded: false, - testwiseCoverageAnalysisSupported: false, titleNamePattern: '', updateCategories(_categories: ExerciseCategory[]): void {}, updateCheckoutDirectory(_editedAuxiliaryRepository: AuxiliaryRepository): (newValue: any) => string | undefined { diff --git a/src/test/javascript/spec/component/shared/navbar.component.spec.ts b/src/test/javascript/spec/component/shared/navbar.component.spec.ts index bc2e7cb37b92..5de3b28f3e38 100644 --- a/src/test/javascript/spec/component/shared/navbar.component.spec.ts +++ b/src/test/javascript/spec/component/shared/navbar.component.spec.ts @@ -1,11 +1,10 @@ -import { HttpResponse, provideHttpClient } from '@angular/common/http'; +import { provideHttpClient } from '@angular/common/http'; import { ComponentFixture, TestBed, fakeAsync, tick } from '@angular/core/testing'; import { ActivatedRoute, Router, UrlSerializer } from '@angular/router'; import { TranslateService } from '@ngx-translate/core'; import { MockTranslateService } from '../../helpers/mocks/service/mock-translate.service'; import { ProfileService } from 'app/shared/layouts/profiles/profile.service'; import { ProfileInfo } from 'app/shared/layouts/profiles/profile-info.model'; -import { ExerciseService } from 'app/exercises/shared/exercise/exercise.service'; import { GuidedTourComponent } from 'app/guided-tour/guided-tour.component'; import { HasAnyAuthorityDirective } from 'app/shared/auth/has-any-authority.directive'; import { FindLanguageFromKeyPipe } from 'app/shared/language/find-language-from-key.pipe'; @@ -21,7 +20,6 @@ import { of } from 'rxjs'; import { MockRouter } from '../../helpers/mocks/mock-router'; import { MockSyncStorage } from '../../helpers/mocks/service/mock-sync-storage.service'; import { MockRouterLinkActiveOptionsDirective, MockRouterLinkDirective } from '../../helpers/mocks/directive/mock-router-link.directive'; -import { Exercise, ExerciseType } from 'app/entities/exercise.model'; import { JhiConnectionWarningComponent } from 'app/shared/connection-warning/connection-warning.component'; import { AccountService } from 'app/core/auth/account.service'; import { MockAccountService } from '../../helpers/mocks/service/mock-account.service'; @@ -52,7 +50,6 @@ describe('NavbarComponent', () => { let fixture: ComponentFixture; let component: NavbarComponent; let entityTitleServiceStub: jest.SpyInstance; - let exerciseService: ExerciseService; let entityTitleService: EntityTitleService; let examParticipationService: ExamParticipationService; @@ -154,8 +151,6 @@ describe('NavbarComponent', () => { entityTitleServiceStub = jest .spyOn(entityTitleService, 'getTitle') .mockImplementation((type) => of('Test ' + type.substring(0, 1) + type.substring(1).toLowerCase())); - - exerciseService = fixture.debugElement.injector.get(ExerciseService); }); }); @@ -443,57 +438,6 @@ describe('NavbarComponent', () => { expect(component.breadcrumbs[4]).toEqual(assessmentCrumb); }); - it('programming exercise hints', () => { - const testUrl = '/course-management/1/exercises/2/exercise-hints/3'; - router.setUrl(testUrl); - - const findStub = jest.spyOn(exerciseService, 'find').mockReturnValue( - of({ - body: { - title: 'Test Exercise', - type: ExerciseType.PROGRAMMING, - }, - } as HttpResponse), - ); - - fixture.detectChanges(); - - expect(entityTitleServiceStub).toHaveBeenCalledTimes(2); - expect(entityTitleServiceStub).toHaveBeenCalledWith(EntityType.COURSE, [1]); - expect(entityTitleServiceStub).toHaveBeenCalledWith(EntityType.HINT, [3, 2]); - expect(findStub).toHaveBeenCalledOnce(); - expect(findStub).toHaveBeenCalledWith(2); - - const hintsCrumb = { - label: 'artemisApp.exerciseHint.home.title', - translate: true, - uri: '/course-management/1/exercises/2/exercise-hints/', - } as MockBreadcrumb; - - const hintCrumb = { - label: 'Test Hint', - translate: false, - uri: '/course-management/1/exercises/2/exercise-hints/3/', - } as MockBreadcrumb; - - expect(component.breadcrumbs).toHaveLength(6); - - expect(component.breadcrumbs[0]).toEqual(courseManagementCrumb); - expect(component.breadcrumbs[1]).toEqual(testCourseCrumb); - expect(component.breadcrumbs[2]).toEqual({ - label: 'artemisApp.course.exercises', - translate: true, - uri: '/course-management/1/exercises/', - } as MockBreadcrumb); - expect(component.breadcrumbs[3]).toEqual({ - label: 'Test Exercise', - translate: false, - uri: '/course-management/1/programming-exercises/2/', - } as MockBreadcrumb); - expect(component.breadcrumbs[4]).toEqual(hintsCrumb); - expect(component.breadcrumbs[5]).toEqual(hintCrumb); - }); - it('exercise assessment dashboard', () => { const courseId = 1; const exerciseId = 2; diff --git a/src/test/javascript/spec/helpers/mocks/service/mock-exercise-hint.service.ts b/src/test/javascript/spec/helpers/mocks/service/mock-exercise-hint.service.ts deleted file mode 100644 index a3767d2437d0..000000000000 --- a/src/test/javascript/spec/helpers/mocks/service/mock-exercise-hint.service.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { HttpResponse } from '@angular/common/http'; -import { Observable, of } from 'rxjs'; -import { ExerciseHintResponse, IExerciseHintService } from 'app/exercises/shared/exercise-hint/shared/exercise-hint.service'; -import { ExerciseHint } from 'app/entities/hestia/exercise-hint.model'; - -export class MockExerciseHintService implements IExerciseHintService { - private exerciseHintDummy = { id: 1 } as ExerciseHint; - private exerciseHintDummy2 = { id: 2 } as ExerciseHint; - - create(exerciseId: number, exerciseHint: ExerciseHint): Observable { - return of({ body: this.exerciseHintDummy }) as Observable; - } - - delete(exerciseId: number, exerciseHintId: number): Observable> { - return of(); - } - - find(exerciseId: number, exerciseHintId: number): Observable { - return of({ body: this.exerciseHintDummy }) as Observable; - } - - findByExerciseId(exerciseId: number): Observable> { - return of({ body: [this.exerciseHintDummy, this.exerciseHintDummy2] }) as Observable>; - } - - update(exerciseId: number, exerciseHint: ExerciseHint): Observable { - return of({ body: this.exerciseHintDummy }) as Observable; - } - - activateExerciseHint(exerciseId: number, exerciseHintId: number): Observable { - return of(); - } - - getActivatedExerciseHints(exerciseId: number): Observable> { - return of(); - } - - getAvailableExerciseHints(exerciseId: number): Observable> { - return of(); - } - - getTitle(exerciseId: number, exerciseHintId: number): Observable> { - return of(); - } - - rateExerciseHint(exerciseId: number, exerciseHintId: number, ratingValue: number): Observable> { - return of(); - } -} diff --git a/src/test/javascript/spec/helpers/mocks/service/mock-programming-exercise.service.ts b/src/test/javascript/spec/helpers/mocks/service/mock-programming-exercise.service.ts index 27c111ba7665..55c4aa8741df 100644 --- a/src/test/javascript/spec/helpers/mocks/service/mock-programming-exercise.service.ts +++ b/src/test/javascript/spec/helpers/mocks/service/mock-programming-exercise.service.ts @@ -23,7 +23,6 @@ export class MockProgrammingExerciseService { createStructuralSolutionEntries = (exerciseId: number) => of({}); createBehavioralSolutionEntries = (exerciseId: number) => of({}); getLatestResult = (participation: Participation) => of({}); - getLatestFullTestwiseCoverageReport = (exerciseId: number) => of({}); combineTemplateRepositoryCommits = (exerciseId: number) => of({}); delete = (programmingExerciseId: number, deleteStudentReposBuildPlans: boolean, deleteBaseReposBuildPlans: boolean) => of({}); generateStructureOracle = (exerciseId: number) => of({}); diff --git a/src/test/javascript/spec/integration/code-editor/code-editor-student.integration.spec.ts b/src/test/javascript/spec/integration/code-editor/code-editor-student.integration.spec.ts index 5df8e8e32ce3..6b3b8441f2e7 100644 --- a/src/test/javascript/spec/integration/code-editor/code-editor-student.integration.spec.ts +++ b/src/test/javascript/spec/integration/code-editor/code-editor-student.integration.spec.ts @@ -1,5 +1,4 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { ExerciseHintButtonOverlayComponent } from 'app/exercises/shared/exercise-hint/participate/exercise-hint-button-overlay.component'; import { LocalStorageService, SessionStorageService } from 'ngx-webstorage'; import dayjs from 'dayjs/esm'; import { JhiLanguageHelper } from 'app/core/language/language.helper'; @@ -107,7 +106,6 @@ describe('CodeEditorStudentIntegration', () => { MockComponent(CodeEditorFileBrowserFolderComponent), MockComponent(CodeEditorFileBrowserFileComponent), MockComponent(CodeEditorStatusComponent), - MockComponent(ExerciseHintButtonOverlayComponent), TreeviewComponent, ], providers: [ diff --git a/src/test/javascript/spec/service/entity-title.service.spec.ts b/src/test/javascript/spec/service/entity-title.service.spec.ts index a0d25c344ae6..7bba4142c05a 100644 --- a/src/test/javascript/spec/service/entity-title.service.spec.ts +++ b/src/test/javascript/spec/service/entity-title.service.spec.ts @@ -38,7 +38,6 @@ describe('EntityTitleService', () => { }); it.each([ - { type: EntityType.HINT, ids: [3, 2], url: 'programming-exercises/2/exercise-hints/3' }, { type: EntityType.EXERCISE, ids: [1], url: 'exercises/1' }, { type: EntityType.LECTURE, ids: [1], url: 'lectures/1' }, { type: EntityType.COURSE, ids: [1], url: 'courses/1' }, @@ -82,7 +81,6 @@ describe('EntityTitleService', () => { it.each([ { type: EntityType.COURSE, ids: [] }, { type: EntityType.COURSE, ids: [undefined] }, - { type: EntityType.HINT, ids: [1, undefined] }, { type: undefined, ids: [undefined] }, { type: undefined, ids: [] }, ])('captures an exception if invalid parameters are supplied to getTitle', ({ type, ids }) => { @@ -100,12 +98,10 @@ describe('EntityTitleService', () => { it.each([ { type: EntityType.COURSE, ids: [], title: 'Test' }, { type: EntityType.COURSE, ids: [undefined], title: 'Test' }, - { type: EntityType.HINT, ids: [1, undefined], title: 'Test' }, { type: undefined, ids: [undefined], title: 'Test' }, { type: undefined, ids: [], title: 'Test' }, { type: EntityType.COURSE, ids: [], title: undefined }, { type: EntityType.COURSE, ids: [undefined], title: undefined }, - { type: EntityType.HINT, ids: [1, undefined], title: undefined }, { type: undefined, ids: [undefined], title: undefined }, { type: undefined, ids: [], title: undefined }, ])('captures an exception if invalid parameters are supplied to setTitle', ({ type, ids, title }) => { diff --git a/src/test/javascript/spec/service/exercise-hint.service.spec.ts b/src/test/javascript/spec/service/exercise-hint.service.spec.ts deleted file mode 100644 index b988b61db162..000000000000 --- a/src/test/javascript/spec/service/exercise-hint.service.spec.ts +++ /dev/null @@ -1,111 +0,0 @@ -import { TestBed } from '@angular/core/testing'; -import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing'; -import { HttpResponse, provideHttpClient } from '@angular/common/http'; -import { take } from 'rxjs/operators'; -import { ExerciseService } from 'app/exercises/shared/exercise/exercise.service'; -import { ProgrammingExercise } from 'app/entities/programming/programming-exercise.model'; -import { ExerciseHint } from 'app/entities/hestia/exercise-hint.model'; -import { MockExerciseService } from '../helpers/mocks/service/mock-exercise.service'; -import { ExerciseHintService } from 'app/exercises/shared/exercise-hint/shared/exercise-hint.service'; - -describe('ExerciseHint Service', () => { - let service: ExerciseHintService; - let httpMock: HttpTestingController; - let elemDefault: ExerciseHint; - let exerciseHint: ExerciseHint; - let expectedResult: any; - - beforeEach(() => { - TestBed.configureTestingModule({ - imports: [], - providers: [provideHttpClient(), provideHttpClientTesting(), { provide: ExerciseService, useClass: MockExerciseService }], - }); - expectedResult = {} as HttpResponse; - service = TestBed.inject(ExerciseHintService); - httpMock = TestBed.inject(HttpTestingController); - - const exercise = new ProgrammingExercise(undefined, undefined); - exercise.id = 1; - - elemDefault = new ExerciseHint(); - elemDefault.id = 0; - elemDefault.title = 'AAAAAAA'; - elemDefault.content = 'AAAAAAA'; - elemDefault.exercise = exercise; - - exerciseHint = new ExerciseHint(); - exerciseHint.title = 'AAAAA'; - exerciseHint.content = 'BBBBB'; - exerciseHint.exercise = exercise; - }); - - describe('Service methods', () => { - it('should find an element', () => { - const returnedFromService = Object.assign({}, elemDefault); - service - .find(1, 123) - .pipe(take(1)) - .subscribe((resp) => (expectedResult = resp)); - - const req = httpMock.expectOne({ method: 'GET' }); - req.flush(returnedFromService); - expect(expectedResult.body).toEqual(elemDefault); - }); - }); - - it('should create an ExerciseHint', () => { - const returnedFromService = Object.assign( - { - id: 0, - title: 'AAAAA', - content: 'BBBBBB', - exercise: { - id: 1, - }, - }, - elemDefault, - ); - const expected = Object.assign({}, returnedFromService); - service - .create(1, exerciseHint) - .pipe(take(1)) - .subscribe((resp) => (expectedResult = resp)); - const req = httpMock.expectOne({ method: 'POST' }); - req.flush(returnedFromService); - expect(expectedResult.body).toEqual(expected); - }); - - it('should update an ExerciseHint', () => { - const returnedFromService = Object.assign( - { - title: 'BBBBBB', - content: 'BBBBBB', - exercise: { - id: 1, - }, - }, - elemDefault, - ); - - const expected = Object.assign({}, returnedFromService); - service - .update(1, elemDefault) - .pipe(take(1)) - .subscribe((resp) => (expectedResult = resp)); - const req = httpMock.expectOne({ method: 'PUT' }); - req.flush(returnedFromService); - expect(expectedResult.body).toEqual(expected); - }); - - it('should delete an ExerciseHint', () => { - service.delete(1, 123).subscribe((resp) => (expectedResult = resp.ok)); - - const req = httpMock.expectOne({ method: 'DELETE' }); - req.flush({ status: 200 }); - expect(expectedResult).toBeTrue(); - }); - - afterEach(() => { - httpMock.verify(); - }); -}); diff --git a/src/test/javascript/spec/service/profile.service.spec.ts b/src/test/javascript/spec/service/profile.service.spec.ts index ace62a0ea60b..29accab79d25 100644 --- a/src/test/javascript/spec/service/profile.service.spec.ts +++ b/src/test/javascript/spec/service/profile.service.spec.ts @@ -76,7 +76,6 @@ describe('ProfileService', () => { packageNameRequired: true, checkoutSolutionRepositoryAllowed: false, projectTypes: [], - testwiseCoverageAnalysisSupported: true, auxiliaryRepositoriesSupported: true, }, { @@ -87,7 +86,6 @@ describe('ProfileService', () => { packageNameRequired: false, checkoutSolutionRepositoryAllowed: false, projectTypes: [], - testwiseCoverageAnalysisSupported: false, auxiliaryRepositoriesSupported: true, }, { @@ -98,7 +96,6 @@ describe('ProfileService', () => { packageNameRequired: true, checkoutSolutionRepositoryAllowed: false, projectTypes: ['PLAIN', 'XCODE'], - testwiseCoverageAnalysisSupported: false, auxiliaryRepositoriesSupported: true, }, { @@ -109,7 +106,6 @@ describe('ProfileService', () => { packageNameRequired: false, checkoutSolutionRepositoryAllowed: false, projectTypes: [], - testwiseCoverageAnalysisSupported: false, auxiliaryRepositoriesSupported: true, }, { @@ -120,7 +116,6 @@ describe('ProfileService', () => { packageNameRequired: true, checkoutSolutionRepositoryAllowed: false, projectTypes: ['PLAIN_MAVEN', 'MAVEN_MAVEN'], - testwiseCoverageAnalysisSupported: true, auxiliaryRepositoriesSupported: true, }, ], @@ -203,7 +198,6 @@ describe('ProfileService', () => { projectTypes: [], sequentialTestRuns: true, staticCodeAnalysis: false, - testwiseCoverageAnalysisSupported: true, auxiliaryRepositoriesSupported: true, }, { @@ -214,7 +208,6 @@ describe('ProfileService', () => { projectTypes: [], sequentialTestRuns: false, staticCodeAnalysis: false, - testwiseCoverageAnalysisSupported: false, auxiliaryRepositoriesSupported: true, }, { @@ -225,7 +218,6 @@ describe('ProfileService', () => { projectTypes: [ProjectType.PLAIN, ProjectType.XCODE], sequentialTestRuns: false, staticCodeAnalysis: true, - testwiseCoverageAnalysisSupported: false, auxiliaryRepositoriesSupported: true, }, { @@ -236,7 +228,6 @@ describe('ProfileService', () => { projectTypes: [], sequentialTestRuns: false, staticCodeAnalysis: false, - testwiseCoverageAnalysisSupported: false, auxiliaryRepositoriesSupported: true, }, { @@ -247,7 +238,6 @@ describe('ProfileService', () => { projectTypes: [ProjectType.PLAIN_MAVEN, ProjectType.MAVEN_MAVEN], sequentialTestRuns: true, staticCodeAnalysis: true, - testwiseCoverageAnalysisSupported: true, auxiliaryRepositoriesSupported: true, }, ], diff --git a/src/test/javascript/spec/service/programming-exercise-task.service.spec.ts b/src/test/javascript/spec/service/programming-exercise-task.service.spec.ts index a47cc762f73b..3b9b7b28e1ff 100644 --- a/src/test/javascript/spec/service/programming-exercise-task.service.spec.ts +++ b/src/test/javascript/spec/service/programming-exercise-task.service.spec.ts @@ -10,7 +10,7 @@ import { ProgrammingExerciseGradingStatistics, TestCaseStats } from 'app/entitie import { MockProvider } from 'ng-mocks'; import { MockProgrammingExerciseGradingService } from '../helpers/mocks/service/mock-programming-exercise-grading.service'; import { ProgrammingExerciseTask } from 'app/exercises/programming/manage/grading/tasks/programming-exercise-task'; -import { ProgrammingExerciseServerSideTask } from 'app/entities/hestia/programming-exercise-task.model'; +import { ProgrammingExerciseServerSideTask } from '../../../../main/webapp/app/entities/programming-exercise-task.model'; import { ProgrammingExerciseTestCase, ProgrammingExerciseTestCaseType, Visibility } from 'app/entities/programming/programming-exercise-test-case.model'; import { firstValueFrom, of } from 'rxjs'; import { provideHttpClient } from '@angular/common/http'; diff --git a/src/test/javascript/spec/service/programming-exercise.service.spec.ts b/src/test/javascript/spec/service/programming-exercise.service.spec.ts index bcc07eeecb3a..5ffade2d2aa9 100644 --- a/src/test/javascript/spec/service/programming-exercise.service.spec.ts +++ b/src/test/javascript/spec/service/programming-exercise.service.spec.ts @@ -14,12 +14,11 @@ import { ProgrammingSubmission } from 'app/entities/programming/programming-subm import { Result } from 'app/entities/result.model'; import { AccountService } from 'app/core/auth/account.service'; import { MockAccountService } from '../helpers/mocks/service/mock-account.service'; -import { ProgrammingExerciseSolutionEntry } from 'app/entities/hestia/programming-exercise-solution-entry.model'; import { Course } from 'app/entities/course.model'; import { SolutionProgrammingExerciseParticipation } from 'app/entities/participation/solution-programming-exercise-participation.model'; import { Submission } from 'app/entities/submission.model'; -import { ProgrammingExerciseGitDiffReport } from 'app/entities/hestia/programming-exercise-git-diff-report.model'; -import { ProgrammingExerciseGitDiffEntry } from 'app/entities/hestia/programming-exercise-git-diff-entry.model'; +import { ProgrammingExerciseGitDiffReport } from '../../../../main/webapp/app/entities/programming-exercise-git-diff-report.model'; +import { ProgrammingExerciseGitDiffEntry } from '../../../../main/webapp/app/entities/programming-exercise-git-diff-entry.model'; import { AuxiliaryRepository } from 'app/entities/programming/programming-exercise-auxiliary-repository-model'; import { provideHttpClient } from '@angular/common/http'; @@ -446,9 +445,7 @@ describe('ProgrammingExercise Service', () => { { uri: 'test-case-state', method: 'getProgrammingExerciseTestCaseState' }, { uri: 'tasks', method: 'getTasksAndTestsExtractedFromProblemStatement' }, { uri: 'diff-report', method: 'getDiffReport' }, - { uri: 'full-testwise-coverage-report', method: 'getLatestFullTestwiseCoverageReport' }, { uri: 'file-names', method: 'getSolutionFileNames' }, - { uri: 'exercise-hints', method: 'getCodeHintsForExercise' }, { uri: 'test-cases', method: 'getAllTestCases' }, { uri: 'build-log-statistics', method: 'getBuildLogStatistics' }, ])('should call correct exercise endpoint', (test) => diff --git a/src/test/playwright/e2e/exercise/programming/ProgrammingExerciseAssessment.spec.ts b/src/test/playwright/e2e/exercise/programming/ProgrammingExerciseAssessment.spec.ts index 0299bd423774..fc1282c3fc36 100644 --- a/src/test/playwright/e2e/exercise/programming/ProgrammingExerciseAssessment.spec.ts +++ b/src/test/playwright/e2e/exercise/programming/ProgrammingExerciseAssessment.spec.ts @@ -33,7 +33,6 @@ test.describe('Programming exercise assessment', { tag: '@sequential' }, () => { assessmentDueDate = dueDate.add(20, 'seconds'); exercise = await exerciseAPIRequests.createProgrammingExercise({ course, - recordTestwiseCoverage: false, releaseDate: dayjs(), dueDate: dueDate, assessmentDate: assessmentDueDate, diff --git a/src/test/playwright/fixtures/exercise/programming/python/template.json b/src/test/playwright/fixtures/exercise/programming/python/template.json index fe3456326355..a9ffcf14c969 100644 --- a/src/test/playwright/fixtures/exercise/programming/python/template.json +++ b/src/test/playwright/fixtures/exercise/programming/python/template.json @@ -33,7 +33,6 @@ "templateParticipation": { "type": "template" }, - "testwiseCoverageEnabled": false, "title": "", "type": "programming", "buildConfig": { diff --git a/src/test/playwright/support/requests/ExerciseAPIRequests.ts b/src/test/playwright/support/requests/ExerciseAPIRequests.ts index 20d55b216fa8..e9c836fb3e1d 100644 --- a/src/test/playwright/support/requests/ExerciseAPIRequests.ts +++ b/src/test/playwright/support/requests/ExerciseAPIRequests.ts @@ -70,7 +70,6 @@ export class ExerciseAPIRequests { * - exerciseGroup: The exercise group the exercise will be added to * - scaMaxPenalty: The max percentage (0-100) static code analysis can reduce from the points * If sca should be disabled, pass null or omit this property - * - recordTestwiseCoverage: Enable testwise coverage analysis for this exercise * - releaseDate: When the programming exercise should be available * - dueDate: When the programming exercise should be due * - title: The title of the programming exercise @@ -85,7 +84,6 @@ export class ExerciseAPIRequests { course?: Course; exerciseGroup?: ExerciseGroup; scaMaxPenalty?: number | undefined; - recordTestwiseCoverage?: boolean; releaseDate?: dayjs.Dayjs; dueDate?: dayjs.Dayjs; title?: string; @@ -101,7 +99,6 @@ export class ExerciseAPIRequests { course, exerciseGroup, scaMaxPenalty = undefined, - recordTestwiseCoverage = false, releaseDate = dayjs(), dueDate = dayjs().add(1, 'day'), title = 'Programming ' + generateUUID(), @@ -147,7 +144,6 @@ export class ExerciseAPIRequests { } exercise.programmingLanguage = programmingLanguage; - exercise.buildConfig!.testwiseCoverageEnabled = recordTestwiseCoverage; exercise.mode = mode; exercise.teamAssignmentConfig = teamAssignmentConfig; diff --git a/supporting_scripts/course-scripts/quick-course-setup/manage_programming_exercise.py b/supporting_scripts/course-scripts/quick-course-setup/manage_programming_exercise.py index ab2dfc469d5d..b550fb565d36 100644 --- a/supporting_scripts/course-scripts/quick-course-setup/manage_programming_exercise.py +++ b/supporting_scripts/course-scripts/quick-course-setup/manage_programming_exercise.py @@ -29,7 +29,6 @@ def create_programming_exercise(session: Session, course_id: int, server_url: st "buildConfig": { "buildScript": "#!/usr/bin/env bash\nset -e\n\ngradle () {\n echo '⚙️ executing gradle'\n chmod +x ./gradlew\n ./gradlew clean test\n}\n\nmain () {\n gradle\n}\n\nmain \"${@}\"\n", "checkoutSolutionRepository": False, - "testwiseCoverageEnabled": False }, }