Web端 优化UI界面 ANDROID端 - 在错题页面中添加详细统计信息,显示错题数量和已练习情况 - 实现单个错题的练习功能,用户可以直接练习特定错题 - 增加标记错题为已掌握的功能,用户可以管理自己的错题库 - 优化题目卡片,显示作答次数,提升用户对题目的掌握情况 - 更新导航结构,增加错题练习的入口,提升功能可用性 - 更新导航结构整合精简重复入口 这些改进旨在提升用户在错题管理和练习过程中的体验,帮助用户更有效地复习和掌握知识点。
197 lines
8.8 KiB
HTML
197 lines
8.8 KiB
HTML
<!-- templates/wrong.html -->
|
|
{% extends 'base.html' %}
|
|
|
|
{% block title %}错题本 - ExamMaster{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="card">
|
|
<div class="card-title d-flex justify-content-between align-items-center">
|
|
<div>
|
|
<i class="fas fa-times-circle"></i> 错题本
|
|
</div>
|
|
<a href="{{ url_for('index') }}" class="btn btn-primary">
|
|
<i class="fas fa-home"></i> 返回主页
|
|
</a>
|
|
</div>
|
|
|
|
{% if questions %}
|
|
<!-- 错题练习功能区域 -->
|
|
<div class="alert alert-warning mb-3">
|
|
<div class="row align-items-center">
|
|
<div class="col-md-8">
|
|
<h5 class="mb-1"><i class="fas fa-exclamation-triangle"></i> 错题统计</h5>
|
|
<p class="mb-0">
|
|
共有 <strong>{{ questions|length }}</strong> 道错题需要复习
|
|
{% if wrong_stats %}
|
|
| 已练习: <span class="text-success">{{ wrong_stats.practiced }}</span> 道
|
|
| 待练习: <span class="text-danger">{{ wrong_stats.remaining }}</span> 道
|
|
{% endif %}
|
|
</p>
|
|
</div>
|
|
<div class="col-md-4 text-right">
|
|
<div class="btn-group" role="group">
|
|
<a href="{{ url_for('start_wrong_practice') }}" class="btn btn-warning">
|
|
<i class="fas fa-play"></i> 开始错题练习
|
|
</a>
|
|
<a href="{{ url_for('wrong_practice_sequential') }}" class="btn btn-outline-warning">
|
|
<i class="fas fa-list-ol"></i> 顺序练习
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 错题练习选项 -->
|
|
<div class="card mb-3">
|
|
<div class="card-body">
|
|
<h6 class="card-title"><i class="fas fa-cog"></i> 练习选项</h6>
|
|
<form method="post" action="{{ url_for('start_wrong_practice') }}" class="form-inline">
|
|
<div class="form-group mr-3">
|
|
<label for="practice_mode" class="mr-2">练习模式:</label>
|
|
<select name="practice_mode" id="practice_mode" class="form-control">
|
|
<option value="random">随机练习</option>
|
|
<option value="sequential">顺序练习</option>
|
|
<option value="difficulty">按难度练习</option>
|
|
</select>
|
|
</div>
|
|
<div class="form-group mr-3">
|
|
<label for="practice_count" class="mr-2">练习数量:</label>
|
|
<select name="practice_count" id="practice_count" class="form-control">
|
|
<option value="all">全部错题</option>
|
|
<option value="10">10道题</option>
|
|
<option value="20">20道题</option>
|
|
<option value="50">50道题</option>
|
|
</select>
|
|
</div>
|
|
<div class="form-group mr-3">
|
|
<div class="form-check">
|
|
<input type="checkbox" name="only_unpracticed" id="only_unpracticed" class="form-check-input">
|
|
<label for="only_unpracticed" class="form-check-label">只练习未复习的错题</label>
|
|
</div>
|
|
</div>
|
|
<button type="submit" class="btn btn-success">
|
|
<i class="fas fa-rocket"></i> 开始练习
|
|
</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 错题列表 -->
|
|
<div class="card">
|
|
<div class="card-body">
|
|
<h6 class="card-title"><i class="fas fa-list"></i> 错题列表</h6>
|
|
<div class="table-responsive">
|
|
<table class="table table-hover">
|
|
<thead>
|
|
<tr>
|
|
<th>题号</th>
|
|
<th>题目</th>
|
|
<th>难度</th>
|
|
<th>类型</th>
|
|
<th>错误次数</th>
|
|
<th>最后错误时间</th>
|
|
<th>操作</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for q in questions %}
|
|
<tr>
|
|
<td><span class="badge badge-danger">{{ q.id }}</span></td>
|
|
<td>
|
|
<a href="{{ url_for('show_question', qid=q.id) }}" class="text-primary">
|
|
{{ q.stem[:50] }}{% if q.stem|length > 50 %}...{% endif %}
|
|
</a>
|
|
</td>
|
|
<td>
|
|
{% if q.difficulty == '简单' %}
|
|
<span class="badge badge-success">{{ q.difficulty }}</span>
|
|
{% elif q.difficulty == '中等' %}
|
|
<span class="badge badge-warning">{{ q.difficulty }}</span>
|
|
{% elif q.difficulty == '困难' %}
|
|
<span class="badge badge-danger">{{ q.difficulty }}</span>
|
|
{% else %}
|
|
<span class="badge badge-secondary">{{ q.difficulty or '未知' }}</span>
|
|
{% endif %}
|
|
</td>
|
|
<td><span class="badge badge-info">{{ q.type or '未知' }}</span></td>
|
|
<td>
|
|
<span class="text-danger">{{ q.wrong_count or 1 }}</span> 次
|
|
</td>
|
|
<td>
|
|
<small class="text-muted">{{ q.last_wrong_time or '未知' }}</small>
|
|
</td>
|
|
<td>
|
|
<div class="btn-group btn-group-sm" role="group">
|
|
<a href="{{ url_for('show_question', qid=q.id) }}" class="btn btn-outline-primary" title="查看题目">
|
|
<i class="fas fa-eye"></i>
|
|
</a>
|
|
<a href="{{ url_for('practice_single_wrong', qid=q.id) }}" class="btn btn-outline-warning" title="单独练习">
|
|
<i class="fas fa-redo"></i>
|
|
</a>
|
|
<button class="btn btn-outline-danger" onclick="removeFromWrong('{{ q.id }}')" title="标记为已掌握">
|
|
<i class="fas fa-check"></i>
|
|
</button>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% else %}
|
|
<div class="alert alert-success mb-3">
|
|
<div class="text-center">
|
|
<i class="fas fa-trophy fa-3x mb-3"></i>
|
|
<h4>恭喜!没有错题</h4>
|
|
<p class="mb-3">当前题库中没有错题,继续保持!</p>
|
|
<a href="{{ url_for('random_question') }}" class="btn btn-primary">
|
|
<i class="fas fa-random"></i> 继续练习
|
|
</a>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
|
|
</div>
|
|
{% endblock %}
|
|
|
|
{% block scripts %}
|
|
<script>
|
|
function removeFromWrong(questionId) {
|
|
if (confirm('确定要将此题标记为已掌握吗?这将从错题本中移除该题目。')) {
|
|
fetch(`/mark_wrong_as_mastered/${questionId}`, {
|
|
method: 'POST',
|
|
headers: {
|
|
'Content-Type': 'application/json',
|
|
}
|
|
})
|
|
.then(response => response.json())
|
|
.then(data => {
|
|
if (data.success) {
|
|
location.reload();
|
|
} else {
|
|
alert('操作失败:' + data.message);
|
|
}
|
|
})
|
|
.catch(error => {
|
|
console.error('Error:', error);
|
|
alert('操作失败,请重试');
|
|
});
|
|
}
|
|
}
|
|
|
|
// 练习模式改变时的处理
|
|
document.getElementById('practice_mode').addEventListener('change', function() {
|
|
const mode = this.value;
|
|
const countSelect = document.getElementById('practice_count');
|
|
const onlyUnpracticed = document.getElementById('only_unpracticed');
|
|
|
|
if (mode === 'sequential') {
|
|
// 顺序练习时建议选择全部
|
|
countSelect.value = 'all';
|
|
onlyUnpracticed.checked = false;
|
|
}
|
|
});
|
|
</script>
|
|
{% endblock %} |