Skip to main content

Overview

Relaciona uses an extended Django user model called UserProfile that stores comprehensive information about students and teachers. These profiles are central to the platform’s gamification and personalization features.
Profile completeness is crucial for games to function properly. Many minigames require students to have profile pictures and personal information filled in.

UserProfile Model

The UserProfile model extends Django’s AbstractUser and is defined in accounts/models.py:5-74.

Core Fields

Role System

Two-role system distinguishing between students and teachers:
  • student (Alumno)
  • teacher (Profesor)

Basic Information

Essential profile data:
  • Full name
  • Date of birth
  • Gender (male/female/other)
  • Nickname
  • Residence area

Profile Picture

Cloudinary-hosted images used in multiple games:
  • Face recognition games
  • Name-to-face matching
  • Profile displays

Learning Data

Assessment results stored on profile:
  • Learning style (VARK)
  • Emotional reinforcement (Chapman)

Personal Preferences

Profiles capture detailed student preferences used for personalization and games.

Entertainment & Interests

favorite_song = models.CharField(max_length=100, blank=True, null=True)
favorite_artist = models.CharField(max_length=100, blank=True, null=True)
favorite_movie = models.CharField(max_length=100, blank=True, null=True)
favorite_place = models.CharField(max_length=255, blank=True, null=True)
spotify_link = models.URLField(max_length=500, blank=True, null=True)
These fields enable:
  • Student Interests Game: Matches descriptions to students
  • Spotify Guess Game: Players identify songs by student
  • Personalized connections: Teachers learn about students

Reflection Questions

Profiles include thoughtful prompts that help teachers understand students better:
  • Motivation: motivation - What drives the student
  • Gratitude: gratitude - What they’re most grateful for in life
  • Happy Memory: happy_memory - Their happiest memory
These fields appear in profile views and help create meaningful connections.

Spotify Integration

The platform includes a special Spotify integration feature.

How It Works

  1. Student Input: Students paste a Spotify song link in their profile
  2. Automatic Conversion: The spotify_embed_url property transforms sharing links to embeddable format
  3. Game Usage: The Spotify Guess Game uses embedded players for gameplay
@property
def spotify_embed_url(self):
    if self.spotify_link:
        if "track/" in self.spotify_link:
            clean_url = self.spotify_link.split('?')[0]
            if "embed/" not in clean_url:
                return clean_url.replace("track/", "embed/track/")
            return clean_url
    return None

Privacy & Sharing Settings

Birthday Celebrations

celebrate_birthday = models.BooleanField(default=True)
Allows students to opt out of birthday recognition.

Class Sharing

share_with_class = models.BooleanField(default=False)
Controls whether profile information is visible to classmates. This affects:
  • Profile visibility in games
  • Information displayed to other students
  • Privacy in social features

Profile Completeness

Many games require complete profiles to function:
  • Profile Picture: Required for Face Guess, Name to Face, Hangman games
  • Personal Info: Used in Student Interests and Complete Profile games
  • Spotify Link: Required for Spotify Guess game (minimum 4 students)
  • Learning Assessments: Displayed in Complete Profile game

Game Requirements

From minigames/views.py, games filter students based on profile completeness:
# Face Guess Game
students = group.students.filter(
    profile_picture__isnull=False
).exclude(id=request.user.id).distinct()

# Spotify Game  
students = group.students.exclude(
    spotify_link__isnull=True
).exclude(spotify_link='').exclude(id=request.user.id).distinct()

Data Handling

Cloudinary Integration

Profile pictures are stored using Cloudinary’s Django field:
from cloudinary.models import CloudinaryField

profile_picture = CloudinaryField('image', blank=True, null=True)
Benefits:
  • Automatic image optimization
  • CDN distribution for fast loading
  • Scalable storage solution
  • Transformation capabilities

Database Schema

All fields are nullable and blank-allowed, making profile building gradual:
  • Students can complete profiles over time
  • No mandatory fields beyond username/password
  • Teachers can encourage profile completion for better game experiences

Teacher vs Student Roles

Student Profiles

Purpose: Personalization and gameplay
  • Fill out personal preferences
  • Complete learning assessments
  • Participate in games
  • Share information with class (optional)

Teacher Profiles

Purpose: Class management and insights
  • View student learning styles
  • Access assessment results
  • Lead gamified activities
  • Build classroom connections

Build docs developers (and LLMs) love