diff --git a/MANIFEST.in b/MANIFEST.in index 2f1ad105..e4a380a3 100755 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1 +1 @@ -recursive-include survey * +recursive-include scientific_survey * diff --git a/README.md b/README.md index c41347ac..d36754b2 100755 --- a/README.md +++ b/README.md @@ -4,6 +4,12 @@ A django survey app for conducting scientific surveys, based on "django-survey-a The following changes were made to the original app to accommodate scientific use cases: * Introduced answer groups for the use cases when a datapoint should be evaluated using multiple different aspects. For instance, for a given text, you might want to evaluate its naturalness on the scale from 1 to 5, its fluency on the scale from 1 to 10 and its coherence on the scale from 1 to 4. +* Added the possibility to use numerical rating scales by prodiving prefix and suffix for an answer group. See example of how this looks below. + +

+ An example of a numerical rating scale +

+ * Added a field called "extra" to the Question model to carry out some extra question-specific information. This information will be invisible to the end user and will be simply transfered to the exported survey results for easier analysis later. For instance, this can hold the information about the model that has generated the text. * Added the possibility of using external redirect on finishing the survey, which is useful for integrating with crowdsourcing platforms frequently used for human evaluation, such as [Prolific](https://www.prolific.co/). * Changed import and export format from CSV to JSON and added the answer groups and the "extra" field to this format. @@ -188,9 +194,7 @@ We're using `pre-commit`, it should take care of linting during commit. ## Translating the project -Django-scientific-survey is available in multiple language. -Your contribution would be very appreciated if you -know a language that is not yet available. +Django-scientific-survey is available in multiple languages. Your contribution would be very appreciated if you know a language that is not yet available. ### As a developer @@ -205,12 +209,12 @@ python manage.py makemessages --no-obsolete --no-wrap --ignore venv -l uk Then run the server, as usual (`python manage.py runserver`) and access `http://localhost:8000/admin` to login. Then go to `http://localhost:8000/rosetta` to translate -Afterwards addd your translations to GitHub +Afterwards addd your translations to GitHub and create a pull request for them to be merged. ~~~~bash git add survey/locale/ ~~~~ -If your language is not yet available in rosetta, [this stack overflow question](https://stackoverflow.com/questions/12946830/) should work even for language not handled by django. +If your language is not yet available in rosetta, [according to this stack overflow question](https://stackoverflow.com/questions/12946830/) should work even for languages not handled by django. ### As a translator diff --git a/doc/numerical_rating_scale_example.png b/doc/numerical_rating_scale_example.png new file mode 100644 index 00000000..aea59ee4 Binary files /dev/null and b/doc/numerical_rating_scale_example.png differ diff --git a/scientific_survey/apps.py b/scientific_survey/apps.py index b97733a1..d82b7f48 100755 --- a/scientific_survey/apps.py +++ b/scientific_survey/apps.py @@ -1,12 +1,12 @@ from django.apps import AppConfig +from django.utils.translation import gettext_lazy as _ -class DjangoScientificSurvey(AppConfig): +class ScientificSurveyConfig(AppConfig): """ See https://docs.djangoproject.com/en/2.1/ref/applications/#django.apps.AppConfig """ name = "scientific_survey" - label = "scientific_survey" - verbose_name = "Scientific survey" + verbose_name = _("Scientific survey") diff --git a/scientific_survey/static/survey/css/bootstrap-theme.min.css b/scientific_survey/static/scientific_survey/css/bootstrap-theme.min.css similarity index 100% rename from scientific_survey/static/survey/css/bootstrap-theme.min.css rename to scientific_survey/static/scientific_survey/css/bootstrap-theme.min.css diff --git a/scientific_survey/static/survey/css/bootstrap.min.css b/scientific_survey/static/scientific_survey/css/bootstrap.min.css similarity index 100% rename from scientific_survey/static/survey/css/bootstrap.min.css rename to scientific_survey/static/scientific_survey/css/bootstrap.min.css diff --git a/scientific_survey/static/survey/css/custom.css b/scientific_survey/static/scientific_survey/css/custom.css similarity index 100% rename from scientific_survey/static/survey/css/custom.css rename to scientific_survey/static/scientific_survey/css/custom.css diff --git a/scientific_survey/static/survey/css/flatpickr.min.css b/scientific_survey/static/scientific_survey/css/flatpickr.min.css similarity index 100% rename from scientific_survey/static/survey/css/flatpickr.min.css rename to scientific_survey/static/scientific_survey/css/flatpickr.min.css diff --git a/scientific_survey/static/survey/fonts/glyphicons-halflings-regular.ttf b/scientific_survey/static/scientific_survey/fonts/glyphicons-halflings-regular.ttf similarity index 100% rename from scientific_survey/static/survey/fonts/glyphicons-halflings-regular.ttf rename to scientific_survey/static/scientific_survey/fonts/glyphicons-halflings-regular.ttf diff --git a/scientific_survey/static/survey/fonts/glyphicons-halflings-regular.woff b/scientific_survey/static/scientific_survey/fonts/glyphicons-halflings-regular.woff similarity index 100% rename from scientific_survey/static/survey/fonts/glyphicons-halflings-regular.woff rename to scientific_survey/static/scientific_survey/fonts/glyphicons-halflings-regular.woff diff --git a/scientific_survey/static/survey/js/bootstrap.min.js b/scientific_survey/static/scientific_survey/js/bootstrap.min.js similarity index 100% rename from scientific_survey/static/survey/js/bootstrap.min.js rename to scientific_survey/static/scientific_survey/js/bootstrap.min.js diff --git a/scientific_survey/static/survey/js/custom.js b/scientific_survey/static/scientific_survey/js/custom.js similarity index 100% rename from scientific_survey/static/survey/js/custom.js rename to scientific_survey/static/scientific_survey/js/custom.js diff --git a/scientific_survey/static/survey/js/flatpickr.min.js b/scientific_survey/static/scientific_survey/js/flatpickr.min.js similarity index 100% rename from scientific_survey/static/survey/js/flatpickr.min.js rename to scientific_survey/static/scientific_survey/js/flatpickr.min.js diff --git a/scientific_survey/static/survey/js/jquery-ui.min.js b/scientific_survey/static/scientific_survey/js/jquery-ui.min.js similarity index 100% rename from scientific_survey/static/survey/js/jquery-ui.min.js rename to scientific_survey/static/scientific_survey/js/jquery-ui.min.js diff --git a/scientific_survey/static/survey/js/jquery.min.js b/scientific_survey/static/scientific_survey/js/jquery.min.js similarity index 100% rename from scientific_survey/static/survey/js/jquery.min.js rename to scientific_survey/static/scientific_survey/js/jquery.min.js diff --git a/scientific_survey/static/survey/sty/pgf-pie.sty b/scientific_survey/static/scientific_survey/sty/pgf-pie.sty similarity index 100% rename from scientific_survey/static/survey/sty/pgf-pie.sty rename to scientific_survey/static/scientific_survey/sty/pgf-pie.sty diff --git a/scientific_survey/static/survey/sty/pgfplots.sty b/scientific_survey/static/scientific_survey/sty/pgfplots.sty similarity index 100% rename from scientific_survey/static/survey/sty/pgfplots.sty rename to scientific_survey/static/scientific_survey/sty/pgfplots.sty diff --git a/scientific_survey/templates/survey/question.html b/scientific_survey/templates/survey/question.html index 3c05fd22..2a1b805c 100755 --- a/scientific_survey/templates/survey/question.html +++ b/scientific_survey/templates/survey/question.html @@ -8,33 +8,33 @@ {{ forloop.counter}}. {{ question }} {% for form, prefix, suffix in fields %} - - {% if form.field.widget.attrs.category == category.name or not form.field.widget.attrs.category %} - -
- {{form.label|safe|linebreaksbr }} - {% if form.field.required %} - + {% if form.field.widget.attrs.category == category.name or not form.field.widget.attrs.category %} + + +
+ {{form.label|safe|linebreaksbr }} + {% if form.field.required %} + + {% endif %} +
+ + {% for error in form.errors %}{{ error }}{% endfor %} + +
+ {% if form.field.widget.input_type == 'select' %} + - {% endif %} - {% if prefix %}{{prefix}}{% endif %} - {% for field in form %} - {{ field }} - {% endfor %} - {% if suffix %}{{suffix}}{% endif %} - {% if form.field.widget.input_type == 'select' %} - - {% endif %} - - {% endif %} - + {% if prefix %}{{prefix}}{% endif %} + {% for field in form %} + {{ field }} + {% endfor %} + {% if suffix %}{{suffix}}{% endif %} + {% if form.field.widget.input_type == 'select' %} + + {% endif %} + + + {% endif %} {% endfor %} diff --git a/setup.py b/setup.py index 1fdb2c29..cc24c4fa 100755 --- a/setup.py +++ b/setup.py @@ -37,7 +37,7 @@ setuptools.setup( name="django-scientific-survey", - version="0.1", + version="0.1.0", description=DESCRIPTION, long_description=LONG_DESCRIPTION, long_description_content_type="text/markdown",