Fix statistics calculation for imported Likert scale responses and support text rating answers

This commit is contained in:
pongpon pitisuk
2026-09-12 16:11:27 +07:00
parent fb5b4b4c95
commit a68bddb5c0
4 changed files with 217 additions and 39 deletions
+29 -11
View File
@@ -24,44 +24,62 @@
}
}
</script>
<link rel="stylesheet" href="css/style.css?v=6">
<link rel="stylesheet" href="css/style.css?v=9">
<style>
body { background-color: var(--bg-color); font-family: 'Noto Sans Thai', sans-serif; }
.stats-view-container {
max-width: 1200px;
margin: 0 auto;
padding: 100px 20px 60px;
padding: 90px 16px 60px;
}
.stats-header {
position: fixed;
top: 0;
left: 0;
right: 0;
height: var(--header-height);
background: rgba(255, 255, 255, 0.95);
min-height: var(--header-height);
background: rgba(255, 255, 255, 0.96);
backdrop-filter: blur(12px);
border-bottom: 3px solid #fbbf24;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 40px;
padding: 10px 24px;
z-index: 1000;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
gap: 12px;
flex-wrap: wrap;
}
.stats-title {
font-size: 1.25rem;
font-size: 1.15rem;
font-weight: 800;
color: #1e3a8a;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 600px;
}
@media (max-width: 768px) {
.stats-header {
padding: 10px 12px;
}
.stats-title {
max-width: 220px;
font-size: 1rem;
}
.stats-view-container {
padding: 120px 10px 40px;
}
}
</style>
</head>
<body class="font-thai">
<header class="stats-header">
<div class="d-flex items-center gap-16">
<button class="btn btn-ghost btn-sm" onclick="window.close()">✕ ปิด</button>
<div class="d-flex items-center gap-12 overflow-hidden">
<button class="btn btn-ghost btn-sm" onclick="window.close()">✕ <span class="hidden sm:inline">ปิด</span></button>
<div class="stats-title" id="statsSurveyTitle">กำลังโหลดผลสถิติ...</div>
</div>
<div id="statsActions" class="d-flex gap-12">
<div id="statsActions" class="d-flex gap-8 flex-wrap">
<!-- Buttons will be rendered here -->
</div>
</header>
@@ -75,7 +93,7 @@
</div>
</main>
<script src="js/app.js"></script>
<script src="js/stats.js"></script>
<script src="js/app.js?v=9"></script>
<script src="js/stats.js?v=9"></script>
</body>
</html>