|
|
@@ -729,10 +729,11 @@ export class LearningPageComponent implements OnInit, OnDestroy {
|
|
|
}
|
|
|
|
|
|
continueAfterStage(): void {
|
|
|
- this.completed.set(false);
|
|
|
if (this.isMatchingPage) {
|
|
|
+ this.completed.set(false);
|
|
|
this.navigateStage('/pages/stu/stu4');
|
|
|
} else if (this.isListeningPage) {
|
|
|
+ this.completed.set(false);
|
|
|
const path = Number(this.session.user()?.groupId) === 3 ? '/pages/stu/pl_stu5' : '/pages/stu/stu5';
|
|
|
this.navigateStage(path);
|
|
|
} else if (this.isSpellingPage) {
|
|
|
@@ -1245,7 +1246,11 @@ export class LearningPageComponent implements OnInit, OnDestroy {
|
|
|
} else if (mode === 'history_word') {
|
|
|
void this.router.navigateByUrl('/pages/his/his');
|
|
|
} else if (this.meta.path === 'pages/stu/pl_stu5') {
|
|
|
- this.createPracticeLearningRecord();
|
|
|
+ if (this.query('orderId')) {
|
|
|
+ this.createPracticeLearningRecord();
|
|
|
+ } else {
|
|
|
+ this.createStandalonePracticeLearningRecord();
|
|
|
+ }
|
|
|
} else {
|
|
|
this.navigateStage('/pages/stu/stu6');
|
|
|
}
|
|
|
@@ -1479,6 +1484,52 @@ export class LearningPageComponent implements OnInit, OnDestroy {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ private createStandalonePracticeLearningRecord(): void {
|
|
|
+ const allWords = this.readAllLearningWords();
|
|
|
+ const user = this.session.user();
|
|
|
+ const student = this.session.student();
|
|
|
+ if (Number(user?.groupId) === 3 && !student?.userId) {
|
|
|
+ this.platform.toast('请先选择学员', 'error');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const owner = Number(user?.groupId) === 3 ? student : user;
|
|
|
+ const xxqs = allWords.map((word) => ({ GeneralID: word.wordId, Title: word.word, check: 0 }));
|
|
|
+ const content: SourceItem = {
|
|
|
+ ModelID: 56,
|
|
|
+ nodeId: 291,
|
|
|
+ inputer: user?.honeyName,
|
|
|
+ status: 99,
|
|
|
+ Hits: xxqs.length,
|
|
|
+ title: owner?.honeyName,
|
|
|
+ };
|
|
|
+ const addon: SourceItem = {
|
|
|
+ con: `完成了${xxqs.length}个单词的学习@${this.dateTime()}`,
|
|
|
+ dqrq: this.compactDate(),
|
|
|
+ pl: Number(user?.groupId) === 3 ? user?.userId : 0,
|
|
|
+ UserID: owner?.userId,
|
|
|
+ learned: xxqs.length,
|
|
|
+ ygg: 0,
|
|
|
+ djq: 0,
|
|
|
+ xxqs: JSON.stringify(xxqs),
|
|
|
+ fxrl: '',
|
|
|
+ };
|
|
|
+ this.submitting.set(true);
|
|
|
+ this.persistWordsAsLearned(allWords, owner).pipe(
|
|
|
+ switchMap(() => this.api.post('content_add_zt', {
|
|
|
+ content: JSON.stringify(content),
|
|
|
+ addon: JSON.stringify(addon),
|
|
|
+ })),
|
|
|
+ finalize(() => this.submitting.set(false)),
|
|
|
+ ).subscribe({
|
|
|
+ next: () => {
|
|
|
+ this.clearLearningStorage();
|
|
|
+ this.platform.toast('学习记录已保存', 'success');
|
|
|
+ void this.router.navigateByUrl('/pages/his/his');
|
|
|
+ },
|
|
|
+ error: (error: ApiError) => this.platform.toast(error.message, 'error'),
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
private loadRecord(): void {
|
|
|
this.api.post<unknown>('e_record_detail', { id: this.query('id') }).pipe(finalize(() => this.loading.set(false))).subscribe({
|
|
|
next: ({ result, addon }) => {
|