Latex za izvoze: Ureditev pravilnega izpisa Tabela - en odgovor: Roleta, ko je razširjen izpis odgovorov
This commit is contained in:
parent
afa70d93e4
commit
ab8096146f
@ -196,11 +196,16 @@ class LatexSurveyElement{
|
|||||||
$rowVrstic = mysqli_fetch_row($sqlVrstic);
|
$rowVrstic = mysqli_fetch_row($sqlVrstic);
|
||||||
$visina = round(($rowVrstic[0]+2) * 8);
|
$visina = round(($rowVrstic[0]+2) * 8);
|
||||||
|
|
||||||
|
//$linecount_vprasanja = $this->pdf->getNumLines($spremenljivke['naslov'], $this->pdf->getPageWidth());
|
||||||
|
|
||||||
|
//$tex = $spremenljivke['naslov'];
|
||||||
######################################### Pridobimo tekst vprasanja - konec
|
######################################### Pridobimo tekst vprasanja - konec
|
||||||
|
|
||||||
#Stevilcenje vprasanj###############################################################
|
#Stevilcenje vprasanj###############################################################
|
||||||
|
//$numberingText = ($this->numbering == 1) ? $spremenljivke['variable'].' - ' : '';
|
||||||
$numberingText = ($this->numbering == 1) ? $this->encodeText($spremenljivke['variable']).' - ' : '';
|
$numberingText = ($this->numbering == 1) ? $this->encodeText($spremenljivke['variable']).' - ' : '';
|
||||||
######################################### Stevilcenje vprasanj - konec
|
######################################### Stevilcenje vprasanj - konec
|
||||||
|
//echo "goli naslov: ".$spremenljivke['naslov']."</br>";
|
||||||
|
|
||||||
//belezenje imena spremenljivke, zaradi GDPR vprasanja
|
//belezenje imena spremenljivke, zaradi GDPR vprasanja
|
||||||
$this->variableName =$spremenljivke['variable'];
|
$this->variableName =$spremenljivke['variable'];
|
||||||
@ -219,6 +224,36 @@ class LatexSurveyElement{
|
|||||||
#Izpis if-ov pri vprasanju#########################################################
|
#Izpis if-ov pri vprasanju#########################################################
|
||||||
if($this->showIf == 1){
|
if($this->showIf == 1){
|
||||||
|
|
||||||
|
// TODO: Stara koda za iskanje po branchingu (briši, če je vse ok)
|
||||||
|
//$b = new Branching($this->anketa);
|
||||||
|
//$parents = $b->get_parents($spremenljivke['id']);
|
||||||
|
//$parents = explode('p_', $parents);
|
||||||
|
//foreach ($parents AS $key => $val) {
|
||||||
|
// if ( is_numeric(trim($val)) ) {
|
||||||
|
// $parents[$key] = (int)$val;
|
||||||
|
// } else {
|
||||||
|
// unset($parents[$key]);
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
|
/* $b = new Branching($this->anketa);
|
||||||
|
$parents = $b->get_parents($spremenljivke['id']);
|
||||||
|
$parents = explode('p_', $parents);
|
||||||
|
foreach ($parents AS $key => $val) {
|
||||||
|
if ( is_numeric(trim($val)) ) {
|
||||||
|
$parents[$key] = (int)$val;
|
||||||
|
} else {
|
||||||
|
unset($parents[$key]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($parents AS $if) {
|
||||||
|
$tex .= $this->displayIf($if);
|
||||||
|
$tex .= $this->texNewLine;
|
||||||
|
}*/
|
||||||
|
###### stara koda, ki je delavala
|
||||||
|
|
||||||
|
|
||||||
// Po novem izpisemo pred vsakim vprasanjem vse ife znotraj katerih se nahaja
|
// Po novem izpisemo pred vsakim vprasanjem vse ife znotraj katerih se nahaja
|
||||||
Cache::cache_all_srv_branching($this->anketa);
|
Cache::cache_all_srv_branching($this->anketa);
|
||||||
$parents = Cache::srv_branching($spremenljivke['id'], 0)['parent'];
|
$parents = Cache::srv_branching($spremenljivke['id'], 0)['parent'];
|
||||||
@ -231,6 +266,8 @@ class LatexSurveyElement{
|
|||||||
}
|
}
|
||||||
######################################### Izpis if-ov pri vprasanju - konec
|
######################################### Izpis if-ov pri vprasanju - konec
|
||||||
|
|
||||||
|
//$tex .= '\textbf{'.$text.'} '.$texNewLine; //izris besedila vprasanja
|
||||||
|
|
||||||
if($export_subtype=='q_data'||$export_subtype=='q_data_all'){ //ce je izpis odgovorov
|
if($export_subtype=='q_data'||$export_subtype=='q_data_all'){ //ce je izpis odgovorov
|
||||||
$text = $this->dataPiping($text); //pokazi odgovore po zanki
|
$text = $this->dataPiping($text); //pokazi odgovore po zanki
|
||||||
}
|
}
|
||||||
@ -277,8 +314,42 @@ class LatexSurveyElement{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else{ //ce je vodoravno ob vprasanju
|
####################
|
||||||
|
/* if( !in_array($spremenljivke['tip'], array(6, 16, 19, 20, 21, 7)) ){ //ce ni multigrid radio, checkbox, besedilo ali stevilo
|
||||||
|
|
||||||
|
//preveri, ce je itemize v besedilu in ustrezno uredi prazno vrstico
|
||||||
|
$findItemize = '\begin{itemize}';
|
||||||
|
$posItemize = strpos($tex, $findItemize); //v trenutni tex kodi najdi prisotnost besedila za itemize
|
||||||
|
if($posItemize === false){ //ce ni besedila itemize, dodaj prazno vrstico
|
||||||
|
//pejdi v novo vrstico
|
||||||
|
$tex .= $this->texNewLine;
|
||||||
|
}
|
||||||
|
//preveri, ce je itemize v besedilu in ustrezno uredi prazno vrstico - konec
|
||||||
|
}
|
||||||
|
|
||||||
|
if($export_subtype=='q_data'||$export_subtype=='q_data_all'){ //ce je izpis odgovorov
|
||||||
|
if( in_array($spremenljivke['tip'], array(6, 16, 19, 20, 21, 7)) ){ //ce je multigrid radio, checkbox, besedilo ali stevilo
|
||||||
|
$tex .= $this->texNewLine;
|
||||||
|
//echo "ni vodoravno ob vprašanju in je število ali besedilo </br>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//ce imamo opombo, jo izpisi
|
||||||
|
if($spremenljivke['info'] != ''){
|
||||||
|
if( in_array($spremenljivke['tip'], array(6, 16, 19, 20, 21, 7)) ){ //ce je multigrid radio, checkbox, besedilo ali stevilo
|
||||||
|
$tex .= $this->texNewLine;
|
||||||
|
echo "ni vodoravno ob vprašanju in je število ali besedilo </br>";
|
||||||
|
}
|
||||||
|
//$tex .= $this->texNewLine;
|
||||||
|
$tex .= '\vspace{2 mm}';
|
||||||
|
$tex .= ' {\indent \\footnotesize '.$this->encodeText($spremenljivke['info']).'}';
|
||||||
|
if( !in_array($spremenljivke['tip'], array(6, 16, 19, 20, 21, 7)) ){ //ce ni multigrid radio, checkbox, besedilo ali stevilo
|
||||||
|
$tex .= $this->texNewLine;
|
||||||
|
}
|
||||||
|
} */
|
||||||
|
####################
|
||||||
|
}else{ //ce je vodoravno ob vprasanju
|
||||||
//ce imamo opombo, jo izpisi
|
//ce imamo opombo, jo izpisi
|
||||||
if($spremenljivke['info'] != ''){
|
if($spremenljivke['info'] != ''){
|
||||||
//pejdi v novo vrstico
|
//pejdi v novo vrstico
|
||||||
@ -299,16 +370,14 @@ class LatexSurveyElement{
|
|||||||
#ce vprasanje nima moznih odgovorov, je potrebno zakljuciti environment (absolutelynopagebreak) pri pdf
|
#ce vprasanje nima moznih odgovorov, je potrebno zakljuciti environment (absolutelynopagebreak) pri pdf
|
||||||
//echo $rowVrstic[0]."za spremenljivko: ".$spremenljivke['tip']."</br>";
|
//echo $rowVrstic[0]."za spremenljivko: ".$spremenljivke['tip']."</br>";
|
||||||
if($rowVrstic[0]==0 && (in_array($spremenljivke['tip'], array(1, 2, 3, 6, 16, 17, 20, 9, 19, 17))) ){
|
if($rowVrstic[0]==0 && (in_array($spremenljivke['tip'], array(1, 2, 3, 6, 16, 17, 20, 9, 19, 17))) ){
|
||||||
|
if($this->export_format == 'pdf'){ //ce je pdf
|
||||||
if($this->export_format == 'pdf'){ //ce je pdf
|
|
||||||
if($spremenljivke['orientation']==0 || $spremenljivke['orientation']==2){ //ce sta vodoravni orientaciji
|
if($spremenljivke['orientation']==0 || $spremenljivke['orientation']==2){ //ce sta vodoravni orientaciji
|
||||||
$tex .= $this->texNewLine; //dodaj na koncu vprasanja prazno vrstico
|
$tex .= $this->texNewLine; //dodaj na koncu vprasanja prazno vrstico
|
||||||
}
|
}
|
||||||
$tex .= $this->texBigSkip;
|
$tex .= $this->texBigSkip;
|
||||||
$tex .= $this->texBigSkip;
|
$tex .= $this->texBigSkip;
|
||||||
$tex .= '\\end{absolutelynopagebreak}'; //zakljucimo environment, da med vprasanji ne bo prelomov strani
|
$tex .= '\\end{absolutelynopagebreak}'; //zakljucimo environment, da med vprasanji ne bo prelomov strani
|
||||||
}
|
}else{ //ce je rtf
|
||||||
else{ //ce je rtf
|
|
||||||
if($spremenljivke['orientation']==0 || $spremenljivke['orientation']==2){ //ce sta vodoravni orientaciji
|
if($spremenljivke['orientation']==0 || $spremenljivke['orientation']==2){ //ce sta vodoravni orientaciji
|
||||||
$tex .= $this->texNewLine; //dodaj na koncu vprasanja prazno vrstico
|
$tex .= $this->texNewLine; //dodaj na koncu vprasanja prazno vrstico
|
||||||
}
|
}
|
||||||
@ -318,7 +387,7 @@ class LatexSurveyElement{
|
|||||||
}
|
}
|
||||||
#ce vprasanje nima moznih odgovorov, je potrebno zakljuciti environment (absolutelynopagebreak) pri pdf - konec
|
#ce vprasanje nima moznih odgovorov, je potrebno zakljuciti environment (absolutelynopagebreak) pri pdf - konec
|
||||||
}
|
}
|
||||||
|
//echo "tex: ".$tex."</br>";
|
||||||
return $tex;
|
return $tex;
|
||||||
}
|
}
|
||||||
#funkcija, ki pripravi latex kodo za prikazovanje besedila vprasanja - konec ############################################################################
|
#funkcija, ki pripravi latex kodo za prikazovanje besedila vprasanja - konec ############################################################################
|
||||||
|
Loading…
x
Reference in New Issue
Block a user