业余无线电操作证在线刷题系统
支持A类、B类、C类操作证考试模拟练习
选择考试类型
// A类题库(部分示例) const questionBankA = [ { q: '我国业余无线电频率范围是多少?', options: ['A. 1.8-29.7MHz', 'B. 1.8-50MHz', 'C. 1.8-430MHz', 'D. 1.8-2500MHz'], answer: 0 }, { q: '业余无线电台呼号由谁分配?', options: ['A. 国家无线电管理机构', 'B. 地方无线电管理机构', 'C. 业余无线电协会', 'D. 国际电信联盟'], answer: 0 }, { q: 'A类业余无线电台的最大发射功率是多少?', options: ['A. 25瓦', 'B. 50瓦', 'C. 100瓦', 'D. 200瓦'], answer: 0 }, { q: '业余无线电通信的主要目的是什么?', options: ['A. 自我训练、技术研究和通信交流', 'B. 商业通信', 'C. 军事通信', 'D. 广播娱乐'], answer: 0 }, { q: '操作证有效期是多久?', options: ['A. 5年', 'B. 10年', 'C. 长期有效', 'D. 3年'], answer: 2 }, ];
// B类题库(部分示例) const questionBankB = [ { q: 'B类业余无线电台的最大发射功率是多少?', options: ['A. 100瓦', 'B. 400瓦', 'C. 1000瓦', 'D. 1500瓦'], answer: 2 }, { q: '短波通信主要依靠什么传播?', options: ['A. 地波', 'B. 天波', 'C. 空间波', 'D. 散射波'], answer: 1 }, { q: '电离层主要分布在什么高度?', options: ['A. 10-50公里', 'B. 60-1000公里', 'C. 1000-10000公里', 'D. 10000公里以上'], answer: 1 }, { q: 'SSB调制方式的中文名称是什么?', options: ['A. 单边带调制', 'B. 双边带调制', 'C. 调幅', 'D. 调频'], answer: 0 }, { q: 'CW通信使用的是什么调制方式?', options: ['A. 等幅报', 'B. 调幅', 'C. 调频', 'D. 单边带'], answer: 0 }, ];
// C类题库(部分示例) const questionBankC = [ { q: 'C类业余无线电台的最大发射功率是多少?', options: ['A. 400瓦', 'B. 1000瓦', 'C. 1500瓦', 'D. 无限制'], answer: 1 }, { q: '数字通信中,FT8模式的带宽约为多少?', options: ['A. 50Hz', 'B. 100Hz', 'C. 500Hz', 'D. 2700Hz'], answer: 0 }, { q: '天线增益的单位是什么?', options: ['A. dB', 'B. dBi', 'C. dBd', 'D. 以上都是'], answer: 3 }, { q: '驻波比(SWR)的理想值是多少?', options: ['A. 1:1', 'B. 1.5:1', 'C. 2:1', 'D. 3:1'], answer: 0 }, { q: '同轴电缆的特性阻抗通常为多少欧姆?', options: ['A. 50欧姆', 'B. 75欧姆', 'C. 300欧姆', 'D. 600欧姆'], answer: 0 }, ];
function selectExamType(type) { currentExamType = type; document.querySelectorAll('.exam-type-btn').forEach(btn => btn.classList.remove('active')); document.getElementById('btn-' + type).classList.add('active'); }
function startPractice() { currentMode = 'practice'; loadQuestions(); startExam(); }
function startMockExam() { currentMode = 'mock'; loadQuestions(); startExam(); }
function loadQuestions() { let bank = currentExamType === 'A' ? questionBankA : (currentExamType === 'B' ? questionBankB : questionBankC); questions = [...bank].sort(() => Math.random() - 0.5); if (currentMode === 'mock' && questions.length > 25) { questions = questions.slice(0, 25); } }
function startExam() { currentIndex = 0; correctCount = 0; document.getElementById('exam-progress').style.display = 'block'; document.getElementById('question-container').style.display = 'block'; document.getElementById('result-container').style.display = 'none'; showQuestion(); }
function showQuestion() { if (currentIndex >= questions.length) { showResult(); return; }
const q = questions[currentIndex]; document.getElementById('question-number').textContent = '第 ' + (currentIndex + 1) + ' / ' + questions.length + ' 题'; document.getElementById('question-text').textContent = q.q; document.getElementById('progress-text').textContent = (currentIndex + 1) + '/' + questions.length; document.getElementById('progress-bar').style.width = ((currentIndex / questions.length) * 100) + '%';
let optionsHtml = ''; q.options.forEach((opt, idx) => { optionsHtml += '
'; }); document.getElementById('options-container').innerHTML = optionsHtml; document.getElementById('answer-feedback').style.display = 'none'; document.getElementById('submit-btn').style.display = 'inline-block'; document.getElementById('next-btn').style.display = 'none'; }
let selectedOption = -1;
function selectOption(idx) { if (document.getElementById('submit-btn').style.display !== 'none') { selectedOption = idx; document.querySelectorAll('.option-item').forEach(item => item.classList.remove('selected')); document.querySelector('.option-item[data-index="' + idx + '"]').classList.add('selected'); } }
function submitAnswer() { if (selectedOption === -1) { alert('请选择一个答案'); return; }
const q = questions[currentIndex]; const isCorrect = selectedOption === q.answer;
if (isCorrect) { correctCount++; document.querySelector('.option-item[data-index="' + selectedOption + '"]').classList.add('correct'); document.getElementById('answer-feedback').innerHTML = '✅ 回答正确!'; document.getElementById('answer-feedback').style.background = '#e8f5e9'; document.getElementById('answer-feedback').style.color = '#2e7d32'; } else { document.querySelector('.option-item[data-index="' + selectedOption + '"]').classList.add('wrong'); document.querySelector('.option-item[data-index="' + q.answer + '"]').classList.add('correct'); document.getElementById('answer-feedback').innerHTML = '❌ 回答错误!正确答案是:' + q.options[q.answer]; document.getElementById('answer-feedback').style.background = '#ffebee'; document.getElementById('answer-feedback').style.color = '#c62828';
// 记录错题 const key = currentExamType + '_' + currentIndex; wrongQuestions[key] = { question: q, type: currentExamType }; localStorage.setItem('wrongQuestions', JSON.stringify(wrongQuestions)); }
const accuracy = Math.round((correctCount / (currentIndex + 1)) * 100); document.getElementById('accuracy-text').textContent = accuracy + '%';
document.getElementById('answer-feedback').style.display = 'block'; document.getElementById('submit-btn').style.display = 'none'; document.getElementById('next-btn').style.display = 'inline-block'; selectedOption = -1; }
function nextQuestion() { currentIndex++; showQuestion(); }
function showResult() { document.getElementById('exam-progress').style.display = 'none'; document.getElementById('question-container').style.display = 'none'; document.getElementById('result-container').style.display = 'block';
const total = questions.length; const score = Math.round((correctCount / total) * 100); const passed = score >= 60;
document.getElementById('result-title').textContent = passed ? '🎉 恭喜通过!' : '😔 未通过'; document.getElementById('result-title').style.color = passed ? '#4CAF50' : '#f44336'; document.getElementById('result-score').textContent = score + '分'; document.getElementById('result-score').style.color = passed ? '#4CAF50' : '#f44336';
document.getElementById('result-stats').innerHTML = '
总题数:' + total + '
' + '
正确:' + correctCount + ' 题
' + '
错误:' + (total - correctCount) + ' 题
' + '
正确率:' + score + '%
'; }
function exitExam() { if (confirm('确定要退出吗?当前进度将丢失。')) { document.getElementById('exam-progress').style.display = 'none'; document.getElementById('question-container').style.display = 'none'; document.getElementById('result-container').style.display = 'none'; } }
function restartExam() { startExam(); }
function showWrongQuestions() { const wrongList = Object.values(wrongQuestions); if (wrongList.length === 0) { alert('暂无错题记录'); return; }
let html = '
错题本 (' + wrongList.length + '题)
'; wrongList.forEach((item, idx) => { html += '
' + (idx + 1) + '. ' + item.question.q + '
'; html += '
正确答案:' + item.question.options[item.question.answer] + '
'; html += '
'; });
document.getElementById('question-container').innerHTML = html; document.getElementById('question-container').style.display = 'block'; document.getElementById('exam-progress').style.display = 'none'; }
// 初始化 selectExamType('A');
📚 考试说明
- A类操作证:初级,可操作30MHz以下频段,最大功率25W
- B类操作证:中级,可操作所有业余频段,最大功率1000W
- C类操作证:高级,可操作所有业余频段,最大功率1500W
考试规则:共25题,每题4分,满分100分,60分及格。
