Amsterdam-Music-Lab / MUSCLE

An application to easily set up and run online listening experiments for music research.
https://www.amsterdammusiclab.nl/
MIT License
4 stars 1 forks source link

🐛 [BUG] - TH(Kids) issues on TST #1106

Closed drikusroor closed 2 months ago

drikusroor commented 2 months ago

Description

Screenshots

image

Reproduction URL

https://tst.amsterdammusiclab.nl/toontje-hoger-1-mozart?participant_id=test)

Reproduction steps

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

Logs

No response

Browsers

No response

OS

No response

Additional context

No response

drikusroor commented 2 months ago

The issue of point 4. seems to be here, in the section_from_any_song method:

https://github.com/Amsterdam-Music-Lab/MUSCLE/blob/53dd7e2a08c266aba22e244ca8841c0c67edffc5/backend/session/models.py#L142-L153

On line 152, it queries sections using the song ids. There is only one song, as the OR and CH sections are seen as the same song - they have the same artist and song name. However, it then selects a section based on the song id randomly (random.choice). As both sections (with group or & ch) are connected to the same song, it randomly selects one of those sections.

Now, I tried to also add the filter_by parameter to that same query:

    def section_from_any_song(self, filter_by={}):
        """Get a random section with a Dutch IP check.

        To ensure appropriate IP restrictions, most rules should use this
        method instead of operating on the playlist directly.
        """

        pks = self.filter_songs(filter_by)
        if pks:
            # Return a random section
            sections = self.playlist.section_set.filter(
                song_id=random.choice(pks)
            ).filter(
                **filter_by
            )
            return random.choice(sections)

And that works for a couple of times, but sometimes it cannot find anything and the whole next_round method crashes... UPDATE: I incorrectly configured TH5K - Tempo with 10 rounds instead of 5, so in round 6 it tried to look for unused songs (which obviously don't exist anymore).

drikusroor commented 2 months ago

I'll close this issue as #1113 has fixed point 4. and point 5. was working on ACC already and has been fixed on TST by updating directory permissions.