File:  [LON-CAPA] / capa / capa51 / JavaTools / tscore.backup.java
Revision 1.3: download - view: text, annotated - select for diffs
Mon Aug 7 20:47:29 2000 UTC (23 years, 9 months ago) by albertel
Branches: MAIN
CVS tags: version_2_9_X, version_2_9_99_0, version_2_9_1, version_2_9_0, version_2_8_X, version_2_8_99_1, version_2_8_99_0, version_2_8_2, version_2_8_1, version_2_8_0, version_2_7_X, version_2_7_99_1, version_2_7_99_0, version_2_7_1, version_2_7_0, version_2_6_X, version_2_6_99_1, version_2_6_99_0, version_2_6_3, version_2_6_2, version_2_6_1, version_2_6_0, version_2_5_X, version_2_5_99_1, version_2_5_99_0, version_2_5_2, version_2_5_1, version_2_5_0, version_2_4_X, version_2_4_99_0, version_2_4_2, version_2_4_1, version_2_4_0, version_2_3_X, version_2_3_99_0, version_2_3_2, version_2_3_1, version_2_3_0, version_2_2_X, version_2_2_99_1, version_2_2_99_0, version_2_2_2, version_2_2_1, version_2_2_0, version_2_1_X, version_2_1_99_3, version_2_1_99_2, version_2_1_99_1, version_2_1_99_0, version_2_1_3, version_2_1_2, version_2_1_1, version_2_1_0, version_2_12_X, version_2_11_X, version_2_11_4_uiuc, version_2_11_4_msu, version_2_11_4, version_2_11_3_uiuc, version_2_11_3_msu, version_2_11_3, version_2_11_2_uiuc, version_2_11_2_msu, version_2_11_2_educog, version_2_11_2, version_2_11_1, version_2_11_0_RC3, version_2_11_0_RC2, version_2_11_0_RC1, version_2_11_0, version_2_10_X, version_2_10_1, version_2_10_0_RC2, version_2_10_0_RC1, version_2_10_0, version_2_0_X, version_2_0_99_1, version_2_0_2, version_2_0_1, version_2_0_0, version_1_99_3, version_1_99_2, version_1_99_1_tmcc, version_1_99_1, version_1_99_0_tmcc, version_1_99_0, version_1_3_X, version_1_3_3, version_1_3_2, version_1_3_1, version_1_3_0, version_1_2_X, version_1_2_99_1, version_1_2_99_0, version_1_2_1, version_1_2_0, version_1_1_X, version_1_1_99_5, version_1_1_99_4, version_1_1_99_3, version_1_1_99_2, version_1_1_99_1, version_1_1_99_0, version_1_1_3, version_1_1_2, version_1_1_1, version_1_1_0, version_1_0_99_3, version_1_0_99_2, version_1_0_99_1, version_1_0_99, version_1_0_3, version_1_0_2, version_1_0_1, version_1_0_0, version_0_99_5, version_0_99_4, version_0_99_3, version_0_99_2, version_0_99_1, version_0_99_0, version_0_6_2, version_0_6, version_0_5_1, version_0_5, version_0_4, stable_2002_spring, stable_2002_july, stable_2002_april, stable_2001_fall, release_5-1-3, loncapaMITrelate_1, language_hyphenation_merge, language_hyphenation, conference_2003, bz6209-base, bz6209, STABLE, HEAD, GCI_3, GCI_2, GCI_1, CAPA_5-1-6, CAPA_5-1-5, CAPA_5-1-4_RC1, BZ4492-merge, BZ4492-feature_horizontal_radioresponse, BZ4492-feature_Support_horizontal_radioresponse, BZ4492-Support_horizontal_radioresponse
- fixed license notices the reference the GNU GPL rather than the GNU LGPL

    1: 
    2: /* ====================================================
    3:    created by Isaac Tsai, 1999
    4:    old score extraplolator widget
    5:    Copyright (C) 1992-2000 Michigan State University
    6: 
    7:    The CAPA system is free software; you can redistribute it and/or
    8:    modify it under the terms of the GNU General Public License as
    9:    published by the Free Software Foundation; either version 2 of the
   10:    License, or (at your option) any later version.
   11: 
   12:    The CAPA system is distributed in the hope that it will be useful,
   13:    but WITHOUT ANY WARRANTY; without even the implied warranty of
   14:    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   15:    General Public License for more details.
   16: 
   17:    You should have received a copy of the GNU General Public
   18:    License along with the CAPA system; see the file COPYING.  If not,
   19:    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   20:    Boston, MA 02111-1307, USA.
   21: 
   22:    As a special exception, you have permission to link this program
   23:    with the TtH/TtM library and distribute executables, as long as you
   24:    follow the requirements of the GNU GPL in regard to all of the
   25:    software in the executable aside from TtH/TtM.
   26: */
   27: 
   28: <CENTER>
   29: 
   30: <APPLET CODE=Tscore.class CODEBASE=JAVA/Class width=550 height=304>
   31: <PARAM NAME="HW_W"  VALUE="0.3">  <!- Weight for Homework assignments -!>
   32: <PARAM NAME="QZ_W"  VALUE="0.07"> <!- Weight for Quizzes -!>
   33: <PARAM NAME="EX_W"  VALUE="0.3">  <!- Weight for examinations and makeups -!>
   34: <PARAM NAME="FE_W"  VALUE="0.35"> <!- Weight for final examination -!>
   35: <PARAM NAME="PC_W"  VALUE="0.3">  <!- Makeup exam discount factor -!>
   36: <PARAM NAME="HW_S"  VALUE="">  <!- Homework scores so far -!>
   37: <PARAM NAME="HW_C"  VALUE="">  <!- Number of sets contributed to Homework score -!>
   38: <PARAM NAME="HW_R"  VALUE="">  <!- Number of sets to be extrapolated -!>
   39: <PARAM NAME="QZ_S"  VALUE="">  <!- Quizz scores so far -!>
   40: <PARAM NAME="QZ_C"  VALUE="">  <!- Number of sets contributed to Quiz score -!>
   41: <PARAM NAME="QZ_R"  VALUE="">  <!- Number of sets to be extrapolated -!>
   42: <PARAM NAME="EX_S"  VALUE="">  <!- Exam scores so far (exclude exam4, which is final exam) -!>
   43: <PARAM NAME="EX_C"  VALUE="">  <!- Number of sets contributed to exam score (must be between 1 to 3) -!>
   44: <PARAM NAME="EX_R"  VALUE="">  <!- Number of sets to be extrapolated -!>
   45: <PARAM NAME="FE_S"  VALUE="">  <!- Final exam score -!>
   46: <PARAM NAME="FE_X"  VALUE="">
   47: </APPLET>
   48: 
   49: </CENTER>
   50: <APPLET
   51:             [CODEBASE = codebaseURL]
   52:             CODE = appletFile 
   53:             [ALT = alternateText]
   54:             [NAME = appletInstanceName]
   55:             WIDTH = pixels
   56:             HEIGHT = pixels 
   57:             [ALIGN = alignment]
   58:             [VSPACE = pixels]
   59:             [HSPACE = pixels]
   60:         >
   61:         [< PARAM NAME = appletParameter1 VALUE = value >]
   62:         [< PARAM NAME = appletParameter2 VALUE = value >]
   63:         . . .
   64:         [alternateHTML]
   65:         </APPLET>
   66: 
   67: */
   68: 
   69: import java.applet.*;
   70: import java.awt.*;
   71: import java.lang.*;
   72: import java.util.*;
   73: import java.net.*;
   74: 
   75: public class Tscore extends Applet implements Runnable
   76: {
   77: 
   78:  public float   hw_w;
   79:  public float   qz_w;
   80:  public float   ex_w;
   81:  public float   fe_w;
   82:  public float   hw_s;
   83:  public int     hw_c;
   84:  public int     hw_r;
   85:  public float   qz_s;
   86:  public int     qz_c;
   87:  public int     qz_r;
   88:  public float   ex_s;
   89:  public int     ex_c;
   90:  public int     ex_r;
   91:  public float   fe_s;
   92:  public float   fe_x;
   93:  
   94:  public float   hw_ext;
   95:  public float   qz_ext;
   96:  public float   ex_ext;
   97:  public float   fe_ext;
   98:  public float   term_score;
   99: 
  100: public void init()
  101:  {
  102:    String   p, q;
  103: 
  104:    
  105:    p=getParameter("HW_W");
  106:    hw_w=(p==null)?1:Float.valueOf(p).floatValue();
  107:    p=getParameter("QZ_W");
  108:    qz_w=(p==null)?1:Float.valueOf(p).floatValue();
  109:    p=getParameter("EX_W");
  110:    ex_w=(p==null)?1:Float.valueOf(p).floatValue();
  111:    p=getParameter("FE_W");
  112:    fe_w=(p==null)?1:Float.valueOf(p).floatValue();
  113:    p=getParameter("PC_W");
  114:    pc_w=(p==null)?1:Float.valueOf(p).floatValue();
  115:    
  116:    p=getParameter("HW_C");
  117:    hw_c=(p==null)?1:Integer.valueOf(p).intValue();
  118:    p=getParameter("HW_S");
  119:    hw_s=(p==null)?1:Float.valueOf(p).floatValue();
  120:    p=getParameter("HW_R");
  121:    hw_r=(p==null)?1:Integer.valueOf(p).intValue();
  122:    
  123:    p=getParameter("QZ_C");
  124:    qz_c=(p==null)?1:Integer.valueOf(p).intValue();
  125:    p=getParameter("QZ_S");
  126:    qz_s=(p==null)?1:Float.valueOf(p).floatValue();
  127:    p=getParameter("QZ_R");
  128:    qz_r=(p==null)?1:Integer.valueOf(p).intValue();
  129:    
  130:    p=getParameter("EX_C");
  131:    ex_c=(p==null)?1:Integer.valueOf(p).intValue();
  132:    p=getParameter("EX_S");
  133:    ex_s=(p==null)?1:Float.valueOf(p).floatValue();
  134:    p=getParameter("EX_R");
  135:    ex_r=(p==null)?1:Integer.valueOf(p).intValue();
  136:    
  137:    p=getParameter("FE_S");
  138:    fe_s=(p==null)?1:Float.valueOf(p).floatValue();
  139:    p=getParameter("FE_X");
  140:    fe_x=(p==null)?1:Integer.valueOf(p).intValue();
  141: 
  142:  }
  143:  
  144: public void paint(Graphics g)
  145:  {
  146:    int        idx; 
  147:    Dimension  d = size();
  148:    int        appw = d.width;
  149:    int        apph = d.height;
  150:    int        x1,y1,x2,y2;
  151:    
  152:     g.setFont(f16);
  153:     if( img != null ) {
  154:        g.drawImage(img, 0, 0, this);
  155:     } else {
  156:        g.setColor(Color.white);
  157:        g.fillRect(0, 0, appw, apph);
  158:     }
  159:     g.setColor(Color.black);
  160:     for(idx=0;idx<label_cnt;idx++){
  161:       g.drawString(sLabel[idx],Xcord[idx],Ycord[idx]);
  162:     }
  163:     if((show_grid == 1) && (grid_ww>1)) {
  164:       for(x1=0,y1=0,y2=apph;x1<=appw;x1=x1+grid_ww) {
  165:         x2=x1;
  166:         g.drawLine(x1,y1,x2,y2);
  167:       }
  168:       for(x1=0,y1=0,x2=appw;y1<=apph;y1=y1+grid_ww) {
  169:         y2=y1;
  170:         g.drawLine(x1,y1,x2,y2);
  171:       }
  172:     }
  173:  }
  174: public void run()   { }
  175: public void start() { }
  176: public void stop()  { }
  177: 
  178: }
  179: 

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>