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

Exmans and vclass

Location:
trunk/app/views/questions
Files:
3 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> 
  • 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;