version 1.93, 2012/02/28 22:42:31
|
version 1.94, 2012/02/29 01:24:47
|
Line 602 sub start_drawvectorsum {
|
Line 602 sub start_drawvectorsum {
|
my $internalid = $Apache::inputtags::part.'_'.$Apache::inputtags::response[-1]; |
my $internalid = $Apache::inputtags::part.'_'.$Apache::inputtags::response[-1]; |
my $tailx=&Apache::lonxml::get_param('tailx',$parstack,$safeeval); |
my $tailx=&Apache::lonxml::get_param('tailx',$parstack,$safeeval); |
my $taily=&Apache::lonxml::get_param('taily',$parstack,$safeeval); |
my $taily=&Apache::lonxml::get_param('taily',$parstack,$safeeval); |
|
my $showvalue=&Apache::lonxml::get_param('showvalue',$parstack,$safeeval); |
my $vectorlist=&Apache::lonxml::get_param('vectorlist',$parstack,$safeeval); |
my $vectorlist=&Apache::lonxml::get_param('vectorlist',$parstack,$safeeval); |
my $label=&Apache::lonxml::get_param('label',$parstack,$safeeval); |
my $label=&Apache::lonxml::get_param('label',$parstack,$safeeval); |
$label=~s/\W//gs; |
$label=~s/\W//gs; |
Line 632 ENDADDVEC
|
Line 633 ENDADDVEC
|
} |
} |
$result.="document.ggbApplet_$internalid.evalCommand(".'"'."xTot$label=".join('+',@sumx).'");'."\n"; |
$result.="document.ggbApplet_$internalid.evalCommand(".'"'."xTot$label=".join('+',@sumx).'");'."\n"; |
$result.="document.ggbApplet_$internalid.evalCommand(".'"'."yTot$label=".join('+',@sumy).'");'."\n"; |
$result.="document.ggbApplet_$internalid.evalCommand(".'"'."yTot$label=".join('+',@sumy).'");'."\n"; |
|
my $show=0; |
|
if ($showvalue=~/yes/i) { |
|
$show=1; |
|
} |
$result.=(<<ENDMAKEVECTOR); |
$result.=(<<ENDMAKEVECTOR); |
document.ggbApplet_$internalid.evalCommand("$label=Vector[($tailx,$taily),($tailx+xTot$label,$taily+yTot$label)]"); |
document.ggbApplet_$internalid.evalCommand("$label=Vector[($tailx,$taily),($tailx+xTot$label,$taily+yTot$label)]"); |
document.ggbApplet_$internalid.setLabelVisible("$label",true); |
document.ggbApplet_$internalid.setLabelVisible("$label",true); |
document.ggbApplet_$internalid.setLineThickness("$label",8); |
document.ggbApplet_$internalid.setLineThickness("$label",8); |
document.ggbApplet_$internalid.setColor("$label",255,0,0); |
document.ggbApplet_$internalid.setColor("$label",255,0,0); |
|
document.ggbApplet_$internalid.setLabelStyle("$label",VALUE=$show); |
ENDMAKEVECTOR |
ENDMAKEVECTOR |
} |
} |
} elsif ($target eq 'edit') { |
} elsif ($target eq 'edit') { |
Line 646 ENDMAKEVECTOR
|
Line 652 ENDMAKEVECTOR
|
&Apache::edit::text_arg('Tail x:','tailx', |
&Apache::edit::text_arg('Tail x:','tailx', |
$token,'8'). |
$token,'8'). |
&Apache::edit::text_arg('Tail y:','taily', |
&Apache::edit::text_arg('Tail y:','taily', |
$token,'8').'<br />'. |
$token,'8'). |
|
&Apache::edit::select_arg('Show Value:','showvalue', |
|
['yes','no'],$token).'<br />'. |
&Apache::edit::text_arg('Vector List:','vectorlist', |
&Apache::edit::text_arg('Vector List:','vectorlist', |
$token,'40'). |
$token,'40'). |
&Apache::edit::end_row(); |
&Apache::edit::end_row(); |
} elsif ($target eq 'modified') { |
} elsif ($target eq 'modified') { |
$env{'form.'.&Apache::edit::html_element_name('label')}=ucfirst($env{'form.'.&Apache::edit::html_element_name('label')}); |
$env{'form.'.&Apache::edit::html_element_name('label')}=ucfirst($env{'form.'.&Apache::edit::html_element_name('label')}); |
my $constructtag=&Apache::edit::get_new_args($token,$parstack,$safeeval,'label','tailx','taily','vectorlist'); |
my $constructtag=&Apache::edit::get_new_args($token,$parstack,$safeeval,'label','tailx','taily','showvalue','vectorlist'); |
if ($constructtag) { $result=&Apache::edit::rebuild_tag($token); } |
if ($constructtag) { $result=&Apache::edit::rebuild_tag($token); } |
} |
} |
return $result; |
return $result; |