Commit 31bdb910e54636decf997f2909eb22240f8485ba

Authored by 商艳涛
1 parent b250ae27

修复第二次播放播放区域代码重复

dist/gxb-ide/CodingEditer.js
@@ -260,28 +260,30 @@ @@ -260,28 +260,30 @@
260 if (_thisNum == 0) { 260 if (_thisNum == 0) {
261 for (var i = 0; i < treeLinkEditor.length; i++) { 261 for (var i = 0; i < treeLinkEditor.length; i++) {
262 var _path = treeLinkEditor[i].filePath; 262 var _path = treeLinkEditor[i].filePath;
263 - console.log(treeLinkEditor)  
264 Dir.showEdite({'treeNode': {'name': treeLinkEditor[i].file}}); 263 Dir.showEdite({'treeNode': {'name': treeLinkEditor[i].file}});
  264 + treeLinkEditor[i].CodeMirrorRecord.setValue('');
265 treeLinkEditor[i].CodeMirrorRecord.setValue(_template); 265 treeLinkEditor[i].CodeMirrorRecord.setValue(_template);
266 } 266 }
267 } else if (_thisNum == 1) { 267 } else if (_thisNum == 1) {
268 for (var i = 0; i < treeLinkEditor.length; i++) { 268 for (var i = 0; i < treeLinkEditor.length; i++) {
269 if (treeLinkEditor[i].CodeMirrorReplay.getValue()) { 269 if (treeLinkEditor[i].CodeMirrorReplay.getValue()) {
270 Dir.showEdite({'treeNode': {'name': treeLinkEditor[i].file}, 'replay': true}); 270 Dir.showEdite({'treeNode': {'name': treeLinkEditor[i].file}, 'replay': true});
271 - treeLinkEditor[i].CodeMirrorReplay.setValue(_template); 271 + treeLinkEditor[i].CodeMirrorReplay.setValue('');
272 } 272 }
273 } 273 }
274 } else { 274 } else {
275 - console.log('------------------------------------------------')  
276 - console.log(treeLinkEditor)  
277 - console.log('------------------------------------------------') 275 + // console.log('------------------------------------------------')
  276 + // console.log(treeLinkEditor)
  277 + // console.log('------------------------------------------------')
278 278
279 for (var i = 0; i < treeLinkEditor.length; i++) { 279 for (var i = 0; i < treeLinkEditor.length; i++) {
280 if(treeLinkEditor[i].CodeMirrorRecord){ 280 if(treeLinkEditor[i].CodeMirrorRecord){
281 Dir.showEdite({'treeNode': {'name': treeLinkEditor[i].file}}); 281 Dir.showEdite({'treeNode': {'name': treeLinkEditor[i].file}});
  282 + treeLinkEditor[i].CodeMirrorRecord.setValue('');
282 treeLinkEditor[i].CodeMirrorRecord.setValue(_template); 283 treeLinkEditor[i].CodeMirrorRecord.setValue(_template);
283 }else if(treeLinkEditor[i].CodeMirrorReplay.getValue()){ 284 }else if(treeLinkEditor[i].CodeMirrorReplay.getValue()){
284 Dir.showEdite({'treeNode': {'name': treeLinkEditor[i].file}, 'replay': true}); 285 Dir.showEdite({'treeNode': {'name': treeLinkEditor[i].file}, 'replay': true});
  286 + treeLinkEditor[i].CodeMirrorReplay.setValue('');
285 treeLinkEditor[i].CodeMirrorReplay.setValue(_template); 287 treeLinkEditor[i].CodeMirrorReplay.setValue(_template);
286 } 288 }
287 } 289 }
dist/gxb-ide/Dir.js
@@ -640,7 +640,9 @@ @@ -640,7 +640,9 @@
640 // TODO 如何设置模板内容 640 // TODO 如何设置模板内容
641 if(getQuery('autoscore')){ 641 if(getQuery('autoscore')){
642 CodingEditer.template = res.programmingList[0].codeModel; 642 CodingEditer.template = res.programmingList[0].codeModel;
643 - Dir.treeLinkEditor[0].CodeMirrorRecord.setValue(res.programmingList[0].codeModel); 643 + if(!Dir.isReplayPage){
  644 + Dir.treeLinkEditor[0].CodeMirrorRecord.setValue(res.programmingList[0].codeModel);
  645 + }
644 } 646 }
645 questionTitle.html(res.programmingList[0].title) 647 questionTitle.html(res.programmingList[0].title)
646 questionDescribe.html(res.programmingList[0].titleDesc) 648 questionDescribe.html(res.programmingList[0].titleDesc)
src/gxb-ide/CodingEditer.js
@@ -260,28 +260,30 @@ @@ -260,28 +260,30 @@
260 if (_thisNum == 0) { 260 if (_thisNum == 0) {
261 for (var i = 0; i < treeLinkEditor.length; i++) { 261 for (var i = 0; i < treeLinkEditor.length; i++) {
262 var _path = treeLinkEditor[i].filePath; 262 var _path = treeLinkEditor[i].filePath;
263 - console.log(treeLinkEditor)  
264 Dir.showEdite({'treeNode': {'name': treeLinkEditor[i].file}}); 263 Dir.showEdite({'treeNode': {'name': treeLinkEditor[i].file}});
  264 + treeLinkEditor[i].CodeMirrorRecord.setValue('');
265 treeLinkEditor[i].CodeMirrorRecord.setValue(_template); 265 treeLinkEditor[i].CodeMirrorRecord.setValue(_template);
266 } 266 }
267 } else if (_thisNum == 1) { 267 } else if (_thisNum == 1) {
268 for (var i = 0; i < treeLinkEditor.length; i++) { 268 for (var i = 0; i < treeLinkEditor.length; i++) {
269 if (treeLinkEditor[i].CodeMirrorReplay.getValue()) { 269 if (treeLinkEditor[i].CodeMirrorReplay.getValue()) {
270 Dir.showEdite({'treeNode': {'name': treeLinkEditor[i].file}, 'replay': true}); 270 Dir.showEdite({'treeNode': {'name': treeLinkEditor[i].file}, 'replay': true});
271 - treeLinkEditor[i].CodeMirrorReplay.setValue(_template); 271 + treeLinkEditor[i].CodeMirrorReplay.setValue('');
272 } 272 }
273 } 273 }
274 } else { 274 } else {
275 - console.log('------------------------------------------------')  
276 - console.log(treeLinkEditor)  
277 - console.log('------------------------------------------------') 275 + // console.log('------------------------------------------------')
  276 + // console.log(treeLinkEditor)
  277 + // console.log('------------------------------------------------')
278 278
279 for (var i = 0; i < treeLinkEditor.length; i++) { 279 for (var i = 0; i < treeLinkEditor.length; i++) {
280 if(treeLinkEditor[i].CodeMirrorRecord){ 280 if(treeLinkEditor[i].CodeMirrorRecord){
281 Dir.showEdite({'treeNode': {'name': treeLinkEditor[i].file}}); 281 Dir.showEdite({'treeNode': {'name': treeLinkEditor[i].file}});
  282 + treeLinkEditor[i].CodeMirrorRecord.setValue('');
282 treeLinkEditor[i].CodeMirrorRecord.setValue(_template); 283 treeLinkEditor[i].CodeMirrorRecord.setValue(_template);
283 }else if(treeLinkEditor[i].CodeMirrorReplay.getValue()){ 284 }else if(treeLinkEditor[i].CodeMirrorReplay.getValue()){
284 Dir.showEdite({'treeNode': {'name': treeLinkEditor[i].file}, 'replay': true}); 285 Dir.showEdite({'treeNode': {'name': treeLinkEditor[i].file}, 'replay': true});
  286 + treeLinkEditor[i].CodeMirrorReplay.setValue('');
285 treeLinkEditor[i].CodeMirrorReplay.setValue(_template); 287 treeLinkEditor[i].CodeMirrorReplay.setValue(_template);
286 } 288 }
287 } 289 }
src/gxb-ide/Dir.js
@@ -640,7 +640,9 @@ @@ -640,7 +640,9 @@
640 // TODO 如何设置模板内容 640 // TODO 如何设置模板内容
641 if(getQuery('autoscore')){ 641 if(getQuery('autoscore')){
642 CodingEditer.template = res.programmingList[0].codeModel; 642 CodingEditer.template = res.programmingList[0].codeModel;
643 - Dir.treeLinkEditor[0].CodeMirrorRecord.setValue(res.programmingList[0].codeModel); 643 + if(!Dir.isReplayPage){
  644 + Dir.treeLinkEditor[0].CodeMirrorRecord.setValue(res.programmingList[0].codeModel);
  645 + }
644 } 646 }
645 questionTitle.html(res.programmingList[0].title) 647 questionTitle.html(res.programmingList[0].title)
646 questionDescribe.html(res.programmingList[0].titleDesc) 648 questionDescribe.html(res.programmingList[0].titleDesc)