+ warning
+
+ Editing the JSON directly is generally not recommended, as errors can break the unit. If
+ you need assistance, please contact WISE staff.
+
+
+
+ Edit Unit JSON
+
+
+
+
+
diff --git a/src/assets/wise5/authoringTool/advanced/advanced-project-authoring.component.ts b/src/assets/wise5/authoringTool/advanced/advanced-project-authoring.component.ts
index 38c80191052..78f5e47b3b1 100644
--- a/src/assets/wise5/authoringTool/advanced/advanced-project-authoring.component.ts
+++ b/src/assets/wise5/authoringTool/advanced/advanced-project-authoring.component.ts
@@ -2,19 +2,17 @@ import { CdkTextareaAutosize } from '@angular/cdk/text-field';
import { Component } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { MatButtonModule } from '@angular/material/button';
-import { MatDialog } from '@angular/material/dialog';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatIconModule } from '@angular/material/icon';
import { MatInputModule } from '@angular/material/input';
import { MatRadioModule } from '@angular/material/radio';
import { MatTooltipModule } from '@angular/material/tooltip';
-import { filter } from 'rxjs/operators';
import { isValidJSONString } from '../../common/string/string';
import { ConfigService } from '../../services/configService';
import { NotificationService } from '../../services/notificationService';
import { TeacherProjectService } from '../../services/teacherProjectService';
-import { AssetChooser } from '../project-asset-authoring/asset-chooser';
import { RubricAuthoringComponent } from '../rubric/rubric-authoring.component';
+import { MatTabChangeEvent, MatTabsModule } from '@angular/material/tabs';
@Component({
imports: [
@@ -25,78 +23,54 @@ import { RubricAuthoringComponent } from '../rubric/rubric-authoring.component';
MatIconModule,
MatInputModule,
MatRadioModule,
+ MatTabsModule,
MatTooltipModule,
RubricAuthoringComponent
],
- styles: [
- `
- .rubric-div {
- margin-bottom: 20px;
- }
-
- .mat-icon {
- margin: 0px;
- }
- `
- ],
templateUrl: 'advanced-project-authoring.component.html'
})
export class AdvancedProjectAuthoringComponent {
- protected jsonDisplayed: boolean;
- protected navigationType: string = 'default';
- private projectId: number;
+ protected navigationType: 'default' | 'tab';
protected projectJSONString: string;
- protected projectScriptFilename: string;
- protected rubricDisplayed: boolean;
+ protected selectedTab: number;
constructor(
- private dialog: MatDialog,
private configService: ConfigService,
private notificationService: NotificationService,
private projectService: TeacherProjectService
- ) {
- this.projectId = this.configService.getProjectId();
- }
+ ) {}
ngOnInit(): void {
- this.setProjectScriptFilename();
- }
-
- protected toggleRubric(): void {
- this.jsonDisplayed = false;
- this.rubricDisplayed = !this.rubricDisplayed;
+ this.navigationType = this.projectService.project.theme ?? 'default';
+ this.projectJSONString = JSON.stringify(this.projectService.project, null, 4);
}
- protected toggleJSON(): void {
- this.rubricDisplayed = false;
- if (this.jsonDisplayed) {
- this.hideJSON();
- } else {
+ protected tabChanged(event: MatTabChangeEvent): void {
+ if (event.index === 2) {
this.showJSON();
+ } else {
+ this.hideJSON();
}
}
+ private showJSON(): void {
+ this.notificationService.showJSONValidMessage();
+ }
+
private hideJSON(): void {
if (isValidJSONString(this.projectJSONString)) {
- this.jsonDisplayed = false;
this.notificationService.hideJSONValidMessage();
} else if (
confirm(
$localize`The JSON is invalid. Invalid JSON will not be saved.\nClick "OK" to revert back to the last valid JSON.\nClick "Cancel" to keep the invalid JSON open so you can fix it.`
)
) {
- this.jsonDisplayed = false;
this.notificationService.hideJSONValidMessage();
+ this.selectedTab = 2; // re-open JSON tab so user can review JSON
}
}
- private showJSON(): void {
- this.jsonDisplayed = true;
- this.projectJSONString = JSON.stringify(this.projectService.project, null, 4);
- this.notificationService.showJSONValidMessage();
- }
-
- protected autoSaveProjectJSONString(): void {
+ protected saveProjectJSONString(): void {
try {
this.saveProjectJSON(this.projectJSONString);
this.notificationService.showJSONValidMessage();
@@ -108,61 +82,14 @@ export class AdvancedProjectAuthoringComponent {
private saveProjectJSON(projectJSONString: string): void {
const project = JSON.parse(projectJSONString);
this.projectService.setProject(project);
- this.setProjectScriptFilename();
this.projectService.checkPotentialStartNodeIdChangeThenSaveProject();
}
- private setProjectScriptFilename(): void {
- this.projectScriptFilename = this.projectService.getProjectScriptFilename();
- }
-
- protected chooseProjectScriptFile(): void {
- new AssetChooser(this.dialog, null, null, this.projectId)
- .open('scriptFilename')
- .afterClosed()
- .pipe(filter((data) => data != null))
- .subscribe((data: any) => {
- this.assetSelected(data);
- });
- }
-
- private assetSelected({ assetItem }): void {
- this.projectScriptFilename = assetItem.fileName;
- this.projectScriptFilenameChanged();
- }
-
protected downloadProject(): void {
- window.location.href = `${this.configService.getWISEBaseURL()}/api/project/export/${
- this.projectId
- }`;
- }
-
- protected openProjectURLInNewTab(): void {
- window.open(this.getProjectURL(), '_blank');
- }
-
- protected copyProjectURL(): void {
- const textArea = document.createElement('textarea');
- textArea.value = this.getProjectURL();
- document.body.appendChild(textArea);
- textArea.select();
- document.execCommand('copy');
- document.body.removeChild(textArea);
- }
-
- protected getProjectURL(): string {
- return window.location.origin + this.configService.getConfigParam('projectURL');
- }
-
- protected projectScriptFilenameChanged(): void {
- this.projectService.setProjectScriptFilename(this.projectScriptFilename);
- if (this.showJSON) {
- this.projectJSONString = JSON.stringify(this.projectService.project, null, 4);
- }
- this.projectService.saveProject();
+ window.location.href = `/api/project/export/${this.configService.getProjectId()}`;
}
- protected updateNavigationType(): void {
+ protected setNavigationType(): void {
this.projectService.project.theme = this.navigationType;
this.projectService.saveProject();
}
diff --git a/src/assets/wise5/authoringTool/node/add-component-button/add-component-button.component.ts b/src/assets/wise5/authoringTool/node/add-component-button/add-component-button.component.ts
index 92d5e38c067..5af06b7a9d1 100644
--- a/src/assets/wise5/authoringTool/node/add-component-button/add-component-button.component.ts
+++ b/src/assets/wise5/authoringTool/node/add-component-button/add-component-button.component.ts
@@ -16,9 +16,6 @@ import { MatMenuModule } from '@angular/material/menu';
selector: 'add-component-button',
styles: [
`
- .rotate-180 {
- transform: rotate(180deg);
- }
.flip-vertical {
transform: scaleY(-1);
}
diff --git a/src/assets/wise5/authoringTool/node/advanced/node-advanced-authoring/node-advanced-authoring.component.html b/src/assets/wise5/authoringTool/node/advanced/node-advanced-authoring/node-advanced-authoring.component.html
index e579d7c0f8d..2c6ca15e815 100644
--- a/src/assets/wise5/authoringTool/node/advanced/node-advanced-authoring/node-advanced-authoring.component.html
+++ b/src/assets/wise5/authoringTool/node/advanced/node-advanced-authoring/node-advanced-authoring.component.html
@@ -15,44 +15,38 @@
mat-raised-button
color="primary"
routerLink="general"
- matTooltip="General Advanced"
+ matTooltip="General settings"
matTooltipPosition="above"
i18n-matTooltip
>
settings
- }
- @if (!isGroupNode) {
- }
- @if (!isGroupNode) {
- }
- @if (!isGroupNode) {
}
@if (nodeHasConstraint(step.id)) {
diff --git a/src/assets/wise5/authoringTool/project-authoring-step/project-authoring-step.component.scss b/src/assets/wise5/authoringTool/project-authoring-step/project-authoring-step.component.scss
index eda4703f283..08bed91e40f 100644
--- a/src/assets/wise5/authoringTool/project-authoring-step/project-authoring-step.component.scss
+++ b/src/assets/wise5/authoringTool/project-authoring-step/project-authoring-step.component.scss
@@ -26,8 +26,8 @@
}
}
-.rotate-180 {
- transform: rotate(180deg);
+.flip-vertical {
+ transform: scaleY(-1);
}
.tooltip-helper {
diff --git a/src/messages.xlf b/src/messages.xlf
index 039420a4a9d..113a974fdaa 100644
--- a/src/messages.xlf
+++ b/src/messages.xlf
@@ -907,6 +907,10 @@
src/app/authoring-tool/edit-component-json/edit-component-json.component.html2,6
+
+ src/assets/wise5/authoringTool/advanced/advanced-project-authoring.component.html
+ 36,39
+ Show JSON
@@ -914,13 +918,9 @@
src/app/authoring-tool/edit-component-json/edit-component-json.component.html8,12
-
- src/assets/wise5/authoringTool/advanced/advanced-project-authoring.component.html
- 18,21
- src/assets/wise5/authoringTool/node/advanced/node-advanced-authoring/node-advanced-authoring.component.html
- 66,70
+ 60,64
@@ -947,7 +947,7 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.
src/assets/wise5/authoringTool/advanced/advanced-project-authoring.component.ts
- 85
+ 65
@@ -1004,6 +1004,10 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.src/app/authoring-tool/edit-component-rubric/edit-component-rubric.component.html
2,6
+
+ src/assets/wise5/authoringTool/advanced/advanced-project-authoring.component.html
+ 28,31
+ src/assets/wise5/themes/default/themeComponents/helpIcon/help-icon.component.ts35
@@ -10575,71 +10579,61 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.30,34
-
- Show Rubric
-
- src/assets/wise5/authoringTool/advanced/advanced-project-authoring.component.html
- 6,9
-
-
-
- Download Unit
-
- src/assets/wise5/authoringTool/advanced/advanced-project-authoring.component.html
- 29,32
-
-
-
- Edit Unit JSON
+
+ General settingssrc/assets/wise5/authoringTool/advanced/advanced-project-authoring.component.html
- 46,50
+ 4,7
- src/assets/wise5/authoringTool/recovery-authoring/recovery-authoring.component.html
- 65,69
+ src/assets/wise5/authoringTool/node/advanced/node-advanced-authoring/node-advanced-authoring.component.html
+ 18,22Navigation mode:src/assets/wise5/authoringTool/advanced/advanced-project-authoring.component.html
- 58,61
+ 7,9Default (lessons appear in drop-down list and unit plan)src/assets/wise5/authoringTool/advanced/advanced-project-authoring.component.html
- 65,67
+ 14,16Tabbed (lessons appear as tabs) src/assets/wise5/authoringTool/advanced/advanced-project-authoring.component.html
- 68,72
+ 17,21
-
- Unit URL
+
+ Download unitsrc/assets/wise5/authoringTool/advanced/advanced-project-authoring.component.html
- 74,75
+ 23,27
-
- Copy Unit URL to Clipboard
+
+ Editing the JSON directly is generally not recommended, as errors can break the unit. If you need assistance, please contact WISE staff. src/assets/wise5/authoringTool/advanced/advanced-project-authoring.component.html
- 81,84
+ 41,45
-
- Open Unit URL in New Tab
+
+ Edit Unit JSONsrc/assets/wise5/authoringTool/advanced/advanced-project-authoring.component.html
- 92,95
+ 46,49
+
+
+ src/assets/wise5/authoringTool/recovery-authoring/recovery-authoring.component.html
+ 65,69
@@ -12369,14 +12363,14 @@ The branches will be removed but the steps will remain in the unit.
Add activitysrc/assets/wise5/authoringTool/node/add-component-button/add-component-button.component.ts
- 34
+ 31Add activity aftersrc/assets/wise5/authoringTool/node/add-component-button/add-component-button.component.ts
- 51
+ 48
@@ -12407,36 +12401,25 @@ The branches will be removed but the steps will remain in the unit.
15,19
-
- General Advanced
-
- src/assets/wise5/authoringTool/node/advanced/node-advanced-authoring/node-advanced-authoring.component.html
- 18,22
-
-
-
- Edit Step Rubric
+
+ Edit step rubricsrc/assets/wise5/authoringTool/node/advanced/node-advanced-authoring/node-advanced-authoring.component.html
- 31,35
-
-
- src/assets/wise5/authoringTool/node/editRubric/edit-node-rubric.component.ts
- 8,11
+ 29,33
-
- Edit Transitions
+
+ Edit transitionssrc/assets/wise5/authoringTool/node/advanced/node-advanced-authoring/node-advanced-authoring.component.html
- 43,47
+ 39,43
-
- Edit Constraints
+
+ Edit constraintssrc/assets/wise5/authoringTool/node/advanced/node-advanced-authoring/node-advanced-authoring.component.html
- 55,59
+ 49,53
@@ -12678,6 +12661,13 @@ The branches will be removed but the steps will remain in the unit.
5,9
+
+ Edit Step Rubric
+
+ src/assets/wise5/authoringTool/node/editRubric/edit-node-rubric.component.ts
+ 8,11
+
+ This step does not have any activities.