diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2025-10-21 14:38:35 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2025-10-21 14:38:35 +0200 |
| commit | d76db24c5b5ad55bf385643387347bae8bfe7633 (patch) | |
| tree | d24518057590d513800ac98d7e482bd2550235b3 /scripts | |
| parent | 832bdcd15e8d8520df65db8a583cbac7348c44b8 (diff) | |
| download | unterricht-d76db24c5b5ad55bf385643387347bae8bfe7633.tar.gz unterricht-d76db24c5b5ad55bf385643387347bae8bfe7633.zip | |
only consider the original grades from moodle grade history
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/eval_moodle_grades.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/scripts/eval_moodle_grades.py b/scripts/eval_moodle_grades.py index 50480e74..7ef61324 100755 --- a/scripts/eval_moodle_grades.py +++ b/scripts/eval_moodle_grades.py @@ -23,6 +23,9 @@ def main(): parser.add_argument("--locale", help="The locale to use", default="de_DE.utf8") + parser.add_argument("--teacher", + help="Name of the teacher to exclude their grades.", + default="Florian Fischer") parser.add_argument("grades", help="The csv file containing the grades") args = parser.parse_args() @@ -40,12 +43,12 @@ def main(): # Collect all first attempts for grade in grades_data: student = grade[1] - if grade[5] != '' and (not student in grades or datetime.strptime( - grades[student][0], MOODLE_DATE_FORMAT) > datetime.strptime( - grade[0], MOODLE_DATE_FORMAT)): + # Original grade + if not grade[5] and grade[6] and student != args.teacher: + assert student not in grades grades[student] = grade - results = [float(grade[5].replace(',', '.')) for grade in grades.values()] + results = [float(grade[6].replace(',', '.')) for grade in grades.values()] mean = sum(results) / len(results) print(f'mean: {mean} -> {args.points*(mean-scale[0])/scale[1]}') |
