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

Exmans and vclass

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • 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>