Changeset 362
- Timestamp:
- 04/02/08 13:51:48 (9 months ago)
- Location:
- trunk/app
- Files:
-
- 1 removed
- 4 modified
-
controllers/mailer_controller.php (deleted)
-
controllers/questions_controller.php (modified) (1 diff)
-
views/questions/questions.ctp (modified) (1 diff)
-
views/tests/admin_edit.ctp (modified) (1 diff)
-
views/tests/admin_questions.ctp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/app/controllers/questions_controller.php
r361 r362 44 44 { 45 45 $conditions = array("Question.test_id" => $this->data['Question']['test_id']); 46 $fields = array("Question.id", "Question.question", "Question.hint", "Question.worth", "Question.explanation" );46 $fields = array("Question.id", "Question.question", "Question.hint", "Question.worth", "Question.explanation", "Answer.id"); 47 47 $order = "Question.id"; 48 48 -
trunk/app/views/questions/questions.ctp
r269 r362 1 1 <?php 2 //var_dump($data); 2 //die(debug($data)); 3 4 $i = 0; 5 3 6 foreach ($data as $val) 4 7 { 5 echo "Question: " . $val["Question"]["question"] . "<br />"; 6 echo "Hint: " . $val["Question"]["hint"] . "<br />"; 7 echo "Explanation: " . $val["Question"]["explanation"] . "<br />"; 8 echo "Worth: " . $val["Question"]["worth"] . "<br /><br />"; 9 echo $html->link('View answers', '/admin/questions/answers/'.$val["Question"]["id"]) .'<br /><br />'; 8 $answers = count($val["Answer"]); 9 $i++; 10 echo '<div style="padding:5px;border:1px dotted gray;margin:auto;width:60%"><b>' . $i . '.-</b> '; 11 echo $html->div('butonright', $gags->sendEdit($val['id'], 'Question')); 12 echo $html->div('butonright', $gags->confirmDel($val['id'], 'Question')); 13 echo "Question: " . $val["question"] . "<br />"; 14 echo "Hint: " . $val["hint"] . "<br />"; 15 echo "Explanation: " . $val["explanation"] . "<br />"; 16 echo "Worth: " . $val["worth"] . "<br /><br />"; 17 echo $html->link('View answers ('.$answers.')', '/admin/questions/answers/'.$val["id"]); 18 echo '</div>'; 10 19 } 11 12 20 ?> -
trunk/app/views/tests/admin_edit.ctp
r361 r362 12 12 echo $html->div('required', $form->input('Test.title', array("size" => 40, "maxlength" => 120))); 13 13 14 echo $html->div('required', $form->label('Test.description', 'Description:') . $form->textarea('Test.description', array("cols" => 50, "rows" => 5)));14 echo $html->div('required', $form->label('Test.description', 'Description:') . $form->textarea('Test.description', array("cols" => 50, "rows" => 15))); 15 15 16 16 echo $html->div('required', $form->label('Test.status', 'Published:' ) . $form->checkbox('Test.status', array('value'=>1))); -
trunk/app/views/tests/admin_questions.ctp
r361 r362 25 25 <legend>New question</legend> 26 26 <?php 27 echo $html->div('required', $form->input('Question.question', array("size" => 40, "maxlength" => 120)));27 echo $html->div('required', $form->input('Question.question', array("size" => 60, "maxlength" => 120))); 28 28 echo $html->div('required', $form->input('Question.hint', array("size" => 40, "maxlength" => 120))); 29 29 echo $html->div('required', $form->label('Question.explanation', 'Explanation:') . $form->textarea('Question.explanation', array("cols" => 50, "rows" => 5))); … … 51 51 52 52 echo $ajax->div('questions'); 53 53 54 $i = 0; 55 54 56 foreach ($data["Question"] as $val) 55 57 {
