Author: Fabrizio
Date: 2010-01-28 00:31:13 +0100 (Thu, 28 Jan 2010)
New Revision: 27262

Added:
   plugins/sfQuizPlugin/trunk/modules/sfQuizStart/actions/components.class.php
   
plugins/sfQuizPlugin/trunk/modules/sfQuizStart/templates/_tabelloneGiocatore.php
Modified:
   plugins/sfQuizPlugin/trunk/modules/sfQuizStart/actions/actions.class.php
   plugins/sfQuizPlugin/trunk/modules/sfQuizStart/templates/fineGiocoSuccess.php
   plugins/sfQuizPlugin/trunk/modules/sfQuizStart/templates/gameSuccess.php
   plugins/sfQuizPlugin/trunk/modules/sfQuizStart/templates/indexSuccess.php
   
plugins/sfQuizPlugin/trunk/modules/sfQuizStart/templates/rispostaGiustaSuccess.php
   
plugins/sfQuizPlugin/trunk/modules/sfQuizStart/templates/rispostaSbagliataSuccess.php
Log:
[sfQuizPlugin] Refactoring

Modified: 
plugins/sfQuizPlugin/trunk/modules/sfQuizStart/actions/actions.class.php
===================================================================
--- plugins/sfQuizPlugin/trunk/modules/sfQuizStart/actions/actions.class.php    
2010-01-27 23:12:44 UTC (rev 27261)
+++ plugins/sfQuizPlugin/trunk/modules/sfQuizStart/actions/actions.class.php    
2010-01-27 23:31:13 UTC (rev 27262)
@@ -13,7 +13,7 @@
       $this->form->bind($request->getParameter('numeroGiocatori'));
       if ($this->form->isValid())
       {
-        
$this->redirect('@quiz-nomi-giocatori?'.http_build_query($this->form->getValues()));
+        
$this->redirect('@quiz-names-of-players?'.http_build_query($this->form->getValues()));
       }
 
     }
@@ -26,7 +26,7 @@
    * @param sfWebRequest $request
    * @return unknown_type
    */
-  public function executeNomiGiocatori(sfWebRequest $request)
+  public function executeNamesOfPlayers(sfWebRequest $request)
   {
      
     $this->form = new NomiGiocatoriForm(null, array(
@@ -88,7 +88,7 @@
     if($this->quiz->numeroDomandaCorrente() 
>($this->quiz->numDomPerGiocatore() * $this->quiz->numGiocatori()))
     {
        
-      $this->redirect('@quiz-fine-gioco');
+      $this->redirect('@quiz-end-game');
     }
 
     $domanda = $this->quiz->testoDomandaCorrente();
@@ -104,33 +104,33 @@
       
       $this->quiz->setRispostaData($request->getParameter('risposta'));
       
-      if (!$this->quiz->turnoSuccessivo()) 
{$this->redirect('quiz-fine-gioco');};
+      if (!$this->quiz->turnoSuccessivo()) {$this->redirect('quiz-end-game');};
       echo 'La tua risposta è '.$request->getParameter('risposta').'. ';
 
       if ($this->quiz->rispostaGiusta($this->quiz->getChiaveDomandaCorrente(), 
$request->getParameter('risposta')))
       {
-        $this->redirect('@quiz-risposta-giusta');
+        $this->redirect('@quiz-correct-answer');
 
       }
       else
       {
-        $this->redirect('@quiz-risposta-sbagliata');
+        $this->redirect('@quiz-wrong-answer');
 
       }
     }
   }
 
-  public function executeRispostaGiusta(sfWebRequest $request)
+  public function executeCorrectAnswer(sfWebRequest $request)
   {
 
   }
 
-  public function executeRispostaSbagliata(sfWebRequest $request)
+  public function executeWrongAnswer(sfWebRequest $request)
   {
 
   }
 
-  public function executeFineGioco(sfWebRequest $request)
+  public function executeEndGame(sfWebRequest $request)
   {
     unset($this->quiz);
   }

Added: 
plugins/sfQuizPlugin/trunk/modules/sfQuizStart/actions/components.class.php
===================================================================
--- plugins/sfQuizPlugin/trunk/modules/sfQuizStart/actions/components.class.php 
                        (rev 0)
+++ plugins/sfQuizPlugin/trunk/modules/sfQuizStart/actions/components.class.php 
2010-01-27 23:31:13 UTC (rev 27262)
@@ -0,0 +1,11 @@
+<?php
+class sfQuizStartComponents extends sfComponents
+{
+  public function executeTabelloneGiocatore()
+  {
+    $this->nome = $this->quiz->nomeGiocatoreCorrente();
+    $this->giocatore = $this->quiz->numeroGiocatoreCorrente()-1;
+    $this->totDomande = $this->quiz->numDomPerGiocatore();
+    $this->risposteDate = $this->quiz->getRisposteDate();
+  }
+}
\ No newline at end of file

Added: 
plugins/sfQuizPlugin/trunk/modules/sfQuizStart/templates/_tabelloneGiocatore.php
===================================================================
--- 
plugins/sfQuizPlugin/trunk/modules/sfQuizStart/templates/_tabelloneGiocatore.php
                            (rev 0)
+++ 
plugins/sfQuizPlugin/trunk/modules/sfQuizStart/templates/_tabelloneGiocatore.php
    2010-01-27 23:31:13 UTC (rev 27262)
@@ -0,0 +1,13 @@
+Percorso giocatore <?php echo $nome?>
+
+<?php for ($d=1; $d<=$totDomande; $d++):?>
+<div>
+<?php echo $d.': ' ?>
+<?php if (isset($risposteDate[$giocatore+1][$d])):?>
+<?php echo $risposteDate[$giocatore+1][$d]['giusta'] ?  __('Correct') : 
__('Wrong') ?>
+<?php else: ?>
+<?php echo __('To respond') ?>
+
+<?php endif; ?>
+</div>
+<?php endfor;?>

Modified: 
plugins/sfQuizPlugin/trunk/modules/sfQuizStart/templates/fineGiocoSuccess.php
===================================================================
--- 
plugins/sfQuizPlugin/trunk/modules/sfQuizStart/templates/fineGiocoSuccess.php   
    2010-01-27 23:12:44 UTC (rev 27261)
+++ 
plugins/sfQuizPlugin/trunk/modules/sfQuizStart/templates/fineGiocoSuccess.php   
    2010-01-27 23:31:13 UTC (rev 27262)
@@ -1 +1 @@
-Il gioco è terminato
\ No newline at end of file
+<?php echo __('The game is over')?>
\ No newline at end of file

Modified: 
plugins/sfQuizPlugin/trunk/modules/sfQuizStart/templates/gameSuccess.php
===================================================================
--- plugins/sfQuizPlugin/trunk/modules/sfQuizStart/templates/gameSuccess.php    
2010-01-27 23:12:44 UTC (rev 27261)
+++ plugins/sfQuizPlugin/trunk/modules/sfQuizStart/templates/gameSuccess.php    
2010-01-27 23:31:13 UTC (rev 27262)
@@ -3,7 +3,8 @@
 <?php include_component('sfQuizStart', 'tabelloneGiocatore', array('quiz' => 
$quiz))?>
 </div>
 
-<h2>Domanda <?php echo $quiz->numeroDomandaCorrente() ?> per il giocatore 
<?php echo $quiz->nomeGiocatoreCorrente() ?>
+<h2>
+<?php echo __('Question %num% for the player %nome%', array('%num%' => 
$quiz->numeroDomandaCorrente(), '%nome%' => $quiz->nomeGiocatoreCorrente()))?>
 </h2>
 
 <p>

Modified: 
plugins/sfQuizPlugin/trunk/modules/sfQuizStart/templates/indexSuccess.php
===================================================================
--- plugins/sfQuizPlugin/trunk/modules/sfQuizStart/templates/indexSuccess.php   
2010-01-27 23:12:44 UTC (rev 27261)
+++ plugins/sfQuizPlugin/trunk/modules/sfQuizStart/templates/indexSuccess.php   
2010-01-27 23:31:13 UTC (rev 27262)
@@ -1,4 +1,4 @@
-<p><?php echo __('Benvenuti') ?></p>
+<p><?php echo __('Welcome') ?></p>
 
 <form method="post">
 <?php echo $form['numeroGiocatori']->renderRow() ?><br />

Modified: 
plugins/sfQuizPlugin/trunk/modules/sfQuizStart/templates/rispostaGiustaSuccess.php
===================================================================
--- 
plugins/sfQuizPlugin/trunk/modules/sfQuizStart/templates/rispostaGiustaSuccess.php
  2010-01-27 23:12:44 UTC (rev 27261)
+++ 
plugins/sfQuizPlugin/trunk/modules/sfQuizStart/templates/rispostaGiustaSuccess.php
  2010-01-27 23:31:13 UTC (rev 27262)
@@ -1,3 +1,3 @@
-La risposta è GIUSTA !!
+<?php echo __('Answer is OK!')?>
 
 <?php include_partial('risposta_successiva')?>
\ No newline at end of file

Modified: 
plugins/sfQuizPlugin/trunk/modules/sfQuizStart/templates/rispostaSbagliataSuccess.php
===================================================================
--- 
plugins/sfQuizPlugin/trunk/modules/sfQuizStart/templates/rispostaSbagliataSuccess.php
       2010-01-27 23:12:44 UTC (rev 27261)
+++ 
plugins/sfQuizPlugin/trunk/modules/sfQuizStart/templates/rispostaSbagliataSuccess.php
       2010-01-27 23:31:13 UTC (rev 27262)
@@ -1,3 +1,3 @@
-La risposta è SBAGLIATA !!
+<?php echo __('The answer is WRONG!')?>
 
 <?php include_partial('risposta_successiva')?>
\ No newline at end of file

-- 
You received this message because you are subscribed to the Google Groups 
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/symfony-svn?hl=en.

Reply via email to