[LON-CAPA-users] Duplicated ids found

Raymond Batchelor batchelo at sfu.ca
Sun Oct 27 12:04:37 EDT 2013

It seems to me that the id="11" is used within the imported file (which imports yet another library file) and redundantly in the actual problem file to import the first library file.  I think you 'might' want to use an id other than "11" in your problem file, for the import.

----- Original Message -----
From: "Itay Furman" <itayf at nospammail.net>
To: lon-capa-users at mail.lon-capa.org
Sent: Sunday, 27 October, 2013 08:45:18
Subject: [LON-CAPA-users] Duplicated ids found


This is problem a newbie question. But I didn't find information on 
this. Sorry for that.

After publishing a problem I get the following error message:

ERROR: Duplicated ids found, problem will operate incorrectly. 
Duplicated ids seen:
This error occurred while processing response 12 in part

I could find in my code only a single id="11".
Note that the numerical ids in
   <import id="11">/res/jce/itayf/pub/lib/const_phys.library</import>
   <numericalresponse unit="C" format="2E" answer="$q" id="12">
were added by lon-capa after publication.

The code follows below.

Thanks in advance,

[start code]
     File    = elec_coulomb_identical-hanging-charges.problem
     Author  = Itay Furman, PhD, itayf at fastmail.fm
     Created = 2013-10-08
     Updated = 2013-10-08
     Version = 0.01

     Source  = Expanded from a problem by Michael Friedberg, JCE.

   <import id="11">/res/jce/itayf/pub/lib/const_phys.library</import>

   <script type="loncapa/perl">
     # Set-up

     $k_coulomb = $Coulomb_Const;
     $g      = 9.8;                                # Gravity acceleration [m / s^2].
     $len    = &random(10, 50, 5);		  # String length [cm].
     $theta  = &random(4,25,1);                    # Angle between string and vertical [degrees].
     $th_rad = $theta* $Pi / 180;                  # Same angle [rad].
     $mass   = &random(5,80,5);                    # Body mass [g].

     # Compute the magnitude of the charge on each body.
     $q = 2 * ($len/100) * sin($th_rad) * sqrt(($mass/1000) * $g * tan($th_rad) / $k_coulomb);
     # Note the following factors are required:
     # 1/100   in ($len/100)       to convert        $len: [cm]  -> [m].
     # 1/1000  in ($mass/1000)     to convert       $mass: [g]   -> [kg].
     # $Pi/180 in ($theta*$Pi/180) to convert sin()'s arg: [deg] -> [Rad].

   <startouttext />
   <h2>The Electrostatic Force Between a Pair of Identical Hanging Point Charges</h2>

     Two point bodies, each having a mass of <num>$mass</num> [g], are connected to identical massless
     isolating strings whose length is <num>$len</num> [cm].
     The strings are connected to the same hook on the ceiling.
     The bodies carry identical charges.
     Therefore, due to electrostatic repulsion, each string is inclined with an angle of
     $theta<sup>o</sup> relative to the line that pass through the hook and is orthogonal to the
   <endouttext />

   <part id="q" display="Compute the charge.">
     <startouttext />
     <strong>Compute: </strong> the electric charge on each body is
     <endouttext />

     <numericalresponse unit="C" format="2E" answer="$q" id="12">
       <responseparam name="tol" type="tolerance" default="2%" description="Numerical Tolerance" />
       <textline readonly="no" />

   <img alt="A pair of identical hanging charged masses." 
encrypturl="no" />
src="/res/jce/itayf/pub/share/img/131012_pair-hanging-charges.jpg" />

[end code]
LON-CAPA-users mailing list
LON-CAPA-users at mail.lon-capa.org

Raymond J. Batchelor, PhD.
Department of Chemistry
Simon Fraser University

Phone: 778-782-5635

More information about the LON-CAPA-users mailing list