症状自评量表
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SCL-90 量表评估</title>
<style>
body { font-family: Arial, sans-serif; max-width: 800px; margin: auto; padding: 20px; }
h2 { text-align: center; }
.question { margin-bottom: 15px; }
.options label { margin-right: 10px; }
#submit-btn { display: block; margin: 20px auto; padding: 10px 20px; font-size: 16px; cursor: pointer; }
#result { font-size: 18px; font-weight: bold; text-align: center; margin-top: 20px; }
</style>
<script>
function calculateScore() {
let totalScore = 0;
let unanswered = 0;
for (let i = 1; i <= 90; i++) {
let value = document.querySelector(`input[name="q${i}"]:checked`);
if (value) {
totalScore += parseInt(value.value);
} else {
unanswered++;
}
}
if (unanswered > 0) {
alert(`请回答所有问题!您还未完成 ${unanswered} 题。`);
return;
}
let averageScore = (totalScore / 90).toFixed(2);
let resultText = `您的总分是:${totalScore},平均分:${averageScore}。`;
if (averageScore >= 2.5) {
resultText += "⚠️ 可能存在心理困扰,建议咨询专业人士。";
} else {
resultText += "😊 结果在正常范围内。";
}
document.getElementById("result").innerHTML = resultText;
}
</script>
</head>
<body>
<h2>SCL-90 症状自评量表</h2>
<p>请根据过去一周的感受,选择最符合您的选项:</p>
<form id="scl90">
<div class="question">
<p>1. 你感到神经过敏,容易烦恼或容易激动吗?</p>
<div class="options">
<label><input type="radio" name="q1" value="1"> 1</label>
<label><input type="radio" name="q1" value="2"> 2</label>
<label><input type="radio" name="q1" value="3"> 3</label>
<label><input type="radio" name="q1" value="4"> 4</label>
<label><input type="radio" name="q1" value="5"> 5</label>
</div>
</div>
<div class="question">
<p>2. 你感到恐惧吗?</p>
<div class="options">
<label><input type="radio" name="q2" value="1"> 1</label>
<label><input type="radio" name="q2" value="2"> 2</label>
<label><input type="radio" name="q2" value="3"> 3</label>
<label><input type="radio" name="q2" value="4"> 4</label>
<label><input type="radio" name="q2" value="5"> 5</label>
</div>
</div>
<div class="question">
<p>3. 你睡眠不好吗?</p>
<div class="options">
<label><input type="radio" name="q3" value="1"> 1</label>
<label><input type="radio" name="q3" value="2"> 2</label>
<label><input type="radio" name="q3" value="3"> 3</label>
<label><input type="radio" name="q3" value="4"> 4</label>
<label><input type="radio" name="q3" value="5"> 5</label>
</div>
</div>
<!-- 🚀 继续添加完整的 90 个问题(建议复制修改) -->
<!-- 你可以根据需求手动增加问题,并替换文本 -->
<button type="button" id="submit-btn" onclick="calculateScore()">提交</button>
</form>
<div id="result"></div>
</body>
</html>
