Commit 80ac8422703f56bfa3e64fa418a8389489c453fe
Merge branch 'new_Kira' of gitlab.gaoxiaobang.com:kira/programming into feature/20170228_rest
Showing
2 changed files
with
14 additions
and
52 deletions
src/js/gb.js
| ... | ... | @@ -1955,7 +1955,11 @@ $(function() { |
| 1955 | 1955 | error: record.error || '', |
| 1956 | 1956 | code: record.code || '' |
| 1957 | 1957 | }; |
| 1958 | - compileResult(resultData, record.runtimeArgus); | |
| 1958 | + console.log(resultData.code) | |
| 1959 | + if (record.code == 0) { | |
| 1960 | + compileResult(resultData, record.runtimeArgus); | |
| 1961 | + } | |
| 1962 | + | |
| 1959 | 1963 | // if (resultData.status) { |
| 1960 | 1964 | // compileResult(resultData); |
| 1961 | 1965 | // } | ... | ... |
src/js/gbreplayer.js
| ... | ... | @@ -382,7 +382,6 @@ $(function(){ |
| 382 | 382 | console.log(coderecords); |
| 383 | 383 | $("#play_audio").attr('src', "http://gxb-file.oss-cn-beijing.aliyuncs.com" + coderecords.audioUrl); |
| 384 | 384 | if (_role ==0) { |
| 385 | - var coderecords = coderecords.codeRecordList; | |
| 386 | 385 | player.init({ |
| 387 | 386 | container: '#audioWrap' |
| 388 | 387 | ,source: "http://gxb-file.oss-cn-beijing.aliyuncs.com" + coderecords.audioUrl |
| ... | ... | @@ -405,9 +404,10 @@ $(function(){ |
| 405 | 404 | playEnd() |
| 406 | 405 | } |
| 407 | 406 | }); |
| 407 | + var coderecords = coderecords.codeRecordList; | |
| 408 | 408 | }else{ |
| 409 | - var coderecords = coderecords.studentRecordList; | |
| 410 | 409 | $('.play-code').show(); |
| 410 | + var coderecords = coderecords.studentRecordList; | |
| 411 | 411 | } |
| 412 | 412 | |
| 413 | 413 | GBCodePlayBack.htmlplayereditor.setValue(''); |
| ... | ... | @@ -1258,14 +1258,8 @@ $(function(){ |
| 1258 | 1258 | changeValueCallback: function(record, replay_type, offset) { |
| 1259 | 1259 | var obj = record.changeobj, |
| 1260 | 1260 | editor = record.editor; |
| 1261 | - | |
| 1261 | + console.log(record); | |
| 1262 | 1262 | return function() { |
| 1263 | - if(GBCodePlayBack.active_editor!==editor){ | |
| 1264 | - $('#' + editor + 'button').trigger('click'); //这里出发触发选择编辑事件 | |
| 1265 | - }else{ | |
| 1266 | - GBCodePlayBack.active_editor = editor; | |
| 1267 | - } | |
| 1268 | - | |
| 1269 | 1263 | if(editor==='html'){ |
| 1270 | 1264 | processChangeObject(GBCodePlayBack.htmlplayereditor, obj); |
| 1271 | 1265 | }else if(editor==='css'){ |
| ... | ... | @@ -1276,7 +1270,6 @@ $(function(){ |
| 1276 | 1270 | |
| 1277 | 1271 | record.trigger = 1; //标记已运行 |
| 1278 | 1272 | record.playTime = new Date().getTime(); // 播放开始时间 |
| 1279 | - GBCodePlayBack.codeTimes = 1; // | |
| 1280 | 1273 | |
| 1281 | 1274 | var resultData = { |
| 1282 | 1275 | output: record.output || '', |
| ... | ... | @@ -1295,35 +1288,19 @@ $(function(){ |
| 1295 | 1288 | GBCodePlayBack.triggertotal += 1; |
| 1296 | 1289 | } |
| 1297 | 1290 | |
| 1298 | - /*计算播放进度*/ | |
| 1299 | - var percertage = '0%', | |
| 1300 | - percertagenum = 0; | |
| 1301 | - if (replay_type) { | |
| 1302 | - percertagenum = Math.ceil(GBCodePlayBack.excercise_triggertotal / GBCodePlayBack.excercise_records.length * 100) | |
| 1303 | - percertage = percertagenum + '%'; | |
| 1304 | - } else { | |
| 1305 | - if (!offset) { | |
| 1306 | - percertagenum = Math.ceil(GBCodePlayBack.triggertotal / GBCodePlayBack.records.length * 100); | |
| 1307 | - percertage = percertagenum + '%'; | |
| 1308 | - $('#replayprogressbar').css({ 'width': percertage }).find('span').html(percertage); | |
| 1309 | - $('.slider').slider("option", "now", percertagenum); | |
| 1310 | - } | |
| 1311 | - } | |
| 1312 | - | |
| 1291 | + // 最后一个字符调用 | |
| 1313 | 1292 | if(GBCodePlayBack.triggertotal === GBCodePlayBack.records.length && !replay_type){ |
| 1314 | - | |
| 1293 | + | |
| 1294 | + $('#recordertab a:first').tab('show'); | |
| 1295 | + | |
| 1315 | 1296 | $('#play') |
| 1316 | 1297 | .data('status', 0) |
| 1317 | 1298 | .attr('title', '播放') |
| 1318 | - .addClass('btn-success') | |
| 1319 | - .removeClass('btn-danger') | |
| 1320 | 1299 | .removeClass('infinite') |
| 1321 | 1300 | .find('span') |
| 1322 | 1301 | .addClass('glyphicon-play') |
| 1323 | 1302 | .removeClass('glyphicon-pause'); |
| 1324 | - | |
| 1325 | 1303 | |
| 1326 | - $('#recordertab a:first').tab('show'); | |
| 1327 | 1304 | if(_role == 1){ |
| 1328 | 1305 | for (var i = 0; i < GBCodePlayBack.records.length; i++) { |
| 1329 | 1306 | GBCodePlayBack.records[i].trigger = 0; |
| ... | ... | @@ -1335,9 +1312,6 @@ $(function(){ |
| 1335 | 1312 | Hourglass.stopTimer(); |
| 1336 | 1313 | } |
| 1337 | 1314 | console.log("-----------播放结束------------") |
| 1338 | - /* 移动设备的下一节和代码编写控制 */ | |
| 1339 | - $('#donenext').removeClass('disabled'); | |
| 1340 | - | |
| 1341 | 1315 | |
| 1342 | 1316 | $('#mobiledonenext').removeClass('disabled'); |
| 1343 | 1317 | |
| ... | ... | @@ -1345,24 +1319,6 @@ $(function(){ |
| 1345 | 1319 | $('#resizeeditors').trigger('click'); |
| 1346 | 1320 | } |
| 1347 | 1321 | |
| 1348 | - $('#replayprogressbar').addClass("animated flash"); | |
| 1349 | - | |
| 1350 | - //教程里的完成和联系按钮 | |
| 1351 | - var panelbody = $('#trybymyselfttips').closest('.panel-body'); | |
| 1352 | - | |
| 1353 | - $('#trybymyselfttips').removeClass('tutorialexcercise_hide').addClass('tutorialexcercise_show'); | |
| 1354 | - | |
| 1355 | - | |
| 1356 | - if($("#replaydone").length){ | |
| 1357 | - scrollToElement(panelbody, $('#donenext')); | |
| 1358 | - } | |
| 1359 | - | |
| 1360 | - $('#replaydone').addClass('animated bounce'); | |
| 1361 | - | |
| 1362 | - if($('#replaydone').data("readonly")){ | |
| 1363 | - $('#replaydone').trigger('click'); | |
| 1364 | - } | |
| 1365 | - | |
| 1366 | 1322 | GBCodePlayBack.triggeroffset=0; //reset offset for 滑动进度条 |
| 1367 | 1323 | } |
| 1368 | 1324 | |
| ... | ... | @@ -1370,6 +1326,8 @@ $(function(){ |
| 1370 | 1326 | var $sliderpropress = $(".replayprogress"); |
| 1371 | 1327 | $sliderpropress.slider( "option", "disabled", false ); |
| 1372 | 1328 | $('#excerciselist .ineedautocodehelp').data('status',0).attr('title','播放').find('span').addClass('glyphicon-play-circle').removeClass('glyphicon-stop'); |
| 1329 | + console.log('============================================') | |
| 1330 | + console.log(GBCodePlayBack.excercise_triggertotal) | |
| 1373 | 1331 | if(_role == 1){ |
| 1374 | 1332 | for (var i = 0; i < GBCodePlayBack.records.length; i++) { |
| 1375 | 1333 | GBCodePlayBack.records[i].trigger = 0; | ... | ... |