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

Development: Disable LTI exercise link button when no exercise is selected #9077

Merged
merged 2 commits into from
Jul 20, 2024

Conversation

iyannsch
Copy link
Contributor

@iyannsch iyannsch commented Jul 17, 2024

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.
  • 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.

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 Gitlab and Jenkins.

Motivation and Context

When linking an Artemis exercise to Moodle, the instructor selects all those exercises from a list. The Link button is available without any selection though and the checkmarks are hardly visible.

Description

I disabled the button when no exercises are selected and changed the button text to highlight the necessary user action.

Steps for Testing

Full System Test

Prerequisites:

  • 1 Instructor
  • 1 Moodle Admin Account
  • 1 LTI-enabled course with at least 1 exercise
  1. Go to Moodle and Select content from Artemis
  2. Select your LTI-enabled course
  3. Verify that you cannot click the button with no exercises selected
  4. Verify that you can click the button with exercises selected

Artemis-Only Test

This test will throw internal server errors as Moodle context is missing. However, all changed aspects are visible here and no Moodle Account is required.
Prerequisites:

  • 1 Instructor
  • 1 LTI-enabled course with at least 1 exercise
  1. Get the Moodle course's ID
  2. Navigate to /lti/exercises/course:id (e.g. https://artemis-test3.artemis.cit.tum.de/lti/exercises/65)
  3. Verify that you cannot click the button with no exercises selected
  4. Verify that you can click the button with exercises selected

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

  • 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

Screenshots

image
image
image

Summary by CodeRabbit

  • New Features

    • Conditional button rendering based on exercise selection for deep linking.
    • Error messages for unselected exercises during deep linking.
  • Localization

    • Added German localization for the prompt to select exercises.
    • Added English localization for the prompt to select exercises.
  • Tests

    • Enhanced test cases for alert notifications and navigation behavior.

@iyannsch iyannsch self-assigned this Jul 17, 2024
@iyannsch iyannsch requested a review from a team as a code owner July 17, 2024 07:23
Copy link

coderabbitai bot commented Jul 17, 2024

Walkthrough

The recent changes enhance the LTI 1.3 deep linking functionality by updating the user interface to conditionally render buttons based on exercise selection, ensuring users are guided correctly. The backend logic now verifies selected exercises before initiating the deep link request and displays appropriate error messages if none are selected. Additionally, localization improvements were made for both English and German interfaces. Test cases were updated to reflect these new behaviors and ensure robust functionality.

Changes

File Path/Group Change Summary
src/.../lti13-deep-linking.component.html Updated to conditionally render buttons based on selectedExercises condition.
src/.../lti13-deep-linking.component.ts Modified sendDeepLinkRequest to check selectedExercises size and display error if none are selected.
src/.../i18n/de/lti.json, src/.../i18n/en/lti.json Added new localization key "selectToLink" with appropriate text in both English and German.
src/test/.../lti13-deep-linking.component.spec.ts Updated tests to include mock alert service, verify error message display, and test navigation for authenticated users.

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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 as 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 resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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.

@github-actions github-actions bot added tests client Pull requests that update TypeScript code. (Added Automatically!) labels Jul 17, 2024
@iyannsch iyannsch changed the title Disable Moodle Exercise-Link button when no exercise is selected Bugfix: Disable Moodle Exercise-Link button when no exercise is selected Jul 17, 2024
@iyannsch iyannsch linked an issue Jul 17, 2024 that may be closed by this pull request
coderabbitai[bot]
coderabbitai bot previously approved these changes Jul 17, 2024
@iyannsch iyannsch added config-change Pull requests that change the config in a way that they require a deployment via Ansible. component:LTI bugfix deploy:artemis-test3 labels Jul 17, 2024
@iyannsch iyannsch temporarily deployed to artemis-test3.artemis.cit.tum.de July 17, 2024 08:02 — with GitHub Actions Inactive
Copy link
Contributor

@pzdr7 pzdr7 left a comment

Choose a reason for hiding this comment

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

Code

@Strohgelaender Strohgelaender changed the title Bugfix: Disable Moodle Exercise-Link button when no exercise is selected General: Disable Moodle Exercise-Link button when no exercise is selected Jul 17, 2024
Copy link
Contributor

@SimonEntholzer SimonEntholzer left a comment

Choose a reason for hiding this comment

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

Code, as I'm not a moodle admin

@Mtze Mtze temporarily deployed to artemis-test3.artemis.cit.tum.de July 18, 2024 13:08 — with GitHub Actions Inactive
Copy link
Member

@Mtze Mtze 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 - working

@krusche krusche changed the title General: Disable Moodle Exercise-Link button when no exercise is selected Development: Disable LTI exercise link button when no exercise is selected Jul 20, 2024
@krusche krusche added this to the 7.4.4 milestone Jul 20, 2024
@krusche krusche merged commit 853cade into develop Jul 20, 2024
50 of 54 checks passed
@krusche krusche deleted the bugfix/make-lti-exercise-selection-better-visible branch July 20, 2024 05:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix client Pull requests that update TypeScript code. (Added Automatically!) component:LTI config-change Pull requests that change the config in a way that they require a deployment via Ansible. ready to merge tests
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Make Moodle Exercise Selection less error-prone
7 participants