Skip to main content

Overview

The Comparison Tools feature provides two powerful comparison modules for strategic analysis and benchmarking:
  1. Compare Dilemmas (compare.php) - Side-by-side comparison of multiple dilemmas
  2. Compare Clients (compare_clients.php) - Client performance benchmarking
These tools enable data-driven decision-making by visualizing performance differences across games or organizations.

1. Compare Dilemmas

Purpose

Compare the performance of 2-5 dilemmas side-by-side to:
  • Identify which content drives the most engagement
  • Benchmark question performance across games
  • Find difficulty disparities between similar dilemmas
  • Inform content strategy and resource allocation

How to Access

From the Games Dashboard (games.php):
1

Select Dilemmas

Check the boxes next to 2-5 dilemmas you want to compare
2

Click Compare Button

Click the “Comparar Seleccionados” button
3

View Comparison

You’ll be redirected to compare.php?games[]=1&games[]=2&games[]=3
You must select at least 2 dilemmas to enable the comparison feature. The page will redirect to games.php if no games are selected.

Key Metrics Summary

The comparison page displays three strategic KPI cards:

Most Popular

Metric: Total ExecutionsHighlights the dilemma with the most user sessionsBadge: 🟢 “Más Popular”

Fastest Completion

Metric: Average Time (minutes)Identifies the dilemma with the lowest average completion timeBadge: 🔵 “Más Rápido”

Most Users

Metric: Unique User CountShows which dilemma reached the most unique participantsBadge: 🟣 “Mayor Alcance”
Example Display:
┌─────────────────────────────┐
│ 🏆 Más Popular              │
│ Mayor Participación         │
│ Ethics Challenge 2024       │
│ 1,247 ejecuciones          │
└─────────────────────────────┘

Question-Level Comparison Table

The main feature is a comparative table that analyzes shared questions across selected dilemmas:

Table Structure

Pregunta / CategoríaDilemma 1Dilemma 2Dilemma 3Var. %
What is ethical leadership? (Ethics)78 (45 respuestas)82 (67 respuestas)65 (23 respuestas)17 pts
Define conflict of interest (Compliance)91 (88 respuestas)88 (102 respuestas)93 (56 respuestas)5 pts
Columns Explained:
  • Pregunta / Categoría: Question text with category badge
  • Dilemma columns: Average score (0-100) and response count for each game
  • Var. %: Score variation (max - min) to identify inconsistencies

Color-Coded Performance

Scores are color-coded for quick analysis:
Score RangeColorMeaning
≥80🟢 Green BoldExcellent performance
50-79🟡 Yellow MediumModerate performance
1-49🔴 RedPoor performance - needs review
0⚪ GrayNo data available
High Variation Scores:If a question has a variation >30 points, investigate why:
  • Different user populations?
  • Question presented with different context?
  • One dilemma may have outdated content

Empty State

If no shared questions exist:
┌───────────────────────────────────────────────────┐
│  ❓ (icon)                                        │
│  No se encontraron preguntas comunes o datos     │
│  de respuestas para los dilemas seleccionados.   │
│  Asegúrate de que los dilemas tengan preguntas   │
│  configuradas y sesiones jugadas.                │
└───────────────────────────────────────────────────┘

Visual Charts

Two interactive Chart.js visualizations:

1. Executions by Dilemma (Bar Chart)

new Chart(document.getElementById('executionsChart'), {
    type: 'bar',
    data: {
        labels: ['Ethics Challenge', 'Data Privacy', 'Leadership'],
        datasets: [{
            label: 'Ejecuciones',
            data: [1247, 892, 634],
            backgroundColor: ['#2563eb', '#db2777', '#7c3aed']
        }]
    }
});
Purpose: Visualize engagement differences at a glance

2. Average Time by Dilemma (Bar Chart)

new Chart(document.getElementById('timeChart'), {
    type: 'bar',
    data: {
        labels: ['Ethics Challenge', 'Data Privacy', 'Leadership'],
        datasets: [{
            label: 'Tiempo (min)',
            data: [24.5, 18.2, 31.7],
            backgroundColor: ['#2563eb', '#db2777', '#7c3aed']
        }]
    }
});
Purpose: Identify dilemmas that may be too long or too short

Export Functionality

Click the “Exportar” button to print/save the comparison:
<button onclick="window.print()">
    <i data-lucide="download"></i> Exportar
</button>
This triggers the browser’s print dialog, allowing export to PDF.

2. Compare Clients

Admin-Only Feature: Client comparison is restricted to administrators. Non-admin users are redirected to the homepage.

Purpose

Benchmark two clients against each other across key performance metrics:
  • Identify which clients are most/least engaged
  • Detect risk differences between organizations
  • Inform client success strategies
  • Support account management and renewal decisions

How to Access

Method 1: From Clients List Page Select 2 clients and click “Comparar”:
compare_clients.php?clients[]=ClientA&clients[]=ClientB
Method 2: Manual Selection on Comparison Page Navigate to compare_clients.php and use the dropdown selectors:
1

Select Client A

Choose the first client from the dropdown
2

Select Client B

Choose the second client from the dropdown
3

Click Comparar

Click the “Comparar” button to generate the comparison

Client Headers

Selected clients are displayed in prominent header cards:
┌────────────────────────────────────────────────────────┐
│              │  🔵 ACME CORP  │  🟣 TECHCORP         │
└────────────────────────────────────────────────────────┘
  • Client A: Blue background (bg-blue-600)
  • Client B: Indigo background (bg-indigo-600)

Comparative Metrics Table

Seven key metrics are compared side-by-side:
MetricClient AClient BWinner Indicator
👥 Usuarios Únicos247189↑ Mejor (A)
▶️ Sesiones Totales1,8932,104↑ Mejor (B)
📈 Score Promedio78.5%82.1%↑ Mejor (B)
⏱️ Tiempo Promedio23 min19 min↑ Mejor (B)
Tasa Completitud76%68%↑ Mejor (A)
⚠️ Índice de Riesgo18%12%↑ Mejor (B)
Engagement7.6x11.1x↑ Mejor (B)

Metric Definitions

Usuarios Únicos

Count of distinct users who participated in dilemmas

Sesiones Totales

Total number of dilemma sessions (a user may have multiple sessions)

Score Promedio

Mean score across all sessions (0-100 scale)

Tiempo Promedio

Average session duration in minutes

Tasa Completitud

Percentage of sessions that were fully completedFormula: (Finished sessions ÷ Total sessions) × 100

Índice de Riesgo

Percentage of sessions with scores <60 (failing grade)Formula: (Low score count ÷ Total sessions) × 100Note: Lower is better

Engagement

Average number of sessions per userFormula: (Total sessions ÷ Unique users) ÷ 10

Winner Highlighting

The client with the better metric is highlighted:
  • Winning value: Displayed in bold blue/indigo
  • Losing value: Displayed in light gray
  • ”↑ Mejor” badge: Green label appears under the winning value
Special Case - Risk Index: For the Risk Index, lower is better, so the logic is inverted:
$isRisk = $m['key'] === 'risk_index';
$winA = $isRisk ? !$winA : $winA; // Flip winner for risk

Activity Trend Chart

A line chart displays 6-month activity trends for both clients:
new Chart(document.getElementById('trendChart'), {
    type: 'line',
    data: {
        labels: ['Sep 2023', 'Oct 2023', 'Nov 2023', 'Dec 2023', 'Jan 2024', 'Feb 2024'],
        datasets: [
            {
                label: 'Acme Corp',
                data: [45, 67, 89, 123, 156, 178],
                borderColor: '#2563eb',
                fill: true
            },
            {
                label: 'TechCorp',
                data: [23, 34, 56, 89, 134, 187],
                borderColor: '#4f46e5',
                fill: true
            }
        ]
    }
});
Purpose:
  • Identify growth or decline trends
  • Detect seasonality patterns
  • Compare adoption rates over time

Use Cases

Content Strategy

Dilemma Comparison:Identify which dilemmas perform best to inform future content creation

Portfolio Optimization

Dilemma Comparison:Retire underperforming dilemmas and double down on high-engagement content

Account Management

Client Comparison:Benchmark clients to identify those needing proactive support or upsell opportunities

Best Practice Sharing

Client Comparison:Study high-engagement clients to replicate success with others

Question Difficulty Analysis

Dilemma Comparison:Find questions with high variation scores to investigate context differences

Risk Monitoring

Client Comparison:Track risk index trends to predict churn or engagement issues

Best Practices

For Dilemma Comparison:✅ Compare dilemmas with similar:
  • Target audiences
  • Difficulty levels
  • Content domains (e.g., all ethics, all compliance)
❌ Avoid comparing:
  • Dilemmas from vastly different time periods
  • Games with <20 sessions (insufficient data)
  • Dilemmas targeting different user populations
For Client Comparison:✅ Compare clients with:
  • Similar industry/size for meaningful benchmarks
  • Active deployments (avoid inactive clients)
  • Comparable time periods
❌ Avoid comparing:
  • New clients (<30 days) with established ones
  • Pilot programs with full deployments
  • Clients with vastly different user counts

Access Control

Compare Dilemmas

Access Level: All authenticated users
  • Administrators can compare any dilemmas
  • Client users may be restricted to their own dilemmas (depending on implementation)

Compare Clients

Access Level: Admin-only
// Access restriction (compare_clients.php:8-11)
if (!check_is_admin()) {
    header('Location: ' . SITE_URL . '/');
    exit;
}

Build docs developers (and LLMs) love