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

Integrated code lifecycle: Open repository for editors and instructors during assessment #9898

Merged
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,26 @@
[singleParticipantMode]="true"
[participationIdList]="participation ? [participation!.id!] : []"
/>
@if (!localVCEnabled) {
<a
class="ms-2 me-5"
href="{{ participation?.userIndependentRepositoryUri }}"
target="_blank"
rel="noopener noreferrer"
jhiTranslate="artemisApp.exerciseAssessmentDashboard.programmingExercise.goToRepo"
></a>
@if (isAtLeastEditor) {
@if (!localVCEnabled) {
<a
class="ms-2 me-5"
href="{{ participation?.userIndependentRepositoryUri }}"
target="_blank"
rel="noopener noreferrer"
jhiTranslate="artemisApp.exerciseAssessmentDashboard.programmingExercise.goToRepo"
></a>
} @else {
<a
class="ms-2 me-5"
[routerLink]="localRepositoryLink"
target="_blank"
rel="noopener noreferrer"
jhiTranslate="artemisApp.exerciseAssessmentDashboard.programmingExercise.goToRepo"
>
<fa-icon [icon]="faExternalLink" />
</a>
}
}
</ng-container>
@if (participation) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ import { DiffMatchPatch } from 'diff-match-patch-typescript';
import { ProgrammingExerciseService } from 'app/exercises/programming/manage/services/programming-exercise.service';
import { TemplateProgrammingExerciseParticipation } from 'app/entities/participation/template-programming-exercise-participation.model';
import { getPositiveAndCappedTotalScore, getTotalMaxPoints } from 'app/exercises/shared/exercise/exercise.utils';
import { getExerciseDashboardLink, getLinkToSubmissionAssessment } from 'app/utils/navigation.utils';
import { getExerciseDashboardLink, getLinkToSubmissionAssessment, getLocalRepositoryLink } from 'app/utils/navigation.utils';
import { SubmissionType, getLatestSubmissionResult } from 'app/entities/submission.model';
import { isAllowedToModifyFeedback } from 'app/assessment/assessment.service';
import { breakCircularResultBackReferences } from 'app/exercises/shared/result/result.utils';
import { faTimesCircle } from '@fortawesome/free-solid-svg-icons';
import { faExternalLink, faTimesCircle } from '@fortawesome/free-solid-svg-icons';
import { cloneDeep } from 'lodash-es';
import { AssessmentAfterComplaint } from 'app/complaints/complaints-for-tutor/complaints-for-tutor.component';
import { PROFILE_LOCALVC } from 'app/app.constants';
Expand Down Expand Up @@ -84,10 +84,12 @@ export class CodeEditorTutorAssessmentContainerComponent implements OnInit, OnDe
exerciseId: number;
exerciseGroupId: number;
exerciseDashboardLink: string[];
localRepositoryLink: string[];
loadingInitialSubmission = true;
highlightDifferences = false;

localVCEnabled = false;
isAtLeastEditor = false;

unreferencedFeedback: Feedback[] = [];
referencedFeedback: Feedback[] = [];
Expand All @@ -111,6 +113,7 @@ export class CodeEditorTutorAssessmentContainerComponent implements OnInit, OnDe

// Icons
faTimesCircle = faTimesCircle;
faExternalLink = faExternalLink;

/**
* Get all feedback suggestions without a reference. They will be shown in cards below the build output.
Expand Down Expand Up @@ -187,13 +190,22 @@ export class CodeEditorTutorAssessmentContainerComponent implements OnInit, OnDe
const programmingExercise = response.body!;
this.templateParticipation = programmingExercise.templateParticipation!;
this.exercise.gradingCriteria = programmingExercise.gradingCriteria;
this.isAtLeastEditor = !!this.exercise.isAtLeastEditor;
}),
switchMap(() => {
// Get all files with content from template repository
this.domainService.setDomain([DomainType.PARTICIPATION, this.templateParticipation]);
const observable = this.repositoryFileService.getFilesWithContent();
// Set back to student participation
this.domainService.setDomain([DomainType.PARTICIPATION, this.participation]);
this.localRepositoryLink = getLocalRepositoryLink(
this.courseId,
this.exerciseId,
this.participation.id!,
this.exerciseGroupId,
this.examId,
this.isTestRun,
);
return observable;
}),
tap((templateFilesObj) => {
Expand Down
11 changes: 11 additions & 0 deletions src/main/webapp/app/utils/navigation.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,17 @@ export const getExerciseDashboardLink = (courseId: number, exerciseId: number, e
: ['/course-management', courseId.toString(), 'assessment-dashboard', exerciseId.toString()];
};

export const getLocalRepositoryLink = (courseId: number, exerciseId: number, participationId: number, exerciseGroupId: number = 0, examId = 0, isTestRun = false): string[] => {
if (isTestRun) {
return ['/course-management', courseId.toString(), 'exams', examId.toString(), 'test-runs', 'assess'];
}
const suffix = ['programming-exercises', exerciseId.toString(), 'participations', participationId.toString(), 'repository'];

return examId > 0
? ['/course-management', courseId.toString(), 'exams', examId.toString(), 'exercise-groups', exerciseGroupId.toString(), ...suffix]
: ['/course-management', courseId.toString(), ...suffix];
};

/**
* A generic method which navigates into a subpage of an exam exercise
* @router the router th component uses to navigate into different webpages
Expand Down
Loading