//* ScormState' i saklamak için kullanılan global değiştken var loadControl = false; var bfb9qc = null; var iframe; var iframeWindow; function Login () { if ($("#login-password").val() !== "" && $("#login-username").val() !== "") { var data = { username: $("#login-username").val(), password: $("#login-password").val(), } fetch('https://report-placement-api.appspot.com/api/student', { method: 'POST', // or 'PUT' headers: { 'Content-Type': 'application/json', }, body: JSON.stringify(data), }).then(res => res.json()) .then(data => { if (data._id && !data.status) { $('#login-content').hide() $('#loading-data').hide() $('#school-content').show() let scormID = data.level === "High" ? 5289969270784000 : 4774311068041216; $iframe = $('#content-iframe') iframeWindow = iframe[0].contentWindow || iframe[0].contentDocument; $iframe.attr('src', `/assets/scorms/${scormID}/index.html` + getHash()) return false; } else if (data.status) { customAlert('Daha önce sınavınız tamamlanmıştır.') return false; } else { customAlert('Yetkisiz giriş. Lütfen tekrar deneyiniz.') console.log(data.message) return false; } }).catch(err => { console.log('err', err); }); } // if (localStorage.code) { // var code = window.atob(localStorage.code); // if (code === "high" || code === "secondary") { // $('#login-content').hide() // $('#loading-data').hide() // $('#school-content').show() // let scormID = code === "high" ? 5289969270784000 : 4774311068041216; // $iframe = $('#content-iframe') // iframeWindow = iframe[0].contentWindow || iframe[0].contentDocument; // $iframe.attr('src', `/assets/scorms/${scormID}/index.html` + getHash()) // return false; // } else { // customAlert('Yetkisiz giriş. Lütfen tekrar deneyiniz.') // return false; // } // } else if($("#login-password").val() === '123456') { // var data = { // username: $("#login-username").val(), // password: $("#login-password").val(), // } // fetch('https://www.ueslms.com/api/v2/authenticate', { // method: 'POST', // or 'PUT' // headers: { // 'Content-Type': 'application/json', // }, // body: JSON.stringify(data), // }) // .then(response => response.json()) // .then(data => { // if (data.success) { // fetch('https://www.ueslms.com/api/v2/user', { // method: 'POST', // or 'PUT' // headers: { // 'Content-Type': 'application/json', // 'Authorization': 'Bearer ' + data.token, // }, // }) // .then(response => response.json()) // .then(y => { // var studentClass = y.data.organization.find(x => x.type === 'grade').name; // if (studentClass === '100-A') { // $('#login-content').hide() // $('#loading-data').hide() // $('#choose-area').show() // } else { // customAlert('Yetkisiz giriş. Lütfen tekrar deneyiniz.') // return false; // } // }) // .catch((error) => { // console.error('Error:', error); // }); // } else { // customAlert('Yetkisiz giriş. Lütfen tekrar deneyiniz.') // return false; // } // }) // .catch((error) => { // console.error('Error:', error); // }); } function chooseArea (value) { if (value === 'high') { $('#choose-area').hide() $('#school-content').show() let scormID = 5289969270784000; $iframe = $('#content-iframe') iframeWindow = iframe[0].contentWindow || iframe[0].contentDocument; $iframe.attr('src', `/assets/scorms/${scormID}/index.html` + getHash()) return false; } else if (value === 'secondary') { $('#choose-area').hide() $('#school-content').show() let scormID = 4774311068041216; $iframe = $('#content-iframe') iframeWindow = iframe[0].contentWindow || iframe[0].contentDocument; $iframe.attr('src', `/assets/scorms/${scormID}/index.html` + getHash()) return false; } } function customAlert (message) { $('#loading-data').hide() $('#login-content').show() $("#login-error-text").html(message) $('#login-error').show() } $("#login-username, #login-password").keyup(function (event) { if (event.keyCode == 13) { $("#login-submit-btn").click(); } }); function logoutExit () { $('#loading-data').show(); setTimeout(() => { const deleteAllCookies = () => { const cookies = document.cookie.split(";"); for (const cookie of cookies) { const eqPos = cookie.indexOf("="); const name = eqPos > -1 ? cookie.substr(0, eqPos) : cookie; document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT"; } } deleteAllCookies() localStorage.clear(); window.location.search = ""; window.location.href = "/"; $('#loading-data').hide(); }, 3000); } $(".popup-background-frame").click(function () { $('.panel-group', '.popup-background-frame').hide(); }) function testStart () { $('.assignmentImg').hide() $('.main-wraper__info').hide() $('#loading-data').show() $('.main-wrapper__title').hide(); $('.assignmentImg').hide() $('#loading-data').hide() $('#embedded-screen').show() } function getHash () { return window.location.hash.substring(1); } function setPlacementScore (levelsAndPercents) { let currentLevel = null; if (levelsAndPercents.length === 1) { currentLevel = levelsAndPercents[0]; } else { for (let i = levelsAndPercents.length - 1; i >= 0; i -= 1) { const level = levelsAndPercents[i]; if (level.success > 70) { currentLevel = level; break; } else { currentLevel = levelsAndPercents[i - 1]; break; } } } // let reportHtml = `

// // // // // // // // // // // // // `; let reportHtml = `
`; // let rowHtml = ''; // for (let i = 0; i < levelsAndPercents.length; i++) { // var item = levelsAndPercents[i]; // if (i === 0) { // rowHtml += ` // // // // // // // // `; // } else { // rowHtml += ` // // // // // // // `; // } // } // reportHtml += rowHtml; reportHtml += `
`; $("#divResults").append(reportHtml); $('#embedded-screen').hide() $("#divResults").show(); }
ResultLevelVocabularyGrammarMeaning in ContextListeningOverall
${currentLevel.level}${item.level}${item.Vocabulary.toFixed(2)}%${item.Grammar.toFixed(2)}%${item.Meaning.toFixed(2)}%${item.Listening.toFixed(2)}%${Math.floor((item.Vocabulary + item.Grammar + item.Meaning + item.Listening) / 4)}%
${item.level}${item.Vocabulary.toFixed(2)}%${item.Grammar.toFixed(2)}%${item.Meaning.toFixed(2)}%${item.Listening.toFixed(2)}%${Math.floor((item.Vocabulary + item.Grammar + item.Meaning + item.Listening) / 4)}%