Changeset 362

Show
Ignore:
Timestamp:
04/02/08 13:51:48 (9 months ago)
Author:
aarkerio
Message:

Locale and test improvements

Location:
trunk/app
Files:
1 removed
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/app/controllers/questions_controller.php

    r361 r362  
    4444   { 
    4545     $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"); 
    4747     $order      = "Question.id"; 
    4848                     
  • trunk/app/views/questions/questions.ctp

    r269 r362  
    11<?php 
    2 //var_dump($data); 
     2//die(debug($data)); 
     3 
     4$i = 0; 
     5 
    36foreach ($data as $val)  
    47{       
    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>'; 
    1019} 
    11  
    1220?> 
  • trunk/app/views/tests/admin_edit.ctp

    r361 r362  
    1212 echo $html->div('required', $form->input('Test.title', array("size" => 40, "maxlength" => 120)));  
    1313    
    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)));  
    1515    
    1616 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  
    2525<legend>New question</legend> 
    2626<?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)));  
    2828 echo $html->div('required', $form->input('Question.hint', array("size" => 40, "maxlength" => 120)));  
    2929 echo $html->div('required', $form->label('Question.explanation', 'Explanation:') . $form->textarea('Question.explanation', array("cols" => 50, "rows" => 5)));  
     
    5151 
    5252echo $ajax->div('questions'); 
     53 
    5354$i = 0; 
     55 
    5456foreach ($data["Question"] as $val)  
    5557{