Changeset 7987 in spip-zone


Ignore:
Timestamp:
Dec 16, 2006, 12:57:14 AM (12 years ago)
Author:
patfr@…
Message:

ch'tite optimisation

Location:
_plugins_/_stable_/jeux/inc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • _plugins_/_stable_/jeux/inc/qcm.php

    r7986 r7987  
    130130function qcm_un_trou($nomVarSelect, $indexQCM) {
    131131  global $qcms;
    132   if (($sizeInput = intval(jeux_config('trou')))==0) {
    133         $sizeInput = 0;
     132  if (($sizeInput = intval(jeux_config('trou')))==0)
    134133        foreach($qcms[$indexQCM]['propositions'] as $mot) $sizeInput = max($sizeInput, strlen($mot));
    135   }
    136134  $prop = strtolower($_POST[$nomVarSelect] = trim($_POST[$nomVarSelect]));
    137   return " <input name=\"$nomVarSelect\" class=\"jeux_input\" size=\"$sizeInput\" type=\"text\"> ";
     135  return " &nbsp; &nbsp; &nbsp;<input name=\"$nomVarSelect\" class=\"jeux_input qcm_input\" size=\"$sizeInput\" type=\"text\"> ";
    138136}
    139137
  • _plugins_/_stable_/jeux/inc/trous.php

    r7986 r7987  
    7777        list($texteAvant, $texteApres) = explode($eregResult[0], $chaine, 2);
    7878        $texteApres = trous_inserer_les_trous($texteApres, $indexJeux);
    79         if (($sizeInput = intval(jeux_config('taille')))==0) {
    80                 $sizeInput = 0;
     79        if (($sizeInput = intval(jeux_config('taille')))==0)
    8180                foreach($propositionsTROUS as $trou) foreach($trou as $mot) $sizeInput = max($sizeInput, strlen($mot));
    82         }
    8381        $chaine = $texteAvant.jeux_rem('TROU-DEBUT', $indexTROU)
    8482                . trous_inserer_le_trou($indexJeux, $indexTROU, $sizeInput, isset($_POST["var_correction_".$indexJeux]))
Note: See TracChangeset for help on using the changeset viewer.