survey/public/completion.html
2025-11-30 23:12:06 +08:00

306 lines
8.6 KiB
HTML

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{student_name}} - 测评已完成</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Microsoft YaHei', sans-serif;
}
body {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
padding: 20px;
}
.container {
background: white;
border-radius: 20px;
box-shadow: 0 20px 40px rgba(0,0,0,0.1);
padding: 40px;
text-align: center;
max-width: 600px;
width: 100%;
}
.success-icon {
width: 80px;
height: 80px;
background: linear-gradient(135deg, #4CAF50, #45a049);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
margin: 0 auto 30px;
font-size: 40px;
color: white;
}
h1 {
color: #333;
margin-bottom: 20px;
font-size: 28px;
}
.student-info {
background: #f8f9fa;
padding: 20px;
border-radius: 10px;
margin: 20px 0;
text-align: left;
}
.info-row {
display: flex;
justify-content: space-between;
margin: 10px 0;
padding: 5px 0;
border-bottom: 1px solid #eee;
}
.info-row:last-child {
border-bottom: none;
}
.info-label {
font-weight: bold;
color: #666;
}
.info-value {
color: #333;
}
.score-display {
background: linear-gradient(135deg, #FF6B6B, #4ECDC4);
color: white;
padding: 30px;
border-radius: 15px;
margin: 30px 0;
position: relative;
overflow: hidden;
}
.score-display::before {
content: '';
position: absolute;
top: -50%;
right: -50%;
width: 200%;
height: 200%;
background: rgba(255,255,255,0.1);
transform: rotate(45deg);
}
.score-number {
font-size: 48px;
font-weight: bold;
margin-bottom: 10px;
position: relative;
z-index: 1;
}
.score-label {
font-size: 18px;
opacity: 0.9;
position: relative;
z-index: 1;
}
.message {
color: #666;
font-size: 16px;
margin: 20px 0;
line-height: 1.6;
}
.actions {
margin-top: 30px;
}
.btn {
display: inline-block;
padding: 12px 30px;
margin: 10px;
background: linear-gradient(135deg, #667eea, #764ba2);
color: white;
text-decoration: none;
border-radius: 25px;
font-weight: bold;
transition: all 0.3s ease;
border: none;
cursor: pointer;
}
.btn:hover {
transform: translateY(-2px);
box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}
.btn-secondary {
background: linear-gradient(135deg, #6c757d, #5a6268);
}
.footer {
margin-top: 40px;
padding-top: 20px;
border-top: 1px solid #eee;
color: #999;
font-size: 14px;
}
@media (max-width: 768px) {
.container {
padding: 15px;
}
h1 {
font-size: 24px;
}
.result-section {
padding: 25px 15px;
}
.score-display {
padding: 30px 20px;
margin-bottom: 20px;
}
.score-value {
font-size: 36px;
}
.success-icon {
font-size: 45px;
}
.report-status-container {
padding: 25px 20px;
margin: 0 10px;
}
.status-header {
flex-direction: column;
text-align: center;
}
.status-icon {
font-size: 35px;
margin-right: 0;
margin-bottom: 10px;
}
.status-title {
font-size: 20px;
}
.status-message {
font-size: 14px;
}
.primary-action {
width: 100%;
max-width: 280px;
padding: 14px 25px;
font-size: 15px;
}
.secondary-info {
font-size: 13px;
margin-top: 12px;
padding: 10px;
}
.loading-dots {
gap: 6px;
}
.loading-dot {
width: 10px;
height: 10px;
}
.btn {
display: block;
margin: 10px auto;
width: 80%;
}
}
</style>
</head>
<body>
<div class="container">
<div class="success-icon"></div>
<h1>测评已完成!</h1>
<div class="student-info">
<div class="info-row">
<span class="info-label">姓名:</span>
<span class="info-value">{{student_name}}</span>
</div>
<div class="info-row">
<span class="info-label">学校:</span>
<span class="info-value">{{school}}</span>
</div>
<div class="info-row">
<span class="info-label">年级:</span>
<span class="info-value">{{grade}}</span>
</div>
<div class="info-row">
<span class="info-label">完成时间:</span>
<span class="info-value">{{completed_at}}</span>
</div>
</div>
<div class="score-display">
<div class="score-number">{{total_score}} 分</div>
<div class="score-label">本次测评得分</div>
</div>
<div class="message">
恭喜您完成了本次学科能力测评!<br>
系统正在为您生成详细的个性化报告,请稍后查看。
</div>
<div class="actions">
<a href="/quiz-results/{{session_id}}" class="btn btn-secondary">查看答题结果</a>
</div>
<script>
async function checkAndShowReport(sessionId) {
try {
// 首先尝试通过session_id查找报告
const response = await fetch('/api/reports');
const data = await response.json();
const report = data.reports.find(r => r.session_id === sessionId);
if (report) {
// 找到报告,跳转到报告页面
window.location.href = `/report.html?id=${report.id}`;
} else {
// 报告还在生成中,显示提示
alert('报告正在生成中,请稍后再试。\\n您也可以稍后返回首页查看历史报告。');
}
} catch (error) {
console.error('检查报告失败:', error);
alert('检查报告状态失败,请稍后再试。');
}
}
</script>
<div class="footer">
学科能力测评系统 | 专业 · 科学 · 个性化
</div>
</div>
</body>
</html>