Commit be15005bbed6ca85210b7936bbed488f45499053
1 parent
f41510cf
add userid
Showing
2 changed files
with
14 additions
and
6 deletions
src/live/js/student.js
| 1 | 1 | $(function() { |
| 2 | 2 | var teacherId = document.getElementById('teacher'); |
| 3 | 3 | var studentId = document.getElementById('student'); |
| 4 | - var socket = io('https://live-api.gaoxiaobang.com'); | |
| 5 | - // var socket = io('http://localhost:5000'); | |
| 4 | + // var socket = io('https://live-api.gaoxiaobang.com'); | |
| 5 | + var socket = io('http://localhost:5000'); | |
| 6 | 6 | |
| 7 | 7 | var teacher = CodeMirror.fromTextArea(teacherId, { |
| 8 | 8 | value: '输入HTML代码', |
| ... | ... | @@ -97,10 +97,13 @@ $(function() { |
| 97 | 97 | |
| 98 | 98 | var input = $('#input').val() || ''; |
| 99 | 99 | var code = teacher.getValue(); |
| 100 | + // var userId = Math.round(Math.random()*10000); | |
| 101 | + var userId = 826920; | |
| 100 | 102 | var compileData = { |
| 101 | 103 | code: code, |
| 102 | 104 | langid: 10, |
| 103 | - input: input | |
| 105 | + input: input, | |
| 106 | + userId: userId, | |
| 104 | 107 | } |
| 105 | 108 | $.ajax({ |
| 106 | 109 | type: "post", |
| ... | ... | @@ -134,12 +137,15 @@ $(function() { |
| 134 | 137 | |
| 135 | 138 | var input = $('#input').val() || ''; |
| 136 | 139 | var code = student.getValue(); |
| 140 | + // var userId = Math.round(Math.random()*10000); | |
| 141 | + var userId = 826920; | |
| 137 | 142 | var compileData = { |
| 138 | 143 | code: code, |
| 139 | 144 | langid: 10, |
| 140 | - input: input | |
| 145 | + input: input, | |
| 146 | + userId: userId | |
| 141 | 147 | } |
| 142 | - | |
| 148 | + console.log(compileData); | |
| 143 | 149 | $.ajax({ |
| 144 | 150 | type: "post", |
| 145 | 151 | url: gxb_api + "/submit/submitCode/api", | ... | ... |
src/live/js/teacher.js
| ... | ... | @@ -156,10 +156,12 @@ $(function(){ |
| 156 | 156 | |
| 157 | 157 | var input = $('#input').val() || ''; |
| 158 | 158 | var code = teacher.getValue(); |
| 159 | + var userId = 826920; | |
| 159 | 160 | var compileData = { |
| 160 | 161 | code: code, |
| 161 | 162 | langid: 10, |
| 162 | - input: input | |
| 163 | + input: input, | |
| 164 | + userId: userId | |
| 163 | 165 | } |
| 164 | 166 | $.ajax({ |
| 165 | 167 | type: "post", | ... | ... |