Commit 1e5d3bdd authored by linzhiguo's avatar linzhiguo

+ random数组值改为显示字符

parent f83a8a14
......@@ -3,6 +3,7 @@ export class WL01{
audio_url : string;
time:string;
mouses : Array<Rat> = [];
random: string;
}
export class Rat{
......
......@@ -28,6 +28,14 @@
<input type="text" nz-input placeholder="" [(ngModel)]="item.time" (blur)="saveItem()" style="width: 160px;"/> s
</div>
</div>
<div style="display: flex; margin-bottom: 10px;">
<div style="flex:1; margin-left: 10px;">
random
</div>
<div style="flex:5">
<input type="text" nz-input placeholder="" [(ngModel)]="item.random" (blur)="saveItem()" style="width: 160px;"/> s
</div>
</div>
</div>
......
......@@ -175,6 +175,7 @@ cc.Class({
if (this.data.random != null){
this.data.answer = this.data.random.split(',');
console.log(this.data.random);
}
......@@ -298,16 +299,21 @@ cc.Class({
this._time_ani = null;
}
this._aiexerciseid = info.aiexerciseid;
let show_word = info.word;
this.hit_result = true;
if (this.data.answer != null){
let tmp = this.data.answer[this._mouse_index];
if (tmp != null){
this.hit_result = info.word == tmp.toUpperCase() || info.word == tmp.toLowerCase();
if (this.data.answer.length > 0){
show_word = this.data.answer[RandomInt(this.data.answer.length)];
}
if (show_word == '' || show_word == ' ' || show_word == ','){
show_word = info.word;
}
this.hit_result = info.word == show_word.toUpperCase() || info.word == show_word.toLowerCase();
}
console.log('show:' + show_word + ',target:'+ info.word +" " + this.hit_result);
this._aiexerciseid = info.aiexerciseid;
this._astr = info.word;
this.currentOutline(this._mouse_index);
......@@ -321,7 +327,7 @@ cc.Class({
item.active = true;
let mouse = item.getComponent(cc.js.getClassByName('Mouse'));
mouse.init();
mouse.setTitle(info.word);
mouse.setTitle(show_word);
mouse.audio = info.audio_url;
mouse.playAudio();
this.moveUp(mouse.node, ()=>{
......
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