Add exam view (WIP)
This commit is contained in:
parent
6c1e0887b6
commit
5a1cae3143
@ -88,6 +88,10 @@ def create_app(test_config=None):
|
||||
@login_required
|
||||
def my_page():
|
||||
return user_page(session["user_id"])
|
||||
|
||||
@app.get("/exam")
|
||||
def exam():
|
||||
return render_template("exams/level1.html")
|
||||
|
||||
def format_reading(reading: str) -> str:
|
||||
"""Apply bold to the part of the reading which the kanji represents; for kun, this can be
|
||||
@ -102,6 +106,7 @@ def create_app(test_config=None):
|
||||
emboldened_part = reading[:okurigana_position]
|
||||
return f"<b>{emboldened_part}</b>{reading[okurigana_position+1:]}"
|
||||
|
||||
|
||||
@app.route("/kanji/<kanji>")
|
||||
def kanji_page(kanji: str):
|
||||
kanji_obj = get_kanji_by_character(kanji)
|
||||
|
11
kanken_online/static/exam.css
Normal file
11
kanken_online/static/exam.css
Normal file
@ -0,0 +1,11 @@
|
||||
@counter-style katakana {
|
||||
system: cyclic;
|
||||
symbols: "ア" "イ" "ウ" "エ" "オ" "カ" "キ" "ク" "ケ" "コ" "サ" "シ" "ス" "セ" "ソ" "タ" "チ" "ツ" "テ" "ト" "ナ" "ニ" "ヌ" "ネ" "ノ" "ハ" "ヒ" "フ" "ヘ" "ホ" "マ" "ミ" "ム" "メ" "モ" "ヤ" "ユ" "ヨ" "ラ" "リ" "ル" "レ" "ロ" "ワ" "ヲ" "ン";
|
||||
speak-as: spell-out;
|
||||
fallback: lower-alpha;
|
||||
suffix: " ";
|
||||
}
|
||||
|
||||
.katakana-list {
|
||||
list-style-type: katakana;
|
||||
}
|
@ -43,5 +43,6 @@
|
||||
"post_body": "Post body",
|
||||
"success_new_post": "Successfully created new post",
|
||||
"user_introduction": "User",
|
||||
"pfp": "Profile picture"
|
||||
"pfp": "Profile picture",
|
||||
"level_1_exam": "Level 1 exam"
|
||||
}
|
@ -43,5 +43,6 @@
|
||||
"post_body": "投稿内容",
|
||||
"success_new_post": "無事に新しい投稿を作りました",
|
||||
"user_introduction": "利用者の",
|
||||
"pfp": "利用者アイコン"
|
||||
"pfp": "利用者アイコン",
|
||||
"level_1_exam": "一級試験"
|
||||
}
|
60
kanken_online/templates/exams/level1.html
Normal file
60
kanken_online/templates/exams/level1.html
Normal file
@ -0,0 +1,60 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block styles %}
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='exam.css') }}">
|
||||
{% endblock %}
|
||||
|
||||
{% block header %}
|
||||
<h1>{% block title %}{{ localize("level_1_exam") }}{% endblock %}</h1>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1>日本漢字能力検定試験問題</h1>
|
||||
<div id="q1">
|
||||
<h2>(一)</h2>
|
||||
<p>次の傍線部分の読みを<b>ひらがな</b>で記せ。</p>
|
||||
<p>1〜20は<b>音読み</b>、21〜30は<b>訓読み</b>である。</p>
|
||||
|
||||
<ol id="q1-onyomi">
|
||||
{% for i in range(20) %}
|
||||
<li>
|
||||
Test
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
|
||||
<hr>
|
||||
|
||||
<ol id="q2-kunyomi" start="21">
|
||||
{% for i in range(10) %}
|
||||
<li>
|
||||
Test
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="q2">
|
||||
<h2>(二)</h2>
|
||||
<p>次の傍線部分の<b>カタカナ</b>を<b>漢字</b>で記せ。19,20は<b>国字</b>で答えること。</p>
|
||||
<ol id="q2-kakitori">
|
||||
{% for i in range(15) %}
|
||||
<li>Test</li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
<div>
|
||||
<ol start="16">
|
||||
<li>Test</li>
|
||||
<li>Test</li>
|
||||
<li>Test</li>
|
||||
</ol>
|
||||
</div>
|
||||
<hr>
|
||||
<ol id="q2-kokuji-kakitori" start="19">
|
||||
<li>Test</li>
|
||||
<li>Test</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
Loading…
Reference in New Issue
Block a user