Changeset 666

Show
Ignore:
Timestamp:
07/22/08 17:08:42 (3 months ago)
Author:
aarkerio
Message:

Exmans and vclass

Location:
trunk/app
Files:
12 modified

Legend:

Unmodified
Added
Removed
  • trunk/app/controllers/answers_controller.php

    r540 r666  
    2525 public function admin_add()  
    2626 { 
    27    if (!empty($this->data["Answer"])) 
    28    {   
    29     //die(print_r($this->data)); 
     27   if (!empty($this->data["Answer"])):   
    3028         
    31    $this->Sanitize = new Sanitize; 
     29     $this->Sanitize = new Sanitize; 
    3230         
    33    $this->Sanitize->clean($this->data["Answer"]); 
     31     $this->Sanitize->clean($this->data["Answer"]); 
    3432         
    35    $this->data["Answer"]['user_id'] = $this->Auth->user('id'); 
    36  
    37    $this->Answer->create(); 
     33     $this->data["Answer"]['user_id'] = $this->Auth->user('id'); 
    3834         
    39    if ( $this->Answer->save($this->data['Answer']) )  
    40    { 
    41      $conditions = array("Answer.question_id" => $this->data['Answer']['question_id']); 
    42      $fields     = array("Answer.id", "Answer.answer", "Answer.correct", "Answer.question_id"); 
    43      $order      = "Answer.id"; 
    44                      
    45      $this->set('data', $this->Answer->findAll($conditions, $fields, $order)); 
    46                      
    47      $this->render('questions', 'ajax'); 
    48    } 
    49    else 
    50    { 
     35     if ( $this->Answer->save($this->data) ): 
     36         $conditions = array("Answer.question_id" => $this->data['Answer']['question_id']); 
     37         $fields     = array("Answer.id", "Answer.answer", "Answer.correct", "Answer.question_id"); 
     38         $order      = "Answer.id";            
     39         $this->set('data', $this->Answer->findAll($conditions, $fields, $order)); 
     40         $this->render('questions', 'ajax'); 
     41   else: 
    5142     echo "Ajax error, check with the company's computer guy..."; 
    52    } 
    53   } 
     43   endif; 
     44  endif; 
    5445 } 
    5546 
  • trunk/app/controllers/questions_controller.php

    r575 r666  
    55*  GPLv3 manuel<arroba>mononeurona<punto>org 
    66*/  
    7 //File: /app/controllers/quotes_controller.php 
     7//File: /app/controllers/questions_controller.php 
    88 
    99uses('Sanitize'); 
     
    2929         
    3030    $this->data["Question"]['user_id'] = $this->Auth->user('id'); 
    31  
    32     $this->Question->create(); 
    3331         
    34     if ( $this->Question->save( $this->data['Question'] ) ): 
     32    if ( $this->Question->save( $this->data ) ): 
    3533      $conditions = array('Question.test_id' => $this->data['Question']['test_id']); 
    3634      $fields     = array('Question.id','Question.question','Question.hint','Question.worth','Question.explanation','Question.test_id'); 
     
    5048 { 
    5149    $this->layout = 'admin'; 
    52     // adds new vote to database 
    53     if ( !empty($this->data["Question"]) ) 
    54     {          
    55         $this->Sanitize = new Sanitize; 
     50    
     51    if ( !empty($this->data["Question"]) ):          
     52         $this->Sanitize = new Sanitize; 
    5653         
    57         $this->Sanitize->clean($this->data["Question"]); 
     54         $this->Sanitize->clean($this->data["Question"]); 
    5855                 
    59          if ( $this->Question->save( $this->data['Question'] ) )  
    60          { 
    61               $this->msgFlash('Question saved', '/admin/tests/questions/'.$this->data['Question']['test_id']); 
    62          } 
    63          else 
    64          { 
    65                 echo "Ajax error, check with the company's computer guy..."; 
    66          } 
    67      } 
    68      else 
    69      {   
     56     if ( $this->Question->save( $this->data ) ):  
     57             $this->msgFlash(__('Question saved', true), '/admin/tests/questions/'.$this->data['Question']['test_id']); 
     58     else: 
     59             echo "Ajax error, check with the company's computer guy..."; 
     60     endif; 
     61     else:   
    7062        $this->data = $this->Question->read(null, $question_id); 
    71      } 
     63     endif; 
    7264  } 
    7365   
     
    7668        $this->layout    = 'admin'; 
    7769         
    78         $this->pageTitle = 'Questions'; 
     70        $this->pageTitle = __('Questions', true); 
    7971         
    8072        $conditions = array("Question.user_id"=>$this->Auth->user('id')); 
  • trunk/app/controllers/tests_controller.php

    r578 r666  
    2929        $this->Auth->allow(array('view', 'display', 'result')); 
    3030   endif; 
    31    // L10n 
    32    $this->L10n = new L10n(); 
    33    $this->L10n->get("en"); 
    34   
    35    Configure::write('Config.language', "en"); 
    3631 } 
    3732 
    3833 public function display($username, $user_id) 
    3934 { 
    40     $this->pageTitle = 'Exams'; 
     35    $this->pageTitle = __('Tests', true); 
    4136           
    4237    $this->layout    = $this->Edublog->layout($user_id); 
     
    5348    $user_id = $this->Test->field('Test.user_id', array("Test.id"=>$test_id)); 
    5449     
    55     $this->pageTitle = 'Exam'; 
     50    $this->pageTitle = __('Test', true); 
    5651     
    5752    $this->layout    = $this->Edublog->layout($user_id); 
     
    189184   $this->layout    = 'admin'; 
    190185         
    191    $this->pageTitle = 'Tests'; 
     186   $this->pageTitle = __('Tests', true); 
    192187         
    193188   $conditions = array('Test.user_id'=>$this->Auth->user('id')); 
  • trunk/app/locale/spa/LC_MESSAGES/default.po

    r653 r666  
    1717msgstr "Todos los FAQs" 
    1818 
     19msgid  "Hint" 
     20msgstr "Pista" 
     21 
     22msgid  "Explanation" 
     23msgstr "Explicación" 
     24 
     25msgid  "Question" 
     26msgstr "Pregunta" 
     27 
     28msgid  "Questions" 
     29msgstr "Preguntas" 
     30 
     31msgid  "This test had been assigned to class" 
     32msgstr "Este examen ha sido asignado a la clase" 
     33 
     34msgid  "Tests" 
     35msgstr "Exámenes" 
     36 
     37msgid  "Test" 
     38msgstr "Examen" 
     39 
     40msgid  "questions" 
     41msgstr "preguntas" 
     42 
     43msgid  "View answers" 
     44msgstr "Ver respuestas" 
     45 
     46msgid  "Add new question" 
     47msgstr "Agregar nueva pregunta" 
     48 
     49msgid  "Answer" 
     50msgstr "Respuesta" 
     51 
     52msgid  "New answer" 
     53msgstr "Nueva respuesta" 
     54 
     55msgid  "Correct" 
     56msgstr "Correcta" 
     57 
     58msgid  "Answer is correct" 
     59msgstr "Esta respuesta es correcta" 
     60 
     61msgid  "Answers to" 
     62msgstr "Respuestas para" 
     63 
    1964msgid  "Next" 
    2065msgstr "Siguiente" 
     
    163208msgid  "Save" 
    164209msgstr "Guardar" 
     210 
     211msgid  "Description" 
     212msgstr "Descripción" 
     213 
     214msgid  "Points" 
     215msgstr "Puntos" 
     216 
     217msgid  "New question" 
     218msgstr "Nueva pregunta" 
     219 
     220msgid  "Edit question" 
     221msgstr "Editar pregunta" 
    165222 
    166223msgid  "File" 
  • trunk/app/views/answers/questions.ctp

    r541 r666  
    22// die( debug( $data )); 
    33foreach ($data as $val): 
    4  
    5   $st   = ($val['Answer']['correct']==1) ? 'Yes' : 'No';       
    6   $tmp  = $html->div(null, $html->link('Delete', '/admin/answers/delete/'.$val['Answer']['id'].'/'.$val['Answer']['question_id'])); 
    7   $tmp .= $html->div(null, $html->link('Edit',   '/admin/answers/edit/'  .$val['Answer']['id'])); 
    8   $tmp .= "Answer:  "     .    $val['Answer']['answer']       . "<br />"; 
     4  $st   = ($val['Answer']['correct']==1) ? __('Yes', true) : 'No'; 
     5  $tmp  = __('Answer', true) . ':  '  .    $val['Answer']['answer']       . "<br />"; 
    96  $url  = '/admin/answers/change/'.$val['Answer']['id'].'/'.$val['Answer']['correct'].'/'.$val['Answer']['question_id']; 
    10   $tmp .= "Correct: "     . $html->link($st, $url) . "<br />"; 
     7  $tmp .= __('Correct', true). ': '. $html->link($st, $url) . '<br /><br />'; 
     8  $tmp .= $html->div(null,$html->link(__('Delete', true),'/admin/answers/delete/'.$val['Answer']['id'].'/'.$val['Answer']['question_id'])); 
     9  $tmp .= $html->div(null, $html->link(__('Edit', true),   '/admin/answers/edit/'.$val['Answer']['id'])); 
    1110 
    1211  echo $html->div('adminblock', $tmp); 
  • trunk/app/views/questions/admin_answers.ctp

    r422 r666  
    11<?php 
    22//die(debug($data)); 
    3  echo $html->addCrumb('Control Tools', '/admin/entries/start'); 
    4  echo $html->addCrumb('Tests', '/admin/tests/listing'); 
     3 echo $html->addCrumb('Control Panel', '/admin/entries/start'); 
     4 echo $html->addCrumb(__('Tests', true), '/admin/tests/listing'); 
    55 echo $html->addCrumb($data['Test']['title'], '/admin/tests/questions/'.$data['Test']['id']); 
    66 echo $html->getCrumbs(' / ');  
    77 
    8  echo $html->div('title_section', 'Answers to ' . $data['Question']['question']); 
     8 echo $html->para(null, __('Answers to', true) .': <b>'. $data['Question']['question'].'</b>'); 
     9 
     10 echo $html->div(null, $html->image('static/loading.gif', array('alt'=>'Loading')), array('id'=>'loading','style'=>'display: none;')); 
     11 
     12 echo $html->para(null, $html->link($html->image('actions/new.png',array('alt'=>__('Add new', true),'title'=>__('Add new', true))), '#', array("onclick"=>"hU()"), false, false));  
     13 
    914?> 
    10  
    11 <div id="loading" style="display: none;"> <?php echo $html->image("static/loading.gif", array("alt"=>"Loading")); ?></div> 
    12  
    13 <?php echo $html->para(null, $html->link($html->image('actions/new.png', array("alt"=>"Add new answer", "title"=>"Add new answer")), '#', array("onclick"=>"hU()"), false, false)); ?> 
    14  
    1515 
    1616<div id="addquestion" style="display:none"> 
     
    2020   echo $form->hidden('Answer.question_id', array('value'=>$data['Question']['id'])); 
    2121 ?> 
    22 <fieldset><legend>New answer</legend> 
     22<fieldset><legend><?php __('New answer'); ?></legend> 
    2323<?php 
    24  echo $html->div('required',$form->input('Answer.answer', array("size" => 55, "maxlength" => 120)));  
    25  echo $html->div('required',$form->label('Answer.correct','Answer is correct:').$form->checkbox('Answer.correct', array("value" => 1)));  
    26  echo $ajax->submit('Save', array("url" => "/admin/answers/add", 
     24 echo $html->div('required',$form->input('Answer.answer', array('size'=>55, 'maxlength'=>120, 'label'=>__('Answer',true))));  
     25 echo $html->div('required',$form->label('Answer.correct', __('Answer is correct', true)).$form->checkbox('Answer.correct', array('value' => 1)));  
     26 echo $ajax->submit(__('Save', true), array("url" => "/admin/answers/add", 
    2727                                         "update"=>"questions", 
    2828                                         "loading" => "Element.hide('questions');Element.hide('addquestion');Element.show('loading')", 
     
    3535<div id="questions"> 
    3636<?php 
    37 foreach ($data['Answer'] as $val)  
    38 { 
    39   $st = ($val['correct']==1) ? 'Yes' : 'No';       
    40   $tmp  = $html->div(null, $html->link('Delete', '/admin/answers/delete/'.$val['id'].'/'.$val['question_id'])); 
    41   $tmp .= $html->div(null, $html->link('Edit',   '/admin/answers/edit/'  .$val['id'])); 
    42   $tmp .= "Answer:  "     .    $val["answer"]       . "<br />"; 
    43   $tmp .= "Correct: "     . $html->link($st, '/admin/answers/change/'.$val['id'].'/'.$val['correct'] .'/'.$val['question_id']) . "<br />"; 
     37foreach ($data['Answer'] as $val): 
     38 
     39  $st = ($val['correct']==1) ? __('Yes', true) : 'No';       
     40  $tmp  = __('Answer', true) .': ' . $val['answer']   . '<br />'; 
     41  $tmp .= __('Correct', true).': ' . $html->link($st, '/admin/answers/change/'.$val['id'].'/'.$val['correct'] .'/'.$val['question_id']) . "<br /><br />"; 
     42  $tmp .= $html->div(null, $html->link(__('Delete', true), '/admin/answers/delete/'.$val['id'].'/'.$val['question_id'])); 
     43  $tmp .= $html->div(null, $html->link(__('Edit', true),   '/admin/answers/edit/'  .$val['id'])); 
    4444 
    4545  echo $html->div('adminblock', $tmp); 
    46 } 
     46endforeach; 
    4747?> 
    4848</div> 
  • trunk/app/views/questions/admin_edit.ctp

    r361 r666  
    11<?php  
    2    echo $html->addCrumb('Control Tools', '/admin/entries/start'); 
    3    echo $html->addCrumb('Test', '/admin/tests/listing');  
     2   echo $html->addCrumb('Control Panel', '/admin/entries/start'); 
     3   echo $html->addCrumb(__('Tests', true), '/admin/tests/listing');  
    44   echo $html->getCrumbs(' / ');  
    55  
    6    echo $form->create('Question', array("onsubmit"=>"return validateNew()"));  
     6   echo $form->create('Question', array("onsubmit"=>"return chkForm()"));  
    77   echo $form->hidden('Question.id'); 
    88   echo $form->hidden('Question.test_id', array('value'=>$this->data['Question']['test_id'])); 
    99?> 
    1010<fieldset> 
    11 <legend>Edit question</legend> 
     11<legend><?php __('Edit question'); ?></legend> 
    1212<?php 
    13  echo $html->div('required',$form->input('Question.question', array("size" => 40, "maxlength" => 120)));  
     13 echo $html->div('required',$form->input('Question.question', array('size'=>40, 'maxlength'=> 120, 'label'=>__('Question', true))));  
    1414   
    15  echo $html->div('required',$form->input('Question.hint', array("size" => 40, "maxlength" => 120)));  
     15 echo $html->div('required',$form->input('Question.hint', array('size' => 40, 'maxlength'=> 120, 'label'=>__('Hint', true))));  
    1616     
    17  $tmp  = $form->label('Question.explanation', 'Explanation:');  
     17 $tmp  = $form->label('Question.explanation', __('Explanation', true));  
    1818 $tmp .= $form->textarea('Question.explanation', array("cols" => 50, "rows" => 5));  
    1919 
    2020 echo $html->div('required',$tmp); 
    2121  
    22  $t  = $form->label('Question.worth', 'Worth:'); 
    23  $t .= $form->select('Question.worth', array(1,2,3,4,5,6,7,8,9,10), null, null, false, false); 
     22 $t  = $form->label('Question.worth', __('Points', true)); 
     23 $t .= $form->select('Question.worth', array(1=>1,2=>2,3=>3,4=>4,5=>5,6=>6,7=>7,8=>8,9=>9,10=>10), null, null, false, false); 
    2424 echo $html->div('required',$t); 
     25 
     26 echo $form->end(__('Save', true)); 
    2527?> 
    2628</fieldset> 
    27 <?php echo $form->end('Save'); ?>  
    2829 
     30 
  • trunk/app/views/questions/questions.ctp

    r575 r666  
    99    $answers = count($val['Answer']); 
    1010    $i++; 
    11     echo '<div style="padding:5px;border:1px dotted gray;margin:3px auto;width:70%"><b>' . $i . '.-</b> '; 
     11    echo '<div style="padding:5px;border:1px dotted gray;margin:3px auto;width:80%"><b>' . $i . '.-</b> '; 
    1212    echo $html->div('butonright', $gags->sendEdit($val['Question']['id'],   'Question')); 
    1313    echo $html->div('butonright',  
     
    1515            $form->hidden('Question.id', array('value'=>$val['Question']['id'])). 
    1616                    $form->hidden('Question.test_id', array('value'=>$val['Question']['test_id'])). 
    17                     $form->end('Delete'));  
     17                    $form->end(__('Delete', true))); 
    1818 
    19        echo "<b>Question</b>: "    . $val['Question']['question']       . "<br />"; 
    20        echo "<b>Hint</b>: "        . $val['Question']['hint']           . "<br />"; 
    21        echo "<b>Explanation</b>: " . $val['Question']['explanation']    . "<br />"; 
    22        echo "<b>Worth</b>: "       . $val['Question']['worth']          . "<br /><br />"; 
    23        echo $html->link('View answers ('.$answers.')', '/admin/questions/answers/'.$val['Question']['id']); 
     19    echo '<b>'. __('Question', true)    .':</b> '. $val['Question']['question']       . '<br /><br />'; 
     20    echo '<b>'. __('Hint', true)        .':</b> '. $val['Question']['hint']           . '<br /><br />'; 
     21    echo '<b>'. __('Explanation', true) .':</b> '. $val['Question']['explanation']    . '<br /><br />'; 
     22    echo '<b>'. __('Points', true)      .':</b> '. $val['Question']['worth']          . '<br /><br />'; 
     23    echo $html->link(__('View answers', true) . ' ('.$answers.')', '/admin/questions/answers/'.$val['Question']['id']); 
     24 
    2425    echo '</div>'; 
    2526endforeach; 
  • trunk/app/views/tests/admin_add.ctp

    r541 r666  
    1 <?php echo $html->addCrumb('Control Tools', '/admin/entries/start'); ?>  
    2 <?php echo $html->addCrumb('Test', '/admin/tests/listing'); ?>  
    3 <?php echo $html->getCrumbs(' / '); ?> 
    4  
    5 <?php echo $form->create('Test', array('onsubmit'=>'return chkData()')); ?> 
     1<?php  
     2 echo $html->addCrumb('Control Panel', '/admin/entries/start');   
     3 echo $html->addCrumb(__('Tests', true), '/admin/tests/listing');  
     4 echo $html->getCrumbs(' / ');  
     5 echo $form->create('Test', array('onsubmit'=>'return chkData()'));  
     6?> 
    67<fieldset> 
    7 <legend>New test</legend> 
     8<legend><?php __('New test');?></legend> 
    89<div class="required"> 
    910  <?php  
    10      echo $form->input('Test.title', array("size" => 40, "maxlength" => 120));  
     11     echo $form->input('Test.title', array('size' => 40, 'maxlength' => 120, 'label'=>__('Title', true)));  
    1112     echo $form->error('Test.title', 'Title is required.'); 
    1213 ?> 
    1314</div> 
    14  
    1515<div class="required"> 
    1616<?php  
    17    echo $form->label('Test.description', 'Description:' );  
    18    echo $form->textarea('Test.description', array("cols" => 50, "rows" => 5));  
     17   echo $form->label('Test.description', __('Description', true));  
     18   echo $form->textarea('Test.description', array('cols' => 50, 'rows' => 5));  
    1919   echo $form->error('Test.description', 'Description is required.'); 
    2020?> 
     
    2323<div class="required"> 
    2424<?php  
    25       echo $form->label( 'Test.status', 'Published:' ); 
     25      echo $form->label( 'Test.status', __('Published',true) ); 
    2626      echo $form->checkbox('Test.status', null, array("value"=>1));  
    2727?> 
    2828</div> 
    2929 
    30 <?php echo $form->end('Save'); ?> 
     30<?php echo $form->end(__('Save', true)); ?> 
    3131</fieldset> 
  • trunk/app/views/tests/admin_edit.ctp

    r362 r666  
    11<?php  
    2  echo $html->addCrumb('Control Tools', '/admin/entries/start'); 
    3  echo $html->addCrumb('Test', '/admin/tests/listing');  
     2 echo $html->addCrumb('Control Panel', '/admin/entries/start'); 
     3 echo $html->addCrumb(__('Test', true), '/admin/tests/listing');  
    44 echo $html->getCrumbs(' / ');  
    55  
     
    1010<legend>Edit test</legend> 
    1111<?php  
    12  echo $html->div('required', $form->input('Test.title', array("size" => 40, "maxlength" => 120)));  
    13     
    14  echo $html->div('required', $form->label('Test.description', 'Description:') . $form->textarea('Test.description', array("cols" => 50, "rows" => 15)));  
     12 echo $html->div('required', $form->input('Test.title', array('size'=> 40,'maxlength' => 120, ''=>__('Title'. true))));    
     13 echo $html->div('required', $form->label('Test.description', __('Description', true)) . $form->textarea('Test.description', array("cols" => 50, "rows" => 15)));  
    1514    
    1615 echo $html->div('required', $form->label('Test.status', 'Published:' ) . $form->checkbox('Test.status', array('value'=>1))); 
    1716  
    18  echo $form->end('Save');  
     17 echo $form->end(__('Save', true));  
    1918?>  
    2019</fieldset> 
  • trunk/app/views/tests/admin_listing.ctp

    r575 r666  
    22//die( debug( $data )); 
    33 
    4 echo $html->div('title_section', 'Tests'); 
     4echo $html->div('title_section', __('Tests', true)); 
    55 
    66echo $html->para(null,  
     
    1111 
    1212foreach ($data as $val): 
    13   $s  =  ($val['Test']['status'] == 1) ? 'Published': 'Draft'; 
     13  $s  =  ($val['Test']['status'] == 1) ? __('Published', true) : __('Draft', true); 
    1414 
    1515  echo '<div class="grayblock">'; 
    1616    echo $html->div('butonright', $gags->sendEdit($val['Test']['id'], 'tests')); 
    1717    echo $html->div('div_title', $val['Test']['title']); 
    18     echo $html->para(null, '<b>Test description:</b> '.$val['Test']['description']); 
     18    echo $html->para(null, '<b>'.__('Description', true).':</b> '.$val['Test']['description']); 
    1919 
    20     echo $html->link('Questions', '/admin/tests/questions/'.$val['Test']['id']); 
    21     echo $html->link($html->image('admin/questions_icon.gif', array('alt'=>'Questions', 'title'=>'Questions')),  
     20    echo $html->link(__('Questions', true), '/admin/tests/questions/'.$val['Test']['id']); 
     21    echo $html->link($html->image('admin/questions_icon.gif', array('alt'=>__('Questions', true), 'title'=>__('Questions', true))),  
    2222                          '/admin/tests/questions/'.$val['Test']['id'], null, null, false) . '<br />'; 
    2323    if ( count($val['Vclassroom']) < 1 ): 
     
    4242 
    4343           foreach($val['Vclassroom'] as $class): 
    44                echo $html->para(null, 'This test had been assigned to class: '.  
     44               echo $html->para(null, __('This test had been assigned to class', true). ': '.  
    4545                                $html->link($class['name'], '/admin/vclassrooms/members/'.$class['id']) . '</b>'); 
    4646           endforeach; 
  • trunk/app/views/tests/admin_questions.ctp

    r575 r666  
    11<?php  
    2   echo $html->addCrumb('Control Tools', '/admin/entries/start');  
    3   echo $html->addCrumb('Tests', '/admin/tests/listing');  
    4   echo $html->getCrumbs(' / ');  
     2 echo $html->addCrumb('Control Panel', '/admin/entries/start');  
     3 echo $html->addCrumb(__('Tests', true), '/admin/tests/listing');  
     4 echo $html->getCrumbs(' / ');  
    55 
    6   echo $html->div('title_section', 'Tests'); 
    7 ?> 
    8 <div id="loading" style="display: none;"> 
    9         <?php echo $html->image("static/loading.gif", array("alt"=>"Loading")); ?> 
    10 </div> 
    11 <?php 
     6 echo $html->div('title_section', __('Test', true)); 
     7 
     8 echo $html->div(null,$html->image('static/loading.gif', array("alt"=>"Loading")), array('id'=>'loading', 'style'=>'display: none;')); 
     9 
    1210 echo $html->para(null, $html->link('Edit', '/admin/tests/edit/'.$data['Test']['id']).'&nbsp;&nbsp;'.$html->link('Assign to class', '/admin/tests/vclassrooms/'.$data['Test']['id'])); 
    1311 
    14  echo '<b>Description:</b> '. $data['Test']['title'] . "  " . $data['Test']['description']; 
    15  echo "  ". count($data["Question"]) . " questions"; 
     12 echo '<b>'.__('Title',true).'</b> ' . $data['Test']['title'] . '<br />'; 
     13 echo '<b>'.__('Description',true).'</b> ' . $data['Test']['description']; 
    1614 
    17  echo $html->para(null, $html->link($html->image('actions/new.png', array("alt"=>"Add new question", "title"=>"Add new question")), '#', array("onclick"=>"hU()"), false, false));  
     15 echo '  '. count($data["Question"]) .' '. __('questions', true); 
     16 
     17 echo $html->para(null, $html->link($html->image('actions/new.png', array('alt'=>__('Add new question', true),'title'=>__('Add new question', true))), '#', array("onclick"=>"hU()"), false, false));  
    1818?> 
    19  
    2019<!-- Ajax form beggin --> 
    2120<div id="addquestion" style="display:none"> 
     
    2524?> 
    2625<fieldset> 
    27 <legend>New question</legend> 
     26<legend><?php __('New question'); ?></legend> 
    2827<?php 
    29  echo $html->div('required', $form->input('Question.question', array("size" => 60, "maxlength" => 120)));  
    30  echo $html->div('required', $form->input('Question.hint', array("size" => 40, "maxlength" => 120)));  
    31  echo $html->div('required', $form->label('Question.explanation', 'Explanation:') . $form->textarea('Question.explanation', array("cols" => 50, "rows" => 5)));  
     28 echo $html->div('required', $form->input('Question.question', array('size' => 60, 'maxlength' => 120, 'label'=>__('Question',true))));  
     29 echo $html->div('required', $form->input('Question.hint', array('size'=> 40,'maxlength' => 120, 'label'=>__('Hint',true))));  
     30 echo $html->div('required', $form->label('Question.explanation', __('Explanation', true)) . $form->textarea('Question.explanation', array("cols" => 50, "rows" => 5)));  
    3231 
    33  $tmp  = $form->label('Question.worth', 'Worth:'); 
    34  $tmp .=  $form->select('Question.worth',  array(1, 2, 3, 4, 5, 6,7, 8, 9, 10), null, null, false, false);  
     32 $tmp  = $form->label('Question.worth', __('Points', true)); 
     33 $tmp .=  $form->select('Question.worth',  array(1=>1,2=>2,3=>3,4=>4,5=>5,6=>6,7=>7,8=>8,9=>9,10=>10), null, null, false, false);  
    3534 echo $html->div('required', $tmp); 
    3635 
    37  echo $ajax->submit('Add', array("url" => "/admin/questions/add", 
     36 echo $ajax->submit(__('Save',true), array("url" => "/admin/questions/add", 
    3837                                         "update"=>"questions", 
    3938                                         "loading" => "Element.hide('questions');Element.hide('addquestion');Element.show('loading')", 
    40                                          "complete" => "Element.hide('loading');Effect.Appear('questions')" 
     39                                         "complete" => "Element.hide('loading');Effect.Appear('questions');clear();" 
    4140            ));  
    4241 ?> 
    43 </div> 
    4442</fieldset> 
    4543</form> 
    4644</div> 
    4745<!-- Ajax form ends --> 
     46 
    4847<?php 
    4948if ( count($data["Question"]) > 0): 
    50    echo $html->div('title_section', 'Questions'); 
     49   echo $html->div('title_section',  __('Questions', true)); 
    5150endif; 
    5251 
     
    5958    $answers = count($val['Answer']); 
    6059    $i++; 
    61     echo '<div style="padding:5px;border:1px dotted gray;margin:auto;width:60%"><b>' . $i . '.-</b> '; 
     60    echo '<div style="padding:5px;border:1px dotted gray;margin:5px auto;width:80%"><b>' . $i . '.-</b> '; 
    6261    echo $html->div('butonright', $gags->sendEdit($val['id'],   'Question')); 
    6362    echo $html->div('butonright',  
    6463                    $form->create('Question', array('action'=>'delete', 'onsubmit'=>'return confirm("are you sure?")')). 
    65             $form->hidden('Question.id', array('value'=>$val['id'])).$form->hidden('Question.test_id', array('value'=>$val['test_id'])).$form->end('Delete')); 
     64            $form->hidden('Question.id', array('value'=>$val['id'])).$form->hidden('Question.test_id', array('value'=>$val['test_id'])).$form->end(__('Delete', true))); 
    6665