Skip to content

Commit

Permalink
Merge branch 'develop' into feature/break-actions
Browse files Browse the repository at this point in the history
  • Loading branch information
BeritJanssen committed Nov 27, 2023
2 parents 6aef9b3 + 7f6e294 commit 83e635b
Show file tree
Hide file tree
Showing 31 changed files with 908 additions and 576 deletions.
3 changes: 1 addition & 2 deletions backend/experiment/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class ExperimentAdmin(InlineActionsModelAdminMixin, admin.ModelAdmin):
search_fields = ['name']
inline_actions = ['export', 'export_csv']
fields = ['name', 'slug', 'url', 'hashtag', 'language', 'active', 'rules',
'rounds', 'bonus_points', 'playlists', 'experiment_series']
'rounds', 'bonus_points', 'playlists', 'experiment_series','questions']
inlines = [FeedbackInline]
form = ExperimentForm

Expand Down Expand Up @@ -99,7 +99,6 @@ def export_csv(self, request, obj, parent_obj=None):

export_csv.short_description = "Export CSV"


admin.site.register(Experiment, ExperimentAdmin)

class ModelFormFieldAsJSON(ModelMultipleChoiceField):
Expand Down
230 changes: 6 additions & 224 deletions backend/experiment/fixtures/experiment.json
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,9 @@
13,
2,
1
],
"questions": [
"msi_01_music_activities", "msi_03_writing", "msi_08_intrigued_styles", "msi_15_internet_search_music", "msi_21_spend_income", "msi_24_music_addiction", "msi_28_track_new", "msi_34_attended_events", "msi_38_listen_music", "msi_05_good_singer", "msi_06_song_first_time", "msi_11_spot_mistakes", "msi_12_performance_diff", "msi_13_trouble_recognising", "msi_18_out_of_beat", "msi_22_out_of_tune", "msi_23_no_idea_in_tune", "msi_26_genre", "msi_14_never_complimented", "msi_27_consider_musician", "msi_32_practice_years", "msi_33_practice_daily", "msi_35_theory_training", "msi_36_instrumental_training", "msi_37_play_instruments", "msi_04_sing_along", "msi_07_from_memory", "msi_10_sing_with_recording", "msi_17_not_sing_harmony", "msi_25_sing_public", "msi_29_sing_after_hearing", "msi_30_sing_back", "msi_02_shivers", "msi_09_rarely_emotions", "msi_16_motivate", "msi_19_identify_special", "msi_20_talk_emotions", "msi_31_memories", "msi_39_best_instrument", "dgf_genre_preference_zh", "dgf_generation", "dgf_education", "dgf_highest_qualification_expectation", "dgf_occupational_status", "dgf_region_of_origin", "dgf_region_of_residence", "dgf_gender_identity_zh", "contact"
]
}
},
Expand Down Expand Up @@ -344,231 +347,10 @@
"experiment_series": null,
"playlists": [
18
],
"questions": [
"dgf_generation", "dgf_gender_identity", "P01_1", "P01_2", "P01_3", "P02_1", "P02_2", "P02_3", "P03_1", "P03_2", "P03_3", "P04_1", "P04_2", "P04_3", "P04_4", "P05_1", "P05_2", "P05_3", "P05_4", "P05_5", "P06_1", "P06_2", "P06_3", "P06_4", "P07_1", "P07_2", "P07_3", "P08_1", "P08_2", "P08_3", "P09_1", "P09_2", "P09_3", "P10_1", "P10_2", "P10_3", "P11_1", "P11_2", "P11_3", "P12_1", "P12_2", "P12_3", "P13_1", "P13_2", "P13_3", "P14_1", "P14_2", "P14_3", "P14_4", "P15_1", "P15_2", "P15_3", "P15_4", "P16_1", "P16_2", "P16_3", "P17_1", "P17_2", "P17_3"
]
}
},
{
"model": "experiment.feedback",
"pk": 1,
"fields": {
"text": "",
"experiment": 15
}
},
{
"model": "experiment.feedback",
"pk": 2,
"fields": {
"text": "",
"experiment": 15
}
},
{
"model": "experiment.feedback",
"pk": 3,
"fields": {
"text": "",
"experiment": 17
}
},
{
"model": "experiment.feedback",
"pk": 4,
"fields": {
"text": "hh started this test at 11:52 and played until 11:58. But filled in the feedback and submitted at 12: 05.",
"experiment": 17
}
},
{
"model": "experiment.feedback",
"pk": 5,
"fields": {
"text": "I breakdown music by ear a lot, so I found this very interesting. After the top row I realized I needed to jot down reminders on scratch paper. Figuring out what is the most effective approach to summarizing a snippet is a great problem to solve. Maybe I will craft a longer response in an email.",
"experiment": 17
}
},
{
"model": "experiment.feedback",
"pk": 6,
"fields": {
"text": "Not an easy Play. Cannon say That I plagend it well.",
"experiment": 17
}
},
{
"model": "experiment.feedback",
"pk": 7,
"fields": {
"text": "",
"experiment": 17
}
},
{
"model": "experiment.feedback",
"pk": 8,
"fields": {
"text": "",
"experiment": 14
}
},
{
"model": "experiment.feedback",
"pk": 9,
"fields": {
"text": "Hi folks! This is the second time I played, and it worked just like a memory game where two \"cards\" were identical. The first time I played, it was a little different - one of the cards sounded like it was being played through some kind of filter and the other was normal. Also, when I got to the end one was the \"Westworld\" theme and its match did not really sound like it was a match. Not sure if any of this is intentional but I thought I'd let you know! :)",
"experiment": 17
}
},
{
"model": "experiment.feedback",
"pk": 10,
"fields": {
"text": "This was really hard!!",
"experiment": 17
}
},
{
"model": "experiment.feedback",
"pk": 11,
"fields": {
"text": "Sometimes when I clicked, no music played. Not sure if my bluetooth connection was hijacked. Every time I could fix it by clicking on another one -- but I guess that decreased my performance a bit.",
"experiment": 17
}
},
{
"model": "experiment.feedback",
"pk": 12,
"fields": {
"text": "Boring excerpts. Rules aren't clear.",
"experiment": 17
}
},
{
"model": "experiment.feedback",
"pk": 13,
"fields": {
"text": "I notice that when I click play again, then after finishing the game, it adds the points to the previous points. I wonder if this is the intented behaviour. Very cool application tho!",
"experiment": 17
}
},
{
"model": "experiment.feedback",
"pk": 14,
"fields": {
"text": "Were last two correct?! ",
"experiment": 17
}
},
{
"model": "experiment.feedback",
"pk": 15,
"fields": {
"text": "DJB game post fix 1 ",
"experiment": 17
}
},
{
"model": "experiment.feedback",
"pk": 16,
"fields": {
"text": "game 3 o",
"experiment": 17
}
},
{
"model": "experiment.feedback",
"pk": 17,
"fields": {
"text": "game 3 or 4 for me ",
"experiment": 17
}
},
{
"model": "experiment.feedback",
"pk": 18,
"fields": {
"text": "That's really cool! ",
"experiment": 17
}
},
{
"model": "experiment.feedback",
"pk": 19,
"fields": {
"text": "",
"experiment": 17
}
},
{
"model": "experiment.feedback",
"pk": 20,
"fields": {
"text": "play across board djb",
"experiment": 17
}
},
{
"model": "experiment.feedback",
"pk": 21,
"fields": {
"text": "First four cards I clicked already showed misremembered.",
"experiment": 17
}
},
{
"model": "experiment.feedback",
"pk": 22,
"fields": {
"text": "Yes ER theme tune! What nostalgia!! ",
"experiment": 17
}
},
{
"model": "experiment.feedback",
"pk": 23,
"fields": {
"text": "None of the songs were from TV shows",
"experiment": 17
}
},
{
"model": "experiment.feedback",
"pk": 24,
"fields": {
"text": "This is way too hard",
"experiment": 17
}
},
{
"model": "experiment.feedback",
"pk": 25,
"fields": {
"text": "I was too lazy to read the instructions and didn't realize the task at first. But got the hang of it soon enough.",
"experiment": 17
}
},
{
"model": "experiment.feedback",
"pk": 26,
"fields": {
"text": "Pairs are much easier to remember when you know the themes (which is not my case for the most part)\nFun to play ! ",
"experiment": 17
}
},
{
"model": "experiment.feedback",
"pk": 27,
"fields": {
"text": "Nice work!",
"experiment": 17
}
},
{
"model": "experiment.feedback",
"pk": 28,
"fields": {
"text": "nice",
"experiment": 17
}
}
]
10 changes: 9 additions & 1 deletion backend/experiment/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
from experiment.models import Experiment
from experiment.rules import EXPERIMENT_RULES

from django.forms import TypedMultipleChoiceField, CheckboxSelectMultiple
from .questions import QUESTIONS_CHOICES

# session_keys for Export CSV
SESSION_CHOICES = [('experiment_id', 'Experiment ID'),
('experiment_name', 'Experiment name'),
Expand Down Expand Up @@ -127,7 +130,12 @@ def __init__(self, *args, **kwargs):
choices += ((i, EXPERIMENT_RULES[i].__name__),)

self.fields['rules'] = ChoiceField(
choices=choices
choices=sorted(choices)
)

self.fields['questions'] = TypedMultipleChoiceField(
choices=QUESTIONS_CHOICES,
widget=CheckboxSelectMultiple
)

class Meta:
Expand Down
Loading

0 comments on commit 83e635b

Please sign in to comment.