Commit 66c0e4912659de1997fe8cf630daf5767b995640

Authored by 商艳涛
1 parent b240404f

设置作业添加模板内容

dist/gxb-ide/Dir.js
... ... @@ -82,19 +82,23 @@
82 82  
83 83 if(getQuery('languageid') && getQuery('autoscore') && getQuery('question') && (getQuery('languageid') === '10' || getQuery('languageid') === '11')){
84 84 res[_lang].length = 2;
85   - console.log('-1');
86   - switchDir(2);
87   - renderQuestion(getQuery('question'));
88   - }else{
89   - console.log('-2');
90   - switchDir(1);
91 85 }
92 86  
93 87 $("title").html(_lang);
94 88 Dir.treeData = res[_lang];
95 89 Dir.treeObj = $.fn.zTree.init($(el), setting, Dir.treeData);
  90 + console.log('Dir.treeData');
  91 + console.log(Dir.treeData);
96 92 addTextareaPage(Dir.treeData);
97 93 CodingEditer.initCodeMirror(treeLinkEditor);
  94 +
  95 + if(getQuery('languageid') && getQuery('autoscore') && getQuery('question') && (getQuery('languageid') === '10' || getQuery('languageid') === '11')){
  96 + res[_lang].length = 2;
  97 + switchDir(2);
  98 + renderQuestion(getQuery('question'));
  99 + }else{
  100 + switchDir(1);
  101 + }
98 102 },
99 103 error: function(XMLHttpRequest, textStatus, errorThrown) {
100 104 console.log('Ajax langs.json error');
... ... @@ -633,7 +637,8 @@
633 637 success: function(res) {
634 638 console.log('classPopQuiz');
635 639 console.log(res);
636   -
  640 + // TODO 如何设置模板内容
  641 + Dir.treeLinkEditor[0].CodeMirrorRecord.setValue(res.programmingList[0].codeModel);
637 642 questionTitle.html(res.programmingList[0].title)
638 643 questionDescribe.html(res.programmingList[0].titleDesc)
639 644 inputDescribe.html(res.programmingList[0].inputDesc)
... ...
src/gxb-ide/Dir.js
... ... @@ -82,19 +82,23 @@
82 82  
83 83 if(getQuery('languageid') && getQuery('autoscore') && getQuery('question') && (getQuery('languageid') === '10' || getQuery('languageid') === '11')){
84 84 res[_lang].length = 2;
85   - console.log('-1');
86   - switchDir(2);
87   - renderQuestion(getQuery('question'));
88   - }else{
89   - console.log('-2');
90   - switchDir(1);
91 85 }
92 86  
93 87 $("title").html(_lang);
94 88 Dir.treeData = res[_lang];
95 89 Dir.treeObj = $.fn.zTree.init($(el), setting, Dir.treeData);
  90 + console.log('Dir.treeData');
  91 + console.log(Dir.treeData);
96 92 addTextareaPage(Dir.treeData);
97 93 CodingEditer.initCodeMirror(treeLinkEditor);
  94 +
  95 + if(getQuery('languageid') && getQuery('autoscore') && getQuery('question') && (getQuery('languageid') === '10' || getQuery('languageid') === '11')){
  96 + res[_lang].length = 2;
  97 + switchDir(2);
  98 + renderQuestion(getQuery('question'));
  99 + }else{
  100 + switchDir(1);
  101 + }
98 102 },
99 103 error: function(XMLHttpRequest, textStatus, errorThrown) {
100 104 console.log('Ajax langs.json error');
... ... @@ -633,7 +637,8 @@
633 637 success: function(res) {
634 638 console.log('classPopQuiz');
635 639 console.log(res);
636   -
  640 + // TODO 如何设置模板内容
  641 + Dir.treeLinkEditor[0].CodeMirrorRecord.setValue(res.programmingList[0].codeModel);
637 642 questionTitle.html(res.programmingList[0].title)
638 643 questionDescribe.html(res.programmingList[0].titleDesc)
639 644 inputDescribe.html(res.programmingList[0].inputDesc)
... ...