diff --git a/bulk_grades/__init__.py b/bulk_grades/__init__.py index 31184c6..1b1882b 100644 --- a/bulk_grades/__init__.py +++ b/bulk_grades/__init__.py @@ -4,6 +4,6 @@ from __future__ import absolute_import, unicode_literals -__version__ = '0.5.10' +__version__ = '0.5.11' default_app_config = 'bulk_grades.apps.BulkGradesConfig' # pylint: disable=invalid-name diff --git a/bulk_grades/api.py b/bulk_grades/api.py index 6f928de..09e16c5 100644 --- a/bulk_grades/api.py +++ b/bulk_grades/api.py @@ -241,7 +241,7 @@ def _get_graded_subsections(self, course_id, filter_subsection=None, filter_assi continue short_block_id = block_id[:8] if short_block_id not in subsections: - for key in ('name', 'grade', 'previous', 'new_grade'): + for key in ('name', 'original_grade', 'previous_override', 'new_override'): self.columns.append('{}-{}'.format(key, short_block_id)) subsections[short_block_id] = (subsection, subsection.display_name) return subsections @@ -269,7 +269,7 @@ def preprocess_row(self, row): if row['user_id'] in self._users_seen: return operation for key in row: - if key.startswith('new_grade-'): + if key.startswith('new_override-'): value = row[key].strip() if value: short_id = key.split('-', 1)[1] @@ -278,10 +278,10 @@ def preprocess_row(self, row): operation['course_id'] = self.course_id operation['block_id'] = text_type(subsection.location) try: - operation['new_grade'] = float(value) + operation['new_override'] = float(value) except ValueError: raise ValidationError(_('Grade must be a number')) - if operation['new_grade'] < 0: + if operation['new_override'] < 0: raise ValidationError(_('Grade must be positive')) self._users_seen.add(row['user_id']) return operation @@ -295,7 +295,7 @@ def process_row(self, row): row['course_id'], row['block_id'], overrider=self._user, - earned_graded=row['new_grade'], + earned_graded=row['new_override'], feature='grade-import' ) return True, None @@ -345,11 +345,11 @@ def get_rows_to_export(self): row['name-{}'.format(block_id)] = display_name grade = grades.get(subsection.location, None) if grade: - row['grade-{}'.format(block_id)] = grade.earned_graded + row['original_grade-{}'.format(block_id)] = grade.earned_graded try: - row['previous-{}'.format(block_id)] = grade.override.earned_graded_override + row['previous_override-{}'.format(block_id)] = grade.override.earned_graded_override except AttributeError: - row['previous-{}'.format(block_id)] = None + row['previous_override-{}'.format(block_id)] = None yield row diff --git a/tests/test_api.py b/tests/test_api.py index aa18749..3e0c0a2 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -176,7 +176,7 @@ def test_less_than_zero(self, course_grade_factory_mock): row = { 'block_id': self.block_id, - 'new_grade-block-v1': '-1', + 'new_override-block-v1': '-1', 'user_id': self.learner.id, 'csum': '07ec', 'Previous Points': '',