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

Adaptive learning: Improve prerequisite import #8658

Merged
merged 73 commits into from
Jun 22, 2024

Conversation

rstief
Copy link
Contributor

@rstief rstief commented May 24, 2024

Checklist

General

Server

  • Important: I implemented the changes with a very good performance and prevented too many (unnecessary) database calls.
  • I strictly followed the server coding and design guidelines.
  • I added multiple integration tests (Spring) related to the features (with a high test coverage).
  • I added pre-authorization annotations according to the guidelines and checked the course groups for all new REST Calls (security).
  • I documented the Java code using JavaDoc style.

Client

  • Important: I implemented the changes with a very good performance, prevented too many (unnecessary) REST calls and made sure the UI is responsive, even with large data.
  • I strictly followed the client coding and design guidelines.
  • Following the theming guidelines, I specified colors only in the theming variable files and checked that the changes look consistent in both the light and the dark theme.
  • I added multiple integration tests (Jest) related to the features (with a high test coverage), while following the test guidelines.
  • I added authorities to all new routes and checked the course groups for displaying navigation elements (links, buttons).
  • I documented the TypeScript code using JSDoc style.
  • I added multiple screenshots/screencasts of my UI changes.
  • I translated all newly inserted strings into English and German.

Motivation and Context

We want to refactor the prerequisite management with the goal of linking exercise units to prerequisites as pre-tests for a course. To support this, prerequisites need to be changed to be actual entities (before they were only references).

Description

This PR adds Prerequisites as entities to the server:

  • Adds a new entities Prerequisite and CourseCompetency (which is the new superclass of Competency and Prerequisite)
  • Renames the table competency to course_competency as it now contains all CourseCompetencies.
  • Migrates all prerequisites from the old table to the course_competency table

It also improves the prerequisite import:

  • Prerequisites are no longer imported one-by-one
  • Multiple competencies can be selected at once to be imported as prerequisites.

Other changes:

  • Changes the Competency class in the client to be an interface -> to support future use cases where we want to use the new CourseCompetency interface for both competencies and prerequisites.

Steps for Testing

Needed:

  • 1 Instructor

  • Another course with competencies (you can use Raphael Stief Test Course)

  • Test the new prerequisite import (select, de-select competencies, search, filter, import, ...)

  • Test the competency import (import from another course)

  • Test all other occurrences of prerequisites:

    • Competency Management Page
    • View Prerequisites when Self-enrolling

Testserver States

Note

These badges show the state of the test servers.
Green = Currently available, Red = Currently locked






Review Progress

Performance Review

  • I (as a reviewer) confirm that the client changes (in particular related to REST calls and UI responsiveness) are implemented with a very good performance
  • I (as a reviewer) confirm that the server changes (in particular related to database calls) are implemented with a very good performance

Code Review

  • Code Review 1
  • Code Review 2

Manual Tests

  • Test 1
  • Test 2

Test Coverage

Class/File Line Coverage Confirmation (assert/expect)
competency-management.component.ts 94.21%
competency.service.ts 90.54%
create-competency.component.ts 83.33%
competency-search.component.ts 100%
import-competencies.component.ts 90.9%
import-course-competencies.component.ts 94.36%
import-prerequisites.component.ts 91.66%
prerequisite.service.ts 100%
course-management.route.ts not found (modified)
competency.model.ts 87.93%
standardized-competency.model.ts 100%
course.model.ts 100%
lecture-wizard-competencies.component.ts 97.24%
course-competencies.component.ts 95.31%
course-prerequisites-modal.component.ts 94.73%
pageable-table.ts 100%

Server

Class/File Line Coverage Confirmation (assert/expect)
Course.java 92%
BaseCompetency.java 100%
Competency.java 75%
CourseCompetency.java 100%
Prerequisite.java 25% ✅ (only constructor)
CompetencyRepository.java 63% ✅ (no methods added)
CourseCompetencyRepository.java 84%
PrerequisiteRepository.java 100%
CourseService.java 93%
CompetencyService.java 92%
PrerequisiteService.java 100%
CompetencyResource.java 94%
PrerequisiteResource.java 100%
PrerequisiteResponseDTO.java 100%

Screenshots

image

Summary by CodeRabbit

  • New Features

    • Introduced functionality for importing and managing course competencies and prerequisites in the user interface.
    • Added Prerequisite and LinkedCourseCompetencyDTO classes to enhance competency handling.
  • Bug Fixes

    • Improved conditional rendering and null handling in competency-related HTML templates.
  • Documentation

    • Updated i18n files to refine button labels, success messages, and text related to competency import and management.
  • Refactor

    • Restructured Competency class into interfaces for better maintainability and updated related services and repositories.
  • Tests

    • Enhanced test coverage for competency creation, prerequisites handling, and importing functionalities.
  • Chores

    • Removed outdated methods and adjusted security annotations for streamlined access control in competency management.

@github-actions github-actions bot added server Pull requests that update Java code. (Added Automatically!) database Pull requests that update the database. (Added Automatically!). Require a CRITICAL deployment. labels May 24, 2024
@github-actions github-actions bot added the tests label May 26, 2024
@github-actions github-actions bot added the client Pull requests that update TypeScript code. (Added Automatically!) label May 28, 2024
@rstief rstief changed the title Development: Add prerequisite entities Adaptive Learning: Improve Prerequisite Import May 28, 2024
@rstief rstief changed the title Adaptive Learning: Improve Prerequisite Import Adaptive learning: Improve Prerequisite Import May 28, 2024
Copy link
Member

@krusche krusche left a comment

Choose a reason for hiding this comment

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

I tested the migration with production data and it works fine 👍

Copy link
Contributor

@JohannesStoehr JohannesStoehr left a comment

Choose a reason for hiding this comment

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

Reapprove Code after merge

Copy link
Contributor

@Jan-Thurner Jan-Thurner left a comment

Choose a reason for hiding this comment

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

tested again on TS1, works as expected.

Copy link
Contributor

@EneaGore EneaGore left a comment

Choose a reason for hiding this comment

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

Manual test on TS1. Lgtm

Copy link
Member

@BBesrour BBesrour left a comment

Choose a reason for hiding this comment

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

new changes lgtm! (re-approve)

@krusche krusche merged commit deff4f5 into develop Jun 22, 2024
33 of 39 checks passed
@krusche krusche deleted the chore/adaptive-learning/add-prerequisite-entities branch June 22, 2024 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client Pull requests that update TypeScript code. (Added Automatically!) component:AdaptiveLearning database Pull requests that update the database. (Added Automatically!). Require a CRITICAL deployment. maintainer-approved The feature maintainer has approved the PR server Pull requests that update Java code. (Added Automatically!) tests
Projects
Archived in project
Status: Done
Development

Successfully merging this pull request may close these issues.