Browse Source

sp und ba

burningTyger 6 years ago
parent
commit
c1c0cd78bf
1 changed files with 6 additions and 3 deletions
  1. 6 3
      views/vornoten_abi_ba.slim

+ 6 - 3
views/vornoten_abi_ba.slim

@@ -17,7 +17,7 @@ link href=url("/css/print_a4_landscape.css") rel="stylesheet" media="all"
           .voffset-1
           -schueler_slice.each_with_index do |s,i|
             -array=[]
-            -array << ["", "13.1", "13.2", "VN", "SP", "MP", "BA"]
+            -array << ["", "13.1", "13.2", "VN", "SP", "BA"]
             -s.abi_abschluss_leistungen.sort_by{|f|f.f_sortierung}.each do |n|
               -if n.fach.fachgruppe_id == 30 || n.fach_id == 126
                 -Presenters::Warnung.add("Dokument", "Fachgruppe 30 (Diffbereich)/FR übersprungen")
@@ -28,8 +28,11 @@ link href=url("/css/print_a4_landscape.css") rel="stylesheet" media="all"
               -inner_array << NotenHelfer.note_aus_punkten(n.p13_1) || ""
               -inner_array << NotenHelfer.note_aus_punkten(n.p13_2) || ""
               -anzahl_noten = [n.p13_1, n.p13_2].reject{ |n| n.to_i == 0 }.count
-              -inner_array << ((n.p13_1.to_i+n.p13_2.to_i == 0) ? "" : NotenHelfer.note_aus_punkten(((n.p13_1.to_f + n.p13_2.to_f)/anzahl_noten).round).to_i)
-              -inner_array << "" << "" << ""
+              -vornote = ((n.p13_1.to_i+n.p13_2.to_i == 0) ? "" : NotenHelfer.note_aus_punkten(((n.p13_1.to_f + n.p13_2.to_f)/anzahl_noten).round).to_i)
+              -inner_array << vornote
+              -inner_array << (NotenHelfer.note_aus_punkten(n.abi_pruef_ergebnis) if %w(1 2 3).any?(n.abi_fach))
+              / -inner_array << (%w(1 2 3).any?(n.abi_fach) ? vornote : vornote)
+              -inner_array << (%w(1 2 3).any?(n.abi_fach) ? NotenHelfer.note_aus_punkten(((NotenHelfer.punkte_aus_note(vornote.to_s) + n.abi_pruef_ergebnis)/2).round.to_i) : vornote)
               -array << inner_array
             -array = array.transpose
             -faecher = array.shift