The following fields contain the assignment token, a secret key that can be used to access and grade all submissions.
diff --git a/frontend/src/app/assignment/modules/assignment/share/share.component.ts b/frontend/src/app/assignment/modules/assignment/share/share.component.ts
index e7c17d7f4..756e1b5c3 100644
--- a/frontend/src/app/assignment/modules/assignment/share/share.component.ts
+++ b/frontend/src/app/assignment/modules/assignment/share/share.component.ts
@@ -1,14 +1,9 @@
import {DOCUMENT} from '@angular/common';
import {Component, Inject, OnInit} from '@angular/core';
import {ActivatedRoute} from '@angular/router';
-import {switchMap, tap} from 'rxjs/operators';
+import {switchMap} from 'rxjs/operators';
import {AssignmentService} from '../../../services/assignment.service';
import Assignment, {ReadAssignmentDto} from "../../../model/assignment";
-import {MemberService} from "../member.service";
-import {Member} from "../../../../user/member";
-import {User} from "../../../../user/user";
-import {forkJoin} from "rxjs";
-import {UserService} from "../../../../user/user.service";
@Component({
selector: 'app-assignment-share',
@@ -17,16 +12,11 @@ import {UserService} from "../../../../user/user.service";
})
export class ShareComponent implements OnInit {
assignment?: Assignment | ReadAssignmentDto;
- members: Member[];
-
- newMember?: User;
readonly origin: string;
constructor(
private assignmentService: AssignmentService,
- private memberService: MemberService,
- private userService: UserService,
private route: ActivatedRoute,
@Inject(DOCUMENT) document: Document,
) {
@@ -39,14 +29,6 @@ export class ShareComponent implements OnInit {
).subscribe(assignment => {
this.assignment = assignment;
});
-
- this.route.params.pipe(
- switchMap(({aid}) => this.memberService.findAll(aid)),
- tap(members => this.members = members),
- switchMap(members => forkJoin(members.map(member => this.userService.findOne(member.user).pipe(
- tap(user => member._user = user),
- )))),
- ).subscribe();
}
regenerateToken() {
@@ -59,20 +41,5 @@ export class ShareComponent implements OnInit {
});
}
- addMember() {
- this.memberService.update({
- parent: this.assignment!._id,
- user: this.newMember!.id!,
- _user: this.newMember!,
- }).subscribe(member => {
- this.members.push(member);
- this.newMember = undefined;
- });
- }
-
- deleteMember(member: Member) {
- this.memberService.delete(member).subscribe(() => {
- this.members.splice(this.members.indexOf(member), 1);
- });
- }
+ protected readonly switchMap = switchMap;
}
diff --git a/frontend/src/app/assignment/modules/course/share/share.component.html b/frontend/src/app/assignment/modules/course/share/share.component.html
index 7eb4aec03..e5ad5ad8e 100644
--- a/frontend/src/app/assignment/modules/course/share/share.component.html
+++ b/frontend/src/app/assignment/modules/course/share/share.component.html
@@ -2,12 +2,14 @@
Student Link
-
- You can now give your students the following link:
-
-
+
+
+ Share this link with your students. They will be able to submit solutions for this course.
+
+
+
diff --git a/frontend/src/app/assignment/modules/course/share/share.component.ts b/frontend/src/app/assignment/modules/course/share/share.component.ts
index 4f98aa85b..a65200498 100644
--- a/frontend/src/app/assignment/modules/course/share/share.component.ts
+++ b/frontend/src/app/assignment/modules/course/share/share.component.ts
@@ -1,19 +1,31 @@
import {DOCUMENT} from '@angular/common';
-import {Component, Inject} from '@angular/core';
+import {Component, Inject, OnInit} from '@angular/core';
import {ActivatedRoute} from '@angular/router';
+import {CourseService} from "../../../services/course.service";
+import {switchMap} from "rxjs/operators";
+import Course from "../../../model/course";
@Component({
selector: 'app-assignment-share',
templateUrl: './share.component.html',
styleUrls: ['./share.component.scss'],
})
-export class ShareComponent {
+export class ShareComponent implements OnInit {
+ course?: Course;
+
readonly origin: string;
constructor(
- public readonly route: ActivatedRoute,
+ private courseService: CourseService,
+ private route: ActivatedRoute,
@Inject(DOCUMENT) document: Document,
) {
this.origin = document.location.origin;
}
+
+ ngOnInit() {
+ this.route.params.pipe(
+ switchMap(({cid}) => this.courseService.get(cid)),
+ ).subscribe(course => this.course = course);
+ }
}
diff --git a/frontend/src/app/assignment/modules/shared/edit-member-list/edit-member-list.component.html b/frontend/src/app/assignment/modules/shared/edit-member-list/edit-member-list.component.html
new file mode 100644
index 000000000..6e12de77c
--- /dev/null
+++ b/frontend/src/app/assignment/modules/shared/edit-member-list/edit-member-list.component.html
@@ -0,0 +1,13 @@
+