Commit 66c0e4912659de1997fe8cf630daf5767b995640
1 parent
b240404f
设置作业添加模板内容
Showing
2 changed files
with
24 additions
and
14 deletions
dist/gxb-ide/Dir.js
| @@ -82,19 +82,23 @@ | @@ -82,19 +82,23 @@ | ||
| 82 | 82 | ||
| 83 | if(getQuery('languageid') && getQuery('autoscore') && getQuery('question') && (getQuery('languageid') === '10' || getQuery('languageid') === '11')){ | 83 | if(getQuery('languageid') && getQuery('autoscore') && getQuery('question') && (getQuery('languageid') === '10' || getQuery('languageid') === '11')){ |
| 84 | res[_lang].length = 2; | 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 | $("title").html(_lang); | 87 | $("title").html(_lang); |
| 94 | Dir.treeData = res[_lang]; | 88 | Dir.treeData = res[_lang]; |
| 95 | Dir.treeObj = $.fn.zTree.init($(el), setting, Dir.treeData); | 89 | Dir.treeObj = $.fn.zTree.init($(el), setting, Dir.treeData); |
| 90 | + console.log('Dir.treeData'); | ||
| 91 | + console.log(Dir.treeData); | ||
| 96 | addTextareaPage(Dir.treeData); | 92 | addTextareaPage(Dir.treeData); |
| 97 | CodingEditer.initCodeMirror(treeLinkEditor); | 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 | error: function(XMLHttpRequest, textStatus, errorThrown) { | 103 | error: function(XMLHttpRequest, textStatus, errorThrown) { |
| 100 | console.log('Ajax langs.json error'); | 104 | console.log('Ajax langs.json error'); |
| @@ -633,7 +637,8 @@ | @@ -633,7 +637,8 @@ | ||
| 633 | success: function(res) { | 637 | success: function(res) { |
| 634 | console.log('classPopQuiz'); | 638 | console.log('classPopQuiz'); |
| 635 | console.log(res); | 639 | console.log(res); |
| 636 | - | 640 | + // TODO 如何设置模板内容 |
| 641 | + Dir.treeLinkEditor[0].CodeMirrorRecord.setValue(res.programmingList[0].codeModel); | ||
| 637 | questionTitle.html(res.programmingList[0].title) | 642 | questionTitle.html(res.programmingList[0].title) |
| 638 | questionDescribe.html(res.programmingList[0].titleDesc) | 643 | questionDescribe.html(res.programmingList[0].titleDesc) |
| 639 | inputDescribe.html(res.programmingList[0].inputDesc) | 644 | inputDescribe.html(res.programmingList[0].inputDesc) |
src/gxb-ide/Dir.js
| @@ -82,19 +82,23 @@ | @@ -82,19 +82,23 @@ | ||
| 82 | 82 | ||
| 83 | if(getQuery('languageid') && getQuery('autoscore') && getQuery('question') && (getQuery('languageid') === '10' || getQuery('languageid') === '11')){ | 83 | if(getQuery('languageid') && getQuery('autoscore') && getQuery('question') && (getQuery('languageid') === '10' || getQuery('languageid') === '11')){ |
| 84 | res[_lang].length = 2; | 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 | $("title").html(_lang); | 87 | $("title").html(_lang); |
| 94 | Dir.treeData = res[_lang]; | 88 | Dir.treeData = res[_lang]; |
| 95 | Dir.treeObj = $.fn.zTree.init($(el), setting, Dir.treeData); | 89 | Dir.treeObj = $.fn.zTree.init($(el), setting, Dir.treeData); |
| 90 | + console.log('Dir.treeData'); | ||
| 91 | + console.log(Dir.treeData); | ||
| 96 | addTextareaPage(Dir.treeData); | 92 | addTextareaPage(Dir.treeData); |
| 97 | CodingEditer.initCodeMirror(treeLinkEditor); | 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 | error: function(XMLHttpRequest, textStatus, errorThrown) { | 103 | error: function(XMLHttpRequest, textStatus, errorThrown) { |
| 100 | console.log('Ajax langs.json error'); | 104 | console.log('Ajax langs.json error'); |
| @@ -633,7 +637,8 @@ | @@ -633,7 +637,8 @@ | ||
| 633 | success: function(res) { | 637 | success: function(res) { |
| 634 | console.log('classPopQuiz'); | 638 | console.log('classPopQuiz'); |
| 635 | console.log(res); | 639 | console.log(res); |
| 636 | - | 640 | + // TODO 如何设置模板内容 |
| 641 | + Dir.treeLinkEditor[0].CodeMirrorRecord.setValue(res.programmingList[0].codeModel); | ||
| 637 | questionTitle.html(res.programmingList[0].title) | 642 | questionTitle.html(res.programmingList[0].title) |
| 638 | questionDescribe.html(res.programmingList[0].titleDesc) | 643 | questionDescribe.html(res.programmingList[0].titleDesc) |
| 639 | inputDescribe.html(res.programmingList[0].inputDesc) | 644 | inputDescribe.html(res.programmingList[0].inputDesc) |