<?php 
 
 $q = $this->getQuestion(); //create question object (gets $this->q[id] - real or fake
 $q->display = $this;
 
 $fields = $q->getStructureFields();
 if( $q->display->engine->LeaveQuestion === false )
		$fieldsValues = $_POST['answers'];
	else
		$fieldsValues = $q->display->readStructureVariables($fields,'');

 $_SESSION['questionFields'] =array_merge($_SESSION['questionFields'], $fields);
 
 $test = simplexml_load_string( $this->readXML($qVar['id'],$projectId,6)); //read template data
 $q->xmlObj = $test->ANSWER;
 //$html .=  $q->designerDrawAnswers($xmlObj,$this);	 
 $ansArr = $q->PluginGetAnswers();
 	
 //echo $q->id_plugin;
 $debug = 0;
	if ($debug) {
		echo "<pre>";
		//var_dump($q->getAnswerArray());
		var_dump($q);
		//var_dump($fieldsValues);
		echo "</pre>";
	}

    $sql = "SELECT * FROM " . DB_WARPIT_WEBCATI_BASE . "._Plugin WHERE id_plugin = " . $q->id_plugin;
    $res= $db->SQLexecute($sql);
    $dat = $db->fetchAssoc($res);
/*    print "<pre>";
    var_dump($_SESSION);
    print "</pre>";*/
    
    include("../webcati/_plugins/" . $dat['plugin_path'] . "/web/template.php");
 /*if ($q->id_plugin == 3) include("../webcati/_plugins/moj_plugin3.php");
 elseif ($q->id_plugin == 1) include("../webcati/_plugins/moj_plugin.php");
 else include("../webcati/_plugins/moj_plugin2.php"); */
?>