Changeset 365
- Timestamp:
- 04/03/08 10:43:08 (9 months ago)
- Location:
- trunk/app
- Files:
-
- 6 modified
-
controllers/answers_controller.php (modified) (1 diff)
-
controllers/vclassrooms_controller.php (modified) (1 diff)
-
models/answer.php (modified) (2 diffs)
-
views/answers/questions.ctp (modified) (1 diff)
-
views/ecourses/admin_edit.ctp (modified) (1 diff)
-
views/ecourses/admin_vclassrooms.ctp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/app/controllers/answers_controller.php
r364 r365 44 44 { 45 45 $conditions = array("Answer.question_id" => $this->data['Answer']['question_id']); 46 $fields = array("Answer.id", "Answer.answer", "Answer.correct" );46 $fields = array("Answer.id", "Answer.answer", "Answer.correct", "Answer.question_id"); 47 47 $order = "Answer.id"; 48 48 -
trunk/app/controllers/vclassrooms_controller.php
r352 r365 227 227 $this->msgFlash('Your virtual classroom has been updated.', '/admin/vclassrooms/edit/'.$this->data['Vclassroom']['id']); 228 228 } 229 } 230 } 231 232 // change status published/draft 233 public function admin_change($id, $status, $ecourse_id) 234 { 235 $this->data['Vclassroom']['status'] = ($status == 0 ) ? 1 : 0; 236 237 $this->data['Vclassroom']['id'] = $id; 238 239 if ($this->Vclassroom->save($this->data['Vclassroom'])) 240 { 241 $this->msgFlash('Clasroom status changed', '/admin/ecourses/vclassrooms/'.$ecourse_id); 229 242 } 230 243 } -
trunk/app/models/answer.php
r363 r365 3 3 * Chipotle Software TM 4 4 * Manuel Montoya 2002-2008 5 * GPLv3 manuel<a t>mononeurona<dot>org5 * GPLv3 manuel<arroba>mononeurona<punto>org 6 6 **/ 7 7 … … 10 10 public $belongsTo = array('Question' => 11 11 array('className' => 'Question', 12 'conditions' => '',13 'order' => '',14 'foreignKey' => 'question_id'12 'conditions' => '', 13 'order' => '', 14 'foreignKey' => 'question_id' 15 15 ) 16 16 ); 17 17 18 18 public $validate = array( 19 'comment' => VALID_NOT_EMPTY, //'/[a-z0-9\_\-]{3,}$/i',19 'comment' => VALID_NOT_EMPTY, 20 20 'user_id' => VALID_NOT_EMPTY, 21 21 'entry_id' => VALID_NOT_EMPTY, -
trunk/app/views/answers/questions.ctp
r251 r365 1 1 <?php 2 foreach ($data as $val) 3 { 4 echo '<div style="padding:5px;border:1px dotted gray;margin:4px;">'; 5 echo "Answer: " . $val["Answer"]["answer"] . "<br />"; 6 echo "Correct: " . $val["Answer"]["correct"] . "<br />"; 7 echo '</div>'; 2 // die( debug( $data )); 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 />"; 9 $url = '/admin/answers/change/'.$val['Answer']['id'].'/'.$val['Answer']['correct'].'/'.$val['Answer']['question_id']; 10 $tmp .= "Correct: " . $html->link($st, $url) . "<br />"; 11 12 echo $html->div('adminblock', $tmp); 8 13 } 9 14 ?> -
trunk/app/views/ecourses/admin_edit.ctp
r354 r365 1 1 <?php 2 2 echo $javascript->link('fckeditor/fckeditor'); 3 4 echo $html->addCrumb('Control Tools', '/admin/entries/start'); 5 echo $html->addCrumb('Ecourses', '/admin/ecourses/listing'); 6 echo $html->getCrumbs(' / '); 7 3 8 echo $form->create('Ecourse',array("onsubmit"=>"return chkForm();")); 4 9 echo $form->hidden('Ecourse.id'); -
trunk/app/views/ecourses/admin_vclassrooms.ctp
r352 r365 28 28 $tmp = $html->div('butonright', $gags->sendEdit($val['id'], 'Vclassroom')); 29 29 $tmp .= $html->link($val['name'], '/admin/vclassrooms/members/'.$val['id']); 30 $tmp .= $html->para(null, 'Status: '. $html->link($s, '/admin/vclassroom/change/'.$val['id'].'/'.$val['status']));30 $tmp .= $html->para(null, 'Status: '.$html->link($s,'/admin/vclassrooms/change/'.$val['id'].'/'.$val['status'].'/'.$val['ecourse_id'])); 31 31 $tmp .= $html->div('butonright', $gags->confirmDel($val['id'], 'Vclassroom')); 32 32
