--- loncom/homework/edit.pm 2007/02/18 02:00:59 1.105
+++ loncom/homework/edit.pm 2007/09/07 00:21:05 1.109
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# edit mode helpers
#
-# $Id: edit.pm,v 1.105 2007/02/18 02:00:59 albertel Exp $
+# $Id: edit.pm,v 1.109 2007/09/07 00:21:05 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -324,6 +324,56 @@ sub insert_customresponse_answer {
';
}
+sub insert_customhint {
+ return '
+
+
+
+ ';
+}
+
+sub insert_customhint_answer {
+ return '
+
+
+';
+}
+
+sub insert_mathresponse {
+ return '
+
+
+
+
+
+
+
+
+';
+}
+
+sub insert_mathresponse_answer {
+ return '
+
+
+';
+}
+
+sub insert_mathhint {
+ return '
+
+
+
+ ';
+}
+
+sub insert_mathhint_answer {
+ return '
+
+
+';
+}
+
sub insert_stringresponse {
return '
@@ -636,11 +686,13 @@ sub rebuild_tag {
my $result;
if ($token->[0] eq 'S') {
$result = '<'.$token->[1];
- while (my ($key,$val)= each(%{$token->[2]})) {
- $val=~s:^\s+|\s+$::g;
- $val=~s:"::g; #"
- &Apache::lonxml::debug("setting :$key: to :$val:");
- $result.=' '.$key.'="'.$val.'"';
+ #FIXME do this in non random order
+ foreach my $attribute (@{ $token->[3] }) {
+ my $value = $token->[2]{$attribute};
+ $value =~s/^\s+|\s+$//g;
+ $value =~s/\"//g;
+ &Apache::lonxml::debug("setting :$attribute: to :$value:");
+ $result.=' '.$attribute.'="'.$value.'"';
}
if ($token->[4] =~ m:/>$:) {
$result.=' />';
@@ -870,7 +922,7 @@ sub deletecoorddata {
#----------------------------------------------------- browse
sub browse {
# insert a link to call up the filesystem browser (lonindexer)
- my ($id, $mode, $titleid) = @_;
+ my ($id, $mode, $titleid, $only) = @_;
my $form = 'lonhomework';
my $element;
if (! defined($mode) || $mode eq 'attribute') {
@@ -881,7 +933,9 @@ sub browse {
}
my $titleelement;
if ($titleid) {
- $titleelement=",'','','".&escape("$titleid\_$Apache::lonxml::curdepth")."'";
+ $titleelement=",'$only','','".&escape("$titleid\_$Apache::lonxml::curdepth")."'";
+ } else {
+ $titleelement=",'$only'";
}
my $result = <<"ENDBUTTON";
Select