version 1.51, 2003/05/10 23:04:58
|
version 1.57, 2003/06/30 20:41:35
|
Line 75 sub tag_end {
|
Line 75 sub tag_end {
|
my ($target,$token,$description) = @_; |
my ($target,$token,$description) = @_; |
my $result=''; |
my $result=''; |
if ($target eq 'edit') { |
if ($target eq 'edit') { |
my $tag=$token->[1]; |
$result.="</td></tr>".&end_table()."\n"; |
if (!defined($description)) { |
|
$result.="</td></tr><tr><td></$tag></td><td colspan=\"2\"> </td>"; |
|
} else { |
|
if ($description ne '') { $result.="</td></tr><tr><td>$description</td><td colspan=\"2\"> </td>"; } |
|
} |
|
$result.="</tr>".&end_table()."\n"; |
|
} |
} |
return $result; |
return $result; |
} |
} |
Line 310 sub insert_essayresponse {
|
Line 304 sub insert_essayresponse {
|
</essayresponse>'; |
</essayresponse>'; |
} |
} |
|
|
|
sub insert_imageresponse { |
|
return ' |
|
<imageresponse max="1"> |
|
<foilgroup> |
|
</foilgroup> |
|
<hintgroup> |
|
</hintgroup> |
|
</imageresponse>'; |
|
} |
|
|
sub insert_optionresponse { |
sub insert_optionresponse { |
return ' |
return ' |
<optionresponse max="10"> |
<optionresponse max="10"> |
Line 404 sub textarea_sizes {
|
Line 408 sub textarea_sizes {
|
my ($data)=@_; |
my ($data)=@_; |
my $count=0; |
my $count=0; |
my $maxlength=-1; |
my $maxlength=-1; |
foreach (split ("\n", $$data)) { $count++; |
foreach (split ("\n", $$data)) { |
if (length($_) > $maxlength) { $maxlength = length($_); } |
$count+=int(length($_)/79); |
} |
$count++; |
|
if (length($_) > $maxlength) { $maxlength = length($_); } |
|
} |
my $rows = $count; |
my $rows = $count; |
my $cols = $maxlength; |
my $cols = $maxlength; |
return ($rows,$cols); |
return ($rows,$cols); |
Line 460 sub get_new_args {
|
Line 466 sub get_new_args {
|
my $element=&html_element_name($arg); |
my $element=&html_element_name($arg); |
my $newvalue=$ENV{"form.$element"}; |
my $newvalue=$ENV{"form.$element"}; |
&Apache::lonxml::debug(" for:$arg: cur is :$value: new is :$newvalue:"); |
&Apache::lonxml::debug(" for:$arg: cur is :$value: new is :$newvalue:"); |
if ($value ne $newvalue) { |
if (defined($newvalue) && $value ne $newvalue) { |
$token->[2]->{$arg}=$newvalue; |
$token->[2]->{$arg}=$newvalue; |
$rebuild=1; |
$rebuild=1; |
} |
} |
Line 512 sub text_arg {
|
Line 518 sub text_arg {
|
my $arg=$token->[2]{$name}; |
my $arg=$token->[2]{$name}; |
$result=$description.' <input name="'.&html_element_name($name). |
$result=$description.' <input name="'.&html_element_name($name). |
'" type="text" value="'.$arg.'" size="'.$size.'" />'; |
'" type="text" value="'.$arg.'" size="'.$size.'" />'; |
return $result; |
return '<nobr>'.$result.'</nobr>'; |
} |
} |
|
|
sub select_arg { |
sub select_arg { |
Line 534 sub select_arg {
|
Line 540 sub select_arg {
|
$optionlist.="<option $value >$option</option>\n"; |
$optionlist.="<option $value >$option</option>\n"; |
} |
} |
} |
} |
$result.=$description.' <select name="'.&html_element_name($name). |
$result.='<nobr>'.$description.' <select name="'. |
'"> |
&html_element_name($name).'"> |
'.$optionlist.' |
'.$optionlist.' |
</select>'; |
</select></nobr>'; |
return $result; |
return $result; |
} |
} |
|
|
Line 571 sub select_or_text_arg {
|
Line 577 sub select_or_text_arg {
|
} else { |
} else { |
$result.=&text_arg($description,$name,$token,$size); |
$result.=&text_arg($description,$name,$token,$size); |
} |
} |
return $result; |
return '<nobr>'.$result.'</nobr>'; |
} |
} |
|
|
#----------------------------------------------------- image coordinates |
#----------------------------------------------------- image coordinates |
Line 645 sub browse {
|
Line 651 sub browse {
|
$Apache::lonxml::curdepth); |
$Apache::lonxml::curdepth); |
} |
} |
my $result = <<"ENDBUTTON"; |
my $result = <<"ENDBUTTON"; |
<a href=\"javascript:openbrowser('$form','$element')\"\>Browse</a> |
<a href=\"javascript:openbrowser('$form','$element')\"\>Select</a> |
ENDBUTTON |
ENDBUTTON |
return $result; |
return $result; |
} |
} |