Last active
July 24, 2019 09:08
-
-
Save xavierskip/8f4dd9d593dfe8ea1565f5753cdcdf4a to your computer and use it in GitHub Desktop.
yun.chinahrt.com的辅助脚本
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 要在console中选择相应的页面 | |
// iframe(play) | |
window.onfocus = function(){console.log('ononfocus')}; | |
window.onblur = function(){console.log('onblur')}; | |
// 去掉所有的定时器。 | |
var biggestTimeoutId = window.setTimeout(function(){}, 1),i; | |
for(i = 1; i <= biggestTimeoutId; i++) { | |
clearTimeout(i); | |
};console.log('biggestTimeoutId',biggestTimeoutId) | |
// top | |
// 改写我们自己的ajax,其中有些内容需要根据课程的不同手动修改,因为token是直接html模版生成的。 | |
time = new Date().getTime(); | |
Lesson = 1.47; //课程的进度, | |
var Id; | |
var submit = function () { | |
$.ajax({ | |
type: "POST", | |
url: "/lms/itemUpdateLesson?x=x&t=" + time, | |
data: { | |
playToken: "275b840fce0d451aa299dbcaaceeaf52", // 需要替换 | |
complatePer: 95, //不明 | |
totalLearnTime: 15, //不明 | |
id: "aae0fa83-6521-4325-8b6f-d254be8c2686", // 需要替换 | |
reqLessonLocation: Lesson, | |
//onlyPlay: "7195df71-f0ec-4cb4-bf32-88b91105efca", | |
} | |
}) | |
.always(function (data) { | |
console.log('response:',data) | |
if(data == 'complate'){ | |
clearTimeout(Id); | |
loadDataIntoModel('cmi.core.lesson_status', 'complate'); | |
} | |
}); | |
time += 30000; | |
Lesson += 30; | |
console.log('lesson:',Lesson); | |
}; | |
Id = setInterval(submit,30000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment