-
- {{ project.metadata.title }} (Unit ID: {{ project.id }})
-
- 1. Choose Periods
-
-
-
- {{ control.controls.name.value }}
+
+ Use with Class
+
-
-
- Add your own periods
-
- For "Period 9", just enter the number 9. Separate periods with commas (e.g. "Section 1,
- Section 2"). Manually named periods should be no more than 16 characters long.
-
-
-
-
-
- Randomly assign students to periods
-
2. Choose Students Per Team
@@ -36,40 +36,20 @@ 2. Choose Students Per Team
3. Set Schedule
-
+
Start date
-
+
Start date is required
-
+
End date
-
+
@@ -101,6 +81,7 @@ 3. Set Schedule
+ Run Created.
Success! This unit has been added to your Class Schedule.
@@ -115,18 +96,40 @@
3. Set Schedule
You can always find the Access Code for each classroom unit in your Class Schedule.
+
+
+
+
+ Link to a CK Board Project
+ Connected to CK Board Project
+
+
+ Click to connect to a CK Board Project
+ Code: {{linkedCkProjectControl.value}}
+
+
+
+
+ SCORE-CK Connect Code
+
+
+
+
+
+
Note: You can always manage CK Board Project linkining in Run Settings.
+
+
-
-
+
\ No newline at end of file
diff --git a/src/app/teacher/create-run-dialog/create-run-dialog.component.ts b/src/app/teacher/create-run-dialog/create-run-dialog.component.ts
index 7f1e42167c3..3e2584444c3 100644
--- a/src/app/teacher/create-run-dialog/create-run-dialog.component.ts
+++ b/src/app/teacher/create-run-dialog/create-run-dialog.component.ts
@@ -1,4 +1,4 @@
-import { Component, Inject } from '@angular/core';
+import { Component, ElementRef, Inject, ViewChild } from '@angular/core';
import { MatDialogRef, MAT_DIALOG_DATA, MatDialog } from '@angular/material/dialog';
import { FormArray, FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { finalize } from 'rxjs/operators';
@@ -9,6 +9,8 @@ import { ConfigService } from '../../services/config.service';
import { ListClassroomCoursesDialogComponent } from '../list-classroom-courses-dialog/list-classroom-courses-dialog.component';
import { TeacherRun } from '../teacher-run';
import { Router } from '@angular/router';
+import { MatSnackBar } from '@angular/material/snack-bar';
+import { MatExpansionPanel } from '@angular/material/expansion';
@Component({
selector: 'create-run-dialog',
@@ -28,6 +30,10 @@ export class CreateRunDialogComponent {
isCreating: boolean = false;
isCreated: boolean = false;
run: TeacherRun = null;
+ linkedCkProjectControl: FormControl;
+ @ViewChild('CkCodeInput') ckInput: ElementRef;
+ @ViewChild('linkRunPanel') linkPanel: MatExpansionPanel;
+ showProcessingLink: boolean = false;
constructor(
private configService: ConfigService,
@@ -37,7 +43,8 @@ export class CreateRunDialogComponent {
private fb: FormBuilder,
private router: Router,
private teacherService: TeacherService,
- private userService: UserService
+ private userService: UserService,
+ private snackBar: MatSnackBar
) {
this.project = data.project;
this.maxStudentsPerTeam = 3;
@@ -66,6 +73,7 @@ export class CreateRunDialogComponent {
this.endDateControl.valueChanges.subscribe((v) => {
this.updateLockedAfterEndDateCheckbox();
});
+ this.linkedCkProjectControl = new FormControl('');
this.form = this.fb.group({
selectedPeriods: this.periodsGroup,
customPeriods: this.customPeriods,
@@ -102,6 +110,51 @@ export class CreateRunDialogComponent {
return selectedPeriods.length ? selectedPeriods : [];
}
+ openLinkRunToCkProjectPanel() {
+ if (!this.linkedCkProjectControl.disabled) {
+ setTimeout(() => this.ckInput.nativeElement.focus(), 200);
+ }
+ }
+
+ linkRunToCkProject() {
+ this.showProcessingLink = true;
+ this.linkedCkProjectControl.disable();
+ this.teacherService
+ .linkRunToCkProject(this.run.id, this.linkedCkProjectControl.value)
+ .pipe(
+ finalize(() => {
+ this.showProcessingLink = false;
+ })
+ )
+ .subscribe(({ code, message }) => {
+ if (!!code) {
+ setTimeout(() => this.linkPanel.close(), 200);
+ } else {
+ this.linkedCkProjectControl.enable();
+ this.ckInput.nativeElement.focus();
+ }
+ this.snackBar.open($localize`${message}`);
+ });
+ }
+
+ unlinkRunFromCkProject() {
+ this.showProcessingLink = true;
+ this.teacherService
+ .unlinkRunFromCkProject(this.run.id, this.linkedCkProjectControl.value)
+ .pipe(
+ finalize(() => {
+ this.showProcessingLink = false;
+ })
+ )
+ .subscribe(({ code, message }) => {
+ if (!!code) {
+ this.linkedCkProjectControl.enable();
+ this.ckInput.nativeElement.focus();
+ }
+ this.snackBar.open($localize`${message}`);
+ });
+ }
+
create() {
this.isCreating = true;
const combinedPeriods = this.getPeriodsString();
diff --git a/src/app/teacher/run-settings-dialog/run-settings-dialog.component.html b/src/app/teacher/run-settings-dialog/run-settings-dialog.component.html
index 9fe6a290979..a3e2e748310 100644
--- a/src/app/teacher/run-settings-dialog/run-settings-dialog.component.html
+++ b/src/app/teacher/run-settings-dialog/run-settings-dialog.component.html
@@ -121,6 +121,23 @@
>
+
+
+ CK Board Project Linking
+
+
+
+ SCORE-CK Connect Code
+
+
+ add_circle
+
+
+ close
+
+
+
+