-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathMMPI-1-test.html
More file actions
214 lines (183 loc) · 6.48 KB
/
MMPI-1-test.html
File metadata and controls
214 lines (183 loc) · 6.48 KB
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="keywords" content="MMPI-2, 中, 英, 测试">
<meta name="description" content="你可以在该页面进行MMPI测试,并可以在测试完成后得到原始结果、人格剖析图以及基本的解释。">
<meta name="google-site-verification" content="Nn_Nci8x_SMFc-Z2NeVifZ0_MTspzOyIefsEXAPPJgE" />
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=yes">
<title>MMPI-2中文测试</title>
<script type="text/javascript" src="mmpi_2_cn/database/therapist.js"></script>
<script type="text/javascript" src="mmpi_2_cn/database/treatment.js"></script>
<script type="text/javascript" src="mmpi_2_cn/modules/render.js"></script>
<script type="text/javascript" src="mmpi_2_cn/modules/scoring.js"></script>
<script type="text/javascript" src="mmpi_2_cn/my_data.js"></script>
<script type="text/javascript" src="mmpi_2_cn/my_script.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.4/Chart.min.js"></script>
<!-- <link rel="stylesheet" href="./front_page/main.css"> -->
<style>
body {background-color: #1b1f22;
/*background-image: linear-gradient(#1b1f22, #708090);*/
}
.modal {
position: fixed;
top: 0;
left: 0;
width: 60%;
height: 60%;
background-color: rgba(203, 222, 211, 0.5);
display: flex;
justify-content: center;
align-items: center;
z-index: 9999;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.modal-content {
background-color: rgb(204, 210, 199);
padding: 20px;
border-radius: 5px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
font-family:Times New Roman,Hei,Kaiti;
text-align: center;
}
.modal-content h1 {
margin-top: 0;
text-align: center;
}
.modal-content p {
text-align: left;
margin-bottom: 0;
}
.modal-close {
position: absolute;
top: 10px;
right: 10px;
cursor: pointer;
}
.modal-close:before {
content: "×";
font-size: 24px;
}
</style>
<style>
label {
margin-right: 15px;
line-height: 32px;
}
input[type="radio"] {
appearance: none;
border-radius: 50%;
width: 16px;
height: 16px;
border: 2px solid #999;
transition: 0.2s all linear;
margin-right: 5px;
position: relative;
top: 4px;
}
input:checked {
border: 6px solid #B0C4DE;
}
/* from web... */
.my_button {
border-radius: 12px;
padding: 8px 12px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 1.2rem;
margin: 4px 2px;
-webkit-transition-duration: 0.4s; /* Safari */
transition-duration: 0.4s;
cursor: pointer;
font-family:Arial,Kaiti;
}
.my_button {
background-color: #696969;
color: white;
border: 2px solid #B0C4DE;
}
.my_button:hover {
background-color: #B0C4DE;
color: white;
}
</style>
</head>
<body><div>
<!-- 尝试弹出提升框 -->
<script>
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
// 在移动端上不使用该函数
// 2023.5.26我改主意了;重载一个简单的函数就好。
window.onload = showModalInThePhone();
} else {
// 在其他设备上使用该函数
window.onload = showModal();
}
</script>
<div style="width:100%;text-align:center;color:#F0F8FF;font-size:2rem;font-family:Times New Roman,Hei,Kaiti">
<h1>
<b>MMPI-2中文测试</b>
</h1>
</div>
<div style="width:100%;text-align:center;color:#F0F8FF;font-size:1.5rem;font-family:Arial,Hei,Kaiti">
<!-- <div id="my_damn_form"> -->
<form name="config" action="#">
<p>
您的性别:<br>
<input type="radio" name="gender" value="M" onclick="set_gender(0);" checked="">男性
<input type="radio" name="gender" value="F" onclick="set_gender(1);">女性
</p>
</form>
<script type="text/javascript">
function removeRequired() {
// 获取所有的输入元素
var inputs = document.forms.questions.getElementsByTagName('input');
// 遍历所有的输入元素,并移除 'required' 属性
for (var i = 0; i < inputs.length; i++) {
inputs[i].removeAttribute('required');
}
}
</script>
<script type="text/javascript">
function submitForm(e) {
e.preventDefault(); // 阻止表单的默认提交行为
var score = score_rb(document.forms.questions); // 获取分数
// 创建一个新的 FormData 对象,并添加分数
var formData = new FormData(document.forms.questions);
formData.append('score', JSON.stringify(score));
// 使用 fetch 发送异步请求
fetch('https://formspree.io/f/xpzvylav', {
method: 'POST',
body: formData
}).then(response => {
if (response.ok) {
console.log('提交成功');
} else {
console.error('提交失败');
}
}).catch(error => {
console.error('发生错误:', error);
});
}
</script>
<form id="select_all" name="questions" action="https://formspree.io/f/xpzvylav" method="POST" onsubmit="submitForm(event);">
<!-- 其他内容省略 -->
<script type="text/javascript">my_doc_write_all_questions();</script>
<button class="my_button" type="submit">
<span>提交测试</span>
</button>
<!-- 其他内容省略 -->
</form>
</div>
<div id="myCharts" style="width:90%;height:90%;margin:auto">
<canvas id="myChart1"></canvas>
<br><br><br><br>
<canvas id="myChart2"></canvas>
<br><br><br><br>
<div id="therapistGrid"></div>
</div>
</div><!--这种在body上直接加div的方法能解决渐变的问题吗?-->></body>
</html>