Skip to content

Commit

Permalink
Rename methods for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelOwenDyer committed Oct 21, 2024
1 parent 2e3b924 commit 22488d3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public PyrisProgrammingExerciseDTOService(GitService gitService, RepositoryServi
* @param exercise the programming exercise to convert
* @return the converted PyrisProgrammingExerciseDTO
*/
public PyrisProgrammingExerciseDTO convert(ProgrammingExercise exercise) {
public PyrisProgrammingExerciseDTO convertExercise(ProgrammingExercise exercise) {
var templateRepositoryContents = getFilteredRepositoryContents(exercise.getTemplateParticipation());
var solutionRepositoryContents = getFilteredRepositoryContents(exercise.getSolutionParticipation());
Optional<Repository> testRepo = Optional.empty();
Expand Down Expand Up @@ -91,7 +91,7 @@ public PyrisProgrammingExerciseDTO convert(ProgrammingExercise exercise) {
* @param submission the students submission
* @return the converted PyrisSubmissionDTO
*/
public PyrisSubmissionDTO convert(ProgrammingSubmission submission) {
public PyrisSubmissionDTO convertSubmission(ProgrammingSubmission submission) {
// @formatter:off
var buildLogEntries = submission.getBuildLogEntries()
.stream()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ public void requestAndHandleResponse(IrisExerciseChatSession irisSession) {

String variant = irisSettingsService.getCombinedIrisSettingsFor(session.getExercise(), false).irisChatSettings().selectedVariant();
var exercise = programmingExerciseRepository.findByIdWithTemplateAndSolutionParticipationElseThrow(session.getExercise().getId());
var latestSubmissionDTO = getLatestSubmissionIfExists(exercise, session.getUser()).map(pyrisProgrammingExerciseDTOService::convert).orElse(null);
var exerciseDTO = pyrisProgrammingExerciseDTOService.convert(exercise);
var latestSubmissionDTO = getLatestSubmissionIfExists(exercise, session.getUser()).map(pyrisProgrammingExerciseDTOService::convertSubmission).orElse(null);
var exerciseDTO = pyrisProgrammingExerciseDTOService.convertExercise(exercise);
var course = exercise.getCourseViaExerciseGroupOrCourseMember();
var courseDTO = PyrisCourseDTO.from(course);
var conversationDTO = session.getMessages().stream().map(PyrisMessageDTO::from).toList();
Expand Down

0 comments on commit 22488d3

Please sign in to comment.