私はチャーター スクールで働いており、javascript の使い方を学んでいます。以前私の役職に就いていた人が書いたコードがありますが、うまくいくように思えますが、うまくいきません。
これは、SIS のカスタム HTML ページにあるものです。
GED Status: <script language="Javascript">gedCheck('~(ELC_tspp_GED_read_score)','~ (ELC_tspp_GED_wri_score)','~(ELC_tspp_math_GED_score)','~(ELC_science_state_exam_score)','~(soc_sci_state_exam_score)')</script>
JavaScriptルーチンが各値を評価して少なくとも410であることを確認しているため、さまざまなDBフィールドから値を正しく取得しているようです。
JavaScript ルーチン コードは次のとおりです。
function gedCheck(read,wri,math,sci,soc) {
if( read < 0 && read > 1000 )
read = 0;
if( wri < 0 && wri > 1000 )
wri = 0;
if( math < 0 && math > 1000 )
math = 0;
if( sci < 0 && read > 1000 )
read = 0;
if( soc < 0 && soc > 1000 )
soc = 0;
if ( (read >= 410) && (wri >= 410) && (math >= 410) && (sci >= 410) && (soc >= 410) ) {
if( read+wri+math+sci+soc >= 2250 )
document.write( "PASSED" )
}
else
document.write( "NOT PASSED" )
}
GED テストのすべてのスコアが少なくとも 410 であること、およびすべてのスコアの合計が少なくとも 2250 であることを確認することになっています。ただし、最後の部分までは進んでいません。すべてのスコアが 410 を超えると、「PASSED」が返されます。
私はこれを試しましたが、これもうまくいきません。
function gedCheck(read,wri,math,sci,soc) {
if( read < 0 && read > 1000 )
read = 0;
if( wri < 0 && wri > 1000 )
wri = 0;
if( math < 0 && math > 1000 )
math = 0;
if( sci < 0 && read > 1000 )
read = 0;
if( soc < 0 && soc > 1000 )
soc = 0;
if ( (read >= 410) && (wri >= 410) && (math >= 410) && (sci >= 410) && (soc >= 410) ) {
if( read+wri+math+sci+soc/5 >= 450 )
document.write( "PASSED" )
}
else
document.write( "NOT PASSED" )
}
誰かがこれを解決するのを手伝ってくれますか?