Repository: e-valuation/EvaP

Issue:
New bipolar label "Short/Long"
For the Erstifahrt Evaluation, we wanted to evaluate the length of the trip.
For that we would have liked to have a short <-> long bipolar scale.


Discussion:
While possible to use the existing answer options also in this case by formulating the question in a slightly different way, we decided to add this sixth option for the ease of use.

Resolving patch:
diff --git a/evap/evaluation/migrations/0106_add_short_long_question.py b/evap/evaluation/migrations/0106_add_short_long_question.py
new file mode 100644
--- /dev/null
+++ b/evap/evaluation/migrations/0106_add_short_long_question.py
@@ -0,0 +1,37 @@
+# Generated by Django 2.2.7 on 2019-11-18 20:20
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('evaluation', '0105_uuids_for_ratinganswercounter'),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name='question',
+            name='type',
+            field=models.PositiveSmallIntegerField(
+                choices=[
+                    ('Text', ((0, 'Text question'),)),
+                    ('Unipolar Likert', ((1, 'Agreement question'),)),
+                    ('Grade', ((2, 'Grade question'),)),
+                    ('Bipolar Likert', (
+                        (6, 'Easy-difficult question'),
+                        (7, 'Few-many question'),
+                        (8, 'Little-much question'),
+                        (9, 'Small-large question'),
+                        (10, 'Slow-fast question'),
+                        (11, 'Short-long question')
+                    )),
+                    ('Yes-no', (
+                        (3, 'Positive yes-no question'),
+                        (4, 'Negative yes-no question')
+                    )),
+                    ('Layout', ((5, 'Heading'),))
+                ],
+                verbose_name='question type'),
+        ),
+    ]
diff --git a/evap/evaluation/models.py b/evap/evaluation/models.py
--- a/evap/evaluation/models.py
+++ b/evap/evaluation/models.py
@@ -780,6 +780,7 @@ class Question(models.Model):
     LITTLE_MUCH = 8
     SMALL_LARGE = 9
     SLOW_FAST = 10
+    SHORT_LONG = 11
     POSITIVE_YES_NO = 3
     NEGATIVE_YES_NO = 4
     HEADING = 5
@@ -799,6 +800,7 @@ class Question(models.Model):
             (LITTLE_MUCH, _("Little-much question")),
             (SMALL_LARGE, _("Small-large question")),
             (SLOW_FAST, _("Slow-fast question")),
+            (SHORT_LONG, _("Short-long question")),
         )),
         (_("Yes-no"), (
             (POSITIVE_YES_NO, _("Positive yes-no question")),
@@ -837,7 +839,7 @@ def is_likert_question(self):
 
     @property
     def is_bipolar_likert_question(self):
-        return self.type in (self.EASY_DIFFICULT, self.FEW_MANY, self.LITTLE_MUCH, self.SLOW_FAST, self.SMALL_LARGE)
+        return self.type in (self.EASY_DIFFICULT, self.FEW_MANY, self.LITTLE_MUCH, self.SLOW_FAST, self.SMALL_LARGE, self.SHORT_LONG)
 
     @property
     def is_text_question(self):
@@ -995,6 +997,21 @@ def is_heading_question(self):
         ],
         **BASE_BIPOLAR_CHOICES
     ),
+    Question.SHORT_LONG: BipolarChoices(
+        minus_name=_("Short"),
+        plus_name=_("Long"),
+        names=[
+            _("Way too\nshort"),
+            _("Too\nshort"),
+            _("Slightly too\nshort"),
+            _("Ideal"),
+            _("Slightly too\nlong"),
+            _("Too\nlong"),
+            _("Way too\nlong"),
+            _("no answer")
+        ],
+        **BASE_BIPOLAR_CHOICES
+    ),
     Question.POSITIVE_YES_NO: Choices(
         names=[
             _("Yes"),


Test patch: