Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
form_upload_folder
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
form_upload_folder
Commits
9b3584a0
Commit
9b3584a0
authored
Jul 02, 2024
by
limingzhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: debug
parent
642da394
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
25 deletions
+31
-25
form.component.ts
form/src/app/form/form.component.ts
+31
-25
No files found.
form/src/app/form/form.component.ts
View file @
9b3584a0
...
@@ -585,19 +585,19 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -585,19 +585,19 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
const
ipa
=
targetRow
[
1
].
replace
(
/"/g
,
''
);
const
ipa
=
targetRow
[
1
].
replace
(
/"/g
,
''
);
const
zh_cn
=
targetRow
[
3
].
replace
(
/"/g
,
''
);
const
zh_cn
=
targetRow
[
3
].
replace
(
/"/g
,
''
);
const
pos
=
targetRow
[
4
].
replace
(
/"/g
,
''
);
const
pos
=
targetRow
[
4
].
replace
(
/"/g
,
''
);
ques
.
word
=
word
;
ques
.
word
=
word
;
ques
.
ipa
=
ipa
;
ques
.
ipa
=
ipa
;
ques
.
zh_cn
=
zh_cn
;
ques
.
zh_cn
=
zh_cn
;
ques
.
pos
=
pos
;
ques
.
pos
=
pos
;
console
.
log
(
"
word:
"
,
word
);
console
.
log
(
"
ipa:
"
,
ipa
);
console
.
log
(
"
zh_cn:
"
,
zh_cn
);
console
.
log
(
"
pos:
"
,
pos
);
console
.
log
(
"
targetRow:
"
,
targetRow
);
console
.
log
(
"
word:
"
,
word
);
console
.
log
(
"
ipa:
"
,
ipa
);
console
.
log
(
"
zh_cn:
"
,
zh_cn
);
console
.
log
(
"
pos:
"
,
pos
);
console
.
log
(
"
targetRow:
"
,
targetRow
);
this
.
refresh
();
this
.
refresh
();
};
};
...
@@ -644,7 +644,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -644,7 +644,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
const
ipa
=
targetRow
[
1
].
replace
(
/"/g
,
''
);
const
ipa
=
targetRow
[
1
].
replace
(
/"/g
,
''
);
const
zh_cn
=
targetRow
[
3
].
replace
(
/"/g
,
''
);
const
zh_cn
=
targetRow
[
3
].
replace
(
/"/g
,
''
);
const
pos
=
targetRow
[
4
].
replace
(
/"/g
,
''
);
const
pos
=
targetRow
[
4
].
replace
(
/"/g
,
''
);
ques
.
word
=
word
.
split
(
''
).
join
(
'
'
);
ques
.
word
=
word
.
split
(
''
).
join
(
'
'
);
...
@@ -657,7 +657,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -657,7 +657,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
// ques.ipa = ipa;
// ques.ipa = ipa;
// ques.zh_cn = zh_cn;
// ques.zh_cn = zh_cn;
// ques.pos = pos;
// ques.pos = pos;
// console.log("word: " , word);
// console.log("word: " , word);
// console.log("ipa: " , ipa);
// console.log("ipa: " , ipa);
// console.log("zh_cn: " , zh_cn);
// console.log("zh_cn: " , zh_cn);
...
@@ -667,7 +667,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -667,7 +667,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
this
.
refresh
();
this
.
refresh
();
};
};
reader
.
readAsText
(
textFile
);
reader
.
readAsText
(
textFile
);
...
@@ -681,18 +681,18 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -681,18 +681,18 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
// 听写
// 听写
this
.
addOnePageBtnClick
(
false
);
var
curQues
=
this
.
item
.
quesArr
[
this
.
item
.
quesArr
.
length
-
1
];
curQues
.
type
=
'
dictation
'
;
this
.
addOnePageBtnClick
(
false
);
curQues
.
title
=
'
Listen. Write down the word on your note book.
'
;
var
curQues
=
this
.
item
.
quesArr
[
this
.
item
.
quesArr
.
length
-
1
];
const
optionArr
=
[];
curQues
.
type
=
'
dictation
'
;
curQues
.
title
=
'
Listen. Write down the word on your note book.
'
;
const
optionArr
=
[];
for
(
let
i
=
0
;
i
<
this
.
wordDataArr
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
this
.
wordDataArr
.
length
;
i
++
)
{
const
textFile
=
this
.
wordDataArr
[
i
].
textFile
;
const
textFile
=
this
.
wordDataArr
[
i
].
textFile
;
const
audioFile
=
this
.
wordDataArr
[
i
].
audioFile
;
const
audioFile
=
this
.
wordDataArr
[
i
].
audioFile
;
...
@@ -712,12 +712,12 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -712,12 +712,12 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
// const ipa = targetRow[1].replace(/"/g, '');
// const ipa = targetRow[1].replace(/"/g, '');
// const zh_cn = targetRow[3].replace(/"/g, '');
// const zh_cn = targetRow[3].replace(/"/g, '');
// const pos = targetRow[4].replace(/"/g, '');
// const pos = targetRow[4].replace(/"/g, '');
option
[
'
text
'
]
=
word
;
option
[
'
text
'
]
=
word
;
};
};
reader
.
readAsText
(
textFile
);
reader
.
readAsText
(
textFile
);
optionArr
.
push
(
option
);
optionArr
.
push
(
option
);
}
}
...
@@ -761,7 +761,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -761,7 +761,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
if
(
_rightData
)
{
if
(
_rightData
)
{
option
=
_rightData
;
option
=
_rightData
;
}
else
{
}
else
{
const
randomIndex
=
Math
.
floor
(
Math
.
random
()
*
copyData
.
length
);
const
randomIndex
=
Math
.
floor
(
Math
.
random
()
*
copyData
.
length
);
option
=
copyData
[
randomIndex
];
option
=
copyData
[
randomIndex
];
copyData
.
splice
(
randomIndex
,
1
);
copyData
.
splice
(
randomIndex
,
1
);
}
}
...
@@ -782,19 +782,25 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -782,19 +782,25 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
const
zh_cn
=
targetRow
[
3
].
replace
(
/"/g
,
''
);
const
zh_cn
=
targetRow
[
3
].
replace
(
/"/g
,
''
);
const
pos
=
targetRow
[
4
].
replace
(
/"/g
,
''
);
const
pos
=
targetRow
[
4
].
replace
(
/"/g
,
''
);
const
oneOption
=
{
const
oneOption
=
{
text
:
quesData
.
selectType
==
'
en
'
?
zh_cn
:
word
,
text
:
quesData
.
selectType
==
'
en
'
?
zh_cn
:
word
,
answer
:
_rightData
?
'
isRight
'
:
'
isWrong
'
answer
:
_rightData
?
'
isRight
'
:
'
isWrong
'
};
};
if
(
quesData
.
selectType
!=
'
en
'
)
{
if
(
quesData
.
selectType
!=
'
en
'
)
{
oneOption
[
'
audio_url
'
]
=
audioFile
?.
response
?.
url
||
''
;
oneOption
[
'
audio_url
'
]
=
audioFile
?.
response
?.
url
||
''
;
}
}
optionArr
.
push
(
optionArr
.
push
(
oneOption
oneOption
)
)
for
(
let
i
=
optionArr
.
length
-
1
;
i
>
0
;
i
--
)
{
const
j
=
Math
.
floor
(
Math
.
random
()
*
(
i
+
1
));
[
optionArr
[
i
],
optionArr
[
j
]]
=
[
optionArr
[
j
],
optionArr
[
i
]];
// 使用ES6的解构赋值进行交换
}
this
.
refresh
();
this
.
refresh
();
};
};
...
@@ -817,7 +823,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -817,7 +823,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
}
}
...
...
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