Skip to content

Commit

Permalink
Merge branch 'develop' into feature/cleanup-round-getters
Browse files Browse the repository at this point in the history
  • Loading branch information
BeritJanssen committed Aug 9, 2024
2 parents 94fc748 + ad0cf0f commit 6bf0710
Show file tree
Hide file tree
Showing 23 changed files with 152 additions and 460 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
name: Test Backend
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Run Backend Tests
run: sudo docker compose --env-file .env-github-actions run server bash -c "coverage run manage.py test"
- name: Generate Backend Coverage Report (Inline)
Expand Down Expand Up @@ -63,7 +63,7 @@ jobs:
name: Lint Backend
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Lint Backend
continue-on-error: false
run: sudo docker compose --env-file .env-github-actions run server bash -c "ruff check"
6 changes: 3 additions & 3 deletions .github/workflows/ci-frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
name: Test Frontend
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Run Frontend Tests
run: sudo docker compose --env-file .env-github-actions run client yarn test:ci

Expand All @@ -30,7 +30,7 @@ jobs:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/develop'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Generate Frontend Coverage Report (XML) and Badge
run: |
sudo docker compose --env-file .env-github-actions run client yarn test:ci
Expand Down Expand Up @@ -64,5 +64,5 @@ jobs:
name: Lint Frontend
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: sudo docker compose --env-file .env-github-actions run client yarn lint
2 changes: 1 addition & 1 deletion .github/workflows/storybook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install dependencies
run: yarn
working-directory: ./frontend
Expand Down
2 changes: 1 addition & 1 deletion backend/DockerfileDevelop
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM docker.io/python:3.11 as base
ENV PYTHONUNBUFFERED 1
RUN apt-get -y update && apt-get install -y ffmpeg gettext
RUN apt-get -y update && apt-get install -y ffmpeg gettext graphviz graphviz-dev

WORKDIR /server
COPY requirements/dev.txt /server/
Expand Down
29 changes: 18 additions & 11 deletions backend/aml/development_settings.py
Original file line number Diff line number Diff line change
@@ -1,31 +1,38 @@
"""Settings for development environment"""

import os
from aml.base_settings import *

# Database
# https://docs.djangoproject.com/en/3.0/ref/settings/#databases

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': os.getenv('SQL_DATABASE'),
'USER': os.getenv('SQL_USER'),
'PASSWORD': os.getenv('SQL_PASSWORD'),
'HOST': os.getenv('SQL_HOST'),
'PORT': os.getenv('SQL_PORT'),
"default": {
"ENGINE": "django.db.backends.postgresql",
"NAME": os.getenv("SQL_DATABASE"),
"USER": os.getenv("SQL_USER"),
"PASSWORD": os.getenv("SQL_PASSWORD"),
"HOST": os.getenv("SQL_HOST"),
"PORT": os.getenv("SQL_PORT"),
}
}

INSTALLED_APPS += ['debug_toolbar']
# Some installed apps neeed to be prepended to the list and some appended
INSTALLED_APPS = ["django_extensions"] + INSTALLED_APPS + ["debug_toolbar"]

MIDDLEWARE = ['debug_toolbar.middleware.DebugToolbarMiddleware'] + MIDDLEWARE
MIDDLEWARE = ["debug_toolbar.middleware.DebugToolbarMiddleware"] + MIDDLEWARE

INTERNAL_IPS = [
'127.0.0.1',
"127.0.0.1",
]

CORS_ALLOW_ALL_ORIGINS = True

TESTING = DEBUG

BASE_URL = os.getenv('BASE_URL') or 'http://localhost:8000'
BASE_URL = os.getenv("BASE_URL") or "http://localhost:8000"

GRAPH_MODELS = {
"all_applications": True,
"group_models": True,
}
14 changes: 0 additions & 14 deletions backend/experiment/actions/playback.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
TYPE_IMAGE = 'IMAGE'
TYPE_MULTIPLAYER = 'MULTIPLAYER'
TYPE_MATCHINGPAIRS = 'MATCHINGPAIRS'
TYPE_VISUALMATCHINGPAIRS = 'VISUALMATCHINGPAIRS'

# playback methods
PLAY_EXTERNAL = 'EXTERNAL'
Expand Down Expand Up @@ -142,19 +141,6 @@ def __init__(self, sections: List[Dict], score_feedback_display: str = 'large-to
self.score_feedback_display = score_feedback_display


class VisualMatchingPairs(MatchingPairs):
'''
This is a special case of multiplayer:
play buttons are represented as cards
this player does not play audio, but displays images instead
'''

def __init__(self, sections, **kwargs):
super().__init__(sections, **kwargs)
self.ID = TYPE_VISUALMATCHINGPAIRS
self.play_method = PLAY_NOAUDIO


def determine_play_method(section):
filename = str(section.filename)
if not is_audio_file(filename):
Expand Down
18 changes: 1 addition & 17 deletions backend/experiment/fixtures/experiment.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,7 @@
"model": "experiment.Experiment",
"pk": 1,
"fields": {
"slug": "RhythmTestSeries",
"first_experiments": [
"10"
],
"random_experiments": [
"7",
"3",
"1",
"2",
"5",
"4",
"6",
"8"
],
"last_experiments": [
"9"
]
"slug": "RhythmTestSeries"
}
},
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Generated by Django 4.2.14 on 2024-08-06 06:59

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('experiment', '0051_remove_experiment_about_content_and_more'),
]

operations = [
migrations.RemoveField(
model_name='experiment',
name='first_experiments',
),
migrations.RemoveField(
model_name='experiment',
name='last_experiments',
),
migrations.RemoveField(
model_name='experiment',
name='random_experiments',
),
]
5 changes: 0 additions & 5 deletions backend/experiment/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ class Experiment(models.Model):
slug = models.SlugField(max_length=64, default="")
translated_content = models.QuerySet["ExperimentTranslatedContent"]
theme_config = models.ForeignKey("theme.ThemeConfig", blank=True, null=True, on_delete=models.SET_NULL)
# first experiments in a test series, in fixed order
first_experiments = models.JSONField(blank=True, null=True, default=dict)
random_experiments = models.JSONField(blank=True, null=True, default=dict)
# last experiments in a test series, in fixed order
last_experiments = models.JSONField(blank=True, null=True, default=dict)
# present random_experiments as dashboard
dashboard = models.BooleanField(default=False)
active = models.BooleanField(default=True)
Expand Down
2 changes: 0 additions & 2 deletions backend/experiment/rules/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
from .toontjehogerkids_4_absolute import ToontjeHogerKids4Absolute
from .toontjehogerkids_5_tempo import ToontjeHogerKids5Tempo
from .toontjehogerkids_6_relative import ToontjeHogerKids6Relative
from .visual_matching_pairs import VisualMatchingPairsGame

# Rules available to this application
# If you create new Rules, add them to the list
Expand Down Expand Up @@ -79,5 +78,4 @@
ToontjeHogerKids4Absolute.ID: ToontjeHogerKids4Absolute,
ToontjeHogerKids5Tempo.ID: ToontjeHogerKids5Tempo,
ToontjeHogerKids6Relative.ID: ToontjeHogerKids6Relative,
VisualMatchingPairsGame.ID: VisualMatchingPairsGame
}
Loading

0 comments on commit 6bf0710

Please sign in to comment.