Overview
The Spotify Mystery game combines music with memory. Listen to a classmate’s favorite song via an embedded Spotify player and identify who chose it from four options.URL Pattern:
/minijuegos/spotify/<group_id>/Minimum Students: 4 with Spotify links configuredHow to Play
Listen to the Song
An embedded Spotify player appears with a classmate’s favorite song. Press play to listen.
Review Four Students
Four student options appear below the player, each showing name and profile picture.
Spotify Integration
How Students Add Songs
Students add their favorite songs to their profile via thespotify_link field from accounts/models.py:51-57:
Automatic Embed Conversion
Fromaccounts/models.py:59-71, Relaciona automatically converts share links to embed format:
- Student provides:
https://open.spotify.com/track/3n3Ppam7vgaVa1iaRUc9Lp?si=abc123 - System converts to:
https://open.spotify.com/embed/track/3n3Ppam7vgaVa1iaRUc9Lp
Game Mechanics
Student Filtering
Fromminigames/views.py:399:
- ✅ Only students with Spotify links configured
- ✅ Excludes empty Spotify link fields
- ✅ Excludes yourself from appearing
- ✅ Uses
.distinct()to avoid duplicates
Option Generation
Fromminigames/views.py:421-429:
- Avoid showing the last song again (anti-repetition)
- Select random target student
- Get their Spotify embed URL
- Pick 3 other students as distractors
- Shuffle the four options
Scoring
Session variables tracked:spotify_correct: Correct song identificationsspotify_total: Total attempts
Answer Validation
Fromminigames/views.py:409-413:
AJAX Implementation
Fromminigames/views.py:415-418:
Anti-Repetition Logic
The game stores the last song shown inspotify_last_id and avoids repeating it immediately:
Tips for Success
Learn Musical Genres
Learn Musical Genres
Pay attention to what genres and artists classmates like. This helps you associate music styles with people.
Remember Song Discussions
Remember Song Discussions
If classmates talk about their music preferences in class, those memories can help in the game.
Look for Patterns
Look for Patterns
Sometimes personality traits correlate with music taste - though not always!
Use Elimination
Use Elimination
If you know some students’ musical preferences, eliminate those you know are wrong.
Listen to the Whole Preview
Listen to the Whole Preview
Don’t rush - listen to the song long enough to get a feel for the style and mood.
Adding Your Spotify Song
To participate in this game, students need to add their favorite song:Add to Your Profile
Go to your Relaciona profile → Edit → Paste the link in the “Enlace de Spotify” field
Role-Based Access
For Students
Fromminigames/views.py:390-394:
For Teachers
Teachers select a class from the group selection screen.Session State
Variables maintained:spotify_correct: Correct matches countspotify_total: Total attempts countspotify_target_id: Current target student IDspotify_last_id: Previous target (for anti-repetition)
Common Issues
Not Enough Students Error
Not Enough Students Error
Cause: Fewer than 4 students have added Spotify links to their profiles.Solution:
- Ask classmates to add their favorite songs to their profiles
- Teachers can send reminders about profile completion
- See profile completion guide
Spotify Player Won't Load
Spotify Player Won't Load
Cause: Network issues, ad blocker, or invalid Spotify link.Solution:
- Disable ad blockers for the site
- Check internet connection
- Verify the Spotify link is a valid track URL
- Try refreshing the page
Song Won't Play
Song Won't Play
Cause: Spotify requires users to be logged in to play full songs.Solution:
- Log into Spotify in another tab
- Even without playback, you can often see the song title and artist
- The preview should still work in most cases
Educational Value
This game provides unique benefits:Cultural Exchange
Discover music from different cultures and genres through classmates
Connection Building
Music creates emotional connections and common interests
Memory Association
Associating songs with people creates strong memory anchors
Diversity Appreciation
Exposure to diverse musical tastes broadens perspectives
Technical Implementation
View Function:spotify_guess_game() in minigames/views.py:388-437
Key Features:
- Automatic Spotify link to embed conversion
- Student filtering by Spotify link presence
- Anti-repetition logic for song variety
- AJAX instant feedback with reveal message
- Error handling for insufficient students
- Embedded Spotify player integration
Privacy Considerations
Students have control over their Spotify integration:- Spotify links are optional (not required)
- Students can remove their link anytime by editing their profile
- Only the song link is stored, not Spotify account information
- No tracking of listening history or Spotify activity
Next Steps
Add Your Song
Complete your profile with your favorite Spotify song
Student Interests Game
Another personality-based matching game
User Profiles Feature
Learn about all profile fields and features
Playing Games Guide
Strategies for all game types