-
Notifications
You must be signed in to change notification settings - Fork 294
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
Adaptive learning
: Fix bulk creation of competencies
#9682
Adaptive learning
: Fix bulk creation of competencies
#9682
Conversation
Adaptive Learning
: Fix bulk creation of competenciesAdaptive learning
: Fix bulk creation of competencies
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.
LGTM
WalkthroughThe changes in this pull request involve updates to error handling and messaging in the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Warning There were issues while running the following tools: 🔧 pmdsrc/main/java/de/tum/cit/aet/artemis/atlas/web/CompetencyResource.javaThe following rules are missing or misspelled in your ruleset file category/vm/bestpractices.xml: BooleanInstantiation, DontImportJavaLang, DuplicateImports, EmptyFinallyBlock, EmptyIfStmt, EmptyInitializer, EmptyStatementBlock, EmptyStatementNotInLoop, EmptySwitchStatements, EmptySynchronizedBlock, EmptyTryBlock, EmptyWhileStmt, ExcessiveClassLength, ExcessiveMethodLength, ImportFromSamePackage, MissingBreakInSwitch, SimplifyBooleanAssertion. Please check your ruleset configuration. 📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
Documentation and Community
|
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.
Actionable comments posted: 2
🧹 Outside diff range and nitpick comments (2)
src/main/webapp/app/entities/competency.model.ts (1)
83-83
: Consider the architectural impact on competency mastery evaluation.The mastery threshold value of 1% seems inconsistent with the competency evaluation architecture:
- The
getMastery
function (line 252) calculates mastery asprogress * confidence
- Progress is tracked as a percentage (0-100)
- A 1% threshold would effectively mark almost any progress as mastery
This could impact:
- Student progress evaluation
- Learning path progression
- Course completion criteria
Consider reviewing the competency mastery evaluation requirements and ensure the threshold aligns with the intended learning outcomes.
src/main/java/de/tum/cit/aet/artemis/atlas/web/CompetencyResource.java (1)
339-343
: Consider providing more specific error messages.The current error message is generic and doesn't indicate which specific attribute failed validation (title, mastery threshold, etc.). Consider providing more detailed error messages to help users quickly identify and fix issues.
- throw new BadRequestAlertException("The attributes of the competency are invalid!", ENTITY_NAME, "invalidCompetencyAttributes"); + String errorDetail = competency.getTitle() == null || competency.getTitle().trim().isEmpty() + ? "Title cannot be empty" + : "Mastery threshold must be between 1 and 100"; + throw new BadRequestAlertException(errorDetail, ENTITY_NAME, "invalidCompetencyAttributes");
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (2)
src/main/java/de/tum/cit/aet/artemis/atlas/web/CompetencyResource.java
(1 hunks)src/main/webapp/app/entities/competency.model.ts
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
src/main/java/de/tum/cit/aet/artemis/atlas/web/CompetencyResource.java (1)
Pattern 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/webapp/app/entities/competency.model.ts (1)
🔇 Additional comments (2)
src/main/java/de/tum/cit/aet/artemis/atlas/web/CompetencyResource.java (2)
Line range hint 1-356
: Class structure follows best practices and coding guidelines.
The class demonstrates good adherence to coding guidelines with:
- Proper constructor-based dependency injection
- Well-defined REST endpoints with appropriate HTTP methods
- Consistent security annotations
- Proper logging implementation
341-341
: Error message identifier accurately reflects the validation context.
The change from "invalidPrerequisiteAttributes" to "invalidCompetencyAttributes" better represents the actual validation being performed.
src/main/java/de/tum/cit/aet/artemis/atlas/web/CompetencyResource.java
Outdated
Show resolved
Hide resolved
|
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.
Code 👍
|
|
|
|
|
|
|
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.
Code looks good 👍
Checklist
General
Server
Client
Motivation and Context
Fix the competency generation with iris
Description
The competency generation with Iris does not set a mastery threshold. This is fixed now.
Steps for Testing
Prerequisites:
Testserver States
Note
These badges show the state of the test servers.
Green = Currently available, Red = Currently locked
Click on the badges to get to the test servers.
Review Progress
Performance Review
Code Review
Manual Tests
Summary by CodeRabbit
Bug Fixes
New Features
masteryThreshold
inCourseCompetency
is now set to100
, ensuring consistent initialization for users.masteryThreshold
property to form data in competency creation and prerequisite handling tests, reflecting updated requirements.