Skip to content

Commit

Permalink
Minor fixes before release
Browse files Browse the repository at this point in the history
  • Loading branch information
dkalpakchi committed Dec 22, 2021
1 parent 87b4fd6 commit 21e22e2
Show file tree
Hide file tree
Showing 19 changed files with 40 additions and 36 deletions.
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1 @@
recursive-include survey *
recursive-include scientific_survey *
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

<p align="center">
<img src="doc/numerical_rating_scale_example.png" alt="An example of a numerical rating scale">
</p>

* 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.
Expand Down Expand Up @@ -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

Expand All @@ -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

Expand Down
Binary file added doc/numerical_rating_scale_example.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions scientific_survey/apps.py
Original file line number Diff line number Diff line change
@@ -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")
52 changes: 26 additions & 26 deletions scientific_survey/templates/survey/question.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,33 @@
<th>{{ forloop.counter}}. {{ question }}</th>
</tr>
{% for form, prefix, suffix in fields %}
<tr class="{% if form.errors%} danger {% endif %}">
{% if form.field.widget.attrs.category == category.name or not form.field.widget.attrs.category %}
<td>
<div class="criterion">
{{form.label|safe|linebreaksbr }}
{% if form.field.required %}
<span class="glyphicon glyphicon-asterisk" style="color:red"> </span>
{% if form.field.widget.attrs.category == category.name or not form.field.widget.attrs.category %}
<tr class="{% if form.errors%} danger {% endif %}">
<td>
<div class="criterion">
{{form.label|safe|linebreaksbr }}
{% if form.field.required %}
<span class="glyphicon glyphicon-asterisk" style="color:red"> </span>
{% endif %}
</div>
<span class="help-inline" style="color:red">
<strong> {% for error in form.errors %}{{ error }}{% endfor %} </strong>
</span>
<br>
{% if form.field.widget.input_type == 'select' %}
<select name="{{form.name}}"{% if form.field.widget.attrs.disabled %} disabled{% endif %}>
{% endif %}
</div>
<span class="help-inline" style="color:red">
<strong> {% for error in form.errors %}{{ error }}{% endfor %} </strong>
</span>
<br>
{% if form.field.widget.input_type == 'select' %}
<select name="{{form.name}}"{% if form.field.widget.attrs.disabled %} disabled{% endif %}>
{% endif %}
{% if prefix %}<span class="prefix">{{prefix}}</span>{% endif %}
{% for field in form %}
{{ field }}
{% endfor %}
{% if suffix %}<span class="suffix">{{suffix}}</span>{% endif %}
{% if form.field.widget.input_type == 'select' %}
</select>
{% endif %}
</td>
{% endif %}
</tr>
{% if prefix %}<span class="prefix">{{prefix}}</span>{% endif %}
{% for field in form %}
{{ field }}
{% endfor %}
{% if suffix %}<span class="suffix">{{suffix}}</span>{% endif %}
{% if form.field.widget.input_type == 'select' %}
</select>
{% endif %}
</td>
</tr>
{% endif %}
{% endfor %}
</tbody>
</table>
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 21e22e2

Please sign in to comment.