Commit 1e5d3bdd authored by linzhiguo's avatar linzhiguo

+ random数组值改为显示字符

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