From 033728821b1c01d841b43ec4cdc131c2dddc8152 Mon Sep 17 00:00:00 2001 From: Dominik Seeger <dominik.seeger@stud.uni-goettingen.de> Date: Tue, 14 Apr 2020 20:42:15 +0200 Subject: [PATCH 1/2] added modified timestamp to feedback --- core/migrations/0004_feedback_modified.py | 18 ++++++++++++++++++ core/models/feedback.py | 3 +++ core/serializers/feedback.py | 4 ++-- 3 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 core/migrations/0004_feedback_modified.py diff --git a/core/migrations/0004_feedback_modified.py b/core/migrations/0004_feedback_modified.py new file mode 100644 index 00000000..0364705d --- /dev/null +++ b/core/migrations/0004_feedback_modified.py @@ -0,0 +1,18 @@ +# Generated by Django 2.1.14 on 2020-04-14 18:38 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('core', '0003_auto_20191203_1445'), + ] + + operations = [ + migrations.AddField( + model_name='feedback', + name='modified', + field=models.DateTimeField(auto_now=True), + ), + ] diff --git a/core/models/feedback.py b/core/models/feedback.py index ec36f63b..6a83bbe9 100644 --- a/core/models/feedback.py +++ b/core/models/feedback.py @@ -20,6 +20,8 @@ class Feedback(models.Model): accepted. created : DateTimeField When the feedback was initially created + modified: DateTimeField + Timestamp indicating the last time the feedback was saved of_submission : OneToOneField The submission this feedback belongs to. It finally determines how many points a student receives for his submission. @@ -30,6 +32,7 @@ class Feedback(models.Model): """ score = models.DecimalField(max_digits=5, decimal_places=2, default=0) created = models.DateTimeField(auto_now_add=True) + modified = models.DateTimeField(auto_now=True) is_final = models.BooleanField(default=False) final_by_reviewer = models.BooleanField(default=False) diff --git a/core/serializers/feedback.py b/core/serializers/feedback.py index 840b9574..31542342 100644 --- a/core/serializers/feedback.py +++ b/core/serializers/feedback.py @@ -210,7 +210,7 @@ class FeedbackSerializer(DynamicFieldsModelSerializer): class Meta: model = Feedback fields = ('pk', 'of_submission', 'is_final', 'score', 'feedback_lines', - 'created', 'of_submission_type', 'feedback_stage_for_user', 'labels') + 'created', 'modified', 'of_submission_type', 'feedback_stage_for_user', 'labels') class FeedbackWithStudentSerializer(FeedbackSerializer): @@ -219,7 +219,7 @@ class FeedbackWithStudentSerializer(FeedbackSerializer): class Meta: model = Feedback fields = ('pk', 'of_submission', 'is_final', 'score', 'feedback_lines', 'of_student', - 'created', 'of_submission_type', 'feedback_stage_for_user', 'labels') + 'created', 'modified', 'of_submission_type', 'feedback_stage_for_user', 'labels') class VisibleCommentFeedbackSerializer(FeedbackSerializer): -- GitLab From 99b7f18ec8ec8c85a17dc8a60ed8f4caa06d9643 Mon Sep 17 00:00:00 2001 From: Dominik Seeger <dominik.seeger@stud.uni-goettingen.de> Date: Thu, 16 Apr 2020 10:35:36 +0200 Subject: [PATCH 2/2] last modified is now included in the feedback history --- frontend/src/components/feedback_list/FeedbackTable.vue | 5 +++++ frontend/src/models.ts | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/frontend/src/components/feedback_list/FeedbackTable.vue b/frontend/src/components/feedback_list/FeedbackTable.vue index e03eba3f..1af2876b 100644 --- a/frontend/src/components/feedback_list/FeedbackTable.vue +++ b/frontend/src/components/feedback_list/FeedbackTable.vue @@ -34,6 +34,7 @@ </td> <td>{{ props.item.score }}</td> <td>{{ new Date(props.item.created).toLocaleString() }}</td> + <td>{{ new Date(props.item.modified).toLocaleString() }}</td> <td> <v-icon v-if="props.item.isFinal"> check @@ -126,6 +127,10 @@ export default class FeedbackTable extends Vue { text: 'Created', value: 'created' }, + { + text: 'Modified', + value: 'modified', + }, { text: 'Final', value: 'final' diff --git a/frontend/src/models.ts b/frontend/src/models.ts index 10f6d8b5..cbb2903d 100644 --- a/frontend/src/models.ts +++ b/frontend/src/models.ts @@ -148,6 +148,12 @@ export interface Feedback { * @memberof Feedback */ created?: string + /** + * + * @type {Date} + * @memberof Feedback + */ + modified?: string /** * * @type {string} -- GitLab