-
Notifications
You must be signed in to change notification settings - Fork 275
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 JavaScript programming language template
#8859
base: develop
Are you sure you want to change the base?
Programming exercises
: Add JavaScript programming language template
#8859
Conversation
.gitattributes and .gitignore are ignored usually ignored by gradle, but we need them to be included for programming exercise templates.
This only applies to methods returning multiple Resources using a pattern. All use-cases expect non-directories only.
…low-all-template-filenames
…low-all-template-filenames
Warning Rate limit exceeded@magaupp has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 35 minutes and 51 seconds before requesting another review. How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. WalkthroughThe changes introduce support for the JavaScript programming language across various parts of the Artemis platform. This includes adding JavaScript to supported languages in enums, Continuous Integration (CI) services (including GitLab, Jenkins, and local CI), defining build scripts, project templates, and test configurations. Additionally, minor adjustments in HTML templates improve syntax and logic for handling various UI elements. Changes
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 as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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: 5
Outside diff range comments (1)
src/main/webapp/app/entities/programming-exercise.model.ts (1)
Line range hint
40-40
: Replaceany
with a more specific type in WindMetadata.The use of
any
for theauthor
field inWindMetadata
should be replaced with a more specific type to improve type safety and maintainability.- author: string | any; + author: string | AuthorType; // Assuming AuthorType is defined elsewhere
@@ -97,7 +97,7 @@ | |||
<ng-template ngx-datatable-cell-template let-value="value" let-row="row"> | |||
<span | |||
[ngClass]="{ | |||
'text-danger': row.jobTimingInfo.buildDuration > 240, | |||
'text-danger': row.jobTimingInfo.buildDuration > 240 |
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.
Insert a comma for correct JavaScript syntax.
The array should be correctly formatted with commas to separate elements.
- 'text-danger': row.jobTimingInfo.buildDuration > 240
+ 'text-danger': row.jobTimingInfo.buildDuration > 240,
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
'text-danger': row.jobTimingInfo.buildDuration > 240 | |
'text-danger': row.jobTimingInfo.buildDuration > 240, |
Tools
GitHub Check: client-style
[failure] 100-100:
Insert,
export function add(left, right) { | ||
throw new Error('not implemented'); | ||
} | ||
|
||
export function multiply(left, right) { | ||
throw new Error('not implemented'); | ||
} |
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.
Enhance the error messages for better user guidance.
The current error messages simply state "not implemented". It would be beneficial for users, especially beginners, to have a more descriptive message guiding them on what needs to be done.
- throw new Error('not implemented');
+ throw new Error('Function add is not implemented. Replace this placeholder with your own implementation.');
- throw new Error('not implemented');
+ throw new Error('Function multiply is not implemented. Replace this placeholder with your own implementation.');
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
export function add(left, right) { | |
throw new Error('not implemented'); | |
} | |
export function multiply(left, right) { | |
throw new Error('not implemented'); | |
} | |
export function add(left, right) { | |
throw new Error('Function add is not implemented. Replace this placeholder with your own implementation.'); | |
} | |
export function multiply(left, right) { | |
throw new Error('Function multiply is not implemented. Replace this placeholder with your own implementation.'); | |
} |
@@ -7,7 +7,7 @@ | |||
<span | |||
jhiTranslate="artemisApp.examParticipation.finish" | |||
[translateValues]="{ | |||
title: exam.title, | |||
title: exam.title |
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.
Comma is required for JSON consistency.
The static analysis tool correctly identified that a comma is missing after title: exam.title
. This is necessary to maintain JSON syntax consistency.
- title: exam.title
+ title: exam.title,
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
title: exam.title | |
title: exam.title, |
Tools
GitHub Check: client-style
[failure] 10-10:
Insert,
@@ -0,0 +1,11 @@ | |||
import { math } from 'artemis-exercise'; |
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.
Correct the import statement to properly import the functions.
The current import statement imports math
as an object which would require accessing the functions as math.add
and math.multiply
. However, the test cases are written as if add
and multiply
were imported directly.
- import { math } from 'artemis-exercise';
+ import { add, multiply } from 'artemis-exercise';
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
import { math } from 'artemis-exercise'; | |
import { add, multiply } from 'artemis-exercise'; |
@@ -27,7 +27,7 @@ | |||
<tr | |||
[ngClass]="{ | |||
'font-italic text-danger font-weight-bold': exercise.includedInOverallScore === IncludedInOverallScore.NOT_INCLUDED, | |||
'font-italic text-warning font-weight-bold': exercise.includedInOverallScore === IncludedInOverallScore.INCLUDED_AS_BONUS, | |||
'font-italic text-warning font-weight-bold': exercise.includedInOverallScore === IncludedInOverallScore.INCLUDED_AS_BONUS |
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.
Insert missing commas in translation interpolation.
There are several places where commas are missing in translation interpolation, which could lead to syntax errors or unexpected behaviors.
- {{ 'artemisApp.exam.examSummary.points.youAchievedWithBonus' | artemisTranslate : { achievedPoints: overallAchievedPoints, normalPoints: maxPoints } }}
+ {{ 'artemisApp.exam.examSummary.points.youAchievedWithBonus' | artemisTranslate : { achievedPoints: overallAchievedPoints, normalPoints: maxPoints } }}
- {{ 'artemisApp.exam.examSummary.points.youAchieved' | artemisTranslate : { achievedPoints: overallAchievedPoints, normalPoints: maxPoints } }}
+ {{ 'artemisApp.exam.examSummary.points.youAchieved' | artemisTranslate : { achievedPoints: overallAchievedPoints, normalPoints: maxPoints } }}
- {{ 'artemisApp.exam.examSummary.points.youAchievedFromBonus.' + studentExamWithGrade.studentResult.gradeWithBonus.bonusStrategy | artemisTranslate : { achievedBonus: studentExamWithGrade.studentResult.gradeWithBonus.bonusGrade, bonusFromTitle: studentExamWithGrade.studentResult.gradeWithBonus.bonusFromTitle } }}
+ {{ 'artemisApp.exam.examSummary.points.youAchievedFromBonus.' + studentExamWithGrade.studentResult.gradeWithBonus.bonusStrategy | artemisTranslate : { achievedBonus: studentExamWithGrade.studentResult.gradeWithBonus.bonusGrade, bonusFromTitle: studentExamWithGrade.studentResult.gradeWithBonus.bonusFromTitle } }}
Also applies to: 111-111, 121-121, 131-131
Tools
GitHub Check: client-style
[failure] 30-30:
Insert,
…javascript-template # Conflicts: # src/main/java/de/tum/in/www1/artemis/domain/enumeration/ProgrammingLanguage.java
6f4d3cc
to
25d8a33
Compare
Checklist
General
Server
Changes affecting Programming Exercises
Motivation and Context
Description
This PR adds a programming language template for JavaScript.
The template runs tests using Jest. Student code and test code is transpiled with Babel to enable the use of ES6 modules.
The dependencies are cached in the docker image.
Steps for Testing
Prerequisites:
Setup
Javascript
as the programming languageGenerate
Local Test
test/
test/assignment/
test/
directorynpm ci
npm test
Exercise Creation
test/assignment/src/math.js
test/src/math.test.js
Edit
button of the exerciseSave
Exercise Participation
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
Exam Mode Test
Test Coverage
Screenshots
Summary by CodeRabbit
New Features
JAVASCRIPT
support for programming exercises and continuous integration services.package.json
,.gitignore
, and initial code & test files.Bug Fixes
Chores
.gitignore
files to excludenode_modules/
and relevant directories.