version 1.66, 2003/09/19 19:37:53
|
version 1.70, 2003/10/30 20:52:54
|
Line 273 sub handle_insertafter {
|
Line 273 sub handle_insertafter {
|
return $result; |
return $result; |
} |
} |
|
|
|
sub insert_img { |
|
return ' |
|
<img />'; |
|
} |
|
|
sub insert_responseparam { |
sub insert_responseparam { |
return ' |
return ' |
<responseparam />'; |
<responseparam />'; |
Line 283 sub insert_formularesponse {
|
Line 288 sub insert_formularesponse {
|
<formularesponse answer="" samples=""> |
<formularesponse answer="" samples=""> |
<textline /> |
<textline /> |
<hintgroup> |
<hintgroup> |
|
<startouttext/> |
|
<endouttext /> |
</hintgroup> |
</hintgroup> |
</formularesponse>'; |
</formularesponse>'; |
} |
} |
Line 292 sub insert_numericalresponse {
|
Line 299 sub insert_numericalresponse {
|
<numericalresponse answer=""> |
<numericalresponse answer=""> |
<textline /> |
<textline /> |
<hintgroup> |
<hintgroup> |
|
<startouttext/> |
|
<endouttext /> |
</hintgroup> |
</hintgroup> |
</numericalresponse>'; |
</numericalresponse>'; |
} |
} |
Line 301 sub insert_stringresponse {
|
Line 310 sub insert_stringresponse {
|
<stringresponse answer="" type=""> |
<stringresponse answer="" type=""> |
<textline /> |
<textline /> |
<hintgroup> |
<hintgroup> |
|
<startouttext/> |
|
<endouttext /> |
</hintgroup> |
</hintgroup> |
</stringresponse>'; |
</stringresponse>'; |
} |
} |
Line 318 sub insert_imageresponse {
|
Line 329 sub insert_imageresponse {
|
<foilgroup> |
<foilgroup> |
</foilgroup> |
</foilgroup> |
<hintgroup> |
<hintgroup> |
|
<startouttext/> |
|
<endouttext /> |
</hintgroup> |
</hintgroup> |
</imageresponse>'; |
</imageresponse>'; |
} |
} |
Line 328 sub insert_optionresponse {
|
Line 341 sub insert_optionresponse {
|
<foilgroup options=""> |
<foilgroup options=""> |
</foilgroup> |
</foilgroup> |
<hintgroup> |
<hintgroup> |
|
<startouttext/> |
|
<endouttext /> |
</hintgroup> |
</hintgroup> |
</optionresponse>'; |
</optionresponse>'; |
} |
} |
Line 338 sub insert_radiobuttonresponse {
|
Line 353 sub insert_radiobuttonresponse {
|
<foilgroup> |
<foilgroup> |
</foilgroup> |
</foilgroup> |
<hintgroup> |
<hintgroup> |
|
<startouttext/> |
|
<endouttext /> |
</hintgroup> |
</hintgroup> |
</radiobuttonresponse>'; |
</radiobuttonresponse>'; |
} |
} |
Line 348 sub insert_rankresponse {
|
Line 365 sub insert_rankresponse {
|
<foilgroup options=""> |
<foilgroup options=""> |
</foilgroup> |
</foilgroup> |
<hintgroup> |
<hintgroup> |
|
<startouttext/> |
|
<endouttext /> |
</hintgroup> |
</hintgroup> |
</rankresponse>'; |
</rankresponse>'; |
} |
} |
Line 360 sub insert_matchresponse {
|
Line 379 sub insert_matchresponse {
|
</itemgroup> |
</itemgroup> |
</foilgroup> |
</foilgroup> |
<hintgroup> |
<hintgroup> |
|
<startouttext/> |
|
<endouttext /> |
</hintgroup> |
</hintgroup> |
</matchresponse>'; |
</matchresponse>'; |
} |
} |
Line 374 sub insert_hintpart {
|
Line 395 sub insert_hintpart {
|
</hintpart>'; |
</hintpart>'; |
} |
} |
|
|
|
sub insert_hintgroup { |
|
return ' |
|
<hintgroup> |
|
<startouttext/> |
|
<endouttext /> |
|
</hintgroup>'; |
|
} |
|
|
sub insert_numericalhint { |
sub insert_numericalhint { |
return ' |
return ' |
<numericalhint> |
<numericalhint> |
Line 453 sub editfield {
|
Line 482 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 461 sub modifiedfield {
|
Line 490 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 707 ENDBUTTON
|
Line 739 ENDBUTTON
|
#----------------------------------------------------- browse |
#----------------------------------------------------- browse |
sub browse { |
sub browse { |
# insert a link to call up the filesystem browser (lonindexer) |
# insert a link to call up the filesystem browser (lonindexer) |
my ($id, $mode) = @_; |
my ($id, $mode, $titleid) = @_; |
my $form = 'lonhomework'; |
my $form = 'lonhomework'; |
my $element; |
my $element; |
if (! defined($mode) || $mode eq 'attribute') { |
if (! defined($mode) || $mode eq 'attribute') { |
$element = &Apache::lonnet::escape("$id\_$Apache::lonxml::curdepth"); |
$element = &Apache::lonnet::escape("$id\_$Apache::lonxml::curdepth"); |
} elsif ($mode eq 'textnode') { # for data between <tag> ... </tag> |
} elsif ($mode eq 'textnode') { # for data between <tag> ... </tag> |
$element = &Apache::lonnet::escape('homework_edit_'. |
$element = &Apache::lonnet::escape('homework_edit_'. |
$Apache::lonxml::curdepth); |
$Apache::lonxml::curdepth); |
|
} |
|
my $titleelement; |
|
if ($titleid) { |
|
$titleelement=",'','','".&Apache::lonnet::escape("$titleid\_$Apache::lonxml::curdepth")."'"; |
} |
} |
my $result = <<"ENDBUTTON"; |
my $result = <<"ENDBUTTON"; |
<a href=\"javascript:openbrowser('$form','$element')\"\>Select</a> |
<a href=\"javascript:openbrowser('$form','$element'$titleelement)\"\>Select</a> |
ENDBUTTON |
ENDBUTTON |
return $result; |
return $result; |
} |
} |
Line 725 ENDBUTTON
|
Line 761 ENDBUTTON
|
#----------------------------------------------------- browse |
#----------------------------------------------------- browse |
sub search { |
sub search { |
# insert a link to call up the filesystem browser (lonindexer) |
# insert a link to call up the filesystem browser (lonindexer) |
my ($id, $mode) = @_; |
my ($id, $mode, $titleid) = @_; |
my $form = 'lonhomework'; |
my $form = 'lonhomework'; |
my $element; |
my $element; |
if (! defined($mode) || $mode eq 'attribute') { |
if (! defined($mode) || $mode eq 'attribute') { |
Line 734 sub search {
|
Line 770 sub search {
|
$element = &Apache::lonnet::escape('homework_edit_'. |
$element = &Apache::lonnet::escape('homework_edit_'. |
$Apache::lonxml::curdepth); |
$Apache::lonxml::curdepth); |
} |
} |
|
my $titleelement; |
|
if ($titleid) { |
|
$titleelement=",'".&Apache::lonnet::escape("$titleid\_$Apache::lonxml::curdepth")."'"; |
|
} |
my $result = <<"ENDBUTTON"; |
my $result = <<"ENDBUTTON"; |
<a href=\"javascript:opensearcher('$form','$element')\"\>Search</a> |
<a href=\"javascript:opensearcher('$form','$element'$titleelement)\"\>Search</a> |
ENDBUTTON |
ENDBUTTON |
return $result; |
return $result; |
} |
} |