Skip to content

Conversation

@MoritzSpengler
Copy link
Contributor

@MoritzSpengler MoritzSpengler commented Apr 22, 2025

Checklist

General

Server

  • Important: I implemented the changes with a very good performance and prevented too many (unnecessary) and too complex database calls.
  • I strictly followed the principle of data economy for all database calls.
  • I strictly followed the server coding and design guidelines.
  • I documented the Java code using JavaDoc style.

Changes affecting Programming Exercises

  • High priority: I tested all changes and their related features with all corresponding user types on a test server configured with the integrated lifecycle setup (LocalVC and LocalCI).
  • I tested all changes and their related features with all corresponding user types on a test server configured with LocalVC and Jenkins.

Motivation and Context

The average score graphs for exercises in the instructior view should be calculated using the last graded result. Practice runs should not be used.
#9864

Description

The findAvgScore function in the ParticipantScoreRepository is adjusted to select the last rated score, not the last score in general (including possible practice runs).

Steps for Testing

Prerequisites:

  • 1 Instructor
  • 2 Students
  1. Log in to Artemis
  2. Navigate to Course Administration
  3. Create new Quiz
  4. Student takes Quiz
  5. Release Quiz for practice
  6. Student takes Quiz as practice with different score than graded run
  7. Instructor checks Average Score of the Quiz and the Course

Exam Mode Testing

Testserver States

You can manage test servers using Helios. Check environment statuses in the environment list. To deploy to a test server, go to the CI/CD page, find your PR or branch, and trigger the deployment.

Review Progress

Performance Review

Code Review

  • Code Review 1
  • Code Review 2

Manual Tests

  • Test 1
  • Test 2

Summary by CodeRabbit

  • Bug Fixes

    • Updated average score calculation to use the most recent rated scores for selected exercises.
  • Documentation

    • Added detailed descriptions to clarify the average score calculation method.

@MoritzSpengler MoritzSpengler requested a review from Hialus April 22, 2025 14:38
@MoritzSpengler MoritzSpengler linked an issue Apr 22, 2025 that may be closed by this pull request
@github-project-automation github-project-automation bot moved this to Work In Progress in Artemis Development Apr 22, 2025
@MoritzSpengler MoritzSpengler changed the title Quiz exercises: Fix average score calculation in quiz detail view Quiz exercises: Fix average score calculation in quiz detail view Apr 22, 2025
@MoritzSpengler MoritzSpengler changed the title Quiz exercises: Fix average score calculation in quiz detail view Quiz exercises: Fix average score calculation in quiz detail view Apr 22, 2025
@MoritzSpengler MoritzSpengler changed the title Quiz exercises: Fix average score calculation in quiz detail view Quiz exercises : Fix average score calculation in quiz detail view Apr 22, 2025
@github-actions github-actions bot added server Pull requests that update Java code. (Added Automatically!) assessment Pull requests that affect the corresponding module core Pull requests that affect the corresponding module labels Apr 22, 2025
@MoritzSpengler MoritzSpengler changed the title Quiz exercises : Fix average score calculation in quiz detail view Quiz exercises: Fix average score calculation in quiz detail view Apr 22, 2025
@github-actions
Copy link

End-to-End (E2E) Test Results Summary

TestsPassed ☑️Skipped ⚠️Failed ❌️Time ⏱
End-to-End (E2E) Test Report201 ran197 passed3 skipped1 failed55m 57s 14ms
TestResultTime ⏱
End-to-End (E2E) Test Report
e2e/course/CourseMessages.spec.ts
ts.Course messages › Channel messages › Write/edit/delete message in channel › Student should be able to edit message in channel❌ failure2m 2s 496ms

@github-actions
Copy link

End-to-End (E2E) Test Results Summary

@github-actions
Copy link

End-to-End (E2E) Test Results Summary

TestsPassed ☑️Skipped ⚠️Failed ❌️Time ⏱
End-to-End (E2E) Test Report201 ran196 passed3 skipped2 failed49m 37s 486ms
TestResultTime ⏱
End-to-End (E2E) Test Report
e2e/course/CourseMessages.spec.ts
ts.Course messages › Channel messages › Write/edit/delete message in channel › Student should be able to edit message in channel❌ failure2m 3s 126ms
e2e/exercise/programming/ProgrammingExerciseStaticCodeAnalysis.spec.ts
ts.Static code analysis tests › Configures SCA grading and makes a successful submission with SCA errors❌ failure1m 44s 592ms

@helios-aet helios-aet bot temporarily deployed to artemis-test1.artemis.cit.tum.de April 28, 2025 13:11 Inactive
@github-actions github-actions bot removed the core Pull requests that affect the corresponding module label Apr 28, 2025
@github-actions
Copy link

End-to-End (E2E) Test Results Summary

TestsPassed ☑️Skipped ⚠️Failed ❌️Time ⏱
End-to-End (E2E) Test Report201 ran197 passed3 skipped1 failed45m 28s 2ms
TestResultTime ⏱
End-to-End (E2E) Test Report
e2e/course/CourseMessages.spec.ts
ts.Course messages › Channel messages › Write/edit/delete message in channel › Student should be able to edit message in channel❌ failure2m 3s 186ms

@helios-aet helios-aet bot temporarily deployed to artemis-test1.artemis.cit.tum.de April 28, 2025 15:32 Inactive
@MoritzSpengler MoritzSpengler marked this pull request as ready for review April 28, 2025 19:54
@MoritzSpengler MoritzSpengler requested a review from krusche as a code owner April 28, 2025 19:54
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Apr 28, 2025

Walkthrough

The method findAvgScore in the ParticipantScoreRepository interface was updated to compute the average of the lastRatedScore field instead of the lastScore field for a given set of exercises. Additionally, a Javadoc comment was added to the method to document its purpose, parameters, and return value. No other logic or structural changes were introduced.

Changes

File Change Summary
src/main/java/de/tum/cit/aet/artemis/assessment/repository/ParticipantScoreRepository.java Updated findAvgScore to use lastRatedScore instead of lastScore; added Javadoc comment.

Suggested labels

quiz, ready for review

Suggested reviewers

  • krusche
  • ole-ve
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (3)
src/main/java/de/tum/cit/aet/artemis/assessment/repository/ParticipantScoreRepository.java (3)

50-55: Javadoc clarity & accuracy

  • The description says “set of exercise” but should be “set of exercises.”
  • The @return tag refers to a primitive double, yet the method returns a Double which may be null if no matching records exist. Please clarify nullable behavior or default to 0.0.

56-61: Method naming consistency
Other methods use findAverageScoreForExercise(s). To clearly indicate this operates on the rated score and to maintain uniformity, consider renaming to something like findAverageRatedScoreForExercises.


56-61: Add unit tests for findAvgScore
This new method isn’t covered by existing tests. Please add unit or integration tests to verify:

  • Only graded results contribute (practice runs excluded).
  • Correct behavior when the exercise set is empty or participants have no graded results.
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5b7b93d and 000cb55.

📒 Files selected for processing (1)
  • src/main/java/de/tum/cit/aet/artemis/assessment/repository/ParticipantScoreRepository.java (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`src/main/java/**/*.java`: naming:CamelCase; principles:{single_responsibility,small_methods,no_duplication}; db:{perf_queries,datetime_not_timestamp}; rest:{stateless,singleton,de...

src/main/java/**/*.java: naming:CamelCase; principles:{single_responsibility,small_methods,no_duplication}; db:{perf_queries,datetime_not_timestamp}; rest:{stateless,singleton,delegate_logic,http_only,minimal_dtos}; dtos:{java_records,no_entities,min_data,single_resp}; di:constructor_injection; kiss:simple_code; file_handling:os_indep_paths; practices:{least_access,avoid_transactions,code_reuse,static_member_ref,prefer_primitives}; sql:{param_annotation,uppercase,avoid_subqueries};java:avoid_star_imports

  • src/main/java/de/tum/cit/aet/artemis/assessment/repository/ParticipantScoreRepository.java
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Codacy Static Code Analysis

@helios-aet helios-aet bot temporarily deployed to artemis-test3.artemis.cit.tum.de April 29, 2025 18:51 Inactive
Copy link
Contributor

@HawKhiem HawKhiem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on TS3. Practice quiz score doesn't affect average score as expected

@helios-aet helios-aet bot temporarily deployed to artemis-test1.artemis.cit.tum.de April 30, 2025 09:30 Inactive
Copy link
Contributor

@marlonnienaber marlonnienaber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good. Tested on TS1. Behaves as expected.

Copy link
Member

@alexjoham alexjoham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code lgmt

@helios-aet helios-aet bot temporarily deployed to artemis-test2.artemis.cit.tum.de April 30, 2025 15:57 Inactive
Copy link

@chuuuun chuuuun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested on TS 2, students 1,2, instructor 16

I used Student 1 and Student 2. Student 1 answered all questions correctly when scoring, while Student 2 got everything wrong. After releasing practice mode, Student 2 answered all questions correctly. The average was not affected by the practice mode, but I suspect the denominator in the average calculation might be incorrect.
Screenshot 2025-04-30 at 18 15 07
Screenshot 2025-04-30 at 18 20 29

@helios-aet helios-aet bot temporarily deployed to artemis-test5.artemis.cit.tum.de May 1, 2025 06:50 Inactive
Copy link

@DenizOzturk95 DenizOzturk95 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested on TS5, worked as described

@MoritzSpengler
Copy link
Contributor Author

tested on TS 2, students 1,2, instructor 16

I used Student 1 and Student 2. Student 1 answered all questions correctly when scoring, while Student 2 got everything wrong. After releasing practice mode, Student 2 answered all questions correctly. The average was not affected by the practice mode, but I suspect the denominator in the average calculation might be incorrect. Screenshot 2025-04-30 at 18 15 07 Screenshot 2025-04-30 at 18 20 29

If the quiz had a max of 1 point then the denominator is correct, since the average score per student is 0,5 out of the 1 possible point.

@MoritzSpengler MoritzSpengler requested a review from chuuuun May 1, 2025 18:17
@github-actions
Copy link

github-actions bot commented May 9, 2025

There hasn't been any activity on this pull request recently. Therefore, this pull request has been automatically marked as stale and will be closed if no further activity occurs within seven days. Thank you for your contributions.

@krusche krusche added this to the 8.0.7 milestone May 10, 2025
@krusche krusche merged commit 37be810 into develop May 10, 2025
70 of 77 checks passed
@krusche krusche deleted the bugfix/quiz-exercises/include-only-rated-results-in-AvgScore branch May 10, 2025 09:41
@github-project-automation github-project-automation bot moved this from Work In Progress to Merged in Artemis Development May 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

assessment Pull requests that affect the corresponding module server Pull requests that update Java code. (Added Automatically!) stale

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Quiz exercises: Average Score does not use the correct results

8 participants