version 1.69, 2003/10/24 21:45:32
|
version 1.73, 2003/11/28 01:55:24
|
Line 33 package Apache::edit;
|
Line 33 package Apache::edit;
|
use strict; |
use strict; |
use Apache::lonnet(); |
use Apache::lonnet(); |
use HTML::Entities(); |
use HTML::Entities(); |
|
use Apache::lonlocal; |
|
|
# Global Vars |
# Global Vars |
# default list of colors to use in editing |
# default list of colors to use in editing |
Line 347 sub insert_optionresponse {
|
Line 348 sub insert_optionresponse {
|
</optionresponse>'; |
</optionresponse>'; |
} |
} |
|
|
|
sub insert_organicresponse { |
|
return ' |
|
<organicresponse> |
|
<textline /> |
|
<hintgroup> |
|
<startouttext/> |
|
<endouttext /> |
|
</hintgroup> |
|
</organicresponse>'; |
|
} |
|
|
|
sub insert_organicstructure { |
|
return ' |
|
<organicstructure /> |
|
'; |
|
} |
|
|
sub insert_radiobuttonresponse { |
sub insert_radiobuttonresponse { |
return ' |
return ' |
<radiobuttonresponse max="10"> |
<radiobuttonresponse max="10"> |
Line 359 sub insert_radiobuttonresponse {
|
Line 377 sub insert_radiobuttonresponse {
|
</radiobuttonresponse>'; |
</radiobuttonresponse>'; |
} |
} |
|
|
|
sub insert_reactionresponse { |
|
return ' |
|
<reactionresponse> |
|
<textline /> |
|
<hintgroup> |
|
<startouttext/> |
|
<endouttext /> |
|
</hintgroup> |
|
</reactionresponse>'; |
|
} |
|
|
sub insert_rankresponse { |
sub insert_rankresponse { |
return ' |
return ' |
<rankresponse max="10"> |
<rankresponse max="10"> |
Line 482 sub editfield {
|
Line 511 sub editfield {
|
} |
} |
|
|
sub modifiedfield { |
sub modifiedfield { |
my ($token) = @_; |
my ($endtag,$parser) = @_; |
my $result; |
my $result; |
# foreach my $envkey (sort keys %ENV) { |
# foreach my $envkey (sort keys %ENV) { |
# &Apache::lonxml::debug("$envkey ---- $ENV{$envkey}"); |
# &Apache::lonxml::debug("$envkey ---- $ENV{$envkey}"); |
Line 490 sub modifiedfield {
|
Line 519 sub modifiedfield {
|
# &Apache::lonxml::debug("I want homework_edit_$Apache::lonxml::curdepth"); |
# &Apache::lonxml::debug("I want homework_edit_$Apache::lonxml::curdepth"); |
# &Apache::lonxml::debug($ENV{"form.homework_edit_$Apache::lonxml::curdepth"}); |
# &Apache::lonxml::debug($ENV{"form.homework_edit_$Apache::lonxml::curdepth"}); |
$result=$ENV{"form.homework_edit_$Apache::lonxml::curdepth"}; |
$result=$ENV{"form.homework_edit_$Apache::lonxml::curdepth"}; |
|
my $bodytext=&Apache::lonxml::get_all_text($endtag,$parser); |
|
# textareas throw away intial \n |
|
if ($bodytext=~/^\n/) { $result="\n".$result; } |
return $result; |
return $result; |
} |
} |
|
|
Line 558 sub checked_arg {
|
Line 590 sub checked_arg {
|
my $result; |
my $result; |
my $optionlist=""; |
my $optionlist=""; |
my $allselected=$token->[2]{$name}; |
my $allselected=$token->[2]{$name}; |
$result=$description; |
$result=&mt($description); |
foreach my $option (@$list) { |
foreach my $option (@$list) { |
my ($value,$text); |
my ($value,$text); |
if ( ref($option) eq 'ARRAY') { |
if ( ref($option) eq 'ARRAY') { |
Line 587 sub text_arg {
|
Line 619 sub text_arg {
|
my $result; |
my $result; |
if (!defined $size) { $size=20; } |
if (!defined $size) { $size=20; } |
my $arg=$token->[2]{$name}; |
my $arg=$token->[2]{$name}; |
$result=$description.' <input name="'.&html_element_name($name). |
$result=&mt($description).' <input name="'.&html_element_name($name). |
'" type="text" value="'.$arg.'" size="'.$size.'" />'; |
'" type="text" value="'.$arg.'" size="'.$size.'" />'; |
return '<nobr>'.$result.'</nobr>'; |
return '<nobr>'.$result.'</nobr>'; |
} |
} |
Line 645 sub select_or_text_arg {
|
Line 677 sub select_or_text_arg {
|
} |
} |
$optionlist.="<option value=\"TYPEDINVALUE\"". |
$optionlist.="<option value=\"TYPEDINVALUE\"". |
((!$found)?' selected="on"':''). |
((!$found)?' selected="on"':''). |
">Type in value</option>\n"; |
">".&mt('Type-in value')."</option>\n"; |
# |
# |
my $element=&html_element_name($name); |
my $element=&html_element_name($name); |
my $selectelement='select_list_'.$element; |
my $selectelement='select_list_'.$element; |
Line 658 sub select_or_text_arg {
|
Line 690 sub select_or_text_arg {
|
'.options['.$selectedindex.'].value'; |
'.options['.$selectedindex.'].value'; |
my $typedinvalue='this.form.'.$typeinelement.'.value'; |
my $typedinvalue='this.form.'.$typeinelement.'.value'; |
my $selecttypeinindex='this.form.'.$selectelement.'.options.length'; |
my $selecttypeinindex='this.form.'.$selectelement.'.options.length'; |
|
$description=&mt($description); |
# |
# |
return (<<ENDSELECTORTYPE); |
return (<<ENDSELECTORTYPE); |
<nobr> |
<nobr> |