Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development: Add JavaDocs to UtilServices and Factories [8] #7374

Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,8 @@
import de.tum.in.www1.artemis.domain.Course;
import de.tum.in.www1.artemis.domain.User;
import de.tum.in.www1.artemis.domain.exam.Exam;
import de.tum.in.www1.artemis.domain.quiz.DragAndDropQuestion;
import de.tum.in.www1.artemis.domain.quiz.MultipleChoiceQuestion;
import de.tum.in.www1.artemis.domain.quiz.QuizGroup;
import de.tum.in.www1.artemis.domain.quiz.QuizPool;
import de.tum.in.www1.artemis.domain.quiz.QuizQuestion;
import de.tum.in.www1.artemis.domain.quiz.ShortAnswerQuestion;
import de.tum.in.www1.artemis.domain.quiz.*;

Check warning on line 20 in src/test/java/de/tum/in/www1/artemis/exam/QuizPoolIntegrationTest.java

View check run for this annotation

Teamscale / teamscale-findings

src/test/java/de/tum/in/www1/artemis/exam/QuizPoolIntegrationTest.java#L20

Star import of `de.tum.in.www1.artemis.domain.quiz.*` should not be used https://teamscale.io/findings.html#details/GitHub-ls1intum-Artemis?t=development%2Fadd-javadoc-to-utilservices-and-factories%2Fadd-javadoc-group-8%3AHEAD&id=311306AE28EE1AF1C9A9C30E1EDC9646
import de.tum.in.www1.artemis.exercise.quizexercise.QuizExerciseFactory;
import de.tum.in.www1.artemis.exercise.quizexercise.QuizExerciseUtilService;
import de.tum.in.www1.artemis.service.QuizPoolService;
import de.tum.in.www1.artemis.user.UserUtilService;
import de.tum.in.www1.artemis.util.RequestUtilService;
Expand All @@ -42,9 +36,6 @@
@Autowired
private ExamUtilService examUtilService;

@Autowired
private QuizExerciseUtilService quizExerciseUtilService;

@Autowired
private UserUtilService userUtilService;

Expand Down Expand Up @@ -91,10 +82,10 @@
void testUpdateQuizPoolSuccessful() throws Exception {
QuizPool quizPool = createQuizPool();

QuizGroup quizGroup3 = quizExerciseUtilService.createQuizGroup("Exception Handling");
QuizQuestion saQuizQuestion1 = quizExerciseUtilService.createShortAnswerQuestionWithTitleAndGroup("SA 1", quizGroup2);
QuizQuestion saQuizQuestion2 = quizExerciseUtilService.createShortAnswerQuestionWithTitleAndGroup("SA 2", quizGroup3);
QuizQuestion saQuizQuestion3 = quizExerciseUtilService.createShortAnswerQuestionWithTitleAndGroup("SA 3", null);
QuizGroup quizGroup3 = QuizExerciseFactory.createQuizGroup("Exception Handling");
QuizQuestion saQuizQuestion1 = QuizExerciseFactory.createShortAnswerQuestionWithTitleAndGroup("SA 1", quizGroup2);
QuizQuestion saQuizQuestion2 = QuizExerciseFactory.createShortAnswerQuestionWithTitleAndGroup("SA 2", quizGroup3);
QuizQuestion saQuizQuestion3 = QuizExerciseFactory.createShortAnswerQuestionWithTitleAndGroup("SA 3", null);
quizPool.setQuizGroups(List.of(quizPool.getQuizGroups().get(0), quizPool.getQuizGroups().get(2), quizGroup3));
quizPool.setQuizQuestions(List.of(quizPool.getQuizQuestions().get(0), quizPool.getQuizQuestions().get(1), quizPool.getQuizQuestions().get(2), saQuizQuestion1,
saQuizQuestion2, saQuizQuestion3));
Expand Down Expand Up @@ -165,11 +156,11 @@
@Test
@WithMockUser(username = TEST_PREFIX + "instructor1", roles = "INSTRUCTOR")
void testGetQuizPoolSuccessful() throws Exception {
QuizGroup quizGroup0 = quizExerciseUtilService.createQuizGroup("Encapsulation");
QuizGroup quizGroup1 = quizExerciseUtilService.createQuizGroup("Inheritance");
QuizQuestion mcQuizQuestion = quizExerciseUtilService.createMultipleChoiceQuestionWithTitleAndGroup("MC", quizGroup0);
QuizQuestion dndQuizQuestion = quizExerciseUtilService.createDragAndDropQuestionWithTitleAndGroup("DND", quizGroup1);
QuizQuestion saQuizQuestion = quizExerciseUtilService.createShortAnswerQuestionWithTitleAndGroup("SA", null);
QuizGroup quizGroup0 = QuizExerciseFactory.createQuizGroup("Encapsulation");
QuizGroup quizGroup1 = QuizExerciseFactory.createQuizGroup("Inheritance");
QuizQuestion mcQuizQuestion = QuizExerciseFactory.createMultipleChoiceQuestionWithTitleAndGroup("MC", quizGroup0);
QuizQuestion dndQuizQuestion = QuizExerciseFactory.createDragAndDropQuestionWithTitleAndGroup("DND", quizGroup1);
QuizQuestion saQuizQuestion = QuizExerciseFactory.createShortAnswerQuestionWithTitleAndGroup("SA", null);
quizPool.setQuizGroups(List.of(quizGroup0, quizGroup1));
quizPool.setQuizQuestions(List.of(mcQuizQuestion, dndQuizQuestion, saQuizQuestion));
QuizPool savedQuizPool = quizPoolService.update(exam.getId(), quizPool);
Expand All @@ -190,14 +181,14 @@
}

private QuizPool createQuizPool() throws Exception {
quizGroup0 = quizExerciseUtilService.createQuizGroup("Encapsulation");
quizGroup1 = quizExerciseUtilService.createQuizGroup("Inheritance");
quizGroup2 = quizExerciseUtilService.createQuizGroup("Polymorphism");
QuizQuestion mcQuizQuestion0 = quizExerciseUtilService.createMultipleChoiceQuestionWithTitleAndGroup("MC 0", quizGroup0);
QuizQuestion mcQuizQuestion1 = quizExerciseUtilService.createMultipleChoiceQuestionWithTitleAndGroup("MC 1", quizGroup0);
QuizQuestion dndQuizQuestion0 = quizExerciseUtilService.createDragAndDropQuestionWithTitleAndGroup("DND 0", quizGroup1);
QuizQuestion dndQuizQuestion1 = quizExerciseUtilService.createDragAndDropQuestionWithTitleAndGroup("DND 1", quizGroup2);
QuizQuestion saQuizQuestion0 = quizExerciseUtilService.createShortAnswerQuestionWithTitleAndGroup("SA 0", null);
quizGroup0 = QuizExerciseFactory.createQuizGroup("Encapsulation");
quizGroup1 = QuizExerciseFactory.createQuizGroup("Inheritance");
quizGroup2 = QuizExerciseFactory.createQuizGroup("Polymorphism");
QuizQuestion mcQuizQuestion0 = QuizExerciseFactory.createMultipleChoiceQuestionWithTitleAndGroup("MC 0", quizGroup0);
QuizQuestion mcQuizQuestion1 = QuizExerciseFactory.createMultipleChoiceQuestionWithTitleAndGroup("MC 1", quizGroup0);
QuizQuestion dndQuizQuestion0 = QuizExerciseFactory.createDragAndDropQuestionWithTitleAndGroup("DND 0", quizGroup1);
QuizQuestion dndQuizQuestion1 = QuizExerciseFactory.createDragAndDropQuestionWithTitleAndGroup("DND 1", quizGroup2);
QuizQuestion saQuizQuestion0 = QuizExerciseFactory.createShortAnswerQuestionWithTitleAndGroup("SA 0", null);
quizPool.setQuizGroups(List.of(quizGroup0, quizGroup1, quizGroup2));
quizPool.setQuizQuestions(List.of(mcQuizQuestion0, mcQuizQuestion1, dndQuizQuestion0, dndQuizQuestion1, saQuizQuestion0));

Expand Down
Loading
Loading