Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
국민대학교 안전교육 이수 스크립트 (2020.04.09 동작확인)
const INTERVAL = 10000;
var getQueryVariable = function (key) {
let query = window.location.search.substring(1);
let vars = query.split('&');
for (let i = 0; i < vars.length; i++) {
let pair = vars[i].split('=');
if (decodeURIComponent(pair[0]) == key) {
return decodeURIComponent(pair[1]);
}
}
console.error('Query variable %s not found', key);
}
var kmuMacro = function (progressNo, pageNo) {
const givenGap = 10 * 60;
console.log(`현재 ${pageNo} 페이지를 수강중입니다`);
$.ajax({
type: "POST",
async: false,
url: "/Edu/ContentsViewNextProcess",
data: { "scheduleMemberProgressNo": progressNo, "gapTime": givenGap, "currentPage": pageNo },
success: function (data) {
if (data.Success == true) {
console.log(`${pageNo} 페이지 수강처리 완료. ${INTERVAL / 1000}초간 대기합니다...`);
if (data.IsLastPage == true) {
alert("수고 하셨습니다. 해당 교육이 완료 되었습니다.");
return;
}
setTimeout(function () {
kmuMacro(progressNo, pageNo + 1);
}, INTERVAL);
} else {
console.error('처리 도중 오류가 발생했습니다: API 처리 실패');
alert(data.Message);
}
},
error: function (xhr, status, error) {
console.error('처리 도중 오류가 발생했습니다: API 비정상');
alert("err : " + error);
}
});
};
var progressNumber = getQueryVariable('scheduleMemberProgressNo');
console.log('진도 ID: ', progressNumber);
var currentPageNumber = getCurrentPageNumber();
console.log('현재 페이지: ', currentPageNumber);
kmuMacro(progressNumber, currentPageNumber - 1);
@KyuhwanYeon

This comment has been minimized.

Copy link

@KyuhwanYeon KyuhwanYeon commented Apr 14, 2018

Thank you~!

@enduf7686

This comment has been minimized.

Copy link

@enduf7686 enduf7686 commented Mar 25, 2019

Thank you~!

@ray4167

This comment has been minimized.

Copy link

@ray4167 ray4167 commented Mar 27, 2019

Thank you~! You've saved me from hell!

@azure-in-lab

This comment has been minimized.

Copy link

@azure-in-lab azure-in-lab commented May 16, 2019

Thank you~!

@fool8474

This comment has been minimized.

Copy link

@fool8474 fool8474 commented May 16, 2019

Thank you~!

@visionNoob

This comment has been minimized.

Copy link

@visionNoob visionNoob commented May 24, 2019

i love you~!

@pookjw

This comment has been minimized.

Copy link

@pookjw pookjw commented Dec 5, 2019

당신 덕분에 모교가 빛납니다.

@KimMilim

This comment has been minimized.

Copy link

@KimMilim KimMilim commented May 6, 2020

당신 덕분에 모교가 빛납니다.

@Hong-been

This comment has been minimized.

Copy link

@Hong-been Hong-been commented May 23, 2020

최고에요

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment