- Updated pruefling - getReihungstestPerson method to calculate RT results with new formula

- added offsetpoints to testtool.vw_auswertung_ablauf and vw_auswertung
This commit is contained in:
alex
2020-01-13 18:11:13 +01:00
parent 59b6909239
commit db50f6c856
2 changed files with 121 additions and 5 deletions
+9 -5
View File
@@ -446,6 +446,8 @@ class pruefling extends basis_db
if($this->db_num_rows($result)==0)
return false;
$summeGewicht = 0;
while($row = $this->db_fetch_object($result))
{
//wenn maxpunkte ueberschritten wurde -> 100%
@@ -455,17 +457,19 @@ class pruefling extends basis_db
$row->punkte = $row->maxpunkte;
}
else
$prozent = ($row->punkte/$row->maxpunkte)*100;
$prozent = (($row->punkte + $row->offsetpunkte)/($row->maxpunkte + $row->offsetpunkte))*100;
if($punkte)
{
$ergebnis +=$row->punkte;
$ergebnis += $row->punkte;
}
else
$ergebnis+=$prozent*$row->gewicht;
{
$ergebnis += $prozent * $row->gewicht;
$summeGewicht += $row->gewicht;
}
}
return $ergebnis;
return $summeGewicht > 0 ? $ergebnis/$summeGewicht : $ergebnis;
}
else
{