Commit d7a601bac5c855294070f44c95c97addc32613c3

Authored by ykxie
2 parents 80ac8422 0e6a43b5

Merge branch 'new_Kira' of gitlab.gaoxiaobang.com:kira/programming into feature/20170228_rest

src/js/gb.js
... ... @@ -1542,12 +1542,13 @@ $(function() {
1542 1542 $('.upload-tip').hide();
1543 1543 $(window).unbind('beforeunload');
1544 1544 var _data = {
1545   - "programId": data.codeReplayId,
  1545 + "programId": data.codeReplayId || data.studentReplayId,
1546 1546 "programLanguageName": data.languageName,
1547 1547 "programLanguageId": data.languageid,
1548 1548 "programmingSource": data.programmingSource,
1549   - "programAudioLength": keepTimer
  1549 + "programAudioLength": keepTimer || 0
1550 1550 }
  1551 + console.log(_data);
1551 1552 $('.upload-tip').hide();
1552 1553  
1553 1554 $('#cancel').prop("disabled", false);
... ... @@ -1936,17 +1937,8 @@ $(function() {
1936 1937 }
1937 1938 }
1938 1939  
1939   - // if (editor === 'html') {
1940   - // processChangeObject(GBCodePlayBack.htmlplayereditor, obj);
1941   - // } else if (editor === 'css') {
1942   - // processChangeObject(GBCodePlayBack.cssplayereditor, obj);
1943   - // } else if (editor === 'js') {
1944   - // processChangeObject(GBCodePlayBack.jsplayereditor, obj);
1945   - // }
1946   -
1947 1940 record.trigger = 1; //标记已运行
1948 1941 record.playTime = new Date().getTime(); // 播放开始时间
1949   - GBCodePlayBack.codeTimes = 1; //
1950 1942  
1951 1943 var resultData = {
1952 1944 status: record.status || 200,
... ... @@ -1959,16 +1951,9 @@ $(function() {
1959 1951 if (record.code == 0) {
1960 1952 compileResult(resultData, record.runtimeArgus);
1961 1953 }
1962   -
1963   - // if (resultData.status) {
1964   - // compileResult(resultData);
1965   - // }
1966 1954  
1967   - if (replay_type) {
1968   - GBCodePlayBack.excercise_triggertotal += 1;
1969   - } else {
1970   - GBCodePlayBack.triggertotal += 1;
1971   - }
  1955 +
  1956 + GBCodePlayBack.triggertotal += 1;
1972 1957  
1973 1958 /*计算播放进度*/
1974 1959 var percertage = '0%',
... ... @@ -1987,69 +1972,20 @@ $(function() {
1987 1972  
1988 1973 if (GBCodePlayBack.triggertotal === GBCodePlayBack.records.length && !replay_type) {
1989 1974  
1990   - $('#play')
1991   - .data('status', 0)
1992   - .attr('title', '播放')
1993   - .addClass('btn-success')
1994   - .removeClass('btn-danger')
1995   - .removeClass('infinite')
1996   - .find('span')
1997   - .addClass('glyphicon-play')
1998   - .removeClass('glyphicon-pause');
  1975 + $('#play').data('status', 0)
1999 1976  
2000 1977 $('#recordertab a:first').tab('show');
2001   - if(_role == 1){
2002   - for (var i = 0; i < GBCodePlayBack.records.length; i++) {
2003   - GBCodePlayBack.records[i].trigger = 0;
2004   - }
2005   - $('.play-code').attr('disabled', false);
  1978 +
  1979 + for (var i = 0; i < GBCodePlayBack.records.length; i++) {
  1980 + GBCodePlayBack.records[i].trigger = 0;
2006 1981 }
  1982 + $('.play-code').attr('disabled', false);
2007 1983  
2008 1984 if(document.URL.indexOf('index.htm') >= 0) {
2009 1985 Hourglass.stopTimer();
2010 1986 }
2011 1987  
2012   - /* 移动设备的下一节和代码编写控制 */
2013   - $('#donenext').removeClass('disabled');
2014   -
2015   -
2016   - $('#mobiledonenext').removeClass('disabled');
2017   -
2018   - if ($(window).width() > 992 && $('#editorpanel').hasClass('col-md-8')) {
2019   - $('#resizeeditors').trigger('click');
2020   - }
2021   -
2022   - $('#replayprogressbar').addClass("animated flash");
2023   -
2024   - //教程里的完成和联系按钮
2025   - var panelbody = $('#trybymyselfttips').closest('.panel-body');
2026   -
2027   - $('#trybymyselfttips').removeClass('tutorialexcercise_hide').addClass('tutorialexcercise_show');
2028   -
2029   -
2030   - if ($("#replaydone").length) {
2031   - scrollToElement(panelbody, $('#donenext'));
2032   - }
2033   -
2034   - $('#replaydone').addClass('animated bounce');
2035   -
2036   - if ($('#replaydone').data("readonly")) {
2037   - $('#replaydone').trigger('click');
2038   - }
2039   -
2040   - GBCodePlayBack.triggeroffset = 0; //reset offset for 滑动进度条
2041   - }
2042   -
2043   - if (GBCodePlayBack.excercise_triggertotal === GBCodePlayBack.excercise_records.length) {
2044   - var $sliderpropress = $(".replayprogress");
2045   - $sliderpropress.slider("option", "disabled", false);
2046   - $('#excerciselist .ineedautocodehelp').data('status', 0).attr('title', '播放').find('span').addClass('glyphicon-play-circle').removeClass('glyphicon-stop');
2047   - if(_role == 1){
2048   - for (var i = 0; i < GBCodePlayBack.records.length; i++) {
2049   - GBCodePlayBack.records[i].trigger = 0;
2050   - }
2051   - $('.play-code').attr('disabled', false);
2052   - }
  1988 + GBCodePlayBack.triggertotal = 0;
2053 1989 }
2054 1990 }
2055 1991 },
... ... @@ -2557,7 +2493,6 @@ $(function() {
2557 2493  
2558 2494 // 初始化页面
2559 2495 function initRecoding() {
2560   - console.log('initRecoding');
2561 2496 GBCodePlayBack.recordinit();
2562 2497 GBCodePlayBack.resetCodeMirrorValue();
2563 2498 $(".re-tips").hide();
... ...
src/js/gbreplayer.js
... ... @@ -1282,58 +1282,25 @@ $(function(){
1282 1282 compileResult(resultData);
1283 1283 }
1284 1284  
1285   - if(replay_type){
1286   - GBCodePlayBack.excercise_triggertotal += 1;
1287   - }else{
1288   - GBCodePlayBack.triggertotal += 1;
1289   - }
  1285 +
  1286 + GBCodePlayBack.triggertotal += 1;
1290 1287  
1291 1288 // 最后一个字符调用
1292   - if(GBCodePlayBack.triggertotal === GBCodePlayBack.records.length && !replay_type){
1293   -
1294   - $('#recordertab a:first').tab('show');
1295   -
1296   - $('#play')
1297   - .data('status', 0)
1298   - .attr('title', '播放')
1299   - .removeClass('infinite')
1300   - .find('span')
1301   - .addClass('glyphicon-play')
1302   - .removeClass('glyphicon-pause');
1303   -
1304   - if(_role == 1){
1305   - for (var i = 0; i < GBCodePlayBack.records.length; i++) {
1306   - GBCodePlayBack.records[i].trigger = 0;
1307   - }
1308   - $('.play-code').attr('disabled', false);
1309   - }
  1289 + if(GBCodePlayBack.triggertotal === GBCodePlayBack.records.length){
  1290 +
  1291 + $('#recordertab a:first').tab('show');
1310 1292  
1311   - if(document.URL.indexOf('index.htm') >= 0) {
1312   - Hourglass.stopTimer();
1313   - }
1314   - console.log("-----------播放结束------------")
1315   -
1316   - $('#mobiledonenext').removeClass('disabled');
1317   -
1318   - if($(window).width()>992&&$('#editorpanel').hasClass('col-md-8')){
1319   - $('#resizeeditors').trigger('click');
1320   - }
1321   -
1322   - GBCodePlayBack.triggeroffset=0; //reset offset for 滑动进度条
1323   - }
1324   -
1325   - if(GBCodePlayBack.excercise_triggertotal === GBCodePlayBack.excercise_records.length){
1326   - var $sliderpropress = $(".replayprogress");
1327   - $sliderpropress.slider( "option", "disabled", false );
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)
1331   - if(_role == 1){
1332   - for (var i = 0; i < GBCodePlayBack.records.length; i++) {
1333   - GBCodePlayBack.records[i].trigger = 0;
1334   - }
1335   - $('.play-code').attr('disabled', false);
1336   - }
  1293 + $('#play').data('status', 0);
  1294 +
  1295 + for (var i = 0; i < GBCodePlayBack.records.length; i++) {
  1296 + GBCodePlayBack.records[i].trigger = 0;
  1297 + }
  1298 + $('.play-code').attr('disabled', false);
  1299 +
  1300 + if(document.URL.indexOf('index.htm') >= 0) {
  1301 + Hourglass.stopTimer();
  1302 + }
  1303 + GBCodePlayBack.triggertotal = 0;
1337 1304 }
1338 1305 }
1339 1306 },
... ...