Changeset 373

Show
Ignore:
Timestamp:
04/09/08 12:40:29 (9 months ago)
Author:
aarkerio
Message:

Tests fixed

Location:
trunk/app
Files:
7 modified

Legend:

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

    r372 r373  
    197197       
    198198   $this->Test->unbindModel(array('hasMany'=>array('Question', 'Result'))); 
    199        
     199    
    200200   $this->set('data', $this->Test->findAll($conditions, $fields, $order)); 
    201201 } 
  • trunk/app/controllers/users_controller.php

    r352 r373  
    33*  Karamelo E-Learning Platform 
    44*  Chipotle Software 2002-2008 
    5 *  GPL manuel<arroba>mononeurona<punto>org 
     5*  GPLv3 manuel<arroba>mononeurona<punto>org 
    66*/  
    77//File: /app/controllers/users_controller.php 
     
    1919 public function beforeFilter()  
    2020 { 
    21     $this->Auth->allow(array('blog', 'entry','portfolio', 'about', 'register', 'directory', 'bloggers', 'insert')); 
     21    $this->Auth->allow(array('blog', 'entry','portfolio', 'about', 'register', 'directory', 'bloggers', 'insert', 'validate')); 
    2222    parent::beforeFilter(); 
    2323 } 
     
    144144         
    145145        $this->Portal->statics(); // Using Portal component 
    146     } 
    147      
    148     public function parents() 
    149     { 
     146 } 
     147     
     148 public function parents() 
     149 { 
    150150        $this->layout    = 'portal'; 
    151151         
     
    162162         
    163163        $this->Portal->statics(); // Using Portal component 
    164   } 
    165    
    166   public function directory($filter = null) 
    167   { 
     164 } 
     165   
     166 public function directory($filter = null) 
     167 { 
    168168        $this->pageTitle = 'Students :: Karamelo E-learning on Web 2.0'; 
    169169         
     
    185185        $limit      = null;         
    186186        $this->set('users', $this->User->findAll($conditions, $fields, $order, $limit)); 
    187   } 
    188    
    189   public function karanet() 
    190   { 
     187 } 
     188   
     189 public function karanet() 
     190 { 
    191191        $this->pageTitle = 'Directory :: Karamelo E-learning on Web 2.0'; 
    192192         
     
    254254 { 
    255255    $this->layout    = 'portal'; 
     256 
     257    $this->pageTitle = 'Register new user'; 
    256258     
    257259    $conditions = array("id"=>'>1', "id"=>"<5"); 
     
    284286   if (strlen($this->data['User']['pwd']) < 6) 
    285287   { 
    286        $message['pwd_worng'] = "The password has less than 6 characters "; 
     288       $message['pwd_wrong'] = "The password have less than 6 characters "; 
    287289   } 
    288290     
    289    if (strpos($this->data['User']['username'], ' '))  // nos spaces 
     291   if (strpos($this->data['User']['username'], ' '))  // no spaces    
    290292   { 
    291293       $message['username_spaces'] = "Your username should not contain spaces"; 
    292     } 
    293      
    294     /** username check **/ 
    295     if (strlen($this->data['User']['username']) < 5) 
    296     { 
     294   } 
     295     
     296   /** username check **/ 
     297   if (strlen($this->data['User']['username']) < 5) 
     298   { 
    297299       $message['pwd_username'] = "The username has less than 5 characters "; 
    298     } 
    299      
    300     /** name check **/ 
    301     if (strlen($this->data['User']['name']) < 5) 
    302     { 
     300   } 
     301     
     302   /** name check **/ 
     303   if (strlen($this->data['User']['name']) < 5) 
     304   { 
    303305       $message['pwd_username'] = "The name is too short"; 
    304     } 
     306   } 
    305307     
    306308    if (strpos($this->data['User']['pwd'], ' '))  // pwd too short 
     
    318320    if ($this->Adds->validEmail($this->data['User']['email']) === false) 
    319321    { 
    320        $message['pwd_username'] = "The email is invalid"; 
     322       $message['pwd_username'] = "Typed email is invalid"; 
    321323    } 
    322324     
     
    330332     
    331333    /** Check the email **/ 
    332     $email        = $this->User->field('email', array("email" => $this->data['User']['email'])); 
     334    $email        = $this->User->field('email', array('email' => $this->data['User']['email'])); 
    333335     
    334336    if ($email != null) 
     
    338340     
    339341    // get the secret code for teachers registration process 
    340     $code  = $this->User->Group->field('code', array("id"=>$this->data['User']['group_id'])); 
     342    $code  = $this->User->Group->field('code', array('id'=>$this->data['User']['group_id'])); 
    341343     
    342344    if ( $this->data['User']['code'] != $code ) 
  • trunk/app/models/test.php

    r368 r373  
    4444                       array('className'             => 'Vclassroom', 
    4545                         'joinTable'             => 'tests_vclassrooms', 
    46                          'foreignKey'            => 'vclassroom_id', 
    47                          'associationForeignKey' => 'test_id', 
    48                          'conditions'            => '', 
    49                          'order'                 => '', 
     46                         'foreignKey'            => 'test_id', 
     47                         'associationForeignKey' => 'vclassroom_id', 
     48                         'conditions'            => null, 
     49                         'order'                 => null, 
    5050                         'limit'                 => '', 
    5151                         'unique'                => true, 
  • trunk/app/views/tests/admin_listing.ctp

    r372 r373  
    1616  echo '<div class="grayblock">'; 
    1717         echo $html->div('butonright', $gags->sendEdit($val['Test']['id'], 'tests')); 
    18          echo $html->link($val['Test']['title'], '/admin/tests/vclassrooms/'.$val['Test']['id']) . '<br /><br />'; 
     18         echo $html->div('div_title', $val['Test']['title']); 
    1919         echo $html->para(null, '<b>Test description:</b> '.$val['Test']['description']); 
    2020 
     
    2222         echo $html->link($html->image('admin/questions_icon.gif', array('alt'=>'Questions', 'title'=>'Questions')),  
    2323                          '/admin/tests/questions/'.$val['Test']['id'], null, null, false) . '<br />'; 
    24  
    25  
    26          if ( count($val['Vclassroom']) < 0 )  
     24         if ( count($val['Vclassroom']) < 1 )  
    2725         { 
     26            
    2827           echo $html->para(null, $html->link( 
    2928                                              $html->image('admin/vgroups-gray.gif', array( 
     
    4544 
    4645           foreach($val['Vclassroom'] as $class): 
    47                echo $html->para(null, 'This test had been assigned to class: '. $html->link($class['name'], '/admi/ecourses/vclassroom/'.$class['id']) . '</b>'); 
     46               echo $html->para(null, 'This test had been assigned to class: '. $html->link($class['name'], '/admin/vclassrooms/members/'.$class['id']) . '</b>'); 
    4847           endforeach; 
    4948         } 
  • trunk/app/views/tests/admin_vclassrooms.ctp

    r372 r373  
    11<?php 
    22 echo $html->addCrumb('Control Tools', '/admin/entries/start'); 
    3  echo $html->addCrumb('Courses', '/admin/tests/listing'); 
     3 echo $html->addCrumb('Tests', '/admin/tests/listing'); 
    44 echo $html->getCrumbs(' / '); 
    55//die( debug( $data ) ); 
  • trunk/app/views/users/validate.ctp

    r264 r373  
    22//die(print_r($message)); 
    33foreach ($message as $m) 
    4   { 
    5      echo $m . "  <br />"; 
    6   } 
     4{ 
     5      echo $m . "  <br />"; 
     6} 
    77   
    88if ( isset($ok) ) 
     
    1010 
    1111?> 
    12     <script type="text/javascript"> 
    13         <!-- 
    14             var ok = true;  
    15             if ( ok == true )  
    16        {  
     12 <script type="text/javascript"> 
     13<!-- 
     14  var ok = true;  
     15  if ( ok == true )  
     16  {  
    1717              //alert('I am in!!'); 
    1818              var myDiv = document.getElementById('form_register'); 
    1919              myDiv.innerHTML = ''; 
    20        } 
    21         //--> 
    22         </script> 
     20  } 
     21//--> 
     22</script> 
    2323     
    2424<?php } ?> 
  • trunk/app/webroot/css/cpanel/cpanel.css

    r359 r373  
    10221022.grayblock{ padding:6px 3px 28px 4px;margin:10px 0 5px 0;border:1px dotted gray;} 
    10231023 
     1024a.titlink:link { text-decoration: none; color: orange;font-size:13pt;}  
     1025a.titlink:active { text-decoration: none}  
     1026a.titlink:visited { text-decoration: none}  
     1027a.titlink:hover { text-decoration: underline } 
     1028 
     1029.div_title{font-size:13pt;font-weight:bold;color:orange;}