--- loncom/homework/edit.pm 2003/09/17 15:44:19 1.65
+++ loncom/homework/edit.pm 2003/10/30 20:52:54 1.70
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# edit mode helpers
#
-# $Id: edit.pm,v 1.65 2003/09/17 15:44:19 matthew Exp $
+# $Id: edit.pm,v 1.70 2003/10/30 20:52:54 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -67,7 +67,7 @@ sub tag_start {
#
\n";
- my @help;# = Apache::lonxml::helpinfo($token);
+ my @help = Apache::lonxml::helpinfo($token);
if ($help[0]) {
$result .= ' | ' .
Apache::loncommon::help_open_topic(@help) .
@@ -273,6 +273,11 @@ sub handle_insertafter {
return $result;
}
+sub insert_img {
+ return '
+ ';
+}
+
sub insert_responseparam {
return '
';
@@ -283,6 +288,8 @@ sub insert_formularesponse {
+
+
';
}
@@ -292,6 +299,8 @@ sub insert_numericalresponse {
+
+
';
}
@@ -301,6 +310,8 @@ sub insert_stringresponse {
+
+
';
}
@@ -318,6 +329,8 @@ sub insert_imageresponse {
+
+
';
}
@@ -328,6 +341,8 @@ sub insert_optionresponse {
+
+
';
}
@@ -338,6 +353,8 @@ sub insert_radiobuttonresponse {
+
+
';
}
@@ -348,6 +365,8 @@ sub insert_rankresponse {
+
+
';
}
@@ -360,6 +379,8 @@ sub insert_matchresponse {
+
+
';
}
@@ -374,6 +395,14 @@ sub insert_hintpart {
';
}
+sub insert_hintgroup {
+ return '
+
+
+
+';
+}
+
sub insert_numericalhint {
return '
@@ -453,7 +482,7 @@ sub editfield {
}
sub modifiedfield {
- my ($token) = @_;
+ my ($endtag,$parser) = @_;
my $result;
# foreach my $envkey (sort keys %ENV) {
# &Apache::lonxml::debug("$envkey ---- $ENV{$envkey}");
@@ -461,6 +490,9 @@ sub modifiedfield {
# &Apache::lonxml::debug("I want homework_edit_$Apache::lonxml::curdepth");
# &Apache::lonxml::debug($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;
}
@@ -707,17 +739,21 @@ ENDBUTTON
#----------------------------------------------------- browse
sub browse {
# insert a link to call up the filesystem browser (lonindexer)
- my ($id, $mode) = @_;
+ my ($id, $mode, $titleid) = @_;
my $form = 'lonhomework';
my $element;
if (! defined($mode) || $mode eq 'attribute') {
$element = &Apache::lonnet::escape("$id\_$Apache::lonxml::curdepth");
} elsif ($mode eq 'textnode') { # for data between ...
$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";
-Select
+Select
ENDBUTTON
return $result;
}
@@ -725,7 +761,7 @@ ENDBUTTON
#----------------------------------------------------- browse
sub search {
# insert a link to call up the filesystem browser (lonindexer)
- my ($id, $mode) = @_;
+ my ($id, $mode, $titleid) = @_;
my $form = 'lonhomework';
my $element;
if (! defined($mode) || $mode eq 'attribute') {
@@ -734,8 +770,12 @@ sub search {
$element = &Apache::lonnet::escape('homework_edit_'.
$Apache::lonxml::curdepth);
}
+ my $titleelement;
+ if ($titleid) {
+ $titleelement=",'".&Apache::lonnet::escape("$titleid\_$Apache::lonxml::curdepth")."'";
+ }
my $result = <<"ENDBUTTON";
-Search
+Search
ENDBUTTON
return $result;
}
|