• 注册
  • 转载分享 转载分享 关注:46 内容:1568

    新版超星学习通一键进入课程上锁章节

  • 查看作者
  • 打赏作者
  • 当前位置: 七七博客 > 转载分享 > 正文
    • 转载分享
    • Lv.7
      VIP1

      新版超星学习通一键进入课程上锁章节新版超星学习通一键进入课程上锁章节新版超星学习通一键进入课程上锁章节

      一键进入课程上锁章节,无视人脸,无视多终端登录,只支持新版学习通。

      // ==UserScript==
      // home.php?mod=space&uid=170990         (新版学习通)一键进入课程上锁章节
      // home.php?mod=space&uid=467642    Ne-21
      // home.php?mod=space&uid=1248337      1.0
      // @description  一键进入课程上锁章节,无视人脸,无视多终端登录,只是配新版学习通
      // home.php?mod=space&uid=686208       Ne-21
      // home.php?mod=space&uid=195849        *://stat2-ans.chaoxing.com/task/s/index*
      // home.php?mod=space&uid=593100         https://blog.gocos.cn/wp-content/uploads/2021/07/2021-07-2782.ico
      // home.php?mod=space&uid=609072        unsafeWindow
      // @require      https://libs.baidu.com/jquery/2.0.0/jquery.min.js
      // @require      https://cdn.jsdelivr.net/npm/sweetalert2@11
      // @run-at       document-end
      // ==/UserScript==
      
      var _self = unsafeWindow;
      var $ = _self.jQuery || top.jQuery;
      var clazzId = $("#clazzId").val();
      var courseId = $('#courseId').val();
      var cpi = $("#cpi").val();
      var mooc1Domain = $("#mooc1Domain").val();
      var pageSize = 16;
      
      (function() {
          hookAjaxGetMethod();
          _self.ajaxGetTaskTable(1, pageSize, 0);
      })();
      
      function hookAjaxGetMethod() {
          console.log(_self.ajaxGetTaskTable);
          if (typeof _self.ajaxGetTaskTable != 'undefined') {
              let hookAjaxGetTaskTable = _self.ajaxGetTaskTable;
              _self.ajaxGetTaskTable = function (page, pageSize, status) {
                  $.ajax({
                      url: '/task/s/progress/detail',
                      data: {
                          clazzid: clazzId,
                          courseid: courseId,
                          cpi: cpi,
                          ut: 's',
                          page: page,
                          pageSize: pageSize,
                          status: status
                      },
                      success: function (result) {
                          var tbodys = '';
                          var results = result.data.results;
                          for (var i = 0; i < results.length; i++) {
                              var chapter = results[i];
      
                              var list = chapter.list;
      
                              var viewClass = '';
                              var view = '';
                              if (visitor == 0) {
                                  view = '<a href="javascript:;" onclick="toMoocChapter(' + chapter.id + ')">'+I18N.View+'</a>';
                                  if (chapter.status === 'close') {
                                      viewClass = 'disableTd';
                                      view = '<a href="javascript:;">'+I18N.View+'</a>'
                                  }
                              }
      
                              var listLength = list.length;
                              tbodys += '<tbody>' +
                                  '<tr class="tr-group">' +
                                  '   <td>' + chapter.combineName + '</td>' +
                                  '   <td class="color646873">-</td>' +
                                  '   <td>' +
                                  '       <div class="barBox fl"><span style="width:' + chapter.completePercent + '%;"></span></div>' +
                                  '       <p class="fl fs12 colorA8A8B3">' + chapter.completeNum + '/' + listLength + '</p>' +
                                  '   </td>' +
                                  '   <td class="' + viewClass + '">' + view + '<i class="fr up" onclick="tableToggle(this)"></i></td>' +
                                  '</tr>';
      
                              for (var j = 0; j < listLength; j++) {
                                  var job = list[j];
      
                                  var color = 'grey';
                                  if (job.status === I18N.Finished) {
                                      color = 'green';
                                  }
                                  var jobStatus = '<td>' + job.status + '</td>';
      
                                  if (job.type === I18N.WorkAttachment) {
                                      var workScoreJson = job.workScore;
                                      if (workScoreJson.status === 3) {
                                          jobStatus = '<td>' + job.status +
                                              '<span class="colorA8A8B3 mg-l-8"> '+I18N.Ungraded+'</span></td>';
                                      } else if (workScoreJson.status === 4) {
                                          jobStatus = '<td>' + job.status +
                                              '<span class="colorA8A8B3 mg-l-8"> '+I18N.ScoreDis+':' + workScoreJson.score + '</span></td>';
                                      }
                                  }
      
                                  var intro = job.intro;
                                  var type = '<td>' + job.type + '</td>';
                                  if (intro) {
                                      type = '<td>' + job.type + '<span class="colorA8A8B3"> (' + job.intro + ')</span></td>'
                                  }
      
                                  tbodys += '<tr class="level-two-tr">' +
                                      '<td class="overHidden1 tr-title"><i class="icon-right-' + color + '"></i>' + job.name + '</td>' +
                                      type +
                                      jobStatus +
                                      '<td><a href="'
                                      + mooc1Domain +
                                      '/knowledge/cards?clazzid='
                                      + clazzId +
                                      '&courseid='
                                      + courseId +
                                      '&knowledgeid='
                                      + job.chapterId +
                                      '&num='
                                      + j +
                                      '&ut=s&cpi='
                                      + cpi +
                                      '" target="_blank">打开此节</a>'
                                      + '</td>' +
                                      ' </tr>';
                              }
                              tbodys += '</tbody>';
                          }
      
                          // 删掉jobTable下所有的tbody节点
                          $('#jobTable tbody').remove();
                          if (tbodys === '') {
                              tbodys = '<tbody><tr class="null-data" >' +
                                  '<td colspan="4">暂无数据</td>' +
                                  '</tr></tbody>'
                          }
                          $('#jobTable').append(tbodys);
      
                          var pInfo = result.data.pageInfo;
                          $("#timePage").empty();
                          if (pInfo.totalPage > 1) {
                              $("#timePage").paging({
                                  nowPage: pInfo.currentPageNo, // 当前页码
                                  pageNum: pInfo.totalPage, // 总页码
                                  buttonNum: 9, //要展示的页码数量
                                  callback: function (num) { //回调函数
                                      ajaxGetTaskTable(num, pageSize, status);
                                  }
                              });
                          }
      
                      }
                  });
              }
              Swal.fire({
                  title: '<span style="color:#a6dc88;">初始化成功</span>',
                  text: '',
                  imageUrl: 'https://pic.521daigua.cn/qr.png',
                  imageWidth: 500,
                  imageHeight: 200,
                  imageAlt: 'Custom image',
              })
          } else {
              Swal.fire({
                  title: '<span style="color:#dd3333;">初始化失败</span>',
                  text: '',
                  imageUrl: 'https://pic.521daigua.cn/qr.png',
                  imageWidth: 500,
                  imageHeight: 200,
                  imageAlt: 'Custom image',
              })
          }
      }

      隐藏内容需要登录才可以看见

      登录

      请登录之后再进行评论

      登录
    • 任务系统
    • 实时动态
    • 帖子间隔 侧栏位置: