diff --git a/classes/progress.class.php b/classes/progress.class.php index 54e96c6..2d59f58 100755 --- a/classes/progress.class.php +++ b/classes/progress.class.php @@ -25,16 +25,16 @@ class Progress } function setLp_id($lp_id){ - $this->lp_id=$lp_id; + $this->lp_id=$lp_id; } - function setData($value){ - $this->progress=$value; - } + function setData($value){ + $this->progress=$value; + } function getProgress(){ - $sql= "SELECT lp_id,date,number,correct,wrong, passed FROM learnprogress WHERE user_id='".mysql_real_escape_string($_SESSION['profile']['id'])."' AND t_id='".mysql_real_escape_string($this->topic)."' AND root ='".mysql_real_escape_string($_SESSION['profile']['root'])."' order by date"; - $query = mysql_query($sql) OR die(mysql_error()); - $i=1; + $sql= "SELECT lp_id,date,number,correct,wrong, passed FROM learnprogress WHERE user_id='".mysql_real_escape_string($_SESSION['profile']['id'])."' AND t_id='".mysql_real_escape_string($this->topic)."' AND root ='".mysql_real_escape_string($_SESSION['profile']['root'])."' order by date"; + $query = mysql_query($sql) OR die(mysql_error()); + $i=1; while($progress =mysql_fetch_array($query,MYSQL_BOTH )){ $this->progress[$i]['lp_id']=$progress['lp_id']; $this->progress[$i]['date']=$progress['date']; @@ -48,8 +48,8 @@ class Progress } function count() { - $numberOfTests=count($this->progress); - return $numberOfTests; + $numberOfTests=count($this->progress); + return $numberOfTests; } function showTable() { @@ -67,55 +67,55 @@ class Progress echo"
$i.) | "; - $sql="SELECT question,qt_id FROM questions WHERE q_id=".intval($this->incorrect_answers[$i]['q_id']).""; - $query = mysql_query($sql); - while($question =mysql_fetch_array($query,MYSQL_BOTH )) { + echo "$i.) | "; + $sql="SELECT question,qt_id FROM questions WHERE q_id=".intval($this->incorrect_answers[$i]['q_id']).""; + $query = mysql_query($sql); + while($question =mysql_fetch_array($query,MYSQL_BOTH )) { if( $question['qt_id']==4){ - $questionText=$this->getFIBQuestion( $question['question']); + $questionText=$this->getFIBQuestion( $question['question']); - echo"".$questionText." | "; + echo"".$questionText." | "; - } - else{ + } else { echo "". $question['question']." | "; - } } - echo"
"; - echo" | ".Class_Progress_06." $number ".Class_Progress_07." | "; - echo"|||
"; + echo" | ".Class_Progress_06." $number ".Class_Progress_07." | "; + echo"|||
"; echo" | "; @@ -205,23 +204,22 @@ class Progress } function getFIBQuestion($question){ - $addSlashes= preg_quote( $question, '[^]'); // Slash hinzufügen wenn KLammer gefunden wird - $array=explode('\\',$addSlashes); // String teilen - $questionText= $question; - if(substr_count($question,"[")==substr_count($question,"]")) { // gleiche anzahl von Klammer auf und zu - for($i=1;$i<=substr_count($question,"[");$i++){ // Wird solange durchlaufne wie Klammern vorhanden sind - $beginPos = strpos($questionText, "["); // Anfangspunkt festlegen - $endPos=strpos($questionText, "]"); // Endpunkt festlegen - $length=(($endPos+1)-$beginPos) ; // Länge der Strings ermitteln - $answer=substr ($questionText,$beginPos,$length );// den String zwischen den Klammern suchen - $questionText=str_replace($answer,'(xxx)', $questionText); // gespeicherten Wert aus string löschen - $answer=str_replace("]",'', $answer); // Klammer entfernen - $key = array_search($answer, $array); - $answer=str_replace("[",'', $answer); // Klammer entfernen - - } - } - return $questionText; + $addSlashes= preg_quote( $question, '[^]'); // Slash hinzufügen wenn KLammer gefunden wird + $array=explode('\\',$addSlashes); // String teilen + $questionText= $question; + if(substr_count($question,"[")==substr_count($question,"]")) { // gleiche anzahl von Klammer auf und zu + for($i=1;$i<=substr_count($question,"[");$i++){ // Wird solange durchlaufne wie Klammern vorhanden sind + $beginPos = strpos($questionText, "["); // Anfangspunkt festlegen + $endPos=strpos($questionText, "]"); // Endpunkt festlegen + $length=(($endPos+1)-$beginPos) ; // Länge der Strings ermitteln + $answer=substr ($questionText,$beginPos,$length );// den String zwischen den Klammern suchen + $questionText=str_replace($answer,'(xxx)', $questionText); // gespeicherten Wert aus string löschen + $answer=str_replace("]",'', $answer); // Klammer entfernen + $key = array_search($answer, $array); + $answer=str_replace("[",'', $answer); // Klammer entfernen + } + } + return $questionText; } function getPassedImage($passed){ |