[LON-CAPA-cvs] cvs: loncom /homework inputtags.pm /html/adm/help/tex Physical_Units.tex Ranking_Problems.tex

www lon-capa-cvs@mail.lon-capa.org
Fri, 24 Jan 2003 22:32:08 -0000


www		Fri Jan 24 17:32:08 2003 EDT

  Added files:                 
    /loncom/html/adm/help/tex	Physical_Units.tex 

  Modified files:              
    /loncom/homework	inputtags.pm 
    /loncom/html/adm/help/tex	Ranking_Problems.tex 
  Log:
  Build in more contextual help.
  
  
Index: loncom/homework/inputtags.pm
diff -u loncom/homework/inputtags.pm:1.81 loncom/homework/inputtags.pm:1.82
--- loncom/homework/inputtags.pm:1.81	Fri Jan 24 17:02:45 2003
+++ loncom/homework/inputtags.pm	Fri Jan 24 17:32:08 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # input  definitons
 #
-# $Id: inputtags.pm,v 1.81 2003/01/24 22:02:45 www Exp $
+# $Id: inputtags.pm,v 1.82 2003/01/24 22:32:08 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -30,6 +30,7 @@
 package Apache::inputtags;
 use HTML::Entities();
 use strict;
+use Apache::loncommon;
 
 BEGIN {
   &Apache::lonxml::register('Apache::inputtags',('textfield','textline'));
@@ -309,13 +310,15 @@
     $message = "Please adjust significant figures.";# you provided %s significant figures";
     $button=1;
   } elsif ($award eq 'UNIT_FAIL') {
-    $message = "Units incorrect."; #Computer reads units as %s";
+    $message = "Units incorrect. ".
+       &Apache::loncommon::help_open_topic('Physical_Units'); #Computer reads units as %s";
     $button=1;
   } elsif ($award eq 'UNIT_NOTNEEDED') {
     $message = "Only a number required.";# Computer reads units of %s";
     $button=1;
   } elsif ($award eq 'NO_UNIT') {
-    $message = "Units required";
+    $message = "Units required".
+       &Apache::loncommon::help_open_topic('Physical_Units');
     $button=1;
   } elsif ($award eq 'BAD_FORMULA') {
     $message = "Unable to understand formula";
Index: loncom/html/adm/help/tex/Ranking_Problems.tex
diff -u loncom/html/adm/help/tex/Ranking_Problems.tex:1.1 loncom/html/adm/help/tex/Ranking_Problems.tex:1.2
--- loncom/html/adm/help/tex/Ranking_Problems.tex:1.1	Fri Jan 24 17:02:45 2003
+++ loncom/html/adm/help/tex/Ranking_Problems.tex	Fri Jan 24 17:32:08 2003
@@ -1,5 +1,5 @@
 \label{Ranking_Problems}
-\section{Ranking Problems}
+\section*{Ranking Problems}
 If two items are equivalent, ranking is done in the same way as it is done for 
 sports events. 
 Say that there are two second places, then the ranking is {}``1 2 2 4 5 6''.

Index: loncom/html/adm/help/tex/Physical_Units.tex
+++ loncom/html/adm/help/tex/Physical_Units.tex
\label{Physical_Units}
\section*{Physical Units Accepted by LON-CAPA}
The following subsections show the physical units that LON-CAPA accepts. 
The symbols must be used when entering the units, for example {}``35 kg''.
\subsection*{Base Units}
\begin{verbatim}
# name      symbol     comment

meter           m      # length
kilogram        kg     # mass
second          s      # time
ampere          A      # electric current
kelvin          K      # thermodynamic temperature
mole            mol    # amount of substance
candela         cd     # luminous intensity
\end{verbatim}
\subsection*{Prefixes}
\begin{verbatim}
#   Prefix     symbol     factor

yotta            Y         10^{24}
zetta            Z         10^{21}
exa              E         10^{18}
peta             P         10^{15}
tera             T         10^{12}
giga             G         10^9
mega             M         10^6
kilo             k         10^3
hecto            h         10^2

deci             d         10^-1
centi            c         10^-2
milli            m         10^-3
micro            u         10^-6
nano             n         10^-9
pico             p         10^{-12}
femto            f         10^{-15}
atto             a         10^{-18}
zepto            z         10^{-21}
yocto            y         10^{-24}
\end{verbatim}
\subsection*{Derived Units}
\begin{verbatim}
# Derived Unit
# name       symbol    comment

gram            g      # mass
hour            hr     # time
minute          min    # time
day             day    # time
year            yr     # time
pound           lb     # mass
ounce           oz     # mass
inch            in     # length
foot            ft     # length
mile            mi     # length
yard            yd     # length
nautical_mile   n_mi   # length, nautical mile (UK)
rood            rood   # area, rood
acre            acre   # area, acre
hertz           Hz     # frequency
litre           L      # volume
newton          N      # force
pound_force     lbf    # force
dyne            dyn    # force
pascal          Pa     # pressure, stress
bar             bar    # pressure
mmHg            mmHg   # pressure, millimeter of mercury
torr            torr   # pressure
atm             atm    # standard atmosphere
joule           J      # energy, work, heat
electronvolt    eV     # energy
calorie         cal    # energy
Btu             Btu    # energy
watt            W      # power, radiant flux
coulomb         C      # electric charge
volt            V      # electric potential, electromotive force
ohm             ohm    # electric resistance, use this in /ANS
ohm             ohms   # electric resistance
ohm             Ohm    # electric resistance
ohm             Ohms   # electric resistance
siemens         S      # electric conductance
farad           F      # electric capacitance
tesla           T      # magnetic flux density
weber           Wb     # magnetic flux
henry           H      # inductance
radian          rad    # plane angle
degree          deg    # plane angle (Pi rad=180 deg)
steradian       sr     # solid angle
lumen           lm     # luminous flux
lux             lx     # illuminance
becquerel       Bq     # activity (radioactive)
gray            Gy     # absorbed dose (of radiation)
sievert         Sv     # dose equivalent (dose equivalent index)
astroUnit       AU     # mean distance earth to sun
\end{verbatim}
\subsection*{Interpretation}
The coded units are interpreted in the order of basic unit, 
derived unit, then prefix. For example, ``T'' will be matched against 
``tesla'' instead of considered the prefix ``T''. Another example is that 
``min'' will match
``minutes'' instead of treated  as a combination of the prefix ``m'' and units.