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/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 
    67        echo "Question: "    . $val["question"]       . "<br />"; 
    68        echo "Hint: "        . $val["hint"]           . "<br />"; 
    69        echo "Explanation: " . $val["explanation"]    . "<br />"; 
    70        echo "Worth: "       . $val["worth"]          . "<br /><br />"; 
    71        echo $html->link('View answers ('.$answers.')', '/admin/questions/answers/'.$val['id']); 
     66    echo '<b>'. __('Question', true)    .':</b> '. $val["question"]       . "<br />"; 
     67    echo '<b>'. __('Hint', true)        .':</b> '. $val["hint"]           . "<br /><br />"; 
     68    echo '<b>'. __('Explanation', true) .':</b> '. $val["explanation"]    . "<br /><br />"; 
     69    echo '<b>'. __('Points', true)      .':</b> '. $val["worth"]          . "<br /><br />"; 
     70    echo $html->link(__('View answers', true) . ' ('.$answers.')', '/admin/questions/answers/'.$val['id']); 
    7271    echo '</div>'; 
    7372endforeach; 
     
    7776<script type="text/javascript">  
    7877<!--  
     78function clear() { 
     79  var  question = document.getElementById('QuestionQuestion') 
     80  var  hint     = document.getElementById('QuestionHint') 
     81  var  explana  = document.getElementById('QuestionExplanation') 
     82 
     83  question.value = ''  
     84  hint.value     = '' 
     85  explana.value  = ''  
     86 
     87  return true;  
     88} 
     89 
    7990function hU() { 
    8091