mirror of
https://github.com/nelsbrock/NateMan.git
synced 2026-08-14 21:36:49 +02:00
Klausurplaneinsicht für Schüler hinzugefügt
This commit is contained in:
@@ -12,6 +12,7 @@ NateMan (**Na**chschreib**te**rmin-**Man**ager) ist eine Webanwendung zur Koordi
|
|||||||
* Excel-Export von Nachschreibplänen mit automatischer Terminzuordnung
|
* Excel-Export von Nachschreibplänen mit automatischer Terminzuordnung
|
||||||
* Klausurerinnerungen an Lehrkräfte per E-Mail
|
* Klausurerinnerungen an Lehrkräfte per E-Mail
|
||||||
* öffentlich einsehbare Klausurpläne
|
* öffentlich einsehbare Klausurpläne
|
||||||
|
* individuelle Klausurplanansicht für Schüler und Schülerinnen
|
||||||
|
|
||||||
## Schnelle Installation
|
## Schnelle Installation
|
||||||
|
|
||||||
@@ -20,7 +21,7 @@ NateMan (**Na**chschreib**te**rmin-**Man**ager) ist eine Webanwendung zur Koordi
|
|||||||
1. Installieren Sie [Python](https://www.python.org/downloads/) und [Python-Venv](https://docs.python.org/3/library/venv.html).
|
1. Installieren Sie [Python](https://www.python.org/downloads/) und [Python-Venv](https://docs.python.org/3/library/venv.html).
|
||||||
<details>
|
<details>
|
||||||
<summary>Details</summary>
|
<summary>Details</summary>
|
||||||
|
|
||||||
Unter Linux (Debian und Derivate) installieren Sie die Pakete `python3` und `python3-venv`.\
|
Unter Linux (Debian und Derivate) installieren Sie die Pakete `python3` und `python3-venv`.\
|
||||||
Unter Windows und macOS laden Sie den [Python-Installer](https://www.python.org/downloads/) herunter und führen Sie ihn aus. Python-Venv wird standardmäßig mitinstalliert.
|
Unter Windows und macOS laden Sie den [Python-Installer](https://www.python.org/downloads/) herunter und führen Sie ihn aus. Python-Venv wird standardmäßig mitinstalliert.
|
||||||
</details>
|
</details>
|
||||||
@@ -35,7 +36,7 @@ NateMan (**Na**chschreib**te**rmin-**Man**ager) ist eine Webanwendung zur Koordi
|
|||||||
python3 -m venv venv
|
python3 -m venv venv
|
||||||
source venv/bin/activate
|
source venv/bin/activate
|
||||||
```
|
```
|
||||||
|
|
||||||
**Windows:**
|
**Windows:**
|
||||||
```dos
|
```dos
|
||||||
mkdir nateman
|
mkdir nateman
|
||||||
@@ -63,4 +64,4 @@ An der Entwicklung sind beteiligt:
|
|||||||
|
|
||||||
* [Niklas Elsbrock](https://github.com/nelsbrock) (Hauptentwickler)
|
* [Niklas Elsbrock](https://github.com/nelsbrock) (Hauptentwickler)
|
||||||
* [Johannes Bingel](https://github.com/Hecht376) (Exportfunktion und Excel-Importfunktion)
|
* [Johannes Bingel](https://github.com/Hecht376) (Exportfunktion und Excel-Importfunktion)
|
||||||
* Dipl.-Inform. Christian Wolf, OStR (Idee und Betreuung)
|
* Dipl.-Inform. Christian Wolf, OStR (Idee und Betreuung)
|
||||||
|
|||||||
@@ -43,6 +43,29 @@ def mine():
|
|||||||
klausuren_vergangen=klausuren_vergangen)
|
klausuren_vergangen=klausuren_vergangen)
|
||||||
|
|
||||||
|
|
||||||
|
@bp.route("/schueler", endpoint="schueler")
|
||||||
|
def schueler_():
|
||||||
|
schueler_id = request.args.get("id")
|
||||||
|
schueler_nachname = request.args.get("nachname")
|
||||||
|
if schueler_id is None or schueler_nachname is None:
|
||||||
|
flash("Fehlende Schülerdaten.", "error")
|
||||||
|
return redirect(url_for("index.index"), code=303)
|
||||||
|
schueler = Schueler.query.filter_by(id=schueler_id, nachname=schueler_nachname).first()
|
||||||
|
if schueler is None:
|
||||||
|
flash("Ungültige Schülerdaten.", "error")
|
||||||
|
return redirect(url_for("index.index"), code=303)
|
||||||
|
|
||||||
|
kt_query = Klausurteilnahme.query.join(Schueler).join(Klausur) \
|
||||||
|
.filter(Schueler.id == schueler_id) \
|
||||||
|
.order_by(Klausur.date)
|
||||||
|
|
||||||
|
kt_anstehend = kt_query.filter(Klausur.date > datetime.now().date()).all()
|
||||||
|
kt_vergangen = kt_query.filter(Klausur.date <= datetime.now().date()).all()
|
||||||
|
|
||||||
|
return render_template("klausuren/schueler.html.j2", schueler=schueler, kt_vergangen=kt_vergangen,
|
||||||
|
kt_anstehend=kt_anstehend)
|
||||||
|
|
||||||
|
|
||||||
@bp.route("/<stufe_name>/", endpoint="stufe")
|
@bp.route("/<stufe_name>/", endpoint="stufe")
|
||||||
def stufe_(stufe_name):
|
def stufe_(stufe_name):
|
||||||
""" Ansicht der Klausuren einer Stufe (Seite *Klausuren [Stufe]*) """
|
""" Ansicht der Klausuren einer Stufe (Seite *Klausuren [Stufe]*) """
|
||||||
|
|||||||
@@ -35,4 +35,23 @@
|
|||||||
oder sich als Lehrer <a href="{{ url_for('auth.login') }}">anmelden</a>
|
oder sich als Lehrer <a href="{{ url_for('auth.login') }}">anmelden</a>
|
||||||
{%- endif -%}.
|
{%- endif -%}.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<h3>Klausurpläne für Schüler und Schülerinnen</h3>
|
||||||
|
<form action="{{ url_for('klausuren.schueler') }}" method="get">
|
||||||
|
<div class="table-aligned">
|
||||||
|
<div>
|
||||||
|
<div><label for="id-input">Schüler-ID:</label></div>
|
||||||
|
<div><input type="number" name="id" id="id-input" required autofocus></div>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<div><label for="nachname-input">Nachname:</label></div>
|
||||||
|
<div><input type="text" name="nachname" id="nachname-input" autocomplete="family-name" required></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<p>
|
||||||
|
<input type="submit" value="Klausurplan ansehen">
|
||||||
|
</p>
|
||||||
|
</form>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@@ -0,0 +1,68 @@
|
|||||||
|
{#
|
||||||
|
NateMan – Nachschreibtermin-Manager
|
||||||
|
templates/klausuren/schueler.html.j2
|
||||||
|
Copyright © 2021 Niklas Elsbrock
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
-#}
|
||||||
|
|
||||||
|
{% extends 'base.html.j2' %}
|
||||||
|
|
||||||
|
{% macro kt_table(kt_list) %}
|
||||||
|
{% if kt_list|length == 0 %}
|
||||||
|
<p>keine</p>
|
||||||
|
{% else %}
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Datum</th>
|
||||||
|
<th>Lehrkraft</th>
|
||||||
|
<th>Kurs</th>
|
||||||
|
<th>Zeitraum</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{% for kt in kt_list %}
|
||||||
|
<tr>
|
||||||
|
<td>{{ macros.date(kt.klausur.date) }}</td>
|
||||||
|
<td>{{ kt.klausur.lehrer.kuerzel }}</td>
|
||||||
|
<td>{{ kt.klausur.kursname }}</td>
|
||||||
|
<td>{{ macros.zeitraum(kt.klausur) }} Std.</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
{% endif %}
|
||||||
|
{% endmacro %}
|
||||||
|
|
||||||
|
{% block title %}
|
||||||
|
Klausurplan für {{ schueler.vorname }} {{ schueler.nachname }} ({{ schueler.stufe.name }})
|
||||||
|
{% endblock %}
|
||||||
|
{% block header %}
|
||||||
|
Klausurplan für {{ schueler.vorname }} {{ schueler.nachname }} ({{ schueler.stufe.name }})
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{# schueler #}
|
||||||
|
{# kt_vergangen #}
|
||||||
|
{# kt_anstehend #}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
|
||||||
|
<h3>vergangen:</h3>
|
||||||
|
{{ kt_table(kt_vergangen) }}
|
||||||
|
|
||||||
|
<h3>anstehend:</h3>
|
||||||
|
{{ kt_table(kt_anstehend) }}
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
Reference in New Issue
Block a user