Show
Ignore:
Timestamp:
04/02/08 13:19:24 (9 months ago)
Author:
aarkerio
Message:

Locale and test improvements

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/app/views/questions/admin_answers.ctp

    r269 r361  
    11<?php 
    2 // die(print_r($data)); 
    3   if ( isset($javascript) ): 
    4       echo $html->charsetTag('UTF-8'); 
    5       echo $javascript->link('prototype'); 
    6       echo $javascript->link('scriptaculous.js?load=effects'); 
    7   endif; 
    8   
    9   echo $html->addCrumb('Control Tools', '/admin/entries/start'); 
    10   echo $html->addCrumb('Tests', '/admin/tests/listing'); 
    11   echo $html->getCrumbs(' / ');  
     2 echo $html->addCrumb('Control Tools', '/admin/entries/start'); 
     3 echo $html->addCrumb('Tests', '/admin/tests/listing'); 
     4 echo $html->getCrumbs(' / ');  
     5 
     6 echo $html->div('title_section', 'Answers to ' . $data['Question']['question']); 
    127?> 
    13  
    14 <div class="title_section">Answers to <?php echo $data['Question']['question']; ?></div> 
    158 
    169<div id="loading" style="display: none;"> 
     
    2518 
    2619<?php  
    27    echo $ajax->form(null,'post'); 
    28    echo $html->hiddenTag('Answer/question_id', $data['Question']['id']); 
     20   echo $ajax->form(); 
     21   echo $form->hidden('Answer.question_id', array('value'=>$data['Question']['id'])); 
    2922 ?> 
    30 <fieldset> 
    31 <legend>New answer</legend> 
    32  
    33 <div class="required"> 
    34   <?php echo $form->labelTag('Answer/answer', 'Answer:' ); ?> 
    35   <?php echo $html->input('Answer/answer', array("size" => 55, "maxlength" => 120)); ?> 
    36   <?php echo $html->tagErrorMsg('Answer/answer', 'Answer is required.'); ?> 
    37 </div> 
    38 <div class="required"> 
    39   <?php echo $form->labelTag('Answer/correct', 'Answer is correct:' ); ?> 
    40   <?php echo $html->checkbox('Answer/correct', null, array("value" => 1)); ?> 
    41 </div> 
    42 <div> 
     23<fieldset><legend>New answer</legend> 
    4324<?php 
    44     echo $ajax->submit('Save', array("url" => "/admin/answers/add", 
     25 echo $html->div('required',$form->input('Answer.answer', array("size" => 55, "maxlength" => 120)));  
     26 echo $html->div('required',$form->label('Answer.correct','Answer is correct:').$form->checkbox('Answer.correct', array("value" => 1)));  
     27 echo $ajax->submit('Save', array("url" => "/admin/answers/add", 
    4528                                         "update"=>"questions", 
    4629                                         "loading" => "Element.hide('questions');Element.hide('addquestion');Element.show('loading')", 
     
    4831            ));  
    4932 ?> 
    50 </div> 
    5133</fieldset> 
    52  
    5334</div> 
    5435 
     
    5839{ 
    5940  $st = ($val["correct"]==1) ? 'Yes' : 'No';       
    60     echo '<div style="padding:5px;border:1px dotted gray;margin:4px;">'; 
    61        echo '<div class="butonright">' . $html->link('Delete', '/admin/answers/delete/'.$val['id'].'/'.$val['question_id'])   . '</div>'; 
    62        echo '<div class="butonright">' . $html->link('Edit',   '/admin/answers/edit/'  .$val['id']) . '</div>'; 
    63        echo "Answer: "      . $val["answer"]      . "<br />"; 
    64        echo "Correct: "     . $st                  . "<br />"; 
    65     echo '</div>'; 
     41  $tmp  = $html->div(null, $html->link('Delete', '/admin/answers/delete/'.$val['id'].'/'.$val['question_id'])); 
     42  $tmp .= $html->div(null, $html->link('Edit',   '/admin/answers/edit/'  .$val['id'])); 
     43  $tmp .= "Answer:  "     . $val["answer"]          . "<br />"; 
     44  $tmp .= "Correct: "     . $html->link($st, '/admin/answers/changed/'.$val['id'].'/'.$val['question_id']) . "<br />"; 
     45 
     46  echo $html->div('adminblock', $tmp); 
    6647} 
    6748?>