Skip to content

Commit

Permalink
Merge branch 'develop' into chore/exercises/optimize-exercise-details…
Browse files Browse the repository at this point in the history
…-load
  • Loading branch information
julian-christl authored Jun 19, 2024
2 parents cee1649 + f97cdbf commit 933c561
Show file tree
Hide file tree
Showing 33 changed files with 189 additions and 110 deletions.
17 changes: 9 additions & 8 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,15 @@ Prerequisites:
> [!NOTE]
> These badges show the state of the test servers.
> Green = Currently available, Red = Currently locked
![](https://byob.yarr.is/ls1intum/Artemis/artemis-test1)
![](https://byob.yarr.is/ls1intum/Artemis/artemis-test2)
![](https://byob.yarr.is/ls1intum/Artemis/artemis-test3)
![](https://byob.yarr.is/ls1intum/Artemis/artemis-test4)
![](https://byob.yarr.is/ls1intum/Artemis/artemis-test5)
![](https://byob.yarr.is/ls1intum/Artemis/artemis-test6)
![](https://byob.yarr.is/ls1intum/Artemis/artemis-test9)
> Click on the badges to get to the test servers.
[![](https://byob.yarr.is/ls1intum/Artemis/artemis-test1)](https://artemis-test1.artemis.cit.tum.de)
[![](https://byob.yarr.is/ls1intum/Artemis/artemis-test2)](https://artemis-test2.artemis.cit.tum.de)
[![](https://byob.yarr.is/ls1intum/Artemis/artemis-test3)](https://artemis-test3.artemis.cit.tum.de)
[![](https://byob.yarr.is/ls1intum/Artemis/artemis-test4)](https://artemis-test4.artemis.cit.tum.de)
[![](https://byob.yarr.is/ls1intum/Artemis/artemis-test5)](https://artemis-test5.artemis.cit.tum.de)
[![](https://byob.yarr.is/ls1intum/Artemis/artemis-test6)](https://artemis-test6.artemis.cit.tum.de)
[![](https://byob.yarr.is/ls1intum/Artemis/artemis-test9)](https://artemis-test9.artemis.cit.tum.de)

### Review Progress
<!-- Each PR should be reviewed by at least two other developers. The code, the functionality (= manual test) and the exam mode need to be reviewed. -->
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ Refer to [Using JHipster in production](http://www.jhipster.tech/production) for
The following command can automate the deployment to a server. The example shows the deployment to the main Artemis test server (which runs a virtual machine):

```shell
./artemis-server-cli deploy [email protected] -w build/libs/Artemis-7.2.2.war
./artemis-server-cli deploy [email protected] -w build/libs/Artemis-7.2.3.war
```

## Architecture
Expand Down
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ plugins {
}

group = "de.tum.in.www1.artemis"
version = "7.2.2"
version = "7.2.3"
description = "Interactive Learning with Individual Feedback"

java {
Expand Down Expand Up @@ -228,7 +228,7 @@ dependencies {

// Note: jenkins-client is not well maintained and includes dependencies to libraries with critical security issues (e.g. CVE-2020-10683 for [email protected])
// implementation "com.offbytwo.jenkins:jenkins-client:0.3.8"
implementation files("libs/jenkins-client-0.4.0.jar")
implementation files("libs/jenkins-client-0.4.1.jar")
// The following 4 dependencies are explicitly integrated as transitive dependencies of jenkins-client-0.4.0.jar
implementation "org.apache.httpcomponents.client5:httpclient5:5.3.1"
implementation "org.apache.httpcomponents.core5:httpcore5:5.2.4"
Expand Down Expand Up @@ -268,7 +268,7 @@ dependencies {

// Note: spring-security-lti13 does not work with jakarta yet, so we built our own custom version and declare its transitive dependencies below
// implementation "uk.ac.ox.ctl:spring-security-lti13:0.1.11"
implementation files("libs/spring-security-lti13-0.1.12.jar")
implementation files("libs/spring-security-lti13-0.1.13.jar")

// https://search.maven.org/artifact/org.eclipse.jgit/org.eclipse.jgit
implementation "org.eclipse.jgit:org.eclipse.jgit:${jgit_version}"
Expand Down
2 changes: 1 addition & 1 deletion docs/admin/setup/athena.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ HTTP. We need to extend the configuration in the file
artemis:
# ...
athena:
url: http://localhost:5000
url: http://localhost:5100
secret: abcdef12345
modules:
# See https://github.com/ls1intum/Athena for a list of available modules
Expand Down
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ module.exports = {
global: {
// TODO: in the future, the following values should increase to at least 90%
statements: 86.80,
branches: 73.21,
branches: 73.18,
functions: 81.21,
lines: 86.89,
},
Expand Down
Binary file removed libs/jenkins-client-0.4.0.jar
Binary file not shown.
Binary file added libs/jenkins-client-0.4.1.jar
Binary file not shown.
Binary file removed libs/spring-security-lti13-0.1.12.jar
Binary file not shown.
Binary file added libs/spring-security-lti13-0.1.13.jar
Binary file not shown.
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "artemis",
"version": "7.2.2",
"version": "7.2.3",
"description": "Interactive Learning with Individual Feedback",
"private": true,
"license": "MIT",
Expand Down Expand Up @@ -106,7 +106,8 @@
"undici": "6.12.0",
"vite": "5.1.7",
"webpack-dev-middleware": "7.2.1",
"word-wrap": "1.2.5"
"word-wrap": "1.2.5",
"ws": "8.17.1"
},
"devDependencies": {
"@angular-builders/jest": "17.0.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ CASE WHEN TYPE(e) = ProgrammingExercise THEN TREAT(e AS ProgrammingExercise).all
WHERE e.id IN :exerciseIds
AND s.submitted = TRUE
AND (p.student.id = :userId OR u.id = :userId)
AND p.testRun = FALSE
GROUP BY e.id, p.id
""")
Set<ResourceTimestampDTO> findLatestSubmissionDatesForUser(@Param("exerciseIds") Set<Long> exerciseIds, @Param("userId") long userId);
Expand All @@ -127,6 +128,7 @@ CASE WHEN TYPE(e) = ProgrammingExercise THEN TREAT(e AS ProgrammingExercise).all
LEFT JOIN p.exercise e
WHERE e.id IN :exerciseIds
AND s.submitted = TRUE
AND p.testRun = FALSE
GROUP BY e.id, p.id
""")
Set<ResourceTimestampDTO> findLatestSubmissionDates(@Param("exerciseIds") Set<Long> exerciseIds);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public interface LectureUnitMetricsRepository extends JpaRepository<LectureUnit,
* @return the lecture unit information for all lecture units in the course
*/
@Query("""
SELECT new de.tum.in.www1.artemis.web.rest.dto.metrics.LectureUnitInformationDTO(lu.id, lu.lecture.id, COALESCE(lu.name, a.name), lu.releaseDate, TYPE(lu))
SELECT new de.tum.in.www1.artemis.web.rest.dto.metrics.LectureUnitInformationDTO(lu.id, lu.lecture.id, lu.lecture.title, COALESCE(lu.name, a.name), lu.releaseDate, TYPE(lu))
FROM LectureUnit lu
LEFT JOIN Attachment a ON a.attachmentUnit.id = lu.id
WHERE lu.lecture.course.id = :courseId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1013,9 +1013,8 @@ public boolean accept(java.io.File directory, String fileName) {

/**
* Lists all files and directories within the given repository, excluding symbolic links.
* This method utilizes caching to avoid repeated scanning of the repository. If the repository's content is
* already cached, it returns the cached content. Otherwise, it performs a scan, filters out symbolic links,
* and caches the result for future use.
* This method performs a file scan and filters out symbolic links.
* It supports bare and checked-out repositories.
* <p>
* Note: This method does not handle changes to the repository content between invocations. If files change
* after the initial caching, the cache does not automatically refresh, which may lead to stale data.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import de.tum.in.www1.artemis.domain.Repository;
import de.tum.in.www1.artemis.domain.iris.message.IrisMessage;
import de.tum.in.www1.artemis.domain.participation.ProgrammingExerciseParticipation;
import de.tum.in.www1.artemis.service.ProfileService;
import de.tum.in.www1.artemis.service.connectors.GitService;
import de.tum.in.www1.artemis.service.connectors.pyris.dto.data.PyrisBuildLogEntryDTO;
import de.tum.in.www1.artemis.service.connectors.pyris.dto.data.PyrisFeedbackDTO;
Expand All @@ -37,9 +38,12 @@ public class PyrisDTOService {

private final RepositoryService repositoryService;

public PyrisDTOService(GitService gitService, RepositoryService repositoryService) {
private final ProfileService profileService;

public PyrisDTOService(GitService gitService, RepositoryService repositoryService, ProfileService profileService) {
this.gitService = gitService;
this.repositoryService = repositoryService;
this.profileService = profileService;
}

/**
Expand Down Expand Up @@ -125,7 +129,13 @@ private PyrisResultDTO getLatestResult(ProgrammingSubmission submission) {
*/
private Optional<Repository> getRepository(ProgrammingExerciseParticipation participation) {
try {
return Optional.ofNullable(gitService.getOrCheckoutRepository(participation.getVcsRepositoryUri(), true));
var repositoryUri = participation.getVcsRepositoryUri();
if (profileService.isLocalVcsActive()) {
return Optional.ofNullable(gitService.getBareRepository(repositoryUri));
}
else {
return Optional.ofNullable(gitService.getOrCheckoutRepository(repositoryUri, true));
}
}
catch (GitAPIException e) {
log.error("Could not fetch repository", e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@
/**
* DTO for lecture unit information.
*
* @param id the id of the lecture unit
* @param lectureId the id of the lecture
* @param name the name of the lecture unit
* @param releaseDate the release date of the lecture unit
* @param type the type of the lecture unit
* @param id the id of the lecture unit
* @param lectureId the id of the lecture
* @param lectureTitle the title of the lecture
* @param name the name of the lecture unit
* @param releaseDate the release date of the lecture unit
* @param type the type of the lecture unit
*/
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public record LectureUnitInformationDTO(long id, long lectureId, String name, ZonedDateTime releaseDate, Class<? extends LectureUnit> type) {
public record LectureUnitInformationDTO(long id, long lectureId, String lectureTitle, String name, ZonedDateTime releaseDate, Class<? extends LectureUnit> type) {
}
2 changes: 1 addition & 1 deletion src/main/resources/config/application-artemis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ artemis:
name: Artemis
email: [email protected]
athena:
url: http://localhost:5000
url: http://localhost:5100
secret: abcdef12345
restricted-modules: module_text_llm,module_programming_llm
apollon:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@
(click)="toggle()"
>
<h4 class="fw-medium mb-0 py-2 col-sm-6 d-flex gap-2">
<fa-icon
[icon]="getIcon(competency.taxonomy)"
[fixedWidth]="true"
[ngbTooltip]="'artemisApp.competency.taxonomies.' + competency.taxonomy | artemisTranslate"
container="body"
/>
@if (competency.taxonomy) {
<fa-icon
[icon]="getIcon(competency.taxonomy)"
[fixedWidth]="true"
[ngbTooltip]="'artemisApp.competency.taxonomies.' + competency.taxonomy | artemisTranslate"
container="body"
/>
}
{{ competency.title }}
</h4>
<div class="w-100 d-flex align-items-center gap-4">
Expand All @@ -31,7 +33,7 @@ <h4 class="fw-medium mb-0 py-2 col-sm-6 d-flex gap-2">
}
@if (lectureUnitsProgress !== undefined) {
<div class="d-flex gap-3 align-items-center justify-content-center">
<fa-icon [icon]="faPdf" [ngbTooltip]="'artemisApp.studentAnalyticsDashboard.competencyAccordion.lectures' | artemisTranslate" />
<fa-icon [icon]="faFilePdf" [ngbTooltip]="'artemisApp.studentAnalyticsDashboard.competencyAccordion.lectures' | artemisTranslate" />
<ngb-progressbar
class="w-100"
type="success overflow-visible"
Expand All @@ -56,36 +58,42 @@ <h4 class="fw-medium mb-0 py-2 col-sm-6 d-flex gap-2">
</div>
</button>
<div [class.competency-accordion-body-open]="open" [class.competency-accordion-body-closed]="!open" class="competency-accordion-body">
@if (promptForRating) {
<div [class.pb-1]="course && (nextExercises.length > 0 || nextLectureUnits.length > 0)">
<jhi-judgement-of-learning-rating
[competencyId]="competency.id"
[courseId]="course?.id"
[mastery]="mastery"
[rating]="jolRating"
(ratingChange)="onRatingChange($event)"
/>
</div>
}
@if (course && (nextLectureUnits.length > 0 || nextExercises.length > 0)) {
<h5 class="fw-medium fs-4 mt-1" jhiTranslate="artemisApp.studentAnalyticsDashboard.competencyAccordion.nextObjectives"></h5>
<h5 class="fw-medium fs-5 mt-1" jhiTranslate="artemisApp.studentAnalyticsDashboard.competencyAccordion.nextActivities"></h5>
}
@if (course && nextExercises.length > 0) {
@for (exercise of nextExercises; track exercise) {
<jhi-course-exercise-row [course]="course" [exercise]="exercise" />
}
}
@if (course && nextLectureUnits.length > 0) {
@for (lectureUnit of nextLectureUnits; track lectureUnit) {
<div class="lecture-unit-container d-flex align-items-center my-2 px-2 position-relative">
<a class="stretched-link" [routerLink]="['/courses', course.id, 'lectures', lectureUnit.lectureId]"></a>
<div class="m-0 fs-5 fw-medium px-2">
<fa-icon class="me-2" [icon]="lectureUnitIcons[lectureUnit.type]" [ngbTooltip]="lectureUnitTooltips[lectureUnit.type] | artemisTranslate" />
<fa-icon
class="me-2"
[icon]="lectureUnit.type === LectureUnitType.ATTACHMENT ? faFile : lectureUnitIcons[lectureUnit.type]"
[ngbTooltip]="lectureUnitTooltips[lectureUnit.type] | artemisTranslate"
/>
{{ lectureUnit.lectureTitle }}
-
{{ lectureUnit.name }}
</div>
</div>
}
}
@if (course && nextExercises.length > 0) {
@for (exercise of nextExercises; track exercise) {
<jhi-course-exercise-row [course]="course" [exercise]="exercise" />
}
}
@if (promptForRating) {
<div [class.pt-3]="course && (nextExercises.length > 0 || nextLectureUnits.length > 0)">
<jhi-judgement-of-learning-rating
[competencyId]="competency.id"
[courseId]="course?.id"
[mastery]="mastery"
[rating]="jolRating"
(ratingChange)="onRatingChange($event)"
/>
</div>
}
<button
(click)="navigateToCompetencyDetailPage($event)"
class="btn btn-primary w-100 my-2"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { Component, EventEmitter, Input, OnChanges, Output, SimpleChanges } from '@angular/core';
import { faFilePdf, faList } from '@fortawesome/free-solid-svg-icons';
import { faFile, faFilePdf, faList } from '@fortawesome/free-solid-svg-icons';
import { Competency, CompetencyJol, CompetencyProgress, getConfidence, getIcon, getMastery, getProgress } from 'app/entities/competency.model';
import { Course } from 'app/entities/course.model';
import { Router } from '@angular/router';
import { CompetencyInformation, LectureUnitInformation, StudentMetrics } from 'app/entities/student-metrics.model';
import { round } from 'app/shared/util/utils';
import { Exercise } from 'app/entities/exercise.model';
import dayjs from 'dayjs/esm';
import { lectureUnitIcons, lectureUnitTooltips } from 'app/entities/lecture-unit/lectureUnit.model';
import { LectureUnitType, lectureUnitIcons, lectureUnitTooltips } from 'app/entities/lecture-unit/lectureUnit.model';

export interface CompetencyAccordionToggleEvent {
opened: boolean;
Expand Down Expand Up @@ -40,9 +40,11 @@ export class CompetencyAccordionComponent implements OnChanges {
promptForRating = false;

protected readonly faList = faList;
protected readonly faPdf = faFilePdf;
protected readonly faFile = faFile;
protected readonly faFilePdf = faFilePdf;
protected readonly lectureUnitIcons = lectureUnitIcons;
protected readonly lectureUnitTooltips = lectureUnitTooltips;
protected readonly LectureUnitType = LectureUnitType;
protected readonly getIcon = getIcon;
protected readonly getProgress = getProgress;
protected readonly getConfidence = getConfidence;
Expand Down Expand Up @@ -93,7 +95,8 @@ export class CompetencyAccordionComponent implements OnChanges {
.filter((exerciseId) => !submittedExercises.includes(exerciseId))
.flatMap((exerciseId) => this.metrics.exerciseMetrics?.exerciseInformation?.[exerciseId] ?? [])
.filter((exercise) => exercise.startDate.isBefore(dayjs()) && (!exercise.dueDate || exercise.dueDate.isAfter(dayjs())))
.sort((a, b) => (a.dueDate ?? a.startDate).diff(b.dueDate));
.sort((a, b) => (a.dueDate ?? a.startDate).diff(b.dueDate))
.slice(0, 5);

// Workaround to convert ExerciseInformation to Exercise
this.nextExercises = nextExerciseInformations.map(
Expand All @@ -116,7 +119,8 @@ export class CompetencyAccordionComponent implements OnChanges {
.filter((lectureUnitId) => !completedLectureUnits.includes(lectureUnitId))
.flatMap((lectureUnitId) => this.metrics.lectureUnitStudentMetricsDTO?.lectureUnitInformation?.[lectureUnitId] ?? [])
.filter((lectureUnit) => lectureUnit.releaseDate?.isBefore(dayjs()))
.sort((a, b) => (a.releaseDate?.isBefore(b?.releaseDate) ? -1 : 1));
.sort((a, b) => (a.releaseDate?.isBefore(b?.releaseDate) ? -1 : 1))
.slice(0, Math.max(0, 5 - this.nextExercises.length));
}

calculateProgressValues() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
<!-- eslint-disable @angular-eslint/template/eqeqeq -->
<div class="alert alert-info">
<b>
<span jhiTranslate="artemisApp.courseStudentDashboard.judgementOfLearning.title"></span>
</b>
<div class="d-flex gap-1 align-items-center">
<b>
<span jhiTranslate="artemisApp.courseStudentDashboard.judgementOfLearning.title"></span>
</b>
<jhi-help-icon text="artemisApp.courseStudentDashboard.judgementOfLearning.info" />
</div>
<star-rating
checkedColor="var(--yellow)"
uncheckedColor="var(--gray-500)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ import { StarRatingComponent } from 'app/exercises/shared/rating/star-rating/sta
import { ArtemisSharedCommonModule } from 'app/shared/shared-common.module';
import { AlertService } from 'app/core/util/alert.service';
import { CompetencyService } from 'app/course/competencies/competency.service';
import { ArtemisSharedComponentModule } from 'app/shared/components/shared-component.module';

@Component({
selector: 'jhi-judgement-of-learning-rating',
standalone: true,
imports: [RatingModule, ArtemisSharedCommonModule],
imports: [RatingModule, ArtemisSharedCommonModule, ArtemisSharedComponentModule],
templateUrl: './judgement-of-learning-rating.component.html',
})
export class JudgementOfLearningRatingComponent {
Expand Down
Loading

0 comments on commit 933c561

Please sign in to comment.