flexi: mit Mozilla klappts, mit dem IExplorer nicht

Beitrag lesen

Hier der JavaScript Teil:

var Faecher = new Array("Deutsch", "Englisch", "Latein", "Kunst", "Musik","Gemeinschaftskunde","Erdkunde", "Geschichte", "Wirtschaft", "Philosophie", "Religion","Mathematik","Biologie","Chemie","Physik", "Informatik","Sport", "andere Kurse1", "andere Kurse2");

function GetValue(id)
{
 var Value = '';
 if (document.getElementById)
 {
  Value = document.getElementById(id).value;
 }
 else if (document.all)
 {
  Value = id.value;
 }

return Value
}

function Prueffach(i)
{
 if (GetValue('APMP') == Faecher[i])
  return true;
 if (GetValue('APSP') == Faecher[i])
  return true;
      return false;
}

function Leistungsfach(i)
{
 if (GetValue('LK1') == Faecher[i])
  return true;
 if (GetValue('LK2') == Faecher[i])
  return true;

Text = GetValue('LK1') ;
 if (document.getElementById)
  document.getElementById("lkname").innerHTML = Text
 else if (document.all)
  lkname.innerHTML = Text;

Text = GetValue('LK2') ;
 if (document.getElementById)
  document.getElementById("lk2name").innerHTML = Text
 else if (document.all)
  lk2name.innerHTML = Text;

return false;
}

function WriteAndereFaecher()
{

var Text = '<table width="98%" border=0 align="center"><tr bgcolor=green><th colspan="2" width="250">Fach</th><th>Semester 1</th><th>Semester 2</th><th>Semester 3</th><th>Semester 4</th></tr>';
       for (i=0; i<Faecher.length; i++)
 {
  // Ausgabe des Fachnames
  Text = Text + '<tr><td colspan="2" style="background-color:green; color:white">' + Faecher[i] + '</td>';

// Ausgabe von 4 Semesterangaben
  if (!Leistungsfach(i) && !Prueffach(i))
   for (Semester=1; Semester<=4; Semester++)
    Text = Text + '<td align=center><INPUT id="GK' + i + '_S' + Semester + '" type="text" size="2" value="0"></td>';
            if (Prueffach(i) && !Leistungsfach(i))
   for (Semester=5; Semester<=7; Semester++)
    Text = Text + '<td style="background-color:antiquewhite"  align=center><INPUT id="GK' + i + '_S' + Semester + '" type="text" size="2" value="0"></td>';

// Schließe die tr ab
  Text = Text + '</tr>';
 }
 Text = Text + '</table>';

if (document.getElementById)
  document.getElementById("AndereFaecher").innerHTML = Text
 else if (document.all)
  AndereFaecher.innerHTML = Text;

}

function Berechnen()
{
 // Die minimale Punktzahl, die man bei den LK's haben sollte

var LKPunkte = 0;
 var GKPunkte = 0;
 var PunkteGesamt = 0;
 var DNote = 0.0; // Durchschnittsnote
          var ZPunkte = 0;
          var XPunkte = 0;

LKPunkte = 2*(parseInt(GetValue('LK1_S1')) + parseInt(GetValue('LK1_S2')) + parseInt(GetValue('LK1_S3'))) + parseInt(GetValue('LK1_S4')) +
   2*(parseInt(GetValue('LK2_S1')) + parseInt(GetValue('LK2_S2')) + parseInt(GetValue('LK2_S3'))) + parseInt(GetValue('LK2_S4'));

for (i=0; i<Faecher.length; i++)
 {
  if (Prueffach(i))
   for (j=5; j<=7; j++)
  {
   XPunkte += parseInt(GetValue('GK'+i+'_S'+j));
  }
        }

for (i=0; i<Faecher.length; i++)
 {
  if (Leistungsfach(i))
   continue;
                if (Prueffach(i))
   continue;

for (j=1; j<=4; j++)
  {
   ZPunkte += parseInt(GetValue('GK'+i+'_S'+j));
  }
        }

APPunkte = 4*(parseInt(GetValue('APLK1_AP'))) + parseInt(GetValue('APLK1_S4')) +
   4*(parseInt(GetValue('APLK2_AP'))) + parseInt(GetValue('APLK2_S4')) +
             4*(parseInt(GetValue('APSP_AP'))) + parseInt(GetValue('APSP_S4')) +
             4*(parseInt(GetValue('APMP_AP'))) + parseInt(GetValue('APSP_S4'));

GKPunkte = ZPunkte + XPunkte;
 PunkteGesamt = LKPunkte + GKPunkte + APPunkte;

if (LKPunkte < 70)
           alert ("Unzureichende LK Punktzahl");
      if (PunkteGesamt < 280)
           alert ("Unzureichende Gesamtpunktzahl");
      if (APPunkte < 100)
           alert ("Unzureichende Abiturteil Punktzahl");

// Berechne die DNote
 DNote = 0.0;
 if (PunkteGesamt > 279)
  DNote = 4.0;
        if (PunkteGesamt > 280)
  DNote = 3.9;
 if (PunkteGesamt > 296)
  DNote = 3.8;
 if (PunkteGesamt > 313)
  DNote = 3.7;
 if (PunkteGesamt > 330)
  DNote = 3.6;
 if (PunkteGesamt > 347)
  DNote = 3.5;
 if (PunkteGesamt > 364)
  DNote = 3.4;
 if (PunkteGesamt > 380)
  DNote = 3.3;
 if (PunkteGesamt > 397)
  DNote = 3.2;
 if (PunkteGesamt > 414)
  DNote = 3.1;
 if (PunkteGesamt > 431)
  DNote = 3.0;
 if (PunkteGesamt > 448)
  DNote = 2.9;
 if (PunkteGesamt > 464)
  DNote = 2.8;
 if (PunkteGesamt > 481)
  DNote = 2.7;
 if (PunkteGesamt > 498)
  DNote = 2.6;
 if (PunkteGesamt > 515)
  DNote = 2.5;
 if (PunkteGesamt > 532)
  DNote = 2.4;
 if (PunkteGesamt > 548)
  DNote = 2.3;
 if (PunkteGesamt > 565)
  DNote = 2.2;
 if (PunkteGesamt > 582)
  DNote = 2.1;
 if (PunkteGesamt > 599)
  DNote = 2.0;
 if (PunkteGesamt > 616)
  DNote = 1.9;
 if (PunkteGesamt > 632)
  DNote = 1.8;
 if (PunkteGesamt > 649)
  DNote = 1.7;
 if (PunkteGesamt > 666)
  DNote = 1.6;
 if (PunkteGesamt > 683)
  DNote = 1.5;
 if (PunkteGesamt > 700)
  DNote = 1.4;
 if (PunkteGesamt > 716)
  DNote = 1.3;
 if (PunkteGesamt > 733)
  DNote = 1.2;
 if (PunkteGesamt > 750)
  DNote = 1.1;
 if (PunkteGesamt > 767)
  DNote = 1.0;
      if (PunkteGesamt > 840)
  DNote = 'Fehler ';

Text = 'LK-Punkte: ' + LKPunkte;
 if (document.getElementById)
  document.getElementById("LK_Punkte").innerHTML = Text
 else if (document.all)
  LK_Punkte.innerHTML = Text;

Text = 'Abitur-Punkte: ' + APPunkte;
 if (document.getElementById)
  document.getElementById("AP_Punkte").innerHTML = Text
 else if (document.all)
  AP_Punkte.innerHTML = Text;

Text = 'GK-Punkte: ' + GKPunkte;
 if (document.getElementById)
  document.getElementById("GK_Punkte").innerHTML = Text
 else if (document.all)
  GK_Punkte.innerHTML = Text;

Text = 'Gesamtpunkte: ' + PunkteGesamt + ', <b style="color:blue">Durchschnittsnote:</b> ' + DNote + '<hr>';
 if (document.getElementById)
  document.getElementById("Punkte").innerHTML = Text
 else if (document.all)
  Punkte.innerHTML = Text;

}