Changeset 666 for trunk/app/views/tests/admin_questions.ctp
- Timestamp:
- 07/22/08 17:08:42 (4 months ago)
- Files:
-
- 1 modified
-
trunk/app/views/tests/admin_questions.ctp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/app/views/tests/admin_questions.ctp
r575 r666 1 1 <?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(' / '); 5 5 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 12 10 echo $html->para(null, $html->link('Edit', '/admin/tests/edit/'.$data['Test']['id']).' '.$html->link('Assign to class', '/admin/tests/vclassrooms/'.$data['Test']['id'])); 13 11 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']; 16 14 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)); 18 18 ?> 19 20 19 <!-- Ajax form beggin --> 21 20 <div id="addquestion" style="display:none"> … … 25 24 ?> 26 25 <fieldset> 27 <legend> New question</legend>26 <legend><?php __('New question'); ?></legend> 28 27 <?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))); 32 31 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); 35 34 echo $html->div('required', $tmp); 36 35 37 echo $ajax->submit( 'Add', array("url" => "/admin/questions/add",36 echo $ajax->submit(__('Save',true), array("url" => "/admin/questions/add", 38 37 "update"=>"questions", 39 38 "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();" 41 40 )); 42 41 ?> 43 </div>44 42 </fieldset> 45 43 </form> 46 44 </div> 47 45 <!-- Ajax form ends --> 46 48 47 <?php 49 48 if ( count($data["Question"]) > 0): 50 echo $html->div('title_section', 'Questions');49 echo $html->div('title_section', __('Questions', true)); 51 50 endif; 52 51 … … 59 58 $answers = count($val['Answer']); 60 59 $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> '; 62 61 echo $html->div('butonright', $gags->sendEdit($val['id'], 'Question')); 63 62 echo $html->div('butonright', 64 63 $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))); 66 65 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']); 72 71 echo '</div>'; 73 72 endforeach; … … 77 76 <script type="text/javascript"> 78 77 <!-- 78 function 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 79 90 function hU() { 80 91
