Changeset 666
- Timestamp:
- 07/22/08 17:08:42 (3 months ago)
- Location:
- trunk/app
- Files:
-
- 12 modified
-
controllers/answers_controller.php (modified) (1 diff)
-
controllers/questions_controller.php (modified) (4 diffs)
-
controllers/tests_controller.php (modified) (3 diffs)
-
locale/spa/LC_MESSAGES/default.po (modified) (2 diffs)
-
views/answers/questions.ctp (modified) (1 diff)
-
views/questions/admin_answers.ctp (modified) (3 diffs)
-
views/questions/admin_edit.ctp (modified) (1 diff)
-
views/questions/questions.ctp (modified) (2 diffs)
-
views/tests/admin_add.ctp (modified) (2 diffs)
-
views/tests/admin_edit.ctp (modified) (2 diffs)
-
views/tests/admin_listing.ctp (modified) (3 diffs)
-
views/tests/admin_questions.ctp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/app/controllers/answers_controller.php
r540 r666 25 25 public function admin_add() 26 26 { 27 if (!empty($this->data["Answer"])) 28 { 29 //die(print_r($this->data)); 27 if (!empty($this->data["Answer"])): 30 28 31 $this->Sanitize = new Sanitize;29 $this->Sanitize = new Sanitize; 32 30 33 $this->Sanitize->clean($this->data["Answer"]);31 $this->Sanitize->clean($this->data["Answer"]); 34 32 35 $this->data["Answer"]['user_id'] = $this->Auth->user('id'); 36 37 $this->Answer->create(); 33 $this->data["Answer"]['user_id'] = $this->Auth->user('id'); 38 34 39 if ( $this->Answer->save($this->data['Answer']) ) 40 { 41 $conditions = array("Answer.question_id" => $this->data['Answer']['question_id']); 42 $fields = array("Answer.id", "Answer.answer", "Answer.correct", "Answer.question_id"); 43 $order = "Answer.id"; 44 45 $this->set('data', $this->Answer->findAll($conditions, $fields, $order)); 46 47 $this->render('questions', 'ajax'); 48 } 49 else 50 { 35 if ( $this->Answer->save($this->data) ): 36 $conditions = array("Answer.question_id" => $this->data['Answer']['question_id']); 37 $fields = array("Answer.id", "Answer.answer", "Answer.correct", "Answer.question_id"); 38 $order = "Answer.id"; 39 $this->set('data', $this->Answer->findAll($conditions, $fields, $order)); 40 $this->render('questions', 'ajax'); 41 else: 51 42 echo "Ajax error, check with the company's computer guy..."; 52 }53 }43 endif; 44 endif; 54 45 } 55 46 -
trunk/app/controllers/questions_controller.php
r575 r666 5 5 * GPLv3 manuel<arroba>mononeurona<punto>org 6 6 */ 7 //File: /app/controllers/qu otes_controller.php7 //File: /app/controllers/questions_controller.php 8 8 9 9 uses('Sanitize'); … … 29 29 30 30 $this->data["Question"]['user_id'] = $this->Auth->user('id'); 31 32 $this->Question->create();33 31 34 if ( $this->Question->save( $this->data ['Question']) ):32 if ( $this->Question->save( $this->data ) ): 35 33 $conditions = array('Question.test_id' => $this->data['Question']['test_id']); 36 34 $fields = array('Question.id','Question.question','Question.hint','Question.worth','Question.explanation','Question.test_id'); … … 50 48 { 51 49 $this->layout = 'admin'; 52 // adds new vote to database 53 if ( !empty($this->data["Question"]) ) 54 { 55 $this->Sanitize = new Sanitize; 50 51 if ( !empty($this->data["Question"]) ): 52 $this->Sanitize = new Sanitize; 56 53 57 $this->Sanitize->clean($this->data["Question"]);54 $this->Sanitize->clean($this->data["Question"]); 58 55 59 if ( $this->Question->save( $this->data['Question'] ) ) 60 { 61 $this->msgFlash('Question saved', '/admin/tests/questions/'.$this->data['Question']['test_id']); 62 } 63 else 64 { 65 echo "Ajax error, check with the company's computer guy..."; 66 } 67 } 68 else 69 { 56 if ( $this->Question->save( $this->data ) ): 57 $this->msgFlash(__('Question saved', true), '/admin/tests/questions/'.$this->data['Question']['test_id']); 58 else: 59 echo "Ajax error, check with the company's computer guy..."; 60 endif; 61 else: 70 62 $this->data = $this->Question->read(null, $question_id); 71 }63 endif; 72 64 } 73 65 … … 76 68 $this->layout = 'admin'; 77 69 78 $this->pageTitle = 'Questions';70 $this->pageTitle = __('Questions', true); 79 71 80 72 $conditions = array("Question.user_id"=>$this->Auth->user('id')); -
trunk/app/controllers/tests_controller.php
r578 r666 29 29 $this->Auth->allow(array('view', 'display', 'result')); 30 30 endif; 31 // L10n32 $this->L10n = new L10n();33 $this->L10n->get("en");34 35 Configure::write('Config.language', "en");36 31 } 37 32 38 33 public function display($username, $user_id) 39 34 { 40 $this->pageTitle = 'Exams';35 $this->pageTitle = __('Tests', true); 41 36 42 37 $this->layout = $this->Edublog->layout($user_id); … … 53 48 $user_id = $this->Test->field('Test.user_id', array("Test.id"=>$test_id)); 54 49 55 $this->pageTitle = 'Exam';50 $this->pageTitle = __('Test', true); 56 51 57 52 $this->layout = $this->Edublog->layout($user_id); … … 189 184 $this->layout = 'admin'; 190 185 191 $this->pageTitle = 'Tests';186 $this->pageTitle = __('Tests', true); 192 187 193 188 $conditions = array('Test.user_id'=>$this->Auth->user('id')); -
trunk/app/locale/spa/LC_MESSAGES/default.po
r653 r666 17 17 msgstr "Todos los FAQs" 18 18 19 msgid "Hint" 20 msgstr "Pista" 21 22 msgid "Explanation" 23 msgstr "Explicación" 24 25 msgid "Question" 26 msgstr "Pregunta" 27 28 msgid "Questions" 29 msgstr "Preguntas" 30 31 msgid "This test had been assigned to class" 32 msgstr "Este examen ha sido asignado a la clase" 33 34 msgid "Tests" 35 msgstr "Exámenes" 36 37 msgid "Test" 38 msgstr "Examen" 39 40 msgid "questions" 41 msgstr "preguntas" 42 43 msgid "View answers" 44 msgstr "Ver respuestas" 45 46 msgid "Add new question" 47 msgstr "Agregar nueva pregunta" 48 49 msgid "Answer" 50 msgstr "Respuesta" 51 52 msgid "New answer" 53 msgstr "Nueva respuesta" 54 55 msgid "Correct" 56 msgstr "Correcta" 57 58 msgid "Answer is correct" 59 msgstr "Esta respuesta es correcta" 60 61 msgid "Answers to" 62 msgstr "Respuestas para" 63 19 64 msgid "Next" 20 65 msgstr "Siguiente" … … 163 208 msgid "Save" 164 209 msgstr "Guardar" 210 211 msgid "Description" 212 msgstr "Descripción" 213 214 msgid "Points" 215 msgstr "Puntos" 216 217 msgid "New question" 218 msgstr "Nueva pregunta" 219 220 msgid "Edit question" 221 msgstr "Editar pregunta" 165 222 166 223 msgid "File" -
trunk/app/views/answers/questions.ctp
r541 r666 2 2 // die( debug( $data )); 3 3 foreach ($data as $val): 4 5 $st = ($val['Answer']['correct']==1) ? 'Yes' : 'No'; 6 $tmp = $html->div(null, $html->link('Delete', '/admin/answers/delete/'.$val['Answer']['id'].'/'.$val['Answer']['question_id'])); 7 $tmp .= $html->div(null, $html->link('Edit', '/admin/answers/edit/' .$val['Answer']['id'])); 8 $tmp .= "Answer: " . $val['Answer']['answer'] . "<br />"; 4 $st = ($val['Answer']['correct']==1) ? __('Yes', true) : 'No'; 5 $tmp = __('Answer', true) . ': ' . $val['Answer']['answer'] . "<br />"; 9 6 $url = '/admin/answers/change/'.$val['Answer']['id'].'/'.$val['Answer']['correct'].'/'.$val['Answer']['question_id']; 10 $tmp .= "Correct: " . $html->link($st, $url) . "<br />"; 7 $tmp .= __('Correct', true). ': '. $html->link($st, $url) . '<br /><br />'; 8 $tmp .= $html->div(null,$html->link(__('Delete', true),'/admin/answers/delete/'.$val['Answer']['id'].'/'.$val['Answer']['question_id'])); 9 $tmp .= $html->div(null, $html->link(__('Edit', true), '/admin/answers/edit/'.$val['Answer']['id'])); 11 10 12 11 echo $html->div('adminblock', $tmp); -
trunk/app/views/questions/admin_answers.ctp
r422 r666 1 1 <?php 2 2 //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'); 5 5 echo $html->addCrumb($data['Test']['title'], '/admin/tests/questions/'.$data['Test']['id']); 6 6 echo $html->getCrumbs(' / '); 7 7 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 9 14 ?> 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 15 15 16 16 <div id="addquestion" style="display:none"> … … 20 20 echo $form->hidden('Answer.question_id', array('value'=>$data['Question']['id'])); 21 21 ?> 22 <fieldset><legend> New answer</legend>22 <fieldset><legend><?php __('New answer'); ?></legend> 23 23 <?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", 27 27 "update"=>"questions", 28 28 "loading" => "Element.hide('questions');Element.hide('addquestion');Element.show('loading')", … … 35 35 <div id="questions"> 36 36 <?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 />";37 foreach ($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'])); 44 44 45 45 echo $html->div('adminblock', $tmp); 46 } 46 endforeach; 47 47 ?> 48 48 </div> -
trunk/app/views/questions/admin_edit.ctp
r361 r666 1 1 <?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'); 4 4 echo $html->getCrumbs(' / '); 5 5 6 echo $form->create('Question', array("onsubmit"=>"return validateNew()"));6 echo $form->create('Question', array("onsubmit"=>"return chkForm()")); 7 7 echo $form->hidden('Question.id'); 8 8 echo $form->hidden('Question.test_id', array('value'=>$this->data['Question']['test_id'])); 9 9 ?> 10 10 <fieldset> 11 <legend> Edit question</legend>11 <legend><?php __('Edit question'); ?></legend> 12 12 <?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)))); 14 14 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)))); 16 16 17 $tmp = $form->label('Question.explanation', 'Explanation:');17 $tmp = $form->label('Question.explanation', __('Explanation', true)); 18 18 $tmp .= $form->textarea('Question.explanation', array("cols" => 50, "rows" => 5)); 19 19 20 20 echo $html->div('required',$tmp); 21 21 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); 24 24 echo $html->div('required',$t); 25 26 echo $form->end(__('Save', true)); 25 27 ?> 26 28 </fieldset> 27 <?php echo $form->end('Save'); ?>28 29 30 -
trunk/app/views/questions/questions.ctp
r575 r666 9 9 $answers = count($val['Answer']); 10 10 $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> '; 12 12 echo $html->div('butonright', $gags->sendEdit($val['Question']['id'], 'Question')); 13 13 echo $html->div('butonright', … … 15 15 $form->hidden('Question.id', array('value'=>$val['Question']['id'])). 16 16 $form->hidden('Question.test_id', array('value'=>$val['Question']['test_id'])). 17 $form->end( 'Delete'));17 $form->end(__('Delete', true))); 18 18 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 24 25 echo '</div>'; 25 26 endforeach; -
trunk/app/views/tests/admin_add.ctp
r541 r666 1 <?php echo $html->addCrumb('Control Tools', '/admin/entries/start'); ?> 2 <?php echo $html->addCrumb('Test', '/admin/tests/listing'); ?> 3 <?php echo $html->getCrumbs(' / '); ?> 4 5 <?php echo $form->create('Test', array('onsubmit'=>'return chkData()')); ?> 1 <?php 2 echo $html->addCrumb('Control Panel', '/admin/entries/start'); 3 echo $html->addCrumb(__('Tests', true), '/admin/tests/listing'); 4 echo $html->getCrumbs(' / '); 5 echo $form->create('Test', array('onsubmit'=>'return chkData()')); 6 ?> 6 7 <fieldset> 7 <legend> New test</legend>8 <legend><?php __('New test');?></legend> 8 9 <div class="required"> 9 10 <?php 10 echo $form->input('Test.title', array( "size" => 40, "maxlength" => 120));11 echo $form->input('Test.title', array('size' => 40, 'maxlength' => 120, 'label'=>__('Title', true))); 11 12 echo $form->error('Test.title', 'Title is required.'); 12 13 ?> 13 14 </div> 14 15 15 <div class="required"> 16 16 <?php 17 echo $form->label('Test.description', 'Description:');18 echo $form->textarea('Test.description', array( "cols" => 50, "rows"=> 5));17 echo $form->label('Test.description', __('Description', true)); 18 echo $form->textarea('Test.description', array('cols' => 50, 'rows' => 5)); 19 19 echo $form->error('Test.description', 'Description is required.'); 20 20 ?> … … 23 23 <div class="required"> 24 24 <?php 25 echo $form->label( 'Test.status', 'Published:');25 echo $form->label( 'Test.status', __('Published',true) ); 26 26 echo $form->checkbox('Test.status', null, array("value"=>1)); 27 27 ?> 28 28 </div> 29 29 30 <?php echo $form->end( 'Save'); ?>30 <?php echo $form->end(__('Save', true)); ?> 31 31 </fieldset> -
trunk/app/views/tests/admin_edit.ctp
r362 r666 1 1 <?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(__('Test', true), '/admin/tests/listing'); 4 4 echo $html->getCrumbs(' / '); 5 5 … … 10 10 <legend>Edit test</legend> 11 11 <?php 12 echo $html->div('required', $form->input('Test.title', array("size" => 40, "maxlength" => 120))); 13 14 echo $html->div('required', $form->label('Test.description', 'Description:') . $form->textarea('Test.description', array("cols" => 50, "rows" => 15))); 12 echo $html->div('required', $form->input('Test.title', array('size'=> 40,'maxlength' => 120, ''=>__('Title'. true)))); 13 echo $html->div('required', $form->label('Test.description', __('Description', true)) . $form->textarea('Test.description', array("cols" => 50, "rows" => 15))); 15 14 16 15 echo $html->div('required', $form->label('Test.status', 'Published:' ) . $form->checkbox('Test.status', array('value'=>1))); 17 16 18 echo $form->end( 'Save');17 echo $form->end(__('Save', true)); 19 18 ?> 20 19 </fieldset> -
trunk/app/views/tests/admin_listing.ctp
r575 r666 2 2 //die( debug( $data )); 3 3 4 echo $html->div('title_section', 'Tests');4 echo $html->div('title_section', __('Tests', true)); 5 5 6 6 echo $html->para(null, … … 11 11 12 12 foreach ($data as $val): 13 $s = ($val['Test']['status'] == 1) ? 'Published': 'Draft';13 $s = ($val['Test']['status'] == 1) ? __('Published', true) : __('Draft', true); 14 14 15 15 echo '<div class="grayblock">'; 16 16 echo $html->div('butonright', $gags->sendEdit($val['Test']['id'], 'tests')); 17 17 echo $html->div('div_title', $val['Test']['title']); 18 echo $html->para(null, '<b> Test description:</b> '.$val['Test']['description']);18 echo $html->para(null, '<b>'.__('Description', true).':</b> '.$val['Test']['description']); 19 19 20 echo $html->link( 'Questions', '/admin/tests/questions/'.$val['Test']['id']);21 echo $html->link($html->image('admin/questions_icon.gif', array('alt'=> 'Questions', 'title'=>'Questions')),20 echo $html->link(__('Questions', true), '/admin/tests/questions/'.$val['Test']['id']); 21 echo $html->link($html->image('admin/questions_icon.gif', array('alt'=>__('Questions', true), 'title'=>__('Questions', true))), 22 22 '/admin/tests/questions/'.$val['Test']['id'], null, null, false) . '<br />'; 23 23 if ( count($val['Vclassroom']) < 1 ): … … 42 42 43 43 foreach($val['Vclassroom'] as $class): 44 echo $html->para(null, 'This test had been assigned to class: '.44 echo $html->para(null, __('This test had been assigned to class', true). ': '. 45 45 $html->link($class['name'], '/admin/vclassrooms/members/'.$class['id']) . '</b>'); 46 46 endforeach; -
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
