Commit 1d9bce0e authored by linzhiguo's avatar linzhiguo

+ 框架统计答案

parent 540e7d98
......@@ -280,6 +280,8 @@ cc.Class({
this._flyswatter.y = pos.y;
this._touched = false;
playDragonBoneAnimation(this._flyswatter.children[0], 'normal');
let astr = this.flyVirus[i]._text.string;
item._dizzy_ani = cc.tween(this._flyswatter)
//.delay(0.2)
.call(()=>{
......@@ -290,6 +292,7 @@ cc.Class({
}
if (i != this._correct_index){
console.log('hit err');
this.sendAnswer(astr);
playDragonBoneAnimation(item, 'dizzy', 1, ()=>{
playDragonBoneAnimation(item, 'normal', -1);
......@@ -304,6 +307,8 @@ cc.Class({
}
else{
console.log('hit ok');
this.sendAnswer(astr, true);
this._can_hitted = false;
this.fallCare();
......@@ -391,6 +396,7 @@ cc.Class({
.to(this._current_time, {x: 0})
.call(()=>{
this.flyOut();
this.sendAnswer();
})
.start();
......@@ -437,7 +443,15 @@ cc.Class({
this._index = 0;
},
getTime(){
var date = new Date();
return date.getTime();
},
updateItem(){
this._startTime = this.getTime();
console.log(this._startTime);
this._tapped = false;
this._time_node.x = this._time;
......@@ -540,6 +554,16 @@ cc.Class({
}
},
sendAnswer(answer="", isRight = false){
if (window && window.courseware) {
if (window.courseware.sendAnwser)
window.courseware.sendAnwser(answer, isRight, this._startTime);
else if (window.courseware.sendAnswer){
window.courseware.sendAnswer(answer, isRight, this._startTime);
}
}
},
flyIn(cb){
this.flyVirus[0].active = true;
this.flyVirus[1].active = true;
......
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