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

Programming exercises: Add Artemis intelligence rewriting for problem statement #10156

Conversation

FelixTJDietrich
Copy link
Contributor

@FelixTJDietrich FelixTJDietrich commented Jan 16, 2025

Important

This PR builds on #10157, please also review that one since it contains most of the code for the rewriting pipeline

Note

This PR depends on the counterpart in Iris. For testing, deploy Pyris#192 via deploy:pyris-test if it is not already deployed (lock:pyris-test). You can use TS1, TS3, TS5 for testing since it has Iris enabled.

Checklist

General

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 (e.g. using paging).
  • I strictly followed the principle of data economy for all client-server REST calls.
  • 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 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 make it easier to provide high quality problem statements to students while reducing the effort needed by a instructors. For this we want integrated AI assistance to help us rewrite and improve the problem statement.

Description

Adds the Artemis Intelligence rewrite action to the problem statement when creating or editing a programming exercise.

Steps for Testing

Prerequisites:

  • 1 Instructor

Make sure that Pyris#192 is deployed

  1. Log in to Artemis
  2. Navigate to Course Management
  3. Select a course then exercises
  4. Create or edit a programming exercise
  5. Scroll down to "Problem" and modify the problem statement however you want
  6. In the toolbar, right of "Insert Test Case", press "AI", then "Rewrite"
  7. Wait for the response
  8. The problem statement should be updated with a success alert.
  9. Crtl/CMD+Z and Y to compare the changes made by Artemis Intelligence

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

Code Review

  • Code Review 1
  • Code Review 2

Manual Tests

  • Test 1
  • Test 2

Test Coverage

Unchanged

Screenshots

Untitled mov

Summary by CodeRabbit

  • New Features

    • Added Artemis Intelligence actions to the markdown editor component
    • Enhanced programming exercise instruction editor with profile-based intelligence features
  • Tests

    • Updated test suites to support new profile and routing configurations
    • Added mock implementations for profile services and route handling
  • Improvements

    • Implemented OnInit lifecycle hook in programming exercise instruction component
    • Added support for course ID retrieval from route parameters

@github-actions github-actions bot added the client Pull requests that update TypeScript code. (Added Automatically!) label Jan 16, 2025
@github-actions github-actions bot added tests server Pull requests that update Java code. (Added Automatically!) communication Pull requests that affect the corresponding module core Pull requests that affect the corresponding module iris Pull requests that affect the corresponding module labels Jan 17, 2025
@FelixTJDietrich FelixTJDietrich changed the base branch from develop to feature/communication/rephrasing-pipeline January 17, 2025 12:49
…phrase-action-for-problem-statement' into feature/programming-exercises/rephrase-action-for-problem-statement
@github-actions github-actions bot added the tests label Jan 29, 2025
cremertim
cremertim previously approved these changes Jan 29, 2025
wasnertobias
wasnertobias previously approved these changes Jan 30, 2025
Copy link
Contributor

@wasnertobias wasnertobias left a comment

Choose a reason for hiding this comment

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

lgtm

Base automatically changed from feature/communication/rephrasing-pipeline to develop January 30, 2025 15:28
@krusche krusche changed the title Programming exercises: Add Artemis Intelligence rewriting for problem statement Programming exercises: Add Artemis intelligence rewriting for problem statement Jan 30, 2025
@krusche krusche merged commit f2bff3b into develop Jan 30, 2025
12 of 14 checks passed
@krusche krusche deleted the feature/programming-exercises/rephrase-action-for-problem-statement branch January 30, 2025 15:32
Copy link

coderabbitai bot commented Jan 30, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This pull request introduces enhancements to the ProgrammingExerciseEditableInstructionComponent by adding support for Artemis Intelligence (Iris) actions. The changes include updating the component's template to bind Iris-related actions, modifying the TypeScript component to implement OnInit, and adding new properties for course ID and Iris-related functionality. The test files have been correspondingly updated to support these new features, including mock implementations for profile services and route handling.

Changes

File Change Summary
src/main/webapp/app/exercises/programming/manage/instructions-editor/programming-exercise-editable-instruction.component.html Added [artemisIntelligenceActions] input binding to markdown editor component
src/main/webapp/app/exercises/programming/manage/instructions-editor/programming-exercise-editable-instruction.component.ts - Implemented OnInit interface
- Added courseId property
- Added irisEnabled and artemisIntelligenceActions properties
- Updated imports and method signatures
src/test/javascript/spec/component/programming-exercise/programming-exercise-editable-instruction.component.spec.ts - Added mock for ProfileService
- Created mock route and profile info
- Enhanced test setup for routing and profile management
src/test/javascript/spec/helpers/mocks/activated-route/mock-activated-route-with-subjects.ts Added snapshot property with paramMap
src/test/javascript/spec/integration/code-editor/code-editor-instructor.integration.spec.ts Added imports for ProfileService and ProfileInfo

Sequence Diagram

sequenceDiagram
    participant Component as ProgrammingExerciseEditableInstructionComponent
    participant Route as ActivatedRoute
    participant ProfileService
    participant ArtemisIntelligenceService

    Component->>Route: Get courseId from route
    Route-->>Component: Return courseId
    Component->>ProfileService: Request profile info
    ProfileService-->>Component: Return profile details
    Component->>Component: Compute Iris enabled status
    Component->>ArtemisIntelligenceService: Fetch Iris actions
    ArtemisIntelligenceService-->>Component: Return available actions
Loading

Possibly related PRs

Suggested Labels

ready for review, programming, iris

Suggested Reviewers

  • BBesrour
  • SimonEntholzer
  • HawKhiem
  • EneaGore
  • krusche

📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 32212f8 and f8e9c67.

📒 Files selected for processing (5)
  • src/main/webapp/app/exercises/programming/manage/instructions-editor/programming-exercise-editable-instruction.component.html (1 hunks)
  • src/main/webapp/app/exercises/programming/manage/instructions-editor/programming-exercise-editable-instruction.component.ts (6 hunks)
  • src/test/javascript/spec/component/programming-exercise/programming-exercise-editable-instruction.component.spec.ts (4 hunks)
  • src/test/javascript/spec/helpers/mocks/activated-route/mock-activated-route-with-subjects.ts (1 hunks)
  • src/test/javascript/spec/integration/code-editor/code-editor-instructor.integration.spec.ts (4 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

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?

❤️ 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. (Beta)
  • @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.

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:Iris ready to merge tests
Projects
Status: Merged
Development

Successfully merging this pull request may close these issues.