Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
JM_MATH01
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
JM_MATH01
Commits
39b5d7dd
Commit
39b5d7dd
authored
Nov 20, 2021
by
limingzhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 填空功能提交
parent
1ba521e9
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
234 additions
and
79 deletions
+234
-79
form.component.html
src/app/form/form.component.html
+13
-13
form.component.ts
src/app/form/form.component.ts
+21
-0
Unit.ts
src/app/play/Unit.ts
+3
-0
play.component.ts
src/app/play/play.component.ts
+197
-66
No files found.
src/app/form/form.component.html
View file @
39b5d7dd
...
@@ -156,8 +156,8 @@
...
@@ -156,8 +156,8 @@
<span
style=
"margin-right: 5px;"
>
选择题问题:
</span>
<span
style=
"margin-right: 5px;"
>
选择题问题:
</span>
<app-upload-image-with-preview
<app-upload-image-with-preview
[
picUrl
]="
item
.
choice_ques_pic_url
"
[
picUrl
]="
item
.
choice_
obj
.
ques_pic_url
"
(
imageUploaded
)="
onImageUploadSuccess
($
event
,
'
choice_ques_pic_url
'
)"
>
(
imageUploaded
)="
onImageUploadSuccess
($
event
,
'
ques_pic_url
',
item
.
choice_obj
)"
>
</app-upload-image-with-preview>
</app-upload-image-with-preview>
</div>
</div>
...
@@ -167,21 +167,21 @@
...
@@ -167,21 +167,21 @@
<span
style=
"margin-right: 5px; margin-left: 15px;"
>
选择小标题:
</span>
<span
style=
"margin-right: 5px; margin-left: 15px;"
>
选择小标题:
</span>
<app-audio-recorder
<app-audio-recorder
[
audioUrl
]="
item
.
choice_title_audio_url
"
[
audioUrl
]="
item
.
choice_
obj
.
title_audio_url
"
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
'
choice_title_audio_url
'
)"
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
'
title_audio_url
',
item
.
choice_obj
)"
></app-audio-recorder>
></app-audio-recorder>
</div>
</div>
<app-upload-image-with-preview
<app-upload-image-with-preview
[
picUrl
]="
item
.
choice_title_pic_url
"
[
picUrl
]="
item
.
choice_
obj
.
title_pic_url
"
(
imageUploaded
)="
onImageUploadSuccess
($
event
,
'
choice_title_pic_url
'
)"
>
(
imageUploaded
)="
onImageUploadSuccess
($
event
,
'
title_pic_url
',
item
.
choice_obj
)"
>
</app-upload-image-with-preview>
</app-upload-image-with-preview>
</div>
</div>
</div>
</div>
<div
*
ngFor=
"let op of item.optionArr"
style=
"border: 1px solid #ccc; margin: 10px; padding: 10px; border-radius: 5px;"
>
<div
*
ngFor=
"let op of item.
choice_obj.
optionArr"
style=
"border: 1px solid #ccc; margin: 10px; padding: 10px; border-radius: 5px;"
>
<div
style=
"margin-top: 20px; display: flex; align-items: center; width: 500px;"
>
<div
style=
"margin-top: 20px; display: flex; align-items: center; width: 500px;"
>
<span
style=
"margin-right: 5px;"
>
{{op.id}}:
</span>
<span
style=
"margin-right: 5px;"
>
{{op.id}}:
</span>
<div
style=
"width: 300px;"
>
<div
style=
"width: 300px;"
>
...
@@ -211,8 +211,8 @@
...
@@ -211,8 +211,8 @@
<span
style=
"margin-right: 5px;"
>
新简答问题:
</span>
<span
style=
"margin-right: 5px;"
>
新简答问题:
</span>
<app-upload-image-with-preview
<app-upload-image-with-preview
[
picUrl
]="
item
.
answer_ques_pic_url
"
[
picUrl
]="
item
.
answer_
obj
.
ques_pic_url
"
(
imageUploaded
)="
onImageUploadSuccess
($
event
,
'
answer_ques_pic_url
'
)"
>
(
imageUploaded
)="
onImageUploadSuccess
($
event
,
'
ques_pic_url
',
item
.
answer_obj
)"
>
</app-upload-image-with-preview>
</app-upload-image-with-preview>
</div>
</div>
...
@@ -222,14 +222,14 @@
...
@@ -222,14 +222,14 @@
<span
style=
"margin-right: 5px; margin-left: 15px;"
>
新简答小标题:
</span>
<span
style=
"margin-right: 5px; margin-left: 15px;"
>
新简答小标题:
</span>
<app-audio-recorder
<app-audio-recorder
[
audioUrl
]="
item
.
answer_title_audio_url
"
[
audioUrl
]="
item
.
answer_
obj
.
title_audio_url
"
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
'
answer_title_audio_url
'
)"
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
'
title_audio_url
',
item
.
answer_obj
)"
></app-audio-recorder>
></app-audio-recorder>
</div>
</div>
<app-upload-image-with-preview
<app-upload-image-with-preview
[
picUrl
]="
item
.
answer_title_pic_url
"
[
picUrl
]="
item
.
answer_
obj
.
title_pic_url
"
(
imageUploaded
)="
onImageUploadSuccess
($
event
,
'
answer_title_pic_url
'
)"
>
(
imageUploaded
)="
onImageUploadSuccess
($
event
,
'
title_pic_url
',
item
.
answer_obj
)"
>
</app-upload-image-with-preview>
</app-upload-image-with-preview>
</div>
</div>
...
...
src/app/form/form.component.ts
View file @
39b5d7dd
...
@@ -106,9 +106,30 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -106,9 +106,30 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
];
];
}
}
if
(
!
this
.
item
.
answer_obj
)
{
this
.
item
.
answer_obj
=
{};
}
if
(
!
this
.
item
.
choice_obj
)
{
this
.
item
.
choice_obj
=
{};
this
.
item
.
choice_obj
.
optionArr
=
[
{
id
:
'
A
'
,
optionArr
:
[{
id
:
'
A
'
},
{
id
:
'
B
'
}]},
{
id
:
'
B
'
,
optionArr
:
[{
id
:
'
A
'
},
{
id
:
'
B
'
}]},
{
id
:
'
C
'
,
optionArr
:
[{
id
:
'
A
'
},
{
id
:
'
B
'
}]},
{
id
:
'
D
'
,
optionArr
:
[{
id
:
'
A
'
},
{
id
:
'
B
'
}]},
];
}
if
(
!
this
.
item
.
ques_type
)
{
if
(
!
this
.
item
.
ques_type
)
{
this
.
item
.
ques_type
=
'
single_choice
'
this
.
item
.
ques_type
=
'
single_choice
'
}
}
}
}
addSubTemplate
()
{
addSubTemplate
()
{
...
...
src/app/play/Unit.ts
View file @
39b5d7dd
...
@@ -1719,6 +1719,9 @@ export function getAngleByPos(px, py, mx, my) {
...
@@ -1719,6 +1719,9 @@ export function getAngleByPos(px, py, mx, my) {
export
function
removeItemFromArr
(
arr
,
item
)
{
export
function
removeItemFromArr
(
arr
,
item
)
{
if
(
!
arr
||
!
item
)
{
return
;
}
const
index
=
arr
.
indexOf
(
item
);
const
index
=
arr
.
indexOf
(
item
);
if
(
index
!==
-
1
)
{
if
(
index
!==
-
1
)
{
arr
.
splice
(
index
,
1
);
arr
.
splice
(
index
,
1
);
...
...
src/app/play/play.component.ts
View file @
39b5d7dd
This diff is collapsed.
Click to expand it.
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