Average grades in export [REBORN]#2708
Open
Belissimo-T wants to merge 26 commits into
Open
Conversation
Co-authored-by: Niklas Mohrin <dev@niklasmohrin.de>
Co-authored-by: Niklas Mohrin <dev@niklasmohrin.de>
Co-authored-by: Niklas Mohrin <dev@niklasmohrin.de>
Co-authored-by: Niklas Mohrin <dev@niklasmohrin.de>
Co-authored-by: Niklas Mohrin <dev@niklasmohrin.de>
# Conflicts: # evap/results/tests/test_exporters.py
Comment on lines
+657
to
+658
| [course_program.id for course_program in evaluation_1.course.programs.all()] | ||
| + [course_program.id for course_program in evaluation_2.course.programs.all()], |
Member
There was a problem hiding this comment.
This is just [program]? (or, if we want to test the duplication, [program, program])
| binary_content.seek(0) | ||
| workbook = xlrd.open_workbook(file_contents=binary_content.read()) | ||
|
|
||
| self.assertAlmostEqual(workbook.sheets()[0].row_values(5)[1], 1.5833333333333335) |
Member
There was a problem hiding this comment.
Please add a short comment explaining where this number comes from
Comment on lines
+675
to
+678
| # average for second questionnaire must be the value from evaluation2 (since evaluation1 doesn't have the questionnaire) | ||
| self.assertEqual(float(workbook.sheets()[0].row_values(8)[1]), float(workbook.sheets()[0].row_values(8)[3])) | ||
| # average field next to the questionnaire title must be empty | ||
| self.assertEqual("", workbook.sheets()[0].row_values(8)[2]) |
Comment on lines
+124
to
+132
| def grade_average(self) -> float: | ||
| return ( | ||
| sum(grade * count for count, grade in zip(self.counts, self.choices.grades, strict=True)) / self.count_sum | ||
| ) | ||
|
|
||
| @property | ||
| def approval_average(self) -> float: | ||
| return self.approval_count / self.count_sum | ||
|
|
Member
There was a problem hiding this comment.
Is https://github.com/e-valuation/EvaP/wiki/Calculation-of-Results still up to date, or do we need to update anything there?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #2001
TODO: Tests