From cc7566905a04cdb60387b6bc02d5d675c4538cff Mon Sep 17 00:00:00 2001 From: HuangHai <10402852@qq.com> Date: Thu, 28 Aug 2025 14:30:57 +0800 Subject: [PATCH] 'commit' --- dsLightRag/static/YunXiao/physics_quiz.html | 2 ++ dsLightRag/static/YunXiao/physics_quiz.js | 27 +++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/dsLightRag/static/YunXiao/physics_quiz.html b/dsLightRag/static/YunXiao/physics_quiz.html index 6c919be2..2e77d404 100644 --- a/dsLightRag/static/YunXiao/physics_quiz.html +++ b/dsLightRag/static/YunXiao/physics_quiz.html @@ -110,5 +110,7 @@ + + \ No newline at end of file diff --git a/dsLightRag/static/YunXiao/physics_quiz.js b/dsLightRag/static/YunXiao/physics_quiz.js index 5659c865..757b5d38 100644 --- a/dsLightRag/static/YunXiao/physics_quiz.js +++ b/dsLightRag/static/YunXiao/physics_quiz.js @@ -274,6 +274,33 @@ document.addEventListener('DOMContentLoaded', function() { // 渲染题目 renderQuestions(); + // 添加录音按钮事件绑定 + const startRecordBtn = document.getElementById('startRecordBtn'); + const stopRecordBtn = document.getElementById('stopRecordBtn'); + const recordingIndicator = document.getElementById('recordingIndicator'); + + if (startRecordBtn && stopRecordBtn && recordingIndicator) { + startRecordBtn.addEventListener('click', function() { + // 显示录音指示器 + recordingIndicator.style.display = 'block'; + // 这里添加实际录音功能逻辑 + console.log('开始录音...'); + // 示例:调用录音API或相关函数 + // startRecording(); + }); + + stopRecordBtn.addEventListener('click', function() { + // 隐藏录音指示器 + recordingIndicator.style.display = 'none'; + // 这里添加停止录音功能逻辑 + console.log('停止录音...'); + // 示例:停止录音并处理音频 + // stopRecording(); + }); + } else { + console.error('录音相关DOM元素未找到'); + } + // 提交当前难度的答案 submitBtn.addEventListener('click', function() { const currentAnswers = correctAnswers[quizState.currentDifficulty];