Skip to main content

Overview

The Name to Face game is a multiple-choice variation where you see a student’s name and must select their profile picture from four options. This is the easiest face recognition game since you just need to click rather than type.
URL Pattern: /minijuegos/adivina-imagen/<group_id>/Minimum Students: 4 with profile pictures

How to Play

1

See the Target Name

The game displays a student’s name prominently at the top.
2

Review Four Pictures

Four profile pictures appear - one correct answer and three distractors.
3

Click the Correct Picture

Click on the profile picture that matches the displayed name.
4

Get Instant Feedback

The game tells you immediately if you’re correct via AJAX.
5

Continue to Next Round

After answering, a new name and set of pictures appear automatically.

Game Mechanics

Picture Selection

From minigames/views.py:149-153:
target = random.choice(students.exclude(id=request.session.get('name_to_face_last_id')) 
                       if students.count() > 1 else students)
request.session['name_to_face_target_id'] = target.id
options = list(random.sample(list(students.exclude(id=target.id)), 3)) + [target]
random.shuffle(options)
How it works:
  1. Select a random target student (avoiding the last one shown)
  2. Pick 3 other students as distractors
  3. Add the target to create 4 total options
  4. Shuffle so the correct answer isn’t always in the same position

Scoring

Session variables tracked:
  • name_to_face_correct: Number of correct selections
  • name_to_face_total: Total attempts
Displayed as: Correct / Total (e.g., 12 / 15 for 80% accuracy)

Answer Validation

From minigames/views.py:142:
is_correct = str(request.POST.get('selected_id')) == str(request.session.get('name_to_face_target_id'))
The game compares the clicked picture’s ID with the target student’s ID stored in the session.

Anti-Repetition Logic

The game avoids showing the same target name twice in a row:
target = random.choice(students.exclude(id=request.session.get('name_to_face_last_id')) 
                       if students.count() > 1 else students)
request.session['name_to_face_last_id'] = target.id
The anti-repetition only applies to the target name. The same students may appear as distractor options in multiple rounds.

Student Requirements

From minigames/views.py:134-136:
students = group.students.filter(profile_picture__isnull=False).exclude(id=request.user.id).distinct()

if students.count() < 4: 
    return render(request, 'minigames/not_enough_students.html')
Requirements:
  • At least 4 students (excluding yourself) with profile pictures
  • All students must have uploaded a profile picture
  • You are automatically excluded from appearing as an option
If your class has fewer than 4 students with profile pictures, you’ll see an error page. Encourage classmates to upload their pictures!

AJAX Implementation

From minigames/views.py:146:
if request.headers.get('x-requested-with') == 'XMLHttpRequest': 
    return get_ajax_response(request, is_correct, msg, 'name_to_face')
The JSON response includes:
{
  "success": true,
  "message": "¡Correcto!",
  "correct": 12,
  "total": 15
}

Role-Based Access

For Students

From minigames/views.py:125-129:
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 must select a class from the group selection screen or provide a group_id in the URL.

Tips for Success

Before playing, review your classmates’ profiles in the classmates list to familiarize yourself with their pictures.
If you’re unsure, eliminate options you know are wrong to improve your odds.
Hair style, accessories, and backgrounds can help you remember who’s who.
Sometimes the name itself can trigger your memory of what the person looks like.

Session State

The game maintains these session variables:
  • name_to_face_correct: Correct answers count
  • name_to_face_total: Total attempts count
  • name_to_face_target_id: Current target student ID
  • name_to_face_last_id: Previous target (for anti-repetition)

Comparison with Other Recognition Games

FeatureName to FaceFace GuessHangman
Input TypeClick/SelectFree textLetter selection
DifficultyEasyMediumHard
Minimum Students411
Answer HintsYes (4 options)NoYes (picture + blanks)
Time PressureLowMediumLow
This is the best game to start with if you’re new to the class. The multiple-choice format makes it easier to learn faces.

Technical Implementation

View Function: name_to_face_game() in minigames/views.py:123-160 Key Features:
  • Multiple choice with 4 options
  • Randomized option order
  • Anti-repetition for target selection
  • Automatic role-based class detection
  • AJAX for instant feedback
  • Student count validation (minimum 4)

Common Issues

Cause: Fewer than 4 students in your class have profile pictures.Solution:
  1. Ask classmates to upload their profile pictures
  2. Teachers can remind students about profile completion
  3. Try other games that require fewer students (Face Guess, Hangman)
Cause: Small class size means limited student pool for options.Solution: This is normal if you have exactly 4-5 students with pictures. The game will cycle through available combinations.
Cause: Network issues loading images from Cloudinary.Solution:
  1. Check your internet connection
  2. Wait a moment for images to load
  3. Refresh the page if images don’t appear after 5 seconds

Next Steps

Try Face Guess

Test yourself with free-text name entry - more challenging

Complete Profile Challenge

Advanced multiple choice with comprehensive profile data

Playing Games Guide

Learn strategies for all game types

Upload Your Picture

Help classmates practice by completing your profile

Build docs developers (and LLMs) love