--- loncom/homework/imageresponse.pm 2007/09/25 23:16:13 1.85
+++ loncom/homework/imageresponse.pm 2007/09/25 23:47:59 1.87
@@ -2,7 +2,7 @@
# The LearningOnline Network with CAPA
# image click response style
#
-# $Id: imageresponse.pm,v 1.85 2007/09/25 23:16:13 albertel Exp $
+# $Id: imageresponse.pm,v 1.87 2007/09/25 23:47:59 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -237,14 +237,15 @@ sub displayfoils {
} else {
my $respid=$Apache::inputtags::response['-1'];
my $token=&prep_image($image,'submission',$name);
- my $id = "HWVAL_$respid:$temp";
+ my $input_id = "HWVAL_$respid:$temp";
+ my $id = $env{'form.request.prefix'}.$input_id;
$result.=''.
'
'.
- ''.
- ''.
+ '';
}
}
@@ -376,8 +377,8 @@ sub gradefoils {
sub stringify_submission {
my ($response) = @_;
- return
- join("\0",map {$_."\1".$response->{$_}} (sort(keys(%{ $response }))));
+ return &Apache::lonnet::hash2str(%{ $response });
+
}
@@ -391,10 +392,10 @@ sub get_submission {
$Apache::lonhomework::history{"resource.$part.$respid.submission"};
}
- if ($string !~ /\0/) {
+ if ($string !~ /=/) {
return split(':',$string);
} else {
- my %response = map { split("\1",$_,2) } (split("\0",$string));
+ my %response = &Apache::lonnet::str2hash($string);
return split(':',$response{$name});
}
}