<?php

/*
-----------------------------------------------------------
-----------------------------------------------------------
						HEADER
-----------------------------------------------------------
-----------------------------------------------------------
*/ 

// setting the language file
$langFile = "agenda";

// setting the global file that gets the general configuration, the databases, the languages, ...
include('../inc/claro_init_global.inc.php');

//include('../inc/lib/events.lib.inc.php');

include_once("../inc/lib/database.lib.php");


Display::display_header($nameTools,'BlaBlaBla ...');

$TBL_QUIZ_TEST_TABLE = Database::get_current_course_database().Database::get_database_glue().'quiz';
$sql = 'SHOW FULL FIELDS FROM'.'`'. $TBL_QUIZ_TEST_TABLE.'`';
$query = api_sql_query($sql,__FILE__,__LINE__); 
$fields_cnt  = mysql_num_rows($query);

echo $fields_cnt;

if ($fields_cnt < 10){
   echo " moram updajtirat";
   $sql= "ALTER TABLE".'`'. $TBL_QUIZ_TEST_TABLE.'`'. 
      "ADD `show_rez` ENUM( '0', '1' ) DEFAULT '1' NOT NULL ,
      ADD `max_passage` SMALLINT DEFAULT '0' NOT NULL ,
      ADD `timed` ENUM( '0', '1' ) DEFAULT '0' NOT NULL ,
      ADD `start_date` DATETIME DEFAULT '2005-01-01 01:01' NOT NULL ,
      ADD `end_date` DATETIME DEFAULT '2005-01-01 01:01' NOT NULL" ;
   $query = api_sql_query($sql,__FILE__,__LINE__); 
} else
   echo "vec od 10, ne delam nicesar."

?>