-
Notifications
You must be signed in to change notification settings - Fork 313
Development
: Remove quiz view and switch to DTOs
#10571
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
Merged
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
45f1a83
Working on migrating away from QuizView to DTOs
KonstiAnon 4e71831
Merge branch 'develop' into chore/quiz-exercises/dto-migration
KonstiAnon ade0d7a
Remove redundant '{}'
KonstiAnon c807c7d
Working on DTOs, have implemented DTO for ShortAnswerQuestion
KonstiAnon 9243e3f
Merge remote-tracking branch 'origin/develop' into chore/quiz-exercis…
KonstiAnon bf8b136
Working on migrating away from QuizView to DTOs
KonstiAnon 1269d57
Continuing work on DTOs
KonstiAnon 1461b4d
Implemented DTOs for QuizQuestion
KonstiAnon 1591159
Working on QuizExercise DTO Migration
KonstiAnon fbfef10
Implemented DTOs for StudentParticipation
KonstiAnon ecee3c9
Fixed errors and formatting for all DTOs
KonstiAnon 10c7255
Finishing DTOs for start-participation endpoint
KonstiAnon 3d6f3e3
Finishing work on result dto
KonstiAnon 395cc56
Last commit before JsonView is deleted
KonstiAnon 137e082
Merge branch 'develop' into chore/quiz-exercises/dto-migration
KonstiAnon 336674f
Deleted QuizView and its usages
KonstiAnon 9d96cbb
Made getCourse public to it can be included in Json
KonstiAnon cf47d36
Fixed annotations
KonstiAnon 93627e9
.... so many hours because of one line
KonstiAnon 7f4f22b
Merge branch 'develop' into chore/quiz-exercises/dto-migration
KonstiAnon f315b85
Merge branch 'develop' into chore/quiz-exercises/dto-migration
KonstiAnon 6fad826
removed unused DTOs
KonstiAnon ced9f44
Merge branch 'develop' into chore/quiz-exercises/dto-migration
krusche 2f4451f
Clean up code
krusche 1bd4049
Merge branch 'develop' into chore/quiz-exercises/dto-migration
krusche b6b4c56
fix check style warnings
krusche 46966ae
Merge branch 'develop' into chore/quiz-exercises/dto-migration
AjayvirS b2b6b1f
Added integration test and renamed StudentQuizParticipation
KonstiAnon 0eaff4e
Made the Course getter protected again
KonstiAnon 17fa366
Merge branch 'develop' into chore/quiz-exercises/dto-migration
Hialus File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
src/main/java/de/tum/cit/aet/artemis/core/dto/CourseForQuizExerciseDTO.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package de.tum.cit.aet.artemis.core.dto; | ||
|
||
import java.time.ZonedDateTime; | ||
|
||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
|
||
import de.tum.cit.aet.artemis.core.domain.Course; | ||
import de.tum.cit.aet.artemis.core.domain.CourseInformationSharingConfiguration; | ||
import de.tum.cit.aet.artemis.core.domain.Language; | ||
import de.tum.cit.aet.artemis.programming.domain.ProgrammingLanguage; | ||
|
||
@JsonInclude(JsonInclude.Include.NON_EMPTY) | ||
// TODO: we should reduce the amount of information here, not all fields are needed for the quiz exercise | ||
public record CourseForQuizExerciseDTO(Long id, String title, String description, String shortName, String studentGroupName, String teachingAssistantGroupName, | ||
String editorGroupName, String instructorGroupName, ZonedDateTime startDate, ZonedDateTime endDate, ZonedDateTime enrollmentStartDate, ZonedDateTime enrollmentEndDate, | ||
ZonedDateTime unenrollmentEndDate, String semester, boolean testCourse, Language language, ProgrammingLanguage defaultProgrammingLanguage, Boolean onlineCourse, | ||
CourseInformationSharingConfiguration courseInformationSharingConfiguration, Integer maxComplaints, Integer maxTeamComplaints, int maxComplaintTimeDays, | ||
int maxRequestMoreFeedbackTimeDays, int maxComplaintTextLimit, int maxComplaintResponseTextLimit, Integer accuracyOfScores) { | ||
krusche marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
/** | ||
* Create a CourseForQuizExerciseDTO from a Course | ||
* | ||
* @param course the course to convert | ||
* @return the converted CourseForQuizExerciseDTO | ||
*/ | ||
public static CourseForQuizExerciseDTO of(final Course course) { | ||
return new CourseForQuizExerciseDTO(course.getId(), course.getTitle(), course.getDescription(), course.getShortName(), course.getStudentGroupName(), | ||
course.getTeachingAssistantGroupName(), course.getEditorGroupName(), course.getInstructorGroupName(), course.getStartDate(), course.getEndDate(), | ||
course.getEnrollmentStartDate(), course.getEnrollmentEndDate(), course.getUnenrollmentEndDate(), course.getSemester(), course.isTestCourse(), course.getLanguage(), | ||
course.getDefaultProgrammingLanguage(), course.isOnlineCourse(), course.getCourseInformationSharingConfiguration(), course.getMaxComplaints(), | ||
course.getMaxTeamComplaints(), course.getMaxComplaintTimeDays(), course.getMaxRequestMoreFeedbackTimeDays(), course.getMaxComplaintTextLimit(), | ||
course.getMaxComplaintResponseTextLimit(), course.getAccuracyOfScores()); | ||
} | ||
|
||
} |
14 changes: 14 additions & 0 deletions
14
src/main/java/de/tum/cit/aet/artemis/core/dto/DomainObjectDTO.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package de.tum.cit.aet.artemis.core.dto; | ||
|
||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
|
||
import de.tum.cit.aet.artemis.core.domain.DomainObject; | ||
|
||
@JsonInclude(JsonInclude.Include.NON_EMPTY) | ||
public record DomainObjectDTO(Long id) { | ||
|
||
public static DomainObjectDTO of(DomainObject domainObject) { | ||
return new DomainObjectDTO(domainObject.getId()); | ||
} | ||
|
||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is specific to quiz exercises and should therefore be within the quiz module