Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dg10_ty
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
dg10_ty
Commits
b5a53f3b
Commit
b5a53f3b
authored
Sep 30, 2022
by
Tt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
数据调整
parent
2b0a6994
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
106 additions
and
133 deletions
+106
-133
defaultData.ts
assets/dg08_hx/script/defaultData.ts
+20
-28
form.component.html
form/src/app/form/form.component.html
+63
-73
form.component.ts
form/src/app/form/form.component.ts
+23
-32
No files found.
assets/dg08_hx/script/defaultData.ts
View file @
b5a53f3b
export
const
defaultData
=
{
export
const
defaultData
=
{
"
title
"
:
"
捕捞海星
"
,
"
title
"
:
"
听音选择
"
,
"
questions
"
:
[
"
questions
"
:
[
{
{
"
audio
"
:
"
http://staging-teach.cdn.ireadabc.com/7934cdcec68eabe639020bad5420d7f8_l.mp3
"
,
"
audio
"
:
"
http://staging-teach.cdn.ireadabc.com/c14938125a52096dc0be9fbbf6638cb2_l.mp3
"
,
"
text
"
:
"
text
"
,
"
time
"
:
null
,
"
time
"
:
null
,
"
duration
"
:
20
,
"
duration
"
:
""
,
"
audioName
"
:
"
complete.mp3
"
"
audioName
"
:
"
进入下一题.mp3
"
,
},
"
options
"
:
[
{
"
audio
"
:
"
http://staging-teach.cdn.ireadabc.com/5f4e4c72671607bb35d1ecd1d291f238_l.mp3
"
,
"
text
"
:
"
test
"
,
"
time
"
:
null
,
"
duration
"
:
15
,
"
audioName
"
:
"
excellent.mp3
"
},
{
{
"
audio
"
:
"
http://staging-teach.cdn.ireadabc.com/fd75d456ec85f8c90ffd03f1d9d8d10f_l.mp3
"
,
"
type
"
:
"
text
"
,
"
text
"
:
"
apple
"
,
"
audio
"
:
"
"
,
"
time
"
:
null
,
"
image
"
:
""
,
"
duration
"
:
20
,
"
word
"
:
""
,
"
audioName
"
:
"
try again.mp3
"
"
text
"
:
"
apple
"
},
},
{
{
"
audio
"
:
"
http://staging-teach.cdn.ireadabc.com/a053d5915bc3b6f0ec8a42912891c538_l.mp3
"
,
"
type
"
:
"
text
"
,
"
text
"
:
"
add
"
,
"
audio
"
:
"
"
,
"
time
"
:
null
,
"
image
"
:
""
,
"
duration
"
:
10
,
"
word
"
:
""
,
"
audioName
"
:
"
jiasu.mp3
"
"
text
"
:
"
banner
"
}
},
{
"
type
"
:
"
text
"
,
"
audio
"
:
""
,
"
image
"
:
""
,
"
word
"
:
""
,
"
text
"
:
"
pie
"
},
{
"
type
"
:
"
text
"
,
"
audio
"
:
""
,
"
image
"
:
""
,
"
word
"
:
""
,
"
text
"
:
"
test
"
}]
]
},
{
"
audio
"
:
"
http://staging-teach.cdn.ireadabc.com/c14938125a52096dc0be9fbbf6638cb2_l.mp3
"
,
"
time
"
:
null
,
"
duration
"
:
""
,
"
audioName
"
:
"
进入下一题.mp3
"
,
"
options
"
:
[{
"
type
"
:
"
img
"
,
"
audio
"
:
""
,
"
image
"
:
"
http://staging-teach.cdn.ireadabc.com/07c89b4a6a1a18b0c0a3029720fdfdbc.png
"
,
"
word
"
:
""
},
{
"
type
"
:
"
img
"
,
"
audio
"
:
""
,
"
image
"
:
"
http://staging-teach.cdn.ireadabc.com/d20b34eac11f5687d3386389aea170a2.png
"
,
"
word
"
:
""
},
{
"
type
"
:
"
img
"
,
"
audio
"
:
""
,
"
image
"
:
"
http://staging-teach.cdn.ireadabc.com/639ada88f3e52966103caca156f720d6.png
"
,
"
word
"
:
""
},
{
"
type
"
:
"
img
"
,
"
audio
"
:
""
,
"
image
"
:
"
http://staging-teach.cdn.ireadabc.com/38408b9ce048508830086c5e5cd2f384.png
"
,
"
word
"
:
""
}]
}
]
}
}
\ No newline at end of file
form/src/app/form/form.component.html
View file @
b5a53f3b
...
@@ -76,27 +76,8 @@
...
@@ -76,27 +76,8 @@
<div
style=
"padding: 10px;background-color: #fff;"
>
<div
style=
"padding: 10px;background-color: #fff;"
>
<!-- 标题区 -->
<!-- 标题区 -->
<div
class=
"border-dashed"
style=
"margin: 20px;width: 1000px;"
>
<div
class=
"border-dashed"
style=
"margin: 20px;width: 1000px;"
>
<!-- <span style="font-size: 20px;">选项分数: </span>
<input type="text" nz-input [(ngModel)]="item.score" (blur)="save()"> -->
<span
style=
"font-size: 20px;"
>
标题文字:
</span>
<span
style=
"font-size: 20px;"
>
标题文字:
</span>
<input
type=
"text"
nz-input
[(
ngModel
)]="
item
.
title
"
(
blur
)="
save
()"
>
<input
type=
"text"
nz-input
[(
ngModel
)]="
item
.
title
"
(
blur
)="
save
()"
>
<!-- <span style="font-size: 20px;">标题图片: </span>
<div style="width:300px">
<app-upload-image-with-preview [picUrl]="item.image"
(imageUploaded)="onImageUploadSuccess($event,'image', item.top)"></app-upload-image-with-preview>
</div> -->
<!-- <span style="font-size: 20px;">题目说明: </span>
<input type="text" nz-input [(ngModel)]="item.questionText" (blur)="save()">
<span style="font-size: 20px;">标题音频: </span>
<div style="display:flex ;">
<div>
<app-audio-recorder [audioUrl]="item.questionTextAudio"
(audioUploaded)="onAudioUploadSuccess($event, 'questionTextAudio',item,'audioName')"></app-audio-recorder>
</div>
<div style="margin: 5px">
<span>{{ item.audioName}}</span>
</div>
</div> -->
</div>
</div>
</div>
</div>
<!-- 题目区 -->
<!-- 题目区 -->
...
@@ -107,29 +88,6 @@
...
@@ -107,29 +88,6 @@
<div
class=
"word-type-title"
>
<div
class=
"word-type-title"
>
题目{{i+1}}
题目{{i+1}}
</div>
</div>
<!-- <div style="margin-top: 20px;">
<div class="word-type-option-title">
选项类型:
</div>
<div style="margin-top: 5px;">
<nz-radio-group [(ngModel)]="question.type" (ngModelChange)="ngChange()">
<label nz-radio nzValue="img">
<span [style]="{color:question.type=='img' ? '#169BD5':'#000'}">图片</span>
</label>
<label nz-radio nzValue="txt">
<span [style]="{color:question.type=='txt' ? '#169BD5':'#000'}">文字</span>
</label>
</nz-radio-group>
</div>
</div> -->
<!-- <div *ngIf="question.type=='img'">
<span style="font-size: 20px;">标题图片: </span>
<div style="width:300px">
<app-upload-image-with-preview [picUrl]="question.image"
(imageUploaded)="onImageUploadSuccess($event,'image',question)"></app-upload-image-with-preview>
</div>
</div> -->
<div
class=
"option-audio"
>
<div
class=
"option-audio"
>
<div
class=
"word-input-title"
>
<div
class=
"word-input-title"
>
题目音频:
题目音频:
...
@@ -147,36 +105,68 @@
...
@@ -147,36 +105,68 @@
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
" option-text"
>
<div
class=
"word-input-title"
>
<div
*
ngFor=
"let option of question.options; let m = index"
>
<span
style=
"color:red;margin-left:-15px"
>
*
</span>
<div
style=
"display: flex;margin-top: 20px;"
>
<span>
文本:
</span>
<div
class=
"border-dashed"
style=
"min-width: 700px;"
>
<div
style=
"margin-top: 20px;"
>
<div
class=
"word-type-option-title"
>
选项类型:
</div>
<div
style=
"margin-top: 5px;"
>
<nz-radio-group
[(
ngModel
)]="
option
.
type
"
>
<label
nz-radio
nzValue=
"img"
>
<span
[
style
]="{
color:option
.
type=
='img'
?
'#
169BD5
'
:
'#
000
'}"
>
图片
</span>
</label>
<label
nz-radio
nzValue=
"text"
>
<span
[
style
]="{
color:option
.
type=
='text'
?
'#
169BD5
'
:
'#
000
'}"
>
文字
</span>
</label>
<label
nz-radio
nzValue=
"img_text"
>
<span
[
style
]="{
color:option
.
type=
='img_text'
?
'#
169BD5
'
:
'#
000
'}"
>
文字+图片
</span>
</label>
</nz-radio-group>
</div>
</div>
<input
type=
"text"
class=
"input-place-red"
nz-input
[(
ngModel
)]="
question
.
text
"
placeholder=
"必填,根据文本内容去判断对错"
(
blur
)="
save
()"
>
</div>
</div>
<div
class=
"option-time"
>
<div
style=
"margin-top: 25px;"
>
<div
class=
"word-input-title"
>
<div
class=
"option-img"
>
<span>
录音时间:
</span>
<div
*
ngIf=
"option.type=='img' || option.type =='img_text'"
style=
"width: 200px;"
>
<span
style=
"font-size: 20px;"
>
图片:
</span>
<app-upload-image-with-preview
[
picUrl
]="
option
.
image
"
(
imageUploaded
)="
onImageUploadSuccess
($
event
,
'
image
',
option
)"
>
</app-upload-image-with-preview>
</div>
</div>
<div
class=
"option-text"
>
<div
*
ngIf=
"option.type=='text' || option.type =='img_text'"
style=
"width: 200px"
>
<span
style=
"font-size: 20px;"
>
文本
</span>
<input
type=
"text"
nz-input
[(
ngModel
)]="
option
.
text
"
(
blur
)="
save
()"
>
</div>
</div>
<input
type=
"number"
placeholder=
"录音超过时间将自动提交成绩"
nz-input
[(
ngModel
)]="
question
.
duration
"
(
blur
)="
save
()"
>
</div>
</div>
<!-- <div class="option-audio">
<span style="font-size: 20px;">选项音频:</span>
<app-audio-recorder [audioUrl]="option.audio"
(audioUploaded)="onAssetUploadSuccess($event, 'questions', i, 'options', j, 'audio')">
</app-audio-recorder>
</div> -->
</div>
</div>
</div>
<div
style=
"margin:0 20px"
>
<div
style=
"margin-left: 10px;"
>
<button
class=
"btn-red"
nz-button
nzType=
"default"
nzDanger
(
click
)="
removeQuestion
(
i
)"
>
删除题目
</button>
<button
class=
"btn-red"
nz-button
nzType=
"default"
nzDanger
(
click
)="
removeOption
(
i
,
m
)"
>
删除选项
</button>
<button
class=
"btn-blue"
style=
"margin-top: 10px;"
nz-button
nzType=
"default"
nzDanger
(
click
)="
copyQuestion
(
i
)"
>
复制题目
</button>
</div>
</div>
</div>
</div>
</div>
</div>
<button
*
ngIf=
"question.options.length < 4"
class=
"btn-blue"
style=
"margin-top: 10px;"
nz-button
nzType=
"default"
nzDanger
(
click
)="
addOption
(
i
)"
>
增加选项
</button>
</div>
</div>
</div>
<div
style=
"margin-top: 20px;"
>
<div
style=
"margin-top: 20px;"
>
<button
class=
"btn-blue"
style=
"width: 1000px; height: 50px;"
nz-button
nzType=
"default"
nzDanger
<button
class=
"btn-blue"
style=
"width: 1000px; height: 50px;"
nz-button
nzType=
"default"
nzDanger
(
click
)="
addQuestion
()"
>
+增加题目
</button>
(
click
)="
addQuestion
()"
>
+增加题目
</button>
</div>
</div>
</div>
<nz-modal
[(
nzVisible
)]="
isVisible
"
[
nzTitle
]="
null
"
[
nzContent
]="
modalContent
"
[
nzFooter
]="
modalFooter
"
<nz-modal
[(
nzVisible
)]="
isVisible
"
[
nzTitle
]="
null
"
[
nzContent
]="
modalContent
"
[
nzFooter
]="
modalFooter
"
(
nzOnCancel
)="
handleCancel
()"
>
(
nzOnCancel
)="
handleCancel
()"
>
...
@@ -190,4 +180,4 @@
...
@@ -190,4 +180,4 @@
<button
nz-button
nzType=
"primary"
(
click
)="
handleOk
()"
>
确定
</button>
<button
nz-button
nzType=
"primary"
(
click
)="
handleOk
()"
>
确定
</button>
</ng-template>
</ng-template>
</nz-modal>
</nz-modal>
</div>
</div>
\ No newline at end of file
\ No newline at end of file
form/src/app/form/form.component.ts
View file @
b5a53f3b
...
@@ -11,23 +11,13 @@ import { ComponentBase } from './ComponentBase';
...
@@ -11,23 +11,13 @@ import { ComponentBase } from './ComponentBase';
export
class
FormComponent
extends
ComponentBase
implements
OnInit
,
OnChanges
,
OnDestroy
{
export
class
FormComponent
extends
ComponentBase
implements
OnInit
,
OnChanges
,
OnDestroy
{
// 储存数据用
// 储存数据用
saveKey
=
"
dg
08_hx
"
;
saveKey
=
"
dg
10_ty
"
;
// 储存对象
// 储存对象
item
:
any
=
{
item
:
any
=
{
// score: 0,
title
:
'
听音选择
'
,
title
:
'
捕捞海星
'
,
// questionText: "彩蛋里藏了哪些魔法卡牌呢?亲爱的小玩家,快用锤子砸开彩蛋,魔法卡牌就会露出来,只要正确地说出魔法咒语,你就能获得这张魔法卡牌。 游戏结束后,根据获得的魔法卡牌数量,你将获得相应的能量石奖励!开始挑战吧!",
// questionTextAudio: "http://staging-teach.cdn.ireadabc.com/61b41f87fffc8390a519668fece764d3_l.mp3",
questions
:
[],
questions
:
[],
};
};
// item: any = {
// title: '幸运大转盘',
// questionText: "亲爱的小玩家,游戏马上就要开始啦!请动动手指转动转盘,当转盘停止,注意观察指针指向的魔法图片,并大声说出魔法咒语,魔法咒语正确,你就可以获得一张魔法卡牌。 游戏结束后,根据获得的魔法卡牌数量,你将获得相应的能量石奖励!开始挑战吧!",
// questionTextAudio: "http://staging-teach.cdn.ireadabc.com/18ebee93b3eabcd55649a01366431af7.mp3",
// questions: [],
// };
isVisible
=
false
;
isVisible
=
false
;
deleteTitle
=
"
是否删除题目
"
;
deleteTitle
=
"
是否删除题目
"
;
deleteCallback
=
function
()
{
};
deleteCallback
=
function
()
{
};
...
@@ -46,15 +36,14 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
...
@@ -46,15 +36,14 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
addQuestion
()
{
addQuestion
()
{
this
.
item
.
questions
.
push
({
this
.
item
.
questions
.
push
({
// type: 'img',
audio
:
''
,
audio
:
''
,
text
:
''
,
// image: '',
time
:
null
,
time
:
null
,
duration
:
""
,
duration
:
""
,
// word: '',
audioName
:
""
,
audioName
:
""
,
options
:
[]
});
});
this
.
addOption
(
this
.
item
.
questions
.
length
-
1
)
this
.
addOption
(
this
.
item
.
questions
.
length
-
1
)
this
.
save
();
this
.
save
();
}
}
...
@@ -74,23 +63,25 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
...
@@ -74,23 +63,25 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
this
.
item
.
audioBgName
=
""
;
this
.
item
.
audioBgName
=
""
;
this
.
save
();
this
.
save
();
}
}
// addOption(idx) {
addOption
(
idx
)
{
// if (this.item.questions[idx].options.length == 4) return;
if
(
this
.
item
.
questions
[
idx
].
options
.
length
>
4
)
return
;
// this.item.questions[idx].options.push({
this
.
item
.
questions
[
idx
].
options
.
push
({
// text: '',
type
:
'
img
'
,
// audio: '',
audio
:
''
,
// image: '',
image
:
''
,
// word: '',
});
// });
this
.
save
();
// this.save();
}
// }
// removeOption(idx, n) {
removeOption
(
idx
,
n
)
{
// this.openDelete("确定删除选项?", () => {
this
.
openDelete
(
"
确定删除选项?
"
,
()
=>
{
// this.item.questions[idx].options.splice(n, 1);
this
.
item
.
questions
[
idx
].
options
.
splice
(
n
,
1
);
// this.save();
if
(
this
.
item
.
questions
[
idx
].
options
.
length
<
2
)
{
// })
this
.
addOption
(
idx
)
// }
}
this
.
save
();
})
}
ngChange
()
{
ngChange
()
{
this
.
save
();
this
.
save
();
}
}
...
...
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