Notenberechnung: Unterschied zwischen den Versionen

Aus Fachschaft_Informatik
Zur Navigation springen Zur Suche springen
(→‎Implementierung: Pythonimplementation hinzugefuegt)
Zeile 52: Zeile 52:


=== Implementierung ===
=== Implementierung ===
==== Perl ====
<code>
<code>
  #!/usr/bin/perl
  #!/usr/bin/perl
Zeile 76: Zeile 77:
  print "$endnote (".('ausgezeichnet','sehr gut','gut','befriedigend','ausreichend')[int((int((int($endnote * 10) - 6) / 5) * 3 + 4) / 5)].")\n";
  print "$endnote (".('ausgezeichnet','sehr gut','gut','befriedigend','ausreichend')[int((int((int($endnote * 10) - 6) / 5) * 3 + 4) / 5)].")\n";
</code>
</code>
==== Python ====
<pre>
#!/usr/bin/env python
# Copyright: 2011 Tobias Mueller <4tmuelle@informatik.uni-hamburg.de>
# License: GPLv3+
import math
def gerundeter_schnitt(*noten):
    schnitt = (1.0 * sum(noten)/len(noten))
    gerundet = int(math.floor(schnitt * 10))
    return gerundet/10.0
def get_dipl_noten_text(dipl_note):
    translations = (
    (1.0, 1.0, "Ausgezeichnet"),
    (1.1, 1.5, "Sehr Gut"),
    (1.6, 2.5, "Gut"),
    (2.6, 3.5, "Befriedigend"),
    (3.6, 4.0, "Ausreichend"),
    )
   
    for upper, lower, text in translations:
        if upper <= dipl_note <= lower:
            return text
    raise RuntimeError("Couldn't translate note %s with %s", dipl_note, translations)
def diplomnote(a, p, t, th1, th2, th3, sp, ef, dipl):
    theorie = gerundeter_schnitt (th1, th2, th3)
    theorie_msg=r'''
    Th1: %2.1f    \
    Th2: %2.1f    = %2.1f
    Th3: %2.1f    /
    ''' % (th1, th2, theorie, th3)
    print theorie_msg
   
    gris    = gerundeter_schnitt (a, p, t)
    gris_msg=r'''
    A  : %2.1f    \
    P  : %2.1f    = %2.1f
    T  : %2.1f    /
    ''' % (a,p, gris, t)
    print gris_msg
    dipl_note = gerundeter_schnitt (theorie, gris, sp, ef, dipl)
    dipl_noten_text = get_dipl_noten_text(dipl_note)
    rest_msg=r'''
    Nebenfach:    %2.1f
    Schwerpunkt:  %2.1f
    Diplomarbeit:  %2.1f
    ====================
    Gesamt:        %2.1f %s
    ''' % (ef, sp, dipl, dipl_note, dipl_noten_text)
    print rest_msg
       
    return dipl_note
if __name__ == '__main__':
    import sys
    noten = [float(arg) for arg in sys.argv[1:]]
    a, p, t, th1, th2, th3, sp, ef, dipl = noten
    print diplomnote(*noten)
</pre>


== Bachelor ==
== Bachelor ==

Version vom 27. Oktober 2011, 18:30 Uhr

Diplom

Beschreibung

Für Diplomer berechnet sich die Endnote wie folgt:

Es gibt insgesamt 5 Prüfungen, die zu gleichen Teilen in die Endnote einfließen:

  • Grundlagen von Informatik-Systemen
  • Theoretische Informatik
  • Schwerpunkt
  • Ergänzungsfach
  • Diplomarbeit

Um die Note in einer dieser Prüfungen zu ermitteln, wird aus den ungerundeten Noten der jeweiligen Teilprüfungen das arithmetische Mittel gebildet und nach der ersten Nachkommastelle abgeschnitten (abgerundet). Dasselbe Verfahren kommt für die Berechnung der Endnote zur Anwendung.

Beispiel

  • Grundlagen von Informatiksystemen
    • Technische Informatik - DKR - 2.3
    • Angewandte Informatik - CGB - 2.0
    • Praktische Informatik - SNN - 3.7
    • Mittelwert ist 8.0/3 = 2.6666666 = 2.6
  • Theoretische Informatik
    • LOS - 1.7
    • AUK - 2.3
    • PNL - 1.7
    • Mittelwert ist 5.7/3 = 1.90000 = 1.9
  • Schwerpunkt
    • Prüfung - 2.3
    • Mittelwert ist 2.3/1 = 2.30000 = 2.3
  • Ergänzungsfach
    • 1. Prüfung = 4.0
    • 2. Prüfung = 2.3
    • Mittelwert ist 6.3/2 = 3.15000 = 3.1
  • Diplomarbeit
    • Erstgutachter - 1.7
    • Zweitgutachter - 2.0
    • Mittelwert ist 3.7/2 = 1.85000 = 1.8
  • Endnote (2.6 + 1.9 + 2.3 + 3.1 + 1.8) / 5 = 11.7/5 = 2.34000 = 2.3

Textform

Am Ende wird diese numerische Endnote noch in Textform übersetzt:

  • 1.0 bis 1.0 - ausgezeichnet
  • 1.1 bis 1.5 - sehr gut
  • 1.6 bis 2.5 - gut
  • 2.6 bis 3.5 - befriedigend
  • 3.6 bis 4.0 - ausreichend


Implementierung

Perl

#!/usr/bin/perl

sub mittel {
  my $note = 0;
  my $n = 0;
  foreach my $teilnote (@_) {
    $note += $teilnote;
    $n += 1;
  }
  $note = int($note * 10 / $n) / 10;
  return $note;
}

my $endnote = mittel(
  mittel(2.3, 2.0, 3.7),
  mittel(1.7, 2.3, 1.7),
  mittel(2.3),
  mittel(4.0, 2.3),
  mittel(1.7, 2.0)
);

print "$endnote (".('ausgezeichnet','sehr gut','gut','befriedigend','ausreichend')[int((int((int($endnote * 10) - 6) / 5) * 3 + 4) / 5)].")\n";

Python

#!/usr/bin/env python
# Copyright: 2011 Tobias Mueller <4tmuelle@informatik.uni-hamburg.de>
# License: GPLv3+
import math

def gerundeter_schnitt(*noten):
    schnitt = (1.0 * sum(noten)/len(noten))
    gerundet = int(math.floor(schnitt * 10))
    return gerundet/10.0

def get_dipl_noten_text(dipl_note):
    translations = (
     (1.0, 1.0, "Ausgezeichnet"),
     (1.1, 1.5, "Sehr Gut"),
     (1.6, 2.5, "Gut"),
     (2.6, 3.5, "Befriedigend"),
     (3.6, 4.0, "Ausreichend"),
    )
    
    for upper, lower, text in translations:
        if upper <= dipl_note <= lower:
            return text
    raise RuntimeError("Couldn't translate note %s with %s", dipl_note, translations)

def diplomnote(a, p, t, th1, th2, th3, sp, ef, dipl):
    theorie = gerundeter_schnitt (th1, th2, th3)
    theorie_msg=r'''
    Th1: %2.1f    \
    Th2: %2.1f     = %2.1f
    Th3: %2.1f    /
    ''' % (th1, th2, theorie, th3)
    print theorie_msg
    
    gris    = gerundeter_schnitt (a, p, t)
    gris_msg=r'''
    A  : %2.1f    \
    P  : %2.1f     = %2.1f
    T  : %2.1f    /
    ''' % (a,p, gris, t)
    print gris_msg

    dipl_note = gerundeter_schnitt (theorie, gris, sp, ef, dipl)
    dipl_noten_text = get_dipl_noten_text(dipl_note)
    rest_msg=r'''
    Nebenfach:     %2.1f
    Schwerpunkt:   %2.1f
    Diplomarbeit:  %2.1f
    ====================
    Gesamt:        %2.1f %s
    ''' % (ef, sp, dipl, dipl_note, dipl_noten_text)
    print rest_msg
        
    return dipl_note

if __name__ == '__main__':
    import sys
    noten = [float(arg) for arg in sys.argv[1:]]
    a, p, t, th1, th2, th3, sp, ef, dipl = noten
    print diplomnote(*noten)

Bachelor

Beschreibung

FIXME!

Beispiel

FIXME!

Implementierung