Last active
March 13, 2025 04:57
-
-
Save Verssae/0ed510986e87a8360965daaef3608861 to your computer and use it in GitHub Desktop.
한양대 안전교육 스킵 스크립트
This file contains 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
/* | |
Hanyang Univ. a script for skipping safetyedu courses | |
http://safetyedu.hanyang.ac.kr/ | |
[교육 영상 스킵] | |
1. '수강하기' 버튼을 눌러 안전교육 창을 띄운다. | |
2. 개발자도구(F12 버튼을 눌러)를 열어 'console' 탭에 이동해 아래 스크립트를 붙여넣는다. | |
3. 6과목에 대해 반복한다. | |
ref: https://kysgh2.tistory.com/113 | |
*/ | |
var currentPage = nowPageNum; | |
function goNextPage() { | |
if (currentPage < totalPageNum) { | |
opener.PageMove(currentPage); | |
console.log(`${currentPage} 페이지를 수강완료했습니다.`); | |
currentPage += 1; | |
setTimeout(function () { | |
goNextPage(); | |
}, 100); | |
} else { | |
opener.PageMove(currentPage); | |
console.log('강의 수강이 완료되었습니다!'); | |
setTimeout(function () { | |
window.close(); | |
}, 200); | |
} | |
} | |
setTimeout(function () { | |
goNextPage(); | |
}, 100) | |
/* | |
[퀴즈 스킵] | |
1. 6과목을 다 듣고 '평가하기' 버튼을 누른다. | |
2. 개발자도구(F12 버튼을 눌러)를 열어 'console' 탭에 이동해 아래 스크립트를 붙여넣는다. | |
*/ | |
SetExamAfeter(); | |
let answers = Array.from({length: questionCountInExam}, (x,i) => document.getElementById("qustionCorrectNo_" + i).value); | |
SetExamBefore(); | |
for (let i=0; i<questionCountInExam; i++) { | |
let ls = document.getElementsByName(`qustionAnswerList[${i}].Answer`); | |
console.log(ls); | |
ls[answers[i]-1].checked = true; | |
} | |
document.getElementById("Exam_btnSave").click(); |
동영상 전용
url에서 scheduleMemberProgressNo를 자동으로 가져오게 했습니다
const urlParams = new URLSearchParams(window.location.search);
const scheduleMemberProgressNo = urlParams.get('scheduleMemberProgressNo');
const formData = new FormData();
formData.append('scheduleMemberProgressNo', scheduleMemberProgressNo); // URL에서 가져온 값 사용
formData.append('currentTime', '1');
formData.append('isEnd', 'true');
fetch('https://safetyedu.hanyang.ac.kr/Edu/AviProcessCheck', {
method: 'POST',
body: formData
})
.then(response => response.text())
.then(data => {
console.log('서버 응답:', data);
})
.catch(error => {
console.error('에러 발생:', error);
});
스크립트 입력 후 팝업 닫고 새로고침하면 적용됩니다
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
동영상 전용 해결방법
const formData = new FormData();
formData.append('scheduleMemberProgressNo', '1361183(예시)'); // 영상 링크중에 scheduleMemberProgressNo 뒤에 번호 넣으시면 됩니다
formData.append('currentTime', '1');
formData.append('isEnd', 'true');
fetch('https://safetyedu.hanyang.ac.kr/Edu/AviProcessCheck', {
method: 'POST',
body: formData
})
.then(response => response.text())
.then(data => {
console.log('서버 응답:', data);
})
.catch(error => {
console.error('에러 발생:', error);
});
"서버 응답: {"IsSuccess":true,"Msg":""}"
요렇게 뜨시면 나가시고 새로고침 하면 적용됩니다.
몇번 테스트해보긴 했는데 일단 저는 잘 작동했습니다.