Skip to main content

Overview

The Face Guess game shows you a classmate’s profile picture and challenges you to type their name correctly. This tests your ability to recognize faces and remember names.
URL Pattern: /minijuegos/adivina/<group_id>/Minimum Students: 1 with profile picture

How to Play

1

See the Profile Picture

A random classmate’s profile picture is displayed prominently.
2

Type Their Name

Enter the student’s name in the text input field. You can use their:
  • Full name
  • First name
  • Last name
  • Username
  • Nickname
3

Submit Your Answer

Click the submit button to check if you’re correct.
4

Get Instant Feedback

AJAX provides immediate results without reloading the page.
5

Continue Playing

After each answer, a new student appears automatically.

Flexible Answer Validation

The game accepts multiple variations of a student’s name from minigames/views.py:80-96:
# Accepted name fields
fields = ['username', 'first_name', 'last_name', 'full_name', 'nickname']
valid_answers = [normalize_text(getattr(student, f)).strip() 
                 for f in fields if getattr(student, f)]

# Exact match
if answer in valid_answers:
    is_correct = True
# Partial match (e.g., "Juan" matches "Juan Alberto")
else:
    for valid in valid_answers:
        if len(answer) > 2 and (answer in valid or valid in answer):
            is_correct = True
            break

Examples of Accepted Answers

For a student named “María González García”:
  • Maria (accent removed, partial match)
  • MARIA GONZALEZ (case insensitive, partial match)
  • Gonzalez (last name)
  • maria gonzalez garcia (full name, lowercase)
  • Ma (too short, less than 3 characters)
You only need to type part of the name if it’s at least 3 characters. “Ana” matches “Ana María” automatically.

Text Normalization

The game uses the same normalization as Hangman from minigames/views.py:12-18:
def normalize_text(text):
    """Elimina tildes y convierte a mayúsculas."""
    if not text: return ""
    return ''.join(
        c for c in unicodedata.normalize('NFD', text)
        if unicodedata.category(c) != 'Mn'
    ).upper()
This means:
  • Accents don’t matter: José = Jose
  • Case doesn’t matter: maría = MARIA
  • Spaces are preserved

Scoring System

Session variables tracked:
  • face_guess_correct: Number of correct identifications
  • face_guess_total: Total attempts
Displayed as: Correct / Total (e.g., 8 / 10 for 80% accuracy)

Anti-Repetition Logic

From minigames/views.py:109-114:
last_id = request.session.get('face_guess_last_id')
available_students = students.exclude(id=last_id) if students.count() > 1 else students
target_student = random.choice(available_students)

request.session['face_guess_target_id'] = target_student.id
request.session['face_guess_last_id'] = target_student.id
The game avoids showing the same student twice in a row (when there are at least 2 students with profile pictures).

AJAX Implementation

The game can use AJAX for instant feedback from minigames/views.py:103-104:
if request.headers.get('x-requested-with') == 'XMLHttpRequest': 
    return get_ajax_response(request, is_correct, msg, 'face_guess')
The JSON response includes:
{
  "success": true,
  "message": "¡Correcto! Es María González",
  "correct": 8,
  "total": 10
}

Student Filtering

From minigames/views.py:65:
students = group.students.filter(profile_picture__isnull=False).exclude(id=request.user.id).distinct()
The game:
  • ✅ Only includes students with profile pictures
  • ✅ Excludes yourself (you can’t guess your own name)
  • ✅ Uses .distinct() to avoid duplicates
If no other students in your class have profile pictures, you’ll see a “no students” error page.

Tips for Success

Typing just the first name is often enough for a match. Try the simplest version first.
Type “Jose” even if the name is “José”. The game automatically handles accents.
You can type part of a name (minimum 3 characters) and still get credit.
If you can’t remember the full name, try just the last name or a nickname.
Sometimes subtle details in the profile picture can jog your memory.

Role-Based Access

For Students

From minigames/views.py:55-59:
if request.user.role == 'student':
    group = request.user.student_groups.first()
    if not group: 
        return render(request, 'minigames/no_students.html')
    group_id = group.id
Students are automatically assigned to their enrolled class.

For Teachers

Teachers see a class selection screen if they don’t specify a group_id in the URL.

Session State

Session variables used:
  • face_guess_correct: Correct answers count
  • face_guess_total: Total attempts count
  • face_guess_target_id: Current student being guessed
  • face_guess_last_id: Previous student (for anti-repetition)

Technical Implementation

View Function: face_guess_game() in minigames/views.py:52-121 Key Features:
  • Flexible answer validation (5 name fields accepted)
  • Partial matching for convenience
  • Text normalization for accents and case
  • Anti-repetition logic
  • AJAX support for instant feedback
  • Role-based automatic class detection

Comparison with Other Games

FeatureFace GuessHangmanName to Face
Input TypeFree textLetter selectionMultiple choice
DifficultyMediumHardEasy
Partial CreditYesNoNo
Minimum Students114

Next Steps

Try Name to Face

Multiple choice version - easier gameplay

Try Hangman

Letter-by-letter guessing - more challenging

Playing Games Guide

Learn strategies for all game types

Build docs developers (and LLMs) love