File size: 3,028 Bytes
ecbf8f2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | const questions = [
"μλ‘μ΄ μ¬λλ€κ³Ό μ½κ² μ΄μΈλ¦¬λμ?",
"μΈλΆμ¬νλ³΄λ€ ν° κ·Έλ¦Όμ λ³΄λ €κ³ νλμ?",
"λ
Όλ¦¬μ μ΄κ³ κ°κ΄μ μΈ κ²°μ μ λ΄λ¦¬λ €κ³ νλμ?",
"μΌμ μ μ κ³ννκ³ λ°λ₯΄λ νΈμΈκ°μ?",
"λ€μν κ°λ₯μ±μ μμνλ©° μκ°νλ κ²μ μ’μνλμ?",
"μλλ°©μ κ°μ μ λ―Όκ°νκ°μ?",
"μ¦ν₯μ μΌλ‘ νλνλ κ²μ μ¦κΈ°λμ?",
"λν μ€ μμ μ΄ λ§λ³΄λ€ μλλ°©μ λ§μ λ λ§μ΄ λ£λμ?",
"λ―Έλμ κ°λ₯μ±λ³΄λ€ νμ¬μ μ¬μ€μ μ§μ€νλμ?",
"κ°λ± μν©μμ μ¬λλ€μ μ‘°νλ₯Ό μ°μ μνλμ?",
"νΌμλ§μ μκ°μ μ€μνκ² μκ°νλμ?",
"μμ μ κ°μ μ μ νννλμ?",
"볡μ‘ν λ¬Έμ λ₯Ό λ
Όλ¦¬μ μΌλ‘ λΆμνλ κ²μ μ¦κΈ°λμ?",
"κ·μΉκ³Ό μ μ°¨λ₯Ό λ°λ₯΄λ κ²μ μ νΈνλμ?",
"μλ‘μ΄ νκ²½μμ λΉ λ₯΄κ² μ μνλμ?",
"μΈλΆμ¬νλ³΄λ€ ν° κ·Έλ¦Όμ λ μ§μ€νλμ?",
"λ€λ₯Έ μ¬λμ κ°μ μ 곡κ°νλ νΈμΈκ°μ?",
"λ§κ° μκ° μ μ μΌμ λλ΄λ κ²μ μ€μνκ² μκ°νλμ?",
"μ¬λλ€κ³Όμ κ΄κ³κ° μμ μκ² μ€μνκ°μ?",
"μμ μ μ견μ ννν λ λ
Όλ¦¬μ μΈ μ΄μ λ₯Ό μ€μνλμ?",
"μ€μ κ²½νμ ν΅ν΄ λ°°μ°λ κ²μ μ νΈνλμ?",
];
let currentQuestion = 0;
let answers = [];
function selectAnswer(answer) {
answers.push(answer);
currentQuestion++;
if (currentQuestion < questions.length) {
showQuestion();
} else {
showResult();
}
}
function showQuestion() {
document.getElementById("question-text").textContent = questions[currentQuestion];
document.getElementById("question-number").textContent = currentQuestion + 1;
}
function showResult() {
const resultContainer = document.getElementById("result-container");
const questionContainer = document.getElementById("question-container");
questionContainer.classList.add("hidden");
resultContainer.classList.remove("hidden");
// κ²°κ³Ό κ³μ° λ‘μ§
const mbtiTypes = ["INTJ", "ENFP", "INFJ", "ENTP", "ISTJ"];
const randomType = mbtiTypes[Math.floor(Math.random() * mbtiTypes.length)];
document.getElementById("mbti-type").textContent = `MBTI μ ν: ${randomType}`;
document.getElementById("mbti-description").textContent = "μ±κ²© μ€λͺ
μ μ¬κΈ°μ νμλ©λλ€.";
document.getElementById("mbti-jobs").textContent = "μΆμ² μ§μ
: κ°λ°μ, λμμ΄λ";
document.getElementById("mbti-tips").textContent = "μμ° κ΄λ¦¬ μλ Ή: κ³νμ μΌλ‘ ν¬μνμΈμ.";
document.getElementById("mbti-image").src = "https://via.placeholder.com/150";
}
function restartQuiz() {
currentQuestion = 0;
answers = [];
document.getElementById("question-container").classList.remove("hidden");
document.getElementById("result-container").classList.add("hidden");
showQuestion();
}
// μ΄κΈ°ν
showQuestion();
|