999; font-size:18px;">?
NĂšMERO
' . $numero . '
DEPOIS
?
'; } $html .= ''; return $html; } function gmb_gerar_rodape_ia() { return '

Feito com 🤖 por: KIT SÓ ESCOLA

Plugin de Matemática Básica com IA - Ensino Fundamental v3.0

'; } // Manter todas as funções originais (gmb_gerar_cabecalho_padrao, gmb_gerar_atividade_completa, etc.) function gmb_gerar_atividade_completa($tipo, $operacao, $dificuldade, $quantidade, $serie, $turma, $professor, $escola, $logo_url, $cor_principal, $mostrar_data) { $cabecalho = gmb_gerar_cabecalho_padrao($escola, $serie, $turma, $professor, $logo_url, $cor_principal, $mostrar_data); $conteudo_atividade = ''; switch($tipo) { case 'caixas_operacoes': $conteudo_atividade = gmb_template_caixas_operacoes($operacao, $dificuldade, $quantidade); break; case 'operacoes_dedos': $conteudo_atividade = gmb_template_operacoes_dedos($operacao, $dificuldade, $quantidade); break; case 'atividades_relogio': $conteudo_atividade = gmb_template_atividades_relogio($dificuldade, $quantidade); break; case 'colorir_fracao': $conteudo_atividade = gmb_template_colorir_fracao($dificuldade, $quantidade); break; case 'maior_menor_igual': $conteudo_atividade = gmb_template_maior_menor_igual($operacao, $dificuldade, $quantidade); break; case 'numeros_faltantes': $conteudo_atividade = gmb_template_numeros_faltantes($dificuldade, $quantidade); break; case 'numeros_lagarta': $conteudo_atividade = gmb_template_numeros_lagarta($dificuldade, $quantidade); break; case 'busca_matematica': $conteudo_atividade = gmb_template_busca_matematica($operacao, $dificuldade); break; case 'numeros_antes_depois': $conteudo_atividade = gmb_template_numeros_antes_depois($dificuldade, $quantidade); break; } $rodape = gmb_gerar_rodape(); return $cabecalho . $conteudo_atividade . $rodape; } function gmb_gerar_cabecalho_padrao($escola, $serie, $turma, $professor, $logo_url, $cor_principal, $mostrar_data) { $logo_html = ''; if ($logo_url) { $logo_html = '
Logo da Escola
'; } $data_field = ''; if ($mostrar_data) { $data_field = '
Data: ___/___/___
'; } return '
' . $logo_html . '
Escola:
' . esc_html($escola) . '
Professor:
' . esc_html($professor) . '
Aluno:
Série
' . esc_html($serie) . '
Turma: ' . esc_html($turma ?: '____') . '
' . $data_field . '
'; } // Manter todas as outras funções originais... function gmb_template_operacoes_dedos($operacao, $dificuldade, $quantidade) { $html = '

Operações com Dedos

'; $limites = gmb_get_limites_dificuldade($dificuldade); $max_dedos = min($limites['max'], 10); for ($i = 0; $i < $quantidade; $i++) { $num1 = rand(1, $max_dedos); $num2 = rand(1, $max_dedos - $num1); if ($operacao === 'subtracao' && $num2 > $num1) { $temp = $num1; $num1 = $num2; $num2 = $temp; } $simbolo = gmb_get_simbolo_operacao($operacao); $html .= '
' . gmb_gerar_dedos_svg($num1) . '
' . $num1 . '
' . $simbolo . '
' . gmb_gerar_dedos_svg($num2) . '
' . $num2 . '
=
?
'; } $html .= '
'; return $html; } function gmb_template_atividades_relogio($dificuldade, $quantidade) { $html = '

Atividades com RelĂłgio

'; for ($i = 0; $i < $quantidade; $i++) { $hora = rand(1, 12); $minutos = ($dificuldade === 'facil') ? (rand(0, 1) * 30) : (rand(0, 11) * 5); $html .= '
' . gmb_gerar_relogio_melhorado($hora, $minutos) . '
Que horas sĂŁo?
___:___
'; } $html .= '
'; return $html; } function gmb_template_maior_menor_igual($operacao, $dificuldade, $quantidade) { $html = '

Maior, Menor ou Igual

'; $limites = gmb_get_limites_dificuldade($dificuldade); for ($i = 0; $i < $quantidade; $i++) { $num1 = rand($limites['min'], $limites['max']); $num2 = rand($limites['min'], $limites['max']); $html .= '
' . $num1 . '
<
=
>
' . $num2 . '
'; } $html .= '
'; return $html; } // Funções auxiliares melhoradas function gmb_gerar_dedos_svg($numero) { if ($numero == 0) return '
0
'; $svg = ''; $svg .= ''; $dedos_ativos = min($numero, 5); $positions = [ ['x' => 40, 'y' => 45], ['x' => 50, 'y' => 35], ['x' => 60, 'y' => 30], ['x' => 70, 'y' => 35], ['x' => 80, 'y' => 45] ]; for ($i = 0; $i < 5; $i++) { $cor = $i < $dedos_ativos ? '#ffdbcb' : '#e0e0e0'; $stroke = $i < $dedos_ativos ? '#d4a574' : '#bdbdbd'; $svg .= ''; } if ($numero > 5) { $segunda_mao = gmb_gerar_dedos_svg($numero - 5); return '
' . $svg . '' . $segunda_mao . '
'; } $svg .= ''; return $svg; } function gmb_gerar_relogio_melhorado($hora, $minutos) { $svg = ''; $svg .= ''; for ($i = 1; $i <= 12; $i++) { $angle = ($i - 3) * 30 * pi() / 180; $x = 100 + 70 * cos($angle); $y = 100 + 70 * sin($angle) + 6; $svg .= '' . $i . ''; } for ($i = 1; $i <= 12; $i++) { $angle = ($i - 3) * 30 * pi() / 180; $x1 = 100 + 85 * cos($angle); $y1 = 100 + 85 * sin($angle); $x2 = 100 + 75 * cos($angle); $y2 = 100 + 75 * sin($angle); $svg .= ''; } for ($i = 1; $i <= 60; $i++) { if ($i % 5 != 0) { $angle = ($i - 15) * 6 * pi() / 180; $x1 = 100 + 85 * cos($angle); $y1 = 100 + 85 * sin($angle); $x2 = 100 + 80 * cos($angle); $y2 = 100 + 80 * sin($angle); $svg .= ''; } } $hora_angle = (($hora % 12) + $minutos/60 - 3) * 30 * pi() / 180; $hora_x = 100 + 40 * cos($hora_angle); $hora_y = 100 + 40 * sin($hora_angle); $svg .= ''; $minuto_angle = ($minutos - 15) * 6 * pi() / 180; $minuto_x = 100 + 65 * cos($minuto_angle); $minuto_y = 100 + 65 * sin($minuto_angle); $svg .= ''; $svg .= ''; $svg .= ''; return $svg; } function gmb_get_limites_dificuldade($dificuldade) { switch ($dificuldade) { case 'facil': return ['min' => 1, 'max' => 10]; case 'medio': return ['min' => 1, 'max' => 50]; case 'dificil': return ['min' => 1, 'max' => 100]; default: return ['min' => 1, 'max' => 10]; } } function gmb_get_simbolo_operacao($operacao) { switch ($operacao) { case 'adicao': return '+'; case 'subtracao': return '-'; case 'multiplicacao': return 'Ă—'; case 'divisao': return 'Ă·'; default: return '+'; } } function gmb_gerar_rodape() { return '

Feito com por: KIT SĂ“ ESCOLA

Plugin de Matemática Básica - Ensino Fundamental v3.0

'; } // Manter as outras funções template originais... function gmb_template_caixas_operacoes($operacao, $dificuldade, $quantidade) { $html = '

Caixas de Operações

'; $limites = gmb_get_limites_dificuldade($dificuldade); for ($i = 0; $i < $quantidade; $i++) { $num1 = rand($limites['min'], $limites['max']); $num2 = rand($limites['min'], $limites['max']); if ($operacao === 'subtracao' && $num2 > $num1) { $temp = $num1; $num1 = $num2; $num2 = $temp; } $simbolo = gmb_get_simbolo_operacao($operacao); $html .= '
' . $num1 . '
' . $simbolo . '
' . $num2 . '
'; } $html .= '
'; return $html; } function gmb_template_colorir_fracao($dificuldade, $quantidade) { $html = '

Colorir a Fração

'; $fracoes = ($dificuldade === 'facil') ? [ ['numerador' => 1, 'denominador' => 2], ['numerador' => 1, 'denominador' => 3], ['numerador' => 1, 'denominador' => 4] ] : [ ['numerador' => 2, 'denominador' => 3], ['numerador' => 3, 'denominador' => 4], ['numerador' => 2, 'denominador' => 5], ['numerador' => 3, 'denominador' => 8] ]; for ($i = 0; $i < $quantidade; $i++) { $fracao = $fracoes[array_rand($fracoes)]; $html .= '
' . $fracao['numerador'] . '/' . $fracao['denominador'] . '
' . gmb_gerar_figura_fracao($fracao['denominador']) . '
Pinte ' . $fracao['numerador'] . ' parte(s)
'; } $html .= '
'; return $html; } function gmb_template_numeros_faltantes($dificuldade, $quantidade) { $html = '

NĂşmeros Faltantes

'; $limite = ($dificuldade === 'facil') ? 10 : (($dificuldade === 'medio') ? 30 : 100); $exercicios_por_pagina = 6; for ($i = 0; $i < $quantidade; $i++) { $inicio = rand(1, $limite - 10); $sequencia = []; if ($i > 0 && $i % $exercicios_por_pagina == 0) { $html .= '
'; } for ($j = 0; $j < 10; $j++) { if ($j === 3 || $j === 6) { $sequencia[] = '
?
'; } else { $sequencia[] = '
' . ($inicio + $j) . '
'; } } $html .= '
' . implode('', $sequencia) . '
'; } $html .= '
'; return $html; } function gmb_template_numeros_lagarta($dificuldade, $quantidade) { $html = '

NĂşmeros da Lagarta

'; $limite = ($dificuldade === 'facil') ? 20 : (($dificuldade === 'medio') ? 50 : 100); for ($i = 0; $i < $quantidade; $i++) { $inicio = rand(1, $limite - 15); $html .= '
' . $inicio . '
'; for ($j = 1; $j <= 6; $j++) { if ($j === 3 || $j === 5) { $html .= '
?
'; } else { $html .= '
' . ($inicio + $j) . '
'; } } $html .= '
'; } $html .= '
'; return $html; } function gmb_template_busca_matematica($operacao, $dificuldade) { $html = '

Busca Matemática

'; $numeros = []; $limites = gmb_get_limites_dificuldade($dificuldade); for ($i = 0; $i < 64; $i++) { $numeros[] = rand($limites['min'], $limites['max']); } $html .= '
'; foreach ($numeros as $numero) { $html .= '
' . $numero . '
'; } $html .= '
Encontre e circule os nĂşmeros:
'; $targets = array_rand(array_flip($numeros), 8); foreach ($targets as $target) { $html .= '
' . $target . '
'; } $html .= '
'; return $html; } function gmb_template_numeros_antes_depois($dificuldade, $quantidade) { $html = '

NĂşmeros Antes e Depois

'; $limites = gmb_get_limites_dificuldade($dificuldade); for ($i = 0; $i < $quantidade; $i++) { $numero = rand($limites['min'] + 1, $limites['max'] - 1); $html .= '
ANTES