Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
JJ_Game_Card
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
template admin
JJ_Game_Card
Commits
b59a9f3d
Commit
b59a9f3d
authored
May 29, 2026
by
david
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/play_audio' into 'master'
fix: 修复自动保存失败的问题 See merge request
!2
parents
4296dab5
ebdc9884
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
7 deletions
+20
-7
form.component.ts
form/src/app/form/form.component.ts
+20
-7
No files found.
form/src/app/form/form.component.ts
View file @
b59a9f3d
...
@@ -186,13 +186,13 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -186,13 +186,13 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
autoFillOption
(
ques
)
{
autoFillOption
(
ques
)
{
if
(
ques
.
optionTypeText
)
{
if
(
ques
.
optionTypeText
||
ques
.
optionTypePic
||
ques
.
optionTypeAudio
)
{
if
(
ques
.
optionCount
<=
0
)
{
if
(
ques
.
optionCount
<=
0
)
{
ques
.
optionCount
=
5
;
//tempList.length;
ques
.
optionCount
=
5
;
//tempList.length;
for
(
let
i
=
0
;
i
<
ques
.
optionCount
;
i
++
)
{
for
(
let
i
=
0
;
i
<
ques
.
optionCount
;
i
++
)
{
if
(
this
.
curBookWords
.
length
>
0
)
{
if
(
this
.
curBookWords
.
length
>
i
)
{
ques
.
optionArr
.
push
({
ques
.
optionArr
.
push
({
text
:
this
.
curBookWords
[
i
].
word
,
text
:
this
.
curBookWords
[
i
].
word
,
wordData
:
this
.
curBookWords
[
i
],
wordData
:
this
.
curBookWords
[
i
],
...
@@ -209,7 +209,8 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -209,7 +209,8 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
}
else
if
(
ques
.
optionArr
.
length
<
ques
.
optionCount
)
{
}
else
if
(
ques
.
optionArr
.
length
<
ques
.
optionCount
)
{
for
(
let
i
=
ques
.
optionArr
.
length
;
i
<
ques
.
optionCount
;
i
++
)
{
for
(
let
i
=
ques
.
optionArr
.
length
;
i
<
ques
.
optionCount
;
i
++
)
{
ques
.
optionArr
.
push
({
ques
.
optionArr
.
push
({
audioAutoPlay
:
true
audioAutoPlay
:
true
,
wordData
:
this
.
getUnusedWord
(
ques
)
});
});
}
}
}
}
...
@@ -236,7 +237,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -236,7 +237,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
// }
// }
// }
// }
//
this.refreshOptionRes(ques);
this
.
refreshOptionRes
(
ques
);
}
}
/**
/**
...
@@ -414,9 +415,16 @@ getUnusedWord(ques: any): any {
...
@@ -414,9 +415,16 @@ getUnusedWord(ques: any): any {
addOneOption
(
ques
)
{
addOneOption
(
ques
)
{
ques
.
optionArr
.
push
({
ques
.
optionArr
.
push
({
audioAutoPlay
:
true
audioAutoPlay
:
true
,
// answer: 'isWrong'
wordData
:
{
word
:
''
,
wordTranslation
:
''
,
wordAudioUrl
:
''
,
imageUrl
:
''
}
});
});
ques
.
optionCount
=
ques
.
optionArr
.
length
;
this
.
refreshOptionRes
(
ques
);
this
.
save
();
this
.
save
();
}
}
...
@@ -442,7 +450,9 @@ getUnusedWord(ques: any): any {
...
@@ -442,7 +450,9 @@ getUnusedWord(ques: any): any {
}
}
refreshQuesRes
(
ques
)
{
refreshQuesRes
(
ques
)
{
return
;
if
(
!
ques
.
wordData
)
{
return
;
}
if
(
ques
.
quesTypeText
)
{
if
(
ques
.
quesTypeText
)
{
if
(
!
ques
.
text
)
{
if
(
!
ques
.
text
)
{
ques
.
text
=
ques
.
wordData
.
exampleSentence
;
ques
.
text
=
ques
.
wordData
.
exampleSentence
;
...
@@ -463,6 +473,9 @@ getUnusedWord(ques: any): any {
...
@@ -463,6 +473,9 @@ getUnusedWord(ques: any): any {
refreshOptionRes
(
ques
)
{
refreshOptionRes
(
ques
)
{
ques
.
optionArr
.
forEach
(
option
=>
{
ques
.
optionArr
.
forEach
(
option
=>
{
if
(
!
option
.
wordData
)
{
return
;
}
if
(
ques
.
optionTypeText
)
{
if
(
ques
.
optionTypeText
)
{
if
(
!
option
.
text
)
{
if
(
!
option
.
text
)
{
option
.
text
=
option
.
wordData
.
word
;
option
.
text
=
option
.
wordData
.
word
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment