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: Fix translation issue for participation modes in exam management #9293

Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -84,14 +84,19 @@
@if (displayEditorModus) {
<div>
<div class="d-flex justify-content-between">
<span jhiTranslate="'artemisApp.programmingExercise.offlineIde'">: {{ programmingExercise.allowOfflineIde || false }}</span>
<span [jhiTranslate]="'artemisApp.programmingExercise.offlineIde'"></span>:
<span [jhiTranslate]="programmingExercise.allowOfflineIde ? 'artemisApp.exercise.yes' : 'artemisApp.exercise.no'"></span>
iyannsch marked this conversation as resolved.
Show resolved Hide resolved
</div>
<div class="d-flex justify-content-between">
<span jhiTranslate="'artemisApp.programmingExercise.onlineEditor'">: {{ programmingExercise.allowOnlineEditor || false }}</span>
</div>
<div class="d-flex justify-content-between">
<span jhiTranslate="'artemisApp.programmingExercise.onlineIde'">: {{ programmingExercise.allowOnlineIde || false }}</span>
<span [jhiTranslate]="'artemisApp.programmingExercise.onlineEditor'"></span>:
<span [jhiTranslate]="programmingExercise.allowOnlineEditor ? 'artemisApp.exercise.yes' : 'artemisApp.exercise.no'"></span>
</div>
@if (onlineIdeEnabled) {
<div class="d-flex justify-content-between">
<span [jhiTranslate]="'artemisApp.programmingExercise.onlineIde'"></span>:
<span [jhiTranslate]="programmingExercise.allowOnlineIde ? 'artemisApp.exercise.yes' : 'artemisApp.exercise.no'"></span>
</div>
}
</div>
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { ProgrammingExerciseInstructorRepositoryType, ProgrammingExerciseService
import { downloadZipFileFromResponse } from 'app/shared/util/download.util';
import { AlertService } from 'app/core/util/alert.service';
import { faDownload } from '@fortawesome/free-solid-svg-icons';
import { PROFILE_LOCALVC } from 'app/app.constants';
import { PROFILE_LOCALVC, PROFILE_THEIA } from 'app/app.constants';

@Component({
selector: 'jhi-programming-exercise-group-cell',
Expand All @@ -22,6 +22,7 @@ export class ProgrammingExerciseGroupCellComponent implements OnInit {
programmingExercise: ProgrammingExercise;

localVCEnabled = false;
onlineIdeEnabled = false;

@Input()
displayShortName = false;
Expand All @@ -48,6 +49,7 @@ export class ProgrammingExerciseGroupCellComponent implements OnInit {
ngOnInit(): void {
this.profileService.getProfileInfo().subscribe((profileInfo) => {
this.localVCEnabled = profileInfo.activeProfiles.includes(PROFILE_LOCALVC);
this.onlineIdeEnabled = profileInfo.activeProfiles.includes(PROFILE_THEIA);
iyannsch marked this conversation as resolved.
Show resolved Hide resolved
if (this.programmingExercise.projectKey) {
if (this.programmingExercise.solutionParticipation?.buildPlanId) {
this.programmingExercise.solutionParticipation!.buildPlanUrl = createBuildPlanUrl(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,12 @@
<span [jhiTranslate]="'artemisApp.programmingExercise.onlineEditor'"></span>:
<span [jhiTranslate]="programmingExercise.allowOnlineEditor ? 'artemisApp.exercise.yes' : 'artemisApp.exercise.no'"></span>
</div>
<div class="d-flex justify-content-between">
<span [jhiTranslate]="'artemisApp.programmingExercise.onlineIde'"></span>:
<span [jhiTranslate]="programmingExercise.allowOnlineIde ? 'artemisApp.exercise.yes' : 'artemisApp.exercise.no'"></span>
</div>
@if (onlineIdeEnabled) {
<div class="d-flex justify-content-between">
<span [jhiTranslate]="'artemisApp.programmingExercise.onlineIde'"></span>:
<span [jhiTranslate]="programmingExercise.allowOnlineIde ? 'artemisApp.exercise.yes' : 'artemisApp.exercise.no'"></span>
</div>
}
</td>
@if (course.presentationScore !== 0) {
<td class="d-md-table-cell">{{ programmingExercise.presentationScoreEnabled }}</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import {
} from '@fortawesome/free-solid-svg-icons';
import { CourseExerciseService } from 'app/exercises/shared/course-exercises/course-exercise.service';
import { downloadZipFileFromResponse } from 'app/shared/util/download.util';
import { PROFILE_LOCALCI, PROFILE_LOCALVC } from 'app/app.constants';
import { PROFILE_LOCALCI, PROFILE_LOCALVC, PROFILE_THEIA } from 'app/app.constants';

@Component({
selector: 'jhi-programming-exercise',
Expand All @@ -55,6 +55,7 @@ export class ProgrammingExerciseComponent extends ExerciseComponent implements O
// Used to make the repository links download the repositories instead of linking to GitLab.
localVCEnabled = false;
localCIEnabled = false;
onlineIdeEnabled = false;

// extension points, see shared/extension-point
@ContentChild('overrideRepositoryAndBuildPlan') overrideRepositoryAndBuildPlan: TemplateRef<any>;
Expand Down Expand Up @@ -111,6 +112,7 @@ export class ProgrammingExerciseComponent extends ExerciseComponent implements O
this.buildPlanLinkTemplate = profileInfo.buildPlanURLTemplate;
this.localVCEnabled = profileInfo.activeProfiles.includes(PROFILE_LOCALVC);
this.localCIEnabled = profileInfo.activeProfiles.includes(PROFILE_LOCALCI);
this.onlineIdeEnabled = profileInfo.activeProfiles.includes(PROFILE_THEIA);
iyannsch marked this conversation as resolved.
Show resolved Hide resolved
});
// reconnect exercise with course
this.programmingExercises.forEach((exercise) => {
Expand Down
Loading