[LON-CAPA-cvs] cvs: loncom /homework imageresponse.pm rat lonpage.pm
albertel
lon-capa-cvs-allow@mail.lon-capa.org
Tue, 25 Sep 2007 23:47:59 -0000
albertel Tue Sep 25 19:47:59 2007 EDT
Modified files:
/rat lonpage.pm
/loncom/homework imageresponse.pm
Log:
- BUG#1566 - finish supprot for imageresponse in a .page
Index: rat/lonpage.pm
diff -u rat/lonpage.pm:1.84 rat/lonpage.pm:1.85
--- rat/lonpage.pm:1.84 Tue Jul 10 16:51:41 2007
+++ rat/lonpage.pm Tue Sep 25 19:47:54 2007
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Page Handler
#
-# $Id: lonpage.pm,v 1.84 2007/07/10 20:51:41 albertel Exp $
+# $Id: lonpage.pm,v 1.85 2007/09/25 23:47:54 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -378,12 +378,13 @@
$r->send_http_header;
# ------------------------------------------------------------------------ Head
if ($allscript) {
- $allscript .=
- "\n<script type=\"text/javascript\">\n".
- $allscript."\n</script>\n";
+ $allscript =
+ "\n".'<script type="text/javascript">'."\n".
+ $allscript.
+ "\n</script>\n";
}
# ------------------------------------------------------------------ Start body
- $r->print(&Apache::loncommon::start_page(undef,undef,
+ $r->print(&Apache::loncommon::start_page(undef,$allscript,
{'force_register' => 1,
'bgcolor' => '#ffffff',}));
# ------------------------------------------------------------------ Start form
Index: loncom/homework/imageresponse.pm
diff -u loncom/homework/imageresponse.pm:1.86 loncom/homework/imageresponse.pm:1.87
--- loncom/homework/imageresponse.pm:1.86 Tue Sep 25 19:45:33 2007
+++ loncom/homework/imageresponse.pm Tue Sep 25 19:47:59 2007
@@ -2,7 +2,7 @@
# The LearningOnline Network with CAPA
# image click response style
#
-# $Id: imageresponse.pm,v 1.86 2007/09/25 23:45:33 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 @@
} 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.='<img onclick="image_response_click(\''.$id.'\',event);"
src="/adm/randomlabel.png?token='.$token.'"
- id="imageresponse_'.$id.'"
+ id="'.$id.'_imageresponse"
/>'.
'<br />'.
- '<input type="hidden" name="token_'.$id.'" value="'.$token.'" />'.
- '<input type="hidden" name="'.$id.'" value="'.
+ '<input type="hidden" name="'.$input_id.'_token" value="'.$token.'" />'.
+ '<input type="hidden" name="'.$input_id.'" value="'.
join(':',&get_submission($name)).'" />';
}
}