Add 3 files
Browse files- README.md +7 -5
- index.html +570 -19
- prompts.txt +1 -0
README.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 1 |
---
|
| 2 |
+
title: practise
|
| 3 |
+
emoji: 🐳
|
| 4 |
+
colorFrom: yellow
|
| 5 |
+
colorTo: blue
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
tags:
|
| 9 |
+
- deepsite
|
| 10 |
---
|
| 11 |
|
| 12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
index.html
CHANGED
|
@@ -1,19 +1,570 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>小学三年级数学计算训练</title>
|
| 7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
| 9 |
+
<style>
|
| 10 |
+
@keyframes correctAnswer {
|
| 11 |
+
0% { transform: scale(1); }
|
| 12 |
+
50% { transform: scale(1.1); }
|
| 13 |
+
100% { transform: scale(1); }
|
| 14 |
+
}
|
| 15 |
+
|
| 16 |
+
@keyframes wrongAnswer {
|
| 17 |
+
0% { transform: translateX(0); }
|
| 18 |
+
25% { transform: translateX(-5px); }
|
| 19 |
+
50% { transform: translateX(5px); }
|
| 20 |
+
75% { transform: translateX(-5px); }
|
| 21 |
+
100% { transform: translateX(0); }
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
.correct-animation {
|
| 25 |
+
animation: correctAnswer 0.5s ease-in-out;
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
.wrong-animation {
|
| 29 |
+
animation: wrongAnswer 0.5s ease-in-out;
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
.progress-bar {
|
| 33 |
+
transition: width 0.3s ease-in-out;
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
.confetti {
|
| 37 |
+
position: absolute;
|
| 38 |
+
width: 10px;
|
| 39 |
+
height: 10px;
|
| 40 |
+
background-color: #f00;
|
| 41 |
+
opacity: 0;
|
| 42 |
+
}
|
| 43 |
+
</style>
|
| 44 |
+
</head>
|
| 45 |
+
<body class="bg-gradient-to-br from-blue-50 to-purple-50 min-h-screen">
|
| 46 |
+
<div class="container mx-auto px-4 py-8">
|
| 47 |
+
<header class="text-center mb-8">
|
| 48 |
+
<h1 class="text-3xl md:text-4xl font-bold text-purple-800 mb-2">
|
| 49 |
+
<i class="fas fa-calculator mr-2"></i>小学三年级数学计算训练
|
| 50 |
+
</h1>
|
| 51 |
+
<p class="text-gray-600">每天练习10分钟,数学计算变轻松!</p>
|
| 52 |
+
</header>
|
| 53 |
+
|
| 54 |
+
<div class="max-w-3xl mx-auto bg-white rounded-xl shadow-lg overflow-hidden">
|
| 55 |
+
<!-- 模式选择 -->
|
| 56 |
+
<div id="mode-selection" class="p-6">
|
| 57 |
+
<h2 class="text-xl font-semibold text-gray-800 mb-4">选择练习模式</h2>
|
| 58 |
+
<div class="grid grid-cols-1 md:grid-cols-3 gap-4">
|
| 59 |
+
<button onclick="startPractice('addition')" class="bg-blue-100 hover:bg-blue-200 text-blue-800 py-4 px-6 rounded-lg transition-all flex flex-col items-center">
|
| 60 |
+
<i class="fas fa-plus-circle text-3xl mb-2"></i>
|
| 61 |
+
<span>加法练习</span>
|
| 62 |
+
</button>
|
| 63 |
+
<button onclick="startPractice('subtraction')" class="bg-green-100 hover:bg-green-200 text-green-800 py-4 px-6 rounded-lg transition-all flex flex-col items-center">
|
| 64 |
+
<i class="fas fa-minus-circle text-3xl mb-2"></i>
|
| 65 |
+
<span>减法练习</span>
|
| 66 |
+
</button>
|
| 67 |
+
<button onclick="startPractice('multiplication')" class="bg-yellow-100 hover:bg-yellow-200 text-yellow-800 py-4 px-6 rounded-lg transition-all flex flex-col items-center">
|
| 68 |
+
<i class="fas fa-times-circle text-3xl mb-2"></i>
|
| 69 |
+
<span>乘法练习</span>
|
| 70 |
+
</button>
|
| 71 |
+
</div>
|
| 72 |
+
|
| 73 |
+
<div class="mt-6">
|
| 74 |
+
<h3 class="text-lg font-medium text-gray-800 mb-3">混合练习</h3>
|
| 75 |
+
<div class="grid grid-cols-2 md:grid-cols-4 gap-3">
|
| 76 |
+
<button onclick="startPractice('mix-easy')" class="bg-purple-100 hover:bg-purple-200 text-purple-800 py-3 px-4 rounded-lg transition-all text-sm">
|
| 77 |
+
简单混合
|
| 78 |
+
</button>
|
| 79 |
+
<button onclick="startPractice('mix-medium')" class="bg-pink-100 hover:bg-pink-200 text-pink-800 py-3 px-4 rounded-lg transition-all text-sm">
|
| 80 |
+
中等混合
|
| 81 |
+
</button>
|
| 82 |
+
<button onclick="startPractice('mix-hard')" class="bg-red-100 hover:bg-red-200 text-red-800 py-3 px-4 rounded-lg transition-all text-sm">
|
| 83 |
+
困难混合
|
| 84 |
+
</button>
|
| 85 |
+
<button onclick="startPractice('mix-random')" class="bg-indigo-100 hover:bg-indigo-200 text-indigo-800 py-3 px-4 rounded-lg transition-all text-sm">
|
| 86 |
+
随机混合
|
| 87 |
+
</button>
|
| 88 |
+
</div>
|
| 89 |
+
</div>
|
| 90 |
+
</div>
|
| 91 |
+
|
| 92 |
+
<!-- 练习界面 -->
|
| 93 |
+
<div id="practice-screen" class="hidden p-6">
|
| 94 |
+
<div class="flex justify-between items-center mb-6">
|
| 95 |
+
<div class="flex items-center">
|
| 96 |
+
<span id="current-mode" class="font-semibold text-lg mr-4"></span>
|
| 97 |
+
<span id="progress" class="text-gray-600">0/10</span>
|
| 98 |
+
</div>
|
| 99 |
+
<div class="w-32 bg-gray-200 rounded-full h-2.5">
|
| 100 |
+
<div id="progress-bar" class="progress-bar bg-purple-600 h-2.5 rounded-full" style="width: 0%"></div>
|
| 101 |
+
</div>
|
| 102 |
+
</div>
|
| 103 |
+
|
| 104 |
+
<div class="text-center py-8">
|
| 105 |
+
<div id="question-container" class="text-4xl font-bold mb-8 min-h-16 flex items-center justify-center">
|
| 106 |
+
<span id="num1" class="inline-block w-16 text-right"></span>
|
| 107 |
+
<span id="operator" class="inline-block w-8 text-center"></span>
|
| 108 |
+
<span id="num2" class="inline-block w-16 text-left"></span>
|
| 109 |
+
<span class="mx-2">=</span>
|
| 110 |
+
<input type="number" id="answer-input" class="w-24 text-4xl font-bold border-b-2 border-purple-300 focus:border-purple-500 focus:outline-none text-center" autofocus>
|
| 111 |
+
</div>
|
| 112 |
+
|
| 113 |
+
<div id="feedback" class="h-8 mb-6">
|
| 114 |
+
<span id="feedback-text" class="text-lg"></span>
|
| 115 |
+
</div>
|
| 116 |
+
|
| 117 |
+
<div class="grid grid-cols-3 gap-3 max-w-xs mx-auto">
|
| 118 |
+
<button onclick="inputNumber('1')" class="bg-gray-100 hover:bg-gray-200 text-gray-800 text-2xl font-bold py-3 rounded-lg transition-all">1</button>
|
| 119 |
+
<button onclick="inputNumber('2')" class="bg-gray-100 hover:bg-gray-200 text-gray-800 text-2xl font-bold py-3 rounded-lg transition-all">2</button>
|
| 120 |
+
<button onclick="inputNumber('3')" class="bg-gray-100 hover:bg-gray-200 text-gray-800 text-2xl font-bold py-3 rounded-lg transition-all">3</button>
|
| 121 |
+
<button onclick="inputNumber('4')" class="bg-gray-100 hover:bg-gray-200 text-gray-800 text-2xl font-bold py-3 rounded-lg transition-all">4</button>
|
| 122 |
+
<button onclick="inputNumber('5')" class="bg-gray-100 hover:bg-gray-200 text-gray-800 text-2xl font-bold py-3 rounded-lg transition-all">5</button>
|
| 123 |
+
<button onclick="inputNumber('6')" class="bg-gray-100 hover:bg-gray-200 text-gray-800 text-2xl font-bold py-3 rounded-lg transition-all">6</button>
|
| 124 |
+
<button onclick="inputNumber('7')" class="bg-gray-100 hover:bg-gray-200 text-gray-800 text-2xl font-bold py-3 rounded-lg transition-all">7</button>
|
| 125 |
+
<button onclick="inputNumber('8')" class="bg-gray-100 hover:bg-gray-200 text-gray-800 text-2xl font-bold py-3 rounded-lg transition-all">8</button>
|
| 126 |
+
<button onclick="inputNumber('9')" class="bg-gray-100 hover:bg-gray-200 text-gray-800 text-2xl font-bold py-3 rounded-lg transition-all">9</button>
|
| 127 |
+
<button onclick="clearInput()" class="bg-red-100 hover:bg-red-200 text-red-800 text-xl font-bold py-3 rounded-lg transition-all">清除</button>
|
| 128 |
+
<button onclick="inputNumber('0')" class="bg-gray-100 hover:bg-gray-200 text-gray-800 text-2xl font-bold py-3 rounded-lg transition-all">0</button>
|
| 129 |
+
<button onclick="submitAnswer()" class="bg-green-100 hover:bg-green-200 text-green-800 text-xl font-bold py-3 rounded-lg transition-all">确定</button>
|
| 130 |
+
</div>
|
| 131 |
+
</div>
|
| 132 |
+
</div>
|
| 133 |
+
|
| 134 |
+
<!-- 结果界面 -->
|
| 135 |
+
<div id="result-screen" class="hidden p-6">
|
| 136 |
+
<div class="text-center py-8">
|
| 137 |
+
<div class="text-5xl mb-6">
|
| 138 |
+
<i id="result-icon" class="fas"></i>
|
| 139 |
+
</div>
|
| 140 |
+
<h2 id="result-title" class="text-2xl font-bold mb-4"></h2>
|
| 141 |
+
<p id="result-message" class="text-gray-600 mb-6"></p>
|
| 142 |
+
|
| 143 |
+
<div class="bg-gray-50 rounded-lg p-4 mb-6">
|
| 144 |
+
<div class="grid grid-cols-2 gap-4 text-left">
|
| 145 |
+
<div>
|
| 146 |
+
<p class="text-gray-500">正确题数</p>
|
| 147 |
+
<p id="correct-count" class="text-2xl font-bold text-green-600">0</p>
|
| 148 |
+
</div>
|
| 149 |
+
<div>
|
| 150 |
+
<p class="text-gray-500">错误题数</p>
|
| 151 |
+
<p id="wrong-count" class="text-2xl font-bold text-red-600">0</p>
|
| 152 |
+
</div>
|
| 153 |
+
<div>
|
| 154 |
+
<p class="text-gray-500">用时</p>
|
| 155 |
+
<p id="time-used" class="text-xl font-bold text-blue-600">0秒</p>
|
| 156 |
+
</div>
|
| 157 |
+
<div>
|
| 158 |
+
<p class="text-gray-500">准确率</p>
|
| 159 |
+
<p id="accuracy" class="text-xl font-bold text-purple-600">0%</p>
|
| 160 |
+
</div>
|
| 161 |
+
</div>
|
| 162 |
+
</div>
|
| 163 |
+
|
| 164 |
+
<div class="flex justify-center space-x-4">
|
| 165 |
+
<button onclick="showWrongQuestions()" id="review-btn" class="bg-yellow-100 hover:bg-yellow-200 text-yellow-800 py-2 px-6 rounded-lg transition-all">
|
| 166 |
+
<i class="fas fa-book-open mr-2"></i>查看错题
|
| 167 |
+
</button>
|
| 168 |
+
<button onclick="restartPractice()" class="bg-purple-100 hover:bg-purple-200 text-purple-800 py-2 px-6 rounded-lg transition-all">
|
| 169 |
+
<i class="fas fa-redo mr-2"></i>重新练习
|
| 170 |
+
</button>
|
| 171 |
+
</div>
|
| 172 |
+
</div>
|
| 173 |
+
</div>
|
| 174 |
+
|
| 175 |
+
<!-- 错题回顾 -->
|
| 176 |
+
<div id="review-screen" class="hidden p-6">
|
| 177 |
+
<div class="flex justify-between items-center mb-6">
|
| 178 |
+
<h2 class="text-xl font-semibold text-gray-800">
|
| 179 |
+
<i class="fas fa-book-open mr-2"></i>错题回顾
|
| 180 |
+
</h2>
|
| 181 |
+
<button onclick="backToResult()" class="text-purple-600 hover:text-purple-800">
|
| 182 |
+
<i class="fas fa-arrow-left mr-1"></i>返回
|
| 183 |
+
</button>
|
| 184 |
+
</div>
|
| 185 |
+
|
| 186 |
+
<div id="wrong-questions-list" class="space-y-4">
|
| 187 |
+
<!-- 错题将在这里动态生成 -->
|
| 188 |
+
</div>
|
| 189 |
+
</div>
|
| 190 |
+
</div>
|
| 191 |
+
|
| 192 |
+
<footer class="text-center mt-8 text-gray-500 text-sm">
|
| 193 |
+
<p>© 2023 小学三年级数学计算训练 | 每天进步一点点</p>
|
| 194 |
+
</footer>
|
| 195 |
+
</div>
|
| 196 |
+
|
| 197 |
+
<script>
|
| 198 |
+
// 全局变量
|
| 199 |
+
let currentMode = '';
|
| 200 |
+
let currentQuestion = 0;
|
| 201 |
+
let totalQuestions = 10;
|
| 202 |
+
let correctAnswers = 0;
|
| 203 |
+
let wrongAnswers = 0;
|
| 204 |
+
let startTime = 0;
|
| 205 |
+
let wrongQuestions = [];
|
| 206 |
+
let currentNum1 = 0;
|
| 207 |
+
let currentNum2 = 0;
|
| 208 |
+
let currentOperator = '';
|
| 209 |
+
let correctAnswer = 0;
|
| 210 |
+
|
| 211 |
+
// 开始练习
|
| 212 |
+
function startPractice(mode) {
|
| 213 |
+
currentMode = mode;
|
| 214 |
+
currentQuestion = 0;
|
| 215 |
+
correctAnswers = 0;
|
| 216 |
+
wrongAnswers = 0;
|
| 217 |
+
wrongQuestions = [];
|
| 218 |
+
startTime = new Date().getTime();
|
| 219 |
+
|
| 220 |
+
// 更新UI
|
| 221 |
+
document.getElementById('mode-selection').classList.add('hidden');
|
| 222 |
+
document.getElementById('practice-screen').classList.remove('hidden');
|
| 223 |
+
document.getElementById('result-screen').classList.add('hidden');
|
| 224 |
+
document.getElementById('review-screen').classList.add('hidden');
|
| 225 |
+
|
| 226 |
+
// 设置模式显示
|
| 227 |
+
let modeName = '';
|
| 228 |
+
switch(mode) {
|
| 229 |
+
case 'addition': modeName = '加法练习'; break;
|
| 230 |
+
case 'subtraction': modeName = '减法练习'; break;
|
| 231 |
+
case 'multiplication': modeName = '乘法练习'; break;
|
| 232 |
+
case 'mix-easy': modeName = '简单混合'; break;
|
| 233 |
+
case 'mix-medium': modeName = '中等混合'; break;
|
| 234 |
+
case 'mix-hard': modeName = '困难混合'; break;
|
| 235 |
+
case 'mix-random': modeName = '随机混合'; break;
|
| 236 |
+
}
|
| 237 |
+
document.getElementById('current-mode').textContent = modeName;
|
| 238 |
+
|
| 239 |
+
// 生成第一题
|
| 240 |
+
generateQuestion();
|
| 241 |
+
}
|
| 242 |
+
|
| 243 |
+
// 生成题目
|
| 244 |
+
function generateQuestion() {
|
| 245 |
+
currentQuestion++;
|
| 246 |
+
updateProgress();
|
| 247 |
+
|
| 248 |
+
// 根据模式生成题目
|
| 249 |
+
let operator = '';
|
| 250 |
+
let num1 = 0, num2 = 0;
|
| 251 |
+
|
| 252 |
+
if (currentMode === 'addition') {
|
| 253 |
+
operator = '+';
|
| 254 |
+
num1 = Math.floor(Math.random() * 50) + 10; // 10-59
|
| 255 |
+
num2 = Math.floor(Math.random() * 50) + 10; // 10-59
|
| 256 |
+
correctAnswer = num1 + num2;
|
| 257 |
+
}
|
| 258 |
+
else if (currentMode === 'subtraction') {
|
| 259 |
+
operator = '-';
|
| 260 |
+
num1 = Math.floor(Math.random() * 50) + 30; // 30-79
|
| 261 |
+
num2 = Math.floor(Math.random() * 30) + 10; // 10-39
|
| 262 |
+
// 确保结果为正数
|
| 263 |
+
if (num1 < num2) {
|
| 264 |
+
[num1, num2] = [num2, num1]; // 交换两个数
|
| 265 |
+
}
|
| 266 |
+
correctAnswer = num1 - num2;
|
| 267 |
+
}
|
| 268 |
+
else if (currentMode === 'multiplication') {
|
| 269 |
+
operator = '×';
|
| 270 |
+
num1 = Math.floor(Math.random() * 9) + 1; // 1-9
|
| 271 |
+
num2 = Math.floor(Math.random() * 9) + 1; // 1-9
|
| 272 |
+
correctAnswer = num1 * num2;
|
| 273 |
+
}
|
| 274 |
+
else {
|
| 275 |
+
// 混合模式
|
| 276 |
+
const modes = ['addition', 'subtraction', 'multiplication'];
|
| 277 |
+
let selectedMode = '';
|
| 278 |
+
|
| 279 |
+
if (currentMode === 'mix-easy') {
|
| 280 |
+
selectedMode = modes[Math.floor(Math.random() * 2)]; // 只加法和减法
|
| 281 |
+
}
|
| 282 |
+
else if (currentMode === 'mix-medium') {
|
| 283 |
+
selectedMode = modes[Math.floor(Math.random() * 3)]; // 加减乘
|
| 284 |
+
}
|
| 285 |
+
else if (currentMode === 'mix-hard') {
|
| 286 |
+
selectedMode = modes[Math.floor(Math.random() * 2) + 1]; // 只减法和乘法
|
| 287 |
+
}
|
| 288 |
+
else {
|
| 289 |
+
selectedMode = modes[Math.floor(Math.random() * 3)]; // 完全随机
|
| 290 |
+
}
|
| 291 |
+
|
| 292 |
+
if (selectedMode === 'addition') {
|
| 293 |
+
operator = '+';
|
| 294 |
+
num1 = Math.floor(Math.random() * 50) + 10;
|
| 295 |
+
num2 = Math.floor(Math.random() * 50) + 10;
|
| 296 |
+
correctAnswer = num1 + num2;
|
| 297 |
+
}
|
| 298 |
+
else if (selectedMode === 'subtraction') {
|
| 299 |
+
operator = '-';
|
| 300 |
+
num1 = Math.floor(Math.random() * 50) + 30;
|
| 301 |
+
num2 = Math.floor(Math.random() * 30) + 10;
|
| 302 |
+
if (num1 < num2) [num1, num2] = [num2, num1];
|
| 303 |
+
correctAnswer = num1 - num2;
|
| 304 |
+
}
|
| 305 |
+
else {
|
| 306 |
+
operator = '×';
|
| 307 |
+
num1 = Math.floor(Math.random() * 9) + 1;
|
| 308 |
+
num2 = Math.floor(Math.random() * 9) + 1;
|
| 309 |
+
correctAnswer = num1 * num2;
|
| 310 |
+
}
|
| 311 |
+
}
|
| 312 |
+
|
| 313 |
+
currentNum1 = num1;
|
| 314 |
+
currentNum2 = num2;
|
| 315 |
+
currentOperator = operator;
|
| 316 |
+
|
| 317 |
+
// 更新UI
|
| 318 |
+
document.getElementById('num1').textContent = num1;
|
| 319 |
+
document.getElementById('operator').textContent = operator;
|
| 320 |
+
document.getElementById('num2').textContent = num2;
|
| 321 |
+
document.getElementById('answer-input').value = '';
|
| 322 |
+
document.getElementById('answer-input').focus();
|
| 323 |
+
document.getElementById('feedback-text').textContent = '';
|
| 324 |
+
}
|
| 325 |
+
|
| 326 |
+
// 更新进度
|
| 327 |
+
function updateProgress() {
|
| 328 |
+
document.getElementById('progress').textContent = `${currentQuestion}/${totalQuestions}`;
|
| 329 |
+
const progressPercent = (currentQuestion / totalQuestions) * 100;
|
| 330 |
+
document.getElementById('progress-bar').style.width = `${progressPercent}%`;
|
| 331 |
+
}
|
| 332 |
+
|
| 333 |
+
// 提交答案
|
| 334 |
+
function submitAnswer() {
|
| 335 |
+
const answerInput = document.getElementById('answer-input');
|
| 336 |
+
const userAnswer = parseInt(answerInput.value);
|
| 337 |
+
|
| 338 |
+
if (isNaN(userAnswer)) {
|
| 339 |
+
document.getElementById('feedback-text').textContent = '请输入一个数字';
|
| 340 |
+
document.getElementById('feedback-text').classList.add('text-red-500');
|
| 341 |
+
document.getElementById('feedback-text').classList.remove('text-green-500');
|
| 342 |
+
return;
|
| 343 |
+
}
|
| 344 |
+
|
| 345 |
+
if (userAnswer === correctAnswer) {
|
| 346 |
+
// 回答正确
|
| 347 |
+
correctAnswers++;
|
| 348 |
+
document.getElementById('feedback-text').textContent = '回答正确!';
|
| 349 |
+
document.getElementById('feedback-text').classList.add('text-green-500');
|
| 350 |
+
document.getElementById('feedback-text').classList.remove('text-red-500');
|
| 351 |
+
document.getElementById('question-container').classList.add('correct-animation');
|
| 352 |
+
|
| 353 |
+
// 移除动画类
|
| 354 |
+
setTimeout(() => {
|
| 355 |
+
document.getElementById('question-container').classList.remove('correct-animation');
|
| 356 |
+
}, 500);
|
| 357 |
+
} else {
|
| 358 |
+
// 回答错误
|
| 359 |
+
wrongAnswers++;
|
| 360 |
+
document.getElementById('feedback-text').textContent = `回答错误,正确答案是 ${correctAnswer}`;
|
| 361 |
+
document.getElementById('feedback-text').classList.add('text-red-500');
|
| 362 |
+
document.getElementById('feedback-text').classList.remove('text-green-500');
|
| 363 |
+
document.getElementById('question-container').classList.add('wrong-animation');
|
| 364 |
+
|
| 365 |
+
// 记录错题
|
| 366 |
+
wrongQuestions.push({
|
| 367 |
+
num1: currentNum1,
|
| 368 |
+
operator: currentOperator,
|
| 369 |
+
num2: currentNum2,
|
| 370 |
+
correctAnswer: correctAnswer,
|
| 371 |
+
userAnswer: userAnswer
|
| 372 |
+
});
|
| 373 |
+
|
| 374 |
+
// 移除动画类
|
| 375 |
+
setTimeout(() => {
|
| 376 |
+
document.getElementById('question-container').classList.remove('wrong-animation');
|
| 377 |
+
}, 500);
|
| 378 |
+
}
|
| 379 |
+
|
| 380 |
+
// 检查是���完成所有题目
|
| 381 |
+
if (currentQuestion >= totalQuestions) {
|
| 382 |
+
showResults();
|
| 383 |
+
} else {
|
| 384 |
+
// 延迟生成下一题
|
| 385 |
+
setTimeout(() => {
|
| 386 |
+
generateQuestion();
|
| 387 |
+
}, 1000);
|
| 388 |
+
}
|
| 389 |
+
}
|
| 390 |
+
|
| 391 |
+
// 显示结果
|
| 392 |
+
function showResults() {
|
| 393 |
+
const endTime = new Date().getTime();
|
| 394 |
+
const timeUsed = Math.round((endTime - startTime) / 1000);
|
| 395 |
+
const accuracy = Math.round((correctAnswers / totalQuestions) * 100);
|
| 396 |
+
|
| 397 |
+
// 更新结果UI
|
| 398 |
+
document.getElementById('correct-count').textContent = correctAnswers;
|
| 399 |
+
document.getElementById('wrong-count').textContent = wrongAnswers;
|
| 400 |
+
document.getElementById('time-used').textContent = `${timeUsed}秒`;
|
| 401 |
+
document.getElementById('accuracy').textContent = `${accuracy}%`;
|
| 402 |
+
|
| 403 |
+
// 根据准确率显示不同的结果
|
| 404 |
+
let resultTitle = '', resultMessage = '', resultIcon = '', iconColor = '';
|
| 405 |
+
if (accuracy === 100) {
|
| 406 |
+
resultTitle = '太棒了!';
|
| 407 |
+
resultMessage = '你全部答对了,真是数学小天才!';
|
| 408 |
+
resultIcon = 'fa-trophy';
|
| 409 |
+
iconColor = 'text-yellow-500';
|
| 410 |
+
createConfetti();
|
| 411 |
+
} else if (accuracy >= 80) {
|
| 412 |
+
resultTitle = '做得很好!';
|
| 413 |
+
resultMessage = '你的表现非常出色,继续保持!';
|
| 414 |
+
resultIcon = 'fa-star';
|
| 415 |
+
iconColor = 'text-blue-500';
|
| 416 |
+
} else if (accuracy >= 60) {
|
| 417 |
+
resultTitle = '不错!';
|
| 418 |
+
resultMessage = '你已经掌握了不少知识,再加把劲!';
|
| 419 |
+
resultIcon = 'fa-thumbs-up';
|
| 420 |
+
iconColor = 'text-green-500';
|
| 421 |
+
} else {
|
| 422 |
+
resultTitle = '继续努力';
|
| 423 |
+
resultMessage = '还需要多加练习,你会越来越好的!';
|
| 424 |
+
resultIcon = 'fa-lightbulb';
|
| 425 |
+
iconColor = 'text-purple-500';
|
| 426 |
+
}
|
| 427 |
+
|
| 428 |
+
document.getElementById('result-title').textContent = resultTitle;
|
| 429 |
+
document.getElementById('result-message').textContent = resultMessage;
|
| 430 |
+
document.getElementById('result-icon').className = `fas ${resultIcon} ${iconColor}`;
|
| 431 |
+
|
| 432 |
+
// 如果没有错题,隐藏查看错题按钮
|
| 433 |
+
if (wrongAnswers === 0) {
|
| 434 |
+
document.getElementById('review-btn').classList.add('hidden');
|
| 435 |
+
} else {
|
| 436 |
+
document.getElementById('review-btn').classList.remove('hidden');
|
| 437 |
+
}
|
| 438 |
+
|
| 439 |
+
// 切换界面
|
| 440 |
+
document.getElementById('practice-screen').classList.add('hidden');
|
| 441 |
+
document.getElementById('result-screen').classList.remove('hidden');
|
| 442 |
+
}
|
| 443 |
+
|
| 444 |
+
// 创建庆祝彩花效果
|
| 445 |
+
function createConfetti() {
|
| 446 |
+
const container = document.getElementById('result-screen');
|
| 447 |
+
|
| 448 |
+
for (let i = 0; i < 50; i++) {
|
| 449 |
+
const confetti = document.createElement('div');
|
| 450 |
+
confetti.className = 'confetti';
|
| 451 |
+
|
| 452 |
+
// 随机颜色
|
| 453 |
+
const colors = ['#f00', '#0f0', '#00f', '#ff0', '#f0f', '#0ff'];
|
| 454 |
+
const randomColor = colors[Math.floor(Math.random() * colors.length)];
|
| 455 |
+
confetti.style.backgroundColor = randomColor;
|
| 456 |
+
|
| 457 |
+
// 随机位置
|
| 458 |
+
const startX = Math.random() * 100;
|
| 459 |
+
const startY = -10;
|
| 460 |
+
confetti.style.left = `${startX}%`;
|
| 461 |
+
confetti.style.top = `${startY}%`;
|
| 462 |
+
|
| 463 |
+
// 随机大小
|
| 464 |
+
const size = Math.random() * 10 + 5;
|
| 465 |
+
confetti.style.width = `${size}px`;
|
| 466 |
+
confetti.style.height = `${size}px`;
|
| 467 |
+
|
| 468 |
+
// 随机形状
|
| 469 |
+
confetti.style.borderRadius = Math.random() > 0.5 ? '50%' : '0';
|
| 470 |
+
|
| 471 |
+
container.appendChild(confetti);
|
| 472 |
+
|
| 473 |
+
// 动画
|
| 474 |
+
const animationDuration = Math.random() * 3 + 2;
|
| 475 |
+
const endY = Math.random() * 100 + 100;
|
| 476 |
+
const endX = startX + (Math.random() * 40 - 20);
|
| 477 |
+
|
| 478 |
+
confetti.style.transition = `all ${animationDuration}s linear`;
|
| 479 |
+
confetti.style.opacity = '1';
|
| 480 |
+
|
| 481 |
+
setTimeout(() => {
|
| 482 |
+
confetti.style.top = `${endY}%`;
|
| 483 |
+
confetti.style.left = `${endX}%`;
|
| 484 |
+
confetti.style.opacity = '0';
|
| 485 |
+
|
| 486 |
+
// 移除元素
|
| 487 |
+
setTimeout(() => {
|
| 488 |
+
confetti.remove();
|
| 489 |
+
}, animationDuration * 1000);
|
| 490 |
+
}, 10);
|
| 491 |
+
}
|
| 492 |
+
}
|
| 493 |
+
|
| 494 |
+
// 显示错题
|
| 495 |
+
function showWrongQuestions() {
|
| 496 |
+
document.getElementById('result-screen').classList.add('hidden');
|
| 497 |
+
document.getElementById('review-screen').classList.remove('hidden');
|
| 498 |
+
|
| 499 |
+
const wrongList = document.getElementById('wrong-questions-list');
|
| 500 |
+
wrongList.innerHTML = '';
|
| 501 |
+
|
| 502 |
+
if (wrongQuestions.length === 0) {
|
| 503 |
+
wrongList.innerHTML = '<p class="text-gray-500 text-center py-8">没有错题记录</p>';
|
| 504 |
+
return;
|
| 505 |
+
}
|
| 506 |
+
|
| 507 |
+
wrongQuestions.forEach((question, index) => {
|
| 508 |
+
const questionElement = document.createElement('div');
|
| 509 |
+
questionElement.className = 'bg-gray-50 p-4 rounded-lg';
|
| 510 |
+
questionElement.innerHTML = `
|
| 511 |
+
<div class="flex justify-between items-center mb-2">
|
| 512 |
+
<div class="text-xl font-semibold">
|
| 513 |
+
<span>${question.num1}</span>
|
| 514 |
+
<span class="mx-2">${question.operator}</span>
|
| 515 |
+
<span>${question.num2}</span>
|
| 516 |
+
<span class="mx-2">=</span>
|
| 517 |
+
<span class="text-green-600">${question.correctAnswer}</span>
|
| 518 |
+
</div>
|
| 519 |
+
<span class="text-red-500">你的答案: ${question.userAnswer}</span>
|
| 520 |
+
</div>
|
| 521 |
+
<div class="text-sm text-gray-500">
|
| 522 |
+
第 ${index + 1} 题
|
| 523 |
+
</div>
|
| 524 |
+
`;
|
| 525 |
+
wrongList.appendChild(questionElement);
|
| 526 |
+
});
|
| 527 |
+
}
|
| 528 |
+
|
| 529 |
+
// 返回结果界面
|
| 530 |
+
function backToResult() {
|
| 531 |
+
document.getElementById('review-screen').classList.add('hidden');
|
| 532 |
+
document.getElementById('result-screen').classList.remove('hidden');
|
| 533 |
+
}
|
| 534 |
+
|
| 535 |
+
// 重新开始练习
|
| 536 |
+
function restartPractice() {
|
| 537 |
+
startPractice(currentMode);
|
| 538 |
+
}
|
| 539 |
+
|
| 540 |
+
// 数字按钮输入
|
| 541 |
+
function inputNumber(num) {
|
| 542 |
+
const answerInput = document.getElementById('answer-input');
|
| 543 |
+
answerInput.value += num;
|
| 544 |
+
}
|
| 545 |
+
|
| 546 |
+
// 清除输入
|
| 547 |
+
function clearInput() {
|
| 548 |
+
document.getElementById('answer-input').value = '';
|
| 549 |
+
}
|
| 550 |
+
|
| 551 |
+
// 键盘事件监听
|
| 552 |
+
document.addEventListener('keydown', function(event) {
|
| 553 |
+
const answerInput = document.getElementById('answer-input');
|
| 554 |
+
|
| 555 |
+
// 数字键
|
| 556 |
+
if (event.key >= '0' && event.key <= '9') {
|
| 557 |
+
answerInput.value += event.key;
|
| 558 |
+
}
|
| 559 |
+
// 退格键
|
| 560 |
+
else if (event.key === 'Backspace') {
|
| 561 |
+
answerInput.value = answerInput.value.slice(0, -1);
|
| 562 |
+
}
|
| 563 |
+
// 回车键
|
| 564 |
+
else if (event.key === 'Enter') {
|
| 565 |
+
submitAnswer();
|
| 566 |
+
}
|
| 567 |
+
});
|
| 568 |
+
</script>
|
| 569 |
+
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=zterry95/practise" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
| 570 |
+
</html>
|
prompts.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
小学三年级数学计算训练
|