forked from seungeunn/webgrus_team7
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprocess.html
93 lines (80 loc) · 2.11 KB
/
process.html
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>테스트</title>
</head>
<body>
<script>
var EorI = 0; // E인지 I인지 저장할 변수~ 밑에도 같음~
var NorS = 0;
var TorF = 0;
var JorP = 0;
var mbti = ""; // 최종적으로 mbti 문자열이 저장될 변수
/*
Set Test Var
Expected result ==> ISFP
*/
//E or I
if (localStorage.getItem("question4") == "2") {
EorI += 1;
}
if (localStorage.getItem("question7") == "1") {
EorI += 1;
}
if (localStorage.getItem("question11") == "2") {
EorI += 1;
}
if (EorI > 2) {
EorI = "E";
} else EorI = "I";
//N or S
if (localStorage.getItem("question1") == "1") {
NorS += 1;
}
if (localStorage.getItem("question8") == "1") {
NorS += 1;
}
if (localStorage.getItem("question12") == "2") {
NorS += 1;
}
if (NorS > 2) {
NorS = "N";
} else NorS = "S";
//T or F
if (localStorage.getItem("question3") == "2") {
TorF += 1;
}
if (localStorage.getItem("question6") == "2") {
TorF += 1;
}
if (localStorage.getItem("question10") == "2") {
TorF += 1;
}
if (TorF > 2) {
TorF = "T";
} else TorF = "F";
//J or P
if (localStorage.getItem("question2") == "1") {
JorP += 1;
}
if (localStorage.getItem("question5") == "1") {
JorP += 1;
}
if (localStorage.getItem("question9") == "1") {
JorP += 1;
}
if (JorP > 2) {
JorP = "J";
} else JorP = "P";
//MBTI 결정
mbti = EorI + NorS + TorF + JorP;
// 최종 결과 확인
alert(mbti);
location.href = "./result.html?" + mbti;
localStorage.clear();
</script>
</body>
</html>