李勇

1.修复userID随机的问题;2.修复答题卡反复刷新题目的问题

@@ -35,7 +35,7 @@ import QuestionApe from 'apes/QuestionApe'; @@ -35,7 +35,7 @@ import QuestionApe from 'apes/QuestionApe';
35 import UTF8 from 'utf-8'; 35 import UTF8 from 'utf-8';
36 36
37 let loger = Loger.getLoger('McuClient'); 37 let loger = Loger.getLoger('McuClient');
38 -let _sdkInfo = {"version": "v1.55.6.20170727", "author": "www.3mang.com"}; 38 +let _sdkInfo = {"version": "v1.56.0.20170727", "author": "www.3mang.com"};
39 39
40 //APE 40 //APE
41 let _sass; 41 let _sass;
@@ -437,7 +437,7 @@ export default class MessageEntrance extends Emiter { @@ -437,7 +437,7 @@ export default class MessageEntrance extends Emiter {
437 GlobalConfig.isRecordPlayBack = false; //设置为非录制回放状态 437 GlobalConfig.isRecordPlayBack = false; //设置为非录制回放状态
438 GlobalConfig.classId = parseInt(_param.classId); 438 GlobalConfig.classId = parseInt(_param.classId);
439 GlobalConfig.portal = _param.portal; 439 GlobalConfig.portal = _param.portal;
440 - 440 + GlobalConfig.userId = _param.userId || "0";
441 //H5处理 441 //H5处理
442 GlobalConfig.isH5 = _param.isH5 || false;//外部传入的参数,是否是H5 442 GlobalConfig.isH5 = _param.isH5 || false;//外部传入的参数,是否是H5
443 if (GlobalConfig.isH5 == true) { 443 if (GlobalConfig.isH5 == true) {
@@ -456,7 +456,7 @@ export default class MessageEntrance extends Emiter { @@ -456,7 +456,7 @@ export default class MessageEntrance extends Emiter {
456 GlobalConfig.userName = _param.userName || "user_" + (new Date().getTime() % 1000000); 456 GlobalConfig.userName = _param.userName || "user_" + (new Date().getTime() % 1000000);
457 457
458 //如果没有userId或者为"0",随机生成 458 //如果没有userId或者为"0",随机生成
459 - if (!GlobalConfig.userId || GlobalConfig.userId == "0") { 459 + if (GlobalConfig.userId == "0") {
460 GlobalConfig.userId = "user_" + (new Date().getTime() % 1000000); 460 GlobalConfig.userId = "user_" + (new Date().getTime() % 1000000);
461 } 461 }
462 //设置角色身份 462 //设置角色身份
@@ -17,15 +17,18 @@ class SystemConfig { @@ -17,15 +17,18 @@ class SystemConfig {
17 if (GlobalConfig.isMobile) { 17 if (GlobalConfig.isMobile) {
18 loger.warn("当前设备是移动设备"); 18 loger.warn("当前设备是移动设备");
19 GlobalConfig.platform = 3;//移动设备,不是ios和安卓就当H5处理 19 GlobalConfig.platform = 3;//移动设备,不是ios和安卓就当H5处理
  20 + GlobalConfig.deviceType = 3;
20 } else { 21 } else {
21 loger.warn("当前设备是PC"); 22 loger.warn("当前设备是PC");
22 GlobalConfig.platform = 0 23 GlobalConfig.platform = 0
  24 + GlobalConfig.deviceType = 0;
23 } 25 }
24 if (mdetect.isIOS()) { 26 if (mdetect.isIOS()) {
25 GlobalConfig.deviceType = 1; //"ios"; 27 GlobalConfig.deviceType = 1; //"ios";
26 } 28 }
27 if (mdetect.isAndroid()) { 29 if (mdetect.isAndroid()) {
28 GlobalConfig.platform = 2; //"android"; 30 GlobalConfig.platform = 2; //"android";
  31 + GlobalConfig.deviceType = 2; //"ios";
29 } 32 }
30 33
31 //语言 34 //语言
@@ -410,7 +410,7 @@ class MediaSharedApe extends Ape { @@ -410,7 +410,7 @@ class MediaSharedApe extends Ape {
410 loger.warn("timeDistance:"+timeDistance+" seek2seek:"+seek2seek+" seekDistance:"+seekDistance); 410 loger.warn("timeDistance:"+timeDistance+" seek2seek:"+seek2seek+" seekDistance:"+seekDistance);
411 if(seekDistance<=5){ 411 if(seekDistance<=5){
412 //记录最后一次的数据 412 //记录最后一次的数据
413 - loger.warn("媒体共享更新数据->数据只有SEEK发生改变,低于5秒不需要再更新->timeDistance:"+timeDistance+"->seekDistance"+seekDistance); 413 + loger.warn("媒体共享更新数据->数据只有SEEK发生改变,低于5秒不需要再更新");
414 //记录最后一次激活的数据 414 //记录最后一次激活的数据
415 this.lastActiveData=getMediaPackFullInfo; 415 this.lastActiveData=getMediaPackFullInfo;
416 this.lastActiveData.time=new Date().getTime(); 416 this.lastActiveData.time=new Date().getTime();
@@ -23,7 +23,7 @@ class QuestionApe extends Ape { @@ -23,7 +23,7 @@ class QuestionApe extends Ape {
23 ApeConsts.QUESTION_SESSION_NAME, 23 ApeConsts.QUESTION_SESSION_NAME,
24 ApeConsts.QUESTION_SESSION_TAG 24 ApeConsts.QUESTION_SESSION_TAG
25 ); 25 );
26 - 26 + this.isShow={};//已经显示过的题目
27 this.questionList={};//MCU同步的题目数据 27 this.questionList={};//MCU同步的题目数据
28 this.questionTimer=new TimerCounter();//答题卡计时器 28 this.questionTimer=new TimerCounter();//答题卡计时器
29 this.questionTimer.addTimerCallBack(this.questionTimerCounterUptate.bind(this), 1);//计时器监听 29 this.questionTimer.addTimerCallBack(this.questionTimerCounterUptate.bind(this), 1);//计时器监听
@@ -179,7 +179,13 @@ class QuestionApe extends Ape { @@ -179,7 +179,13 @@ class QuestionApe extends Ape {
179 //delete this.questionList[itemIdx]; 179 //delete this.questionList[itemIdx];
180 }else { 180 }else {
181 //显示答题卡数据 181 //显示答题卡数据
  182 + if(!this.isShow[itemIdx]){
182 this._emit(MessageTypes.START_ANSWER_QUESTION,model); 183 this._emit(MessageTypes.START_ANSWER_QUESTION,model);
  184 + this.isShow[itemIdx]=itemIdx;
  185 + }else {
  186 + loger.warn("已经显现答题卡数据");
  187 + }
  188 +
183 } 189 }
184 } 190 }
185 if( this.questionTimer){ 191 if( this.questionTimer){
@@ -224,7 +230,13 @@ class QuestionApe extends Ape { @@ -224,7 +230,13 @@ class QuestionApe extends Ape {
224 break; 230 break;
225 } 231 }
226 } 232 }
  233 + try{
227 delete this.questionList[itemIdxs[i]]; 234 delete this.questionList[itemIdxs[i]];
  235 + delete this.isShow[itemIdxs[i]];
  236 + }catch (err){
  237 +
  238 + }
  239 +
228 } 240 }
229 } 241 }
230 } 242 }