summaryrefslogtreecommitdiffstats
path: root/admin/survey/export/latexclasses/Vprasanja/RadioCheckboxSelectLatex.php
diff options
context:
space:
mode:
Diffstat (limited to 'admin/survey/export/latexclasses/Vprasanja/RadioCheckboxSelectLatex.php')
-rw-r--r--admin/survey/export/latexclasses/Vprasanja/RadioCheckboxSelectLatex.php231
1 files changed, 152 insertions, 79 deletions
diff --git a/admin/survey/export/latexclasses/Vprasanja/RadioCheckboxSelectLatex.php b/admin/survey/export/latexclasses/Vprasanja/RadioCheckboxSelectLatex.php
index 51b5ddb..df4228f 100644
--- a/admin/survey/export/latexclasses/Vprasanja/RadioCheckboxSelectLatex.php
+++ b/admin/survey/export/latexclasses/Vprasanja/RadioCheckboxSelectLatex.php
@@ -11,8 +11,8 @@
//namespace Export\Latexclasses\Vprasanja;
-define("PIC_SIZE", "\includegraphics[width=10cm]"); //slika sirine 50mm
-define("ICON_SIZE", "\includegraphics[width=0.5cm]"); //za ikone @ slikovni tip
+if (!defined('PIC_SIZE')) define("PIC_SIZE", "\includegraphics[width=5cm]"); //slika sirine 50mm
+if (!defined('ICON_SIZE')) define("ICON_SIZE", "\includegraphics[width=0.5cm]"); //za ikone @ slikovni tip
class RadioCheckboxSelectLatex extends LatexSurveyElement
{
@@ -40,6 +40,7 @@ class RadioCheckboxSelectLatex extends LatexSurveyElement
}
public function export($spremenljivke=null, $export_format='', $questionText='', $fillablePdf=null, $texNewLine='', $usr_id=null, $db_table=null, $preveriSpremenljivko=null, $export_data_type=null, $export_subtype=null, $loop_id=null, $language=null){
+ //$time_start = microtime(true);
global $lang, $site_path;
$this->language = $language;
@@ -47,7 +48,7 @@ class RadioCheckboxSelectLatex extends LatexSurveyElement
//preverjanje, ali je prevod
if(isset($_GET['language'])){
- $this->language = $_GET['language'];
+ $this->language = isset($_GET['language'])?$_GET['language']:null;
$this->prevod = 1;
}else{
$this->prevod = 0;
@@ -73,6 +74,7 @@ class RadioCheckboxSelectLatex extends LatexSurveyElement
$indeksOdgovorov = 0;
$oznakaVprasanja = $this->UrediOznakoVprasanja($spremenljivke['id']); //uredi oznako vprasanja, ker ne sme biti stevilska
$prviOdgovorSlikovniTip = 0;
+ $vizualnaSkalaNumber = null;
if ($usr_id){
$userDataPresent = $this->GetUsersData($db_table, $spremenljivke['id'], $spremenljivke['tip'], $usr_id, $this->loop_id); //zgenerira podatke z odgovori respondenta v $this->userAnswer, zabelezi, ce so podatki prisotni
@@ -91,24 +93,24 @@ class RadioCheckboxSelectLatex extends LatexSurveyElement
#ce je respondent odgovarjal v drugem jeziku ########################
$rowl = $this->srv_language_vrednost($rowVrednost['id']);
- if (strip_tags($rowl['naslov']) != '') $rowVrednost['naslov'] = $rowl['naslov'];
- if (strip_tags($rowl['naslov2']) != '') $rowVrednost['naslov2'] = $rowl['naslov2'];
+ if ($rowl!=null && strip_tags($rowl['naslov']) != '') $rowVrednost['naslov'] = $rowl['naslov'];
+ if ($rowl!=null && strip_tags($rowl['naslov2']) != '') $rowVrednost['naslov2'] = $rowl['naslov2'];
#ce je respondent odgovarjal v drugem jeziku - konec ################
- $stringTitle = ( $rowVrednost['naslov'] ) ? $rowVrednost['naslov'] : ( ( $rowVrednost['naslov2'] ) ? $rowVrednost['naslov2'] : $rowVrednost['variable'] );
- $stringTitle = Common::getInstance()->dataPiping($stringTitle, $usr_id, $loop_id);
- $stringTitle = '\\textcolor{crta}{'.$this->encodeText($stringTitle).'}';
-
- //echo $stringTitle."za indeks: ".$indeksZaWhile."</br>";
- //stetje stevila vrstic
- //$stetje_vrstic = $this->pdf->getNumLines($stringTitle, 180*$expand_width);
- // še dodamo textbox če je polj other
+ $stringTitle = ( $rowVrednost['naslov'] ) ? $rowVrednost['naslov'] : ( ( $rowVrednost['naslov2'] ) ? $rowVrednost['naslov2'] : $rowVrednost['variable'] );
+ if($usr_id){
+ $stringTitle = Common::getInstance()->dataPiping($stringTitle, $usr_id, $loop_id);
+ }
+ $stringTitle = '\\textcolor{crta}{'.LatexDocument::encodeText($stringTitle, 0, 0, $indeksZaWhile).'}'; //encodeText($text='', $vre_id=0, $no_br = 0, $img_id=0, $variable_name = '')
+
+ // še dodamo textbox če je polje other
$_txt = '';
if ( $rowVrednost['other'] == 1 && $usr_id ){
//$sqlOtherText = sisplet_query("SELECT * FROM srv_data_text".$this->db_table." WHERE spr_id='".$spremenljivke['id']."' AND vre_id='".$rowVrednost['id']."' AND usr_id='".$this->getUserId()."' AND loop_id $loop_id");
- $sqlOtherText = sisplet_query("SELECT * FROM srv_data_text".$db_table." WHERE spr_id='".$spremenljivke['id']."' AND vre_id='".$rowVrednost['id']."' AND usr_id=".$usr_id);
- $row4 = mysqli_fetch_assoc($sqlOtherText);
- $_txt = ' \\textcolor{crta}{'.$row4['text'].'}';
+ $sqlOtherText = sisplet_query("SELECT * FROM srv_data_text".$db_table." WHERE spr_id='".$spremenljivke['id']."' AND vre_id='".$rowVrednost['id']."' AND usr_id=".$usr_id .
+ ($loop_id !== null ? " AND loop_id='$loop_id'" : ""));
+ $row4 = mysqli_fetch_assoc($sqlOtherText);
+ $_txt = ' \\textcolor{crta}{'.LatexDocument::encodeText($row4['text']).'}';
}
//$tex .= ' '.$stringTitle.$_txt.',';
if($indeksZaWhile==1){
@@ -150,7 +152,7 @@ class RadioCheckboxSelectLatex extends LatexSurveyElement
#za ureditev preloma odgovorov, ce so odgovori ob vprasanju - najprej je potrebno zabeleziti dolzino besedila vprasanja
if($spremenljivke['orientation']==0 && $export_format == 'pdf'){ //vodoravno ob vprasanju, ce je pdf
- $tex .= '\settowidth{\questionLength}{'.$this->encodeText($questionText).'}'; //v definirano dolzino shranimo trenutno dolzino teksta vprasanja
+ $tex .= '\settowidth{\questionLength}{'.LatexDocument::encodeText($questionText).'}'; //v definirano dolzino shranimo trenutno dolzino teksta vprasanja
$tex .= '\addtolength{\questionTotalLength}{\questionLength}'; //celotni dolzini dodamo dolzino vprasanja
//ce je opomba prisotna, daj spremenljivko na 2
@@ -163,40 +165,35 @@ class RadioCheckboxSelectLatex extends LatexSurveyElement
#za ureditev preloma odgovorov, ce so odgovori ob vprasanju - konec
if($spremenljivke['orientation']==7){ //navpicno - tekst levo
- //$tex .= '\begin{tabular}{l l}'.$texNewLine;
if($export_format == 'pdf'){
- $tex .= '\begin{tabularx}{.5\textwidth}{l l}';
+ $tex .= '\begin{xltabular}{.5\textwidth}{l l}';
}else{
$tex .= '\begin{tabular}{l l}'.$texNewLine; //za omogociti izris odgovorov v tabeli
}
}elseif($spremenljivke['orientation']==8){ //ce je "povleci-spusti"
- $tex .= '\setlength{\parindent}{0.1\textwidth} ';
+ $tex .= '\setlength{\parindent}{0.04\textwidth} ';
//prva vrstica pred tabelo z odgovori
if($export_format == 'pdf'){ //ce je pdf
$tex .= '\begin{tabular}{l c l} '; //izris z vecstolpicno tabelo
- //$tex .= '\begin{tabularx}{.5\textwidth}{l c l} '; //izris z vecstolpicno tabelo
$tex .= $lang['srv_ranking_available_categories'].': & \hspace{0.1\textwidth} & '.$lang['srv_drag_drop_answers'].': '.$texNewLine;
- $tex .= '\rule{0.4\textwidth}{0.4 pt} & & \rule{0.4\textwidth}{0.4 pt} \end{tabular} '.$texBigSkip;
+ $tex .= '\rule{0.4\textwidth}{0.4 pt} & & \rule{0.4\textwidth}{0.4 pt} \end{tabular} ';
$tex .= $texNewLine;
}else{ //ce je rtf
$tex .= '\begin{tabular}{l} '; //izris z enostolpicno tabelo
$tex .= $lang['srv_ranking_available_categories'].': '.$texNewLine; //Rapolozljive kategorije
- //$tex .= '\hline \end{tabular} '.$texBigSkip;
$tex .= '\hline \end{tabular} ';
}
//prva vrstica pred tabelo z odgovori - konec
if($export_format == 'pdf'){ //ce je pdf
//$tex .= '\begin{tabular}{c c c} '; //izris s tabelo
- $tex .= '\begin{tabularx}{.5\textwidth}{c c c} '; //izris s tabelo
+ $tex .= '\begin{xltabular}{.5\textwidth}{c c c} '; //izris s tabelo
}
}elseif($spremenljivke['orientation']==10){ //image hot-spot
- $imageName = $this->getImageName('hotspot', $spremenljivke['id'], 'hotspot_image=');
+ $imageName = LatexDocument::getImageName('hotspot', $spremenljivke['id'], 'hotspot_image=');
$imageNameTest = $this->path2ImagesRadio.$imageName.'.png'; //za preveriti, ali obstaja slikovna datoteka na strezniku
- //error_log("za image hot spot ne grid: ".$imageNameTest);
- //echo("za image hot spot ne grid: ".$imageNameTest."</br>");
if(filesize($imageNameTest) > 0){
$image = PIC_SIZE."{".$this->path2ImagesRadio."".$imageName."}"; //priprave slike predefinirane dimenzije
}else{
@@ -220,14 +217,15 @@ class RadioCheckboxSelectLatex extends LatexSurveyElement
$tex .= $texNewLine.$lang['srv_export_hotspot_chosen_regions_names'].': '.$texNewLine; //besedilo "Izbrana obmocja na sliki"
while ($rowVrednost = mysqli_fetch_assoc($sqlVrednosti)){
if( isset($this->userAnswer[$rowVrednost['id']]) ){ //ce je podatek prisoten
- $stringTitle = ($this->encodeText(( $rowVrednost['naslov'] ) ? $rowVrednost['naslov'] : ( ( $rowVrednost['naslov2'] ) ? $rowVrednost['naslov2'] : $rowVrednost['variable'] ) ));
- // še dodamo textbox če je polj other
+ $stringTitle = (LatexDocument::encodeText(( $rowVrednost['naslov'] ) ? $rowVrednost['naslov'] : ( ( $rowVrednost['naslov2'] ) ? $rowVrednost['naslov2'] : $rowVrednost['variable'] ), 0, 0, 0, '', 1 ));
+ // še dodamo textbox če je polje other
$_txt = '';
if ( $rowVrednost['other'] == 1 && $usr_id ){
//$sqlOtherText = sisplet_query("SELECT * FROM srv_data_text".$this->db_table." WHERE spr_id='".$spremenljivke['id']."' AND vre_id='".$rowVrednost['id']."' AND usr_id='".$this->getUserId()."' AND loop_id $loop_id");
- $sqlOtherText = sisplet_query("SELECT * FROM srv_data_text".$db_table." WHERE spr_id='".$spremenljivke['id']."' AND vre_id='".$rowVrednost['id']."' AND usr_id=".$usr_id);
+ $sqlOtherText = sisplet_query("SELECT * FROM srv_data_text".$db_table." WHERE spr_id='".$spremenljivke['id']."' AND vre_id='".$rowVrednost['id']."' AND usr_id=".$usr_id .
+ ($loop_id !== null ? " AND loop_id='$loop_id'" : ""));
$row4 = mysqli_fetch_assoc($sqlOtherText);
- $_txt = ' '.$row4['text'];
+ $_txt = ' '.LatexDocument::encodeText($row4['text']);
}
$tex .= $stringTitle.$_txt.$texNewLine;
}
@@ -236,30 +234,26 @@ class RadioCheckboxSelectLatex extends LatexSurveyElement
}elseif($spremenljivke['orientation']==9 || $spremenljivke['orientation']==11){ //ce je "slikovni tip" ali VAS
if($spremenljivke['orientation']==11){ //ce je VAS
$spremenljivkaParams = new enkaParameters($spremenljivke['params']);
- $vizualnaSkalaNumber = $spremenljivkaParams->get('vizualnaSkalaNumber');
+ $vizualnaSkalaNumber = ($spremenljivkaParams->get('vizualnaSkalaNumber') ? $spremenljivkaParams->get('vizualnaSkalaNumber') : '5');
$numRowsSql = $vizualnaSkalaNumber;
}
- //echo "stevilo zadev: ".$numRowsSql."</br>";
if($spremenljivke['orientation']==9){
$mejaVAS = 20;
}elseif($spremenljivke['orientation']==11){
$mejaVAS = 8;
$numRowsSql = mysqli_num_rows($sqlVrednosti);
}
- //if($numRowsSql<20){ //ce je manj kot x slikovnih tipov, izpisemo s tabelo, drugace simbol in zraven število
if($numRowsSql<$mejaVAS){ //ce je manj kot x slikovnih tipov, izpisemo s tabelo, drugace simbol in zraven število
$tableParamsSlikovniTip = '';
for($i=0; $i<$numRowsSql;$i++){
$tableParamsSlikovniTip .= ' c ';
}
- $tex .= '\begin{tabular}{'.$tableParamsSlikovniTip.'} '; //izris s tabelo
+ $tex .= '\\\\ \begin{tabular}{'.$tableParamsSlikovniTip.'} '; //izris s tabelo
}
- //echo "parametri tabele: ".$tableParamsSlikovniTip."</br>";
}
if($spremenljivke['orientation']!=10){ //ce ni image hot-spot
-
//pregled vseh moznih vrednosti (kategorij) po $sqlVrednosti
while ($rowVrednost = mysqli_fetch_assoc($sqlVrednosti)){
$prop['full'] = ( isset($userAnswer[$rowVrednost['id']]) );
@@ -267,57 +261,132 @@ class RadioCheckboxSelectLatex extends LatexSurveyElement
if($this->prevod){ //ce je prevod ankete
$rowl = $this->srv_language_vrednost($rowVrednost['id']); //pridobi prevod naslova v ustreznem jeziku
$stringTitle = ((( $rowl['naslov'] ) ? $rowl['naslov'] : ( ( $rowl['naslov2'] ) ? $rowl['naslov2'] : $rowl['variable'] ) )); //prevod naslova v ustreznem jeziku
+ if($stringTitle == ''){ //ce ni prevoda, prevzemi izvirno
+ $stringTitle = ((( $rowVrednost['naslov'] ) ? $rowVrednost['naslov'] : ( ( $rowVrednost['naslov2'] ) ? $rowVrednost['naslov2'] : $rowVrednost['variable'] ) ));
+ }
}else{
$stringTitle = ((( $rowVrednost['naslov'] ) ? $rowVrednost['naslov'] : ( ( $rowVrednost['naslov2'] ) ? $rowVrednost['naslov2'] : $rowVrednost['variable'] ) ));
}
- $stringTitle = Common::getInstance()->dataPiping($stringTitle, $usr_id, $loop_id);
-
- //echo "naslov: $stringTitle</br>";
- //echo "jezik: ".$this->language."</br>";
- if ( $spremenljivke['tip'] == 1 || $spremenljivke['tip'] == 3 ){
- $symbol = $this->getAnswerSymbol($export_format, $fillablePdf, $spremenljivke['tip'], $spremenljivke['grids'], 0, $this->userAnswer[$rowVrednost['id']], $spremenljivke['orientation'], $indeksZaWhile, $vizualnaSkalaNumber);
- //$tex .= '{\ChoiceMenu[radio,radiosymbol=\ding{108},name=myGroupOfRadiobuttons]{}{='.$stringTitle.'}}'.$stringTitle.' '.$this->texNewLine;
- $internalCellHeight = '0.3 cm'; //visina praznega okvirja @povleci-spusti
- }else if ( $spremenljivke['tip'] == 2 ){
- $symbol = $this->getAnswerSymbol($export_format, $fillablePdf, $spremenljivke['tip'], $spremenljivke['grids'], 0, $this->userAnswer[$rowVrednost['id']]);
- $internalCellHeight = '3 cm'; //visina praznega okvirja @povleci-spusti
+ if($usr_id){
+ $stringTitle = Common::getInstance()->dataPiping($stringTitle, $usr_id, $loop_id);
+ }
+
+ $userAnswerTmp = isset($this->userAnswer[$rowVrednost['id']])?$this->userAnswer[$rowVrednost['id']]:null;
+
+ if ( $spremenljivke['tip'] == 1 || $spremenljivke['tip'] == 3 ){
+ $symbol = $this->getAnswerSymbol($export_subtype, $export_format, $fillablePdf, $spremenljivke['tip'], $spremenljivke['grids'], 0, $userAnswerTmp, $spremenljivke['orientation'], $indeksZaWhile, $vizualnaSkalaNumber);
+ $internalCellHeight = 1; //visina praznega okvirja @povleci-spusti
+
+ }else if ( $spremenljivke['tip'] == 2 ){
+ $symbol = $this->getAnswerSymbol($export_subtype, $export_format, $fillablePdf, $spremenljivke['tip'], $spremenljivke['grids'], 0, $userAnswerTmp);
+ $internalCellHeight = 3; //visina praznega okvirja @povleci-spusti
}
- if($spremenljivke['orientation']==1&&$spremenljivke['tip'] != 3){ //navpicno
- $tex .= $symbol.' '.$this->encodeText($stringTitle, $rowVrednost['id']).' '.$texNewLine;
- //$test = $symbol.' '.$this->encodeText($stringTitle, $rowVrednost['id']).' '.$texNewLine;
- //echo "tukaj! $test </br>";
- }elseif($spremenljivke['orientation']==7){ //navpicno - tekst levo
- $text = $this->encodeText($stringTitle, $rowVrednost['id']).' & '.$symbol.' '.$texNewLine;
+ if($spremenljivke['orientation'] == 1 && $spremenljivke['tip'] != 3){ //navpicno
+ $tex .= $symbol.' '.LatexDocument::encodeText($stringTitle, $rowVrednost['id'], 0, 0, '', 1).' ';
+ if($rowVrednost['other'] == 1){ //ce je odgovor Drugo:, izpisi se tabelo za drugo
+ $tex .= '\begin{tabular}{c} '; //izris s tabelo brez obrob
+ if(isset($this->userAnswer[$rowVrednost['id']])){
+ $sqlOtheText1 = "SELECT * FROM srv_data_text".$db_table." WHERE spr_id='".$spremenljivke['id']."' AND vre_id='".$rowVrednost['id']."' AND usr_id=".$usr_id .
+ ($loop_id !== null ? " AND loop_id='$loop_id'" : "");
+ $sqlOtherText = sisplet_query($sqlOtheText1);
+ $row4 = mysqli_fetch_assoc($sqlOtherText);
+ $tex .= '\fbox{\parbox{0.2\textwidth}{ '.LatexDocument::encodeText($row4['text']).' }} ';
+ }else{
+ $tex .= '\fbox{\parbox{0.2\textwidth}{ \hphantom{\hspace{0.2\textwidth}} }} ';
+ }
+ $tex .= ' \end{tabular}'; //za zakljuciti izris odgovorov v tabeli
+ }
+ $tex .= $texNewLine;
+ }elseif($spremenljivke['orientation'] == 7){ //navpicno - tekst levo
+
+ $text = LatexDocument::encodeText($stringTitle,$rowVrednost['id'], 0, 0, '', 1).' & '.$symbol.' '.$texNewLine;
$textLength = strlen($text);
if($textLength > MAX_STRING_LENGTH){
$tex .= '\vspace{2 mm}';
- $tex .= '\parbox{'.LINE_BREAK_AT.'}{'.$this->encodeText($stringTitle, $rowVrednost['id']).'} & '.$symbol.' '.$texNewLine; //tekst odgovora razbij pri LINE_BREAK_AT (5 cm) in zraven dodaj ustrezni simbol
+ $tex .= '\parbox{'.LINE_BREAK_AT.'}{'.LatexDocument::encodeText($stringTitle, $rowVrednost['id'], 0, 0, '', 1).'} & '.$symbol.' '.$texNewLine; //tekst odgovora razbij pri LINE_BREAK_AT (5 cm) in zraven dodaj ustrezni simbol
}else{
- $tex .= $text;
- }
+ $tex .= LatexDocument::encodeText($stringTitle, $rowVrednost['id'], 0, 0, '', 1).' & ';
+ if($rowVrednost['other'] == 1){ //ce je odgovor Drugo:, izpisi se tabelo za drugo
+ $tex .= '\begin{tabular}{c} '; //izris s tabelo brez obrob
+ if(isset($this->userAnswer[$rowVrednost['id']])){
+ $sqlOtheText1 = "SELECT * FROM srv_data_text".$db_table." WHERE spr_id='".$spremenljivke['id']."' AND vre_id='".$rowVrednost['id']."' AND usr_id=".$usr_id .
+ ($loop_id !== null ? " AND loop_id='$loop_id'" : "");
+ $sqlOtherText = sisplet_query($sqlOtheText1);
+ $row4 = mysqli_fetch_assoc($sqlOtherText);
+ $tex .= '\fbox{\parbox{0.2\textwidth}{ '.LatexDocument::encodeText($row4['text']).' }} ';
+ }else{
+ $tex .= '\fbox{\parbox{0.2\textwidth}{ \hphantom{\hspace{0.2\textwidth}} }} ';
+ }
+ $tex .= ' \end{tabular}'; //za zakljuciti izris odgovorov v tabeli
+ }
+ $tex .= $symbol.' '.$texNewLine;
+ }
}elseif($spremenljivke['orientation']==0){ //vodoravno ob vprasanju
- $tex .= ' '.$symbol.' '.$this->encodeText($stringTitle, $rowVrednost['id']).' ';
+ $tex .= ' '.$symbol.' '.LatexDocument::encodeText($stringTitle, $rowVrednost['id'], 0, 0, '', 1).' ';
+ if($rowVrednost['other'] == 1){ //ce je odgovor Drugo:, izpisi se tabelo za drugo
+ $tex .= '\begin{tabular}{c} '; //izris s tabelo brez obrob
+ if(isset($this->userAnswer[$rowVrednost['id']])){
+ $sqlOtheText1 = "SELECT * FROM srv_data_text".$db_table." WHERE spr_id='".$spremenljivke['id']."' AND vre_id='".$rowVrednost['id']."' AND usr_id=".$usr_id .
+ ($loop_id !== null ? " AND loop_id='$loop_id'" : "");
+ $sqlOtherText = sisplet_query($sqlOtheText1);
+ $row4 = mysqli_fetch_assoc($sqlOtherText);
+ $tex .= '\fbox{\parbox{0.2\textwidth}{ '.LatexDocument::encodeText($row4['text']).' }} ';
+ }else{
+ $tex .= '\fbox{\parbox{0.2\textwidth}{ \hphantom{\hspace{0.2\textwidth}} }} ';
+ }
+ $tex .= ' \end{tabular}'; //za zakljuciti izris odgovorov v tabeli
+ }
}elseif($spremenljivke['orientation']==2){ //vodoravno pod vprasanjem
- $tex .= ' '.$symbol.' '.$this->encodeText($stringTitle, $rowVrednost['id']).' ';
- }elseif(($spremenljivke['tip'] == 3&&$spremenljivke['orientation']==1)||$spremenljivke['orientation']==6){ //roleta ali izberite s seznama
- if($export_data_type==1&&isset($this->userAnswer[$rowVrednost['id']])){ //ce je dolg izvoz in je podatek za odgovor
- $tex .= ' \textbf{'.$this->encodeText($stringTitle, $rowVrednost['id']).'} '.$texNewLine;
+ $tex .= ' '.$symbol.' '.LatexDocument::encodeText($stringTitle, $rowVrednost['id'], 0, 0, '', 1).' ';
+ if($rowVrednost['other'] == 1){ //ce je odgovor Drugo:, izpisi se tabelo za drugo
+ $tex .= '\begin{tabular}{c} '; //izris s tabelo brez obrob
+ if(isset($this->userAnswer[$rowVrednost['id']])){
+ $sqlOtheText1 = "SELECT * FROM srv_data_text".$db_table." WHERE spr_id='".$spremenljivke['id']."' AND vre_id='".$rowVrednost['id']."' AND usr_id=".$usr_id .
+ ($loop_id !== null ? " AND loop_id='$loop_id'" : "");
+ $sqlOtherText = sisplet_query($sqlOtheText1);
+ $row4 = mysqli_fetch_assoc($sqlOtherText);
+ $tex .= '\fbox{\parbox{0.2\textwidth}{ '.LatexDocument::encodeText($row4['text']).' }} ';
+ }else{
+ $tex .= '\fbox{\parbox{0.2\textwidth}{ \hphantom{\hspace{0.2\textwidth}} }} ';
+ }
+ $tex .= ' \end{tabular}'; //za zakljuciti izris odgovorov v tabeli
+ }
+ }elseif(($spremenljivke['tip'] == 3 && $spremenljivke['orientation'] == 1) || $spremenljivke['orientation'] == 6){ //roleta ali izberite s seznama
+ if($export_data_type == 1 && isset($this->userAnswer[$rowVrednost['id']])){ //ce je dolg izvoz in je podatek za odgovor
+ $tex .= ' \textbf{'.LatexDocument::encodeText($stringTitle, $rowVrednost['id'], 0, 0, '', 1).' }';
}else{
- $tex .= $this->encodeText($stringTitle, $rowVrednost['id']).' '.$texNewLine;
- }
+ $tex .= LatexDocument::encodeText($stringTitle, $rowVrednost['id'], 0, 0, '', 1).' ';
+ }
+ if($rowVrednost['other'] == 1){ //ce je odgovor Drugo:, izpisi se tabelo za drugo
+ $tex .= '\begin{tabular}{c} '; //izris s tabelo brez obrob
+ if(isset($this->userAnswer[$rowVrednost['id']])){
+ $sqlOtheText1 = "SELECT * FROM srv_data_text".$db_table." WHERE spr_id='".$spremenljivke['id']."' AND vre_id='".$rowVrednost['id']."' AND usr_id=".$usr_id .
+ ($loop_id !== null ? " AND loop_id='$loop_id'" : "");
+ $sqlOtherText = sisplet_query($sqlOtheText1);
+ $row4 = mysqli_fetch_assoc($sqlOtherText);
+ $tex .= '\fbox{\parbox{0.2\textwidth}{ '.LatexDocument::encodeText($row4['text']).' }} ';
+ }else{
+ $tex .= '\fbox{\parbox{0.2\textwidth}{ \hphantom{\hspace{0.2\textwidth}} }} ';
+ }
+ $tex .= ' \end{tabular}'; //za zakljuciti izris odgovorov v tabeli
+ if($export_data_type==1&&isset($this->userAnswer[$rowVrednost['id']])){ //ce je dolg izvoz in je podatek za odgovor
+ $tex .= '}';
+ }
+
+ }
+ $tex .= $texNewLine;
}elseif($spremenljivke['orientation']==8){ //povleci-spusti
-
if(isset($this->userAnswer[$rowVrednost['id']])){
- $textR = $this->encodeText($stringTitle, $rowVrednost['id']);
+ $textR = LatexDocument::encodeText($stringTitle, $rowVrednost['id']);
$textRArray[$indeksZaWhile] = $textR; //rabimo kasneje, za izpis rtf desne strani vprasanja, ce izpisujemo odgovore respondenta
$textL = '';
}else{
- $textL = $this->encodeText($stringTitle, $rowVrednost['id']);
+ $textL = LatexDocument::encodeText($stringTitle, $rowVrednost['id']);
$textR = '';
}
-
+
if($export_format == 'pdf'){ //ce je pdf
if($textL){
@@ -327,7 +396,8 @@ class RadioCheckboxSelectLatex extends LatexSurveyElement
}
if($indeksZaWhile == 1&&($export_subtype=='q_empty')){
- $tex .= '& \hspace{1.2 cm} \multirow{'.$numRowsSql.'}{*}{\fbox{\parbox[t]['.$internalCellHeight.']{0.2\textwidth}{ \hphantom{\hspace{0.2\textwidth}}} } } '; //v prvi vrstici izrisi prazen okvir, ki se razpotegne skozi vse vrstice
+ $visinaOkvirja = $internalCellHeight; //$visinaOkvirja = $internalCellHeight*$numRowsSql;
+ $tex .= '& \hspace{1.2 cm} \multirow{'.$numRowsSql.'}{*}{\fbox{\parbox[t]['.$visinaOkvirja.' cm]{0.2\textwidth}{ \hphantom{\hspace{0.2\textwidth}}} } } '; //v prvi vrstici izrisi prazen okvir, ki se razpotegne skozi vse vrstice
}elseif($export_subtype=='q_empty'){
$tex .= '& '; //izrisi potrebno praznino za multirow okvir iz prve vrstice
}else{
@@ -373,22 +443,21 @@ class RadioCheckboxSelectLatex extends LatexSurveyElement
$prviOdgovorSlikovniTip = 1;
}
- }elseif($spremenljivke['orientation']==11){ //ce je VAS
- //$tex .= ' '.$symbol.' '.$this->encodeText($stringTitle, $rowVrednost['id']).' ';
+ }elseif($spremenljivke['orientation'] == 11){ //ce je VAS
if($indeksZaWhile == 1){
- if($numRowsSql<=7){ //ce je manj kot 7 slikovnih tipov, izpisemo s tabelo, drugace simbol in zraven število
- $tex .= ' '.$symbol;
+ if($numRowsSql<=7){ //ce je manj kot 7 VAS, izpisemo s tabelo, drugace simbol in zraven število
+ $tex .= ' '.$symbol[$indeksZaWhile-1];
}
}else{
- if($numRowsSql<=7){ //ce je manj kot 7 slikovnih tipov, izpisemo s tabelo, drugace simbol in zraven število
- $tex .= ' & '.$symbol;
+ if($numRowsSql<=7){ //ce je manj kot 7 VAS, izpisemo s tabelo, drugace simbol in zraven število
+ $tex .= ' & '.$symbol[$indeksZaWhile-1];
}
}
if($numRowsSql>7){
$tex .= ' ('.$indeksZaWhile.') ';
}
}else{ //ce ni urejenega izrisa naj bo default oz. navpicno
- $tex .= $symbol.' '.$this->encodeText($stringTitle, $rowVrednost['id']).' '.$texNewLine;
+ $tex .= $symbol.' '.LatexDocument::encodeText($stringTitle, $rowVrednost['id'], 0, 0, '', 1).' '.$texNewLine;
}
$oznakaOdgovora++;
@@ -407,7 +476,7 @@ class RadioCheckboxSelectLatex extends LatexSurveyElement
$tex .= ' & ('.$i.')';
}
}
- $tex .= ' \end{tabular}'; //zakljuci izris odgovorov v tabeli za "slikovni tip"
+ $tex .= ' \end{tabular}'.$texBigSkip; //zakljuci izris odgovorov v tabeli za "slikovni tip"
}
//$tex .= $texNewLine;
$tex .= $texNewLine;
@@ -415,10 +484,10 @@ class RadioCheckboxSelectLatex extends LatexSurveyElement
if($export_format == 'pdf'|| $spremenljivke['orientation']==7){ //ce je pdf
//if($spremenljivke['orientation']==7 && $export_format == 'pdf'){
if($export_format == 'pdf'){
- $tex .= '\end{tabularx}'; //za zakljuciti izrisa odgovorov v tabeli//tabularx
+ $tex .= '\end{xltabular}'; //za zakljuciti izrisa odgovorov v tabeli//tabularx
$tex .= $this->texBigSkip;
$tex .= $this->texBigSkip;
- $tex .= ' \noindent ';
+ //$tex .= ' \noindent ';
}else{
$tex .= ' \end{tabular}'; //za zakljuciti izris odgovorov v tabeli
$tex .= $texNewLine;
@@ -483,6 +552,10 @@ class RadioCheckboxSelectLatex extends LatexSurveyElement
//$tex .= '\\end{absolutelynopagebreak}'; //zakljucimo environment, da med vprasanji ne bo prelomov strani
}
+ /* $time_end = microtime(true);
+ $execution_time = ($time_end - $time_start);
+ echo '<b>Total Execution Time radio:</b> '.floatval($execution_time).' sec</br>'; */
+
return $tex;
}
} \ No newline at end of file