Commit 19aa0e5c authored by 李维's avatar 李维

feat: 添加题干

parent 70a95770
This diff is collapsed.
......@@ -208,10 +208,15 @@ export default class SceneComponent extends MyCocosSceneComponent {
private bubbleCreate() {
let layout_play = this.layout_game.getChildByName('layout_play')
layout_play.removeAllChildren();
const layoutQuestion = this.layout_game.getChildByName('layout_text');
let layout_text = layoutQuestion.getChildByName('text');
let layout_pop = this.layout_game.getChildByName('layout_pop')
let btn_fish = this.layout_game.getChildByName('btn_fish')
let item = this.layout_game.getChildByName('item')
layout_text.getComponent(cc.Label).string = this.starData.questionText || "";
layoutQuestion.active = this.starData.questionText ? true : false;
let list = this.starData.options;
for (let i = 0; i < 10; i++) {
list.sort(() => Math.random() < 0.5 ? 1 : -1)
......
......@@ -17,6 +17,7 @@ export class Option {
}
export class Question {
public questionText: string;
public txt;
public audioUrl;
public data;
......@@ -30,6 +31,7 @@ export class Question {
constructor(data, id) {
this.id = id;
this.count = 0;
this.questionText = data.questionText;
this.txt = data.text;
this.time = data.duration;
this.audioUrl = data.audio;
......
{
"ver": "2.3.5",
"uuid": "300884ed-edca-4c8b-be1e-69307e6fa539",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": true,
"genMipmaps": false,
"packable": true,
"width": 1911,
"height": 248,
"platformSettings": {},
"subMetas": {
"bg_question_panel": {
"ver": "1.0.4",
"uuid": "c66e6b6b-54f7-4c58-bdf4-2da77a8172cb",
"rawTextureUuid": "300884ed-edca-4c8b-be1e-69307e6fa539",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1911,
"height": 248,
"rawWidth": 1911,
"rawHeight": 248,
"borderTop": 40,
"borderBottom": 40,
"borderLeft": 1911,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
......@@ -137,6 +137,10 @@
<div *ngFor="let option of question.options; let m = index">
<div style="display: flex;margin-top: 20px;">
<div class="border-dashed" style="min-width: 700px;">
<div style="width: 400px">
<span style="font-size: 20px;">题干</span>
<textarea nz-input rows="3" [(ngModel)]="option.questionText" (blur)="save()"></textarea>
</div>
<div style="margin-top: 20px;">
<div class="word-type-option-title">
选项类型:
......
......@@ -41,6 +41,7 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
addQuestion() {
this.item.questions.push({
questionText: "",
audio: '',
time: null,
duration: "",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment