--- loncom/homework/structuretags.pm 2011/01/07 05:09:32 1.484 +++ loncom/homework/structuretags.pm 2011/06/06 21:01:06 1.489 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: structuretags.pm,v 1.484 2011/01/07 05:09:32 raeburn Exp $ +# $Id: structuretags.pm,v 1.489 2011/06/06 21:01:06 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -144,7 +144,7 @@ function image_response_click (which, e) var y= e.clientY-getY(img_element)+Geometry.getVerticalScroll(); var click = x+':'+y; input_element.value = click; - img_element.src = '/adm/randomlabel.png?token='+token+'&clickdata='+click; + img_element.src = '/adm/randomlabel.png?token='+token+'&clickdata='+click; } // ]]> @@ -154,10 +154,12 @@ JS sub setmode_javascript { return <<"ENDSCRIPT"; ENDSCRIPT } @@ -409,8 +411,14 @@ sub setup_rndseed { delete($env{'form.resetdata'}); delete($env{'form.newrandomization'}); } - if (defined($rndseed) && $rndseed ne int($rndseed)) { - $rndseed=join(':',&Apache::lonnet::digest($rndseed)); + $rndseed=~s/\,/\:/g; + $rndseed=~s/[^\w\d\:\-]//g; + if (defined($rndseed)) { + my ($c1,$c2)=split(/\:/,$rndseed); + unless ($c2) { $c2=0; } + unless (($c1==int($c1)) && ($c2==int($c2))) { + $rndseed=join(':',&Apache::lonnet::digest($rndseed)); + } } if ($Apache::lonhomework::history{'resource.CODE'}) { $rndseed=&Apache::lonnet::rndseed(); @@ -462,27 +470,48 @@ sub remember_problem_state { '; } +sub problem_edit_action_button { + my ($name,$action,$accesskey,$text,$flag)=@_; + my $actionscript="setmode(this.form,'$action')"; + return "\n"; +} + sub problem_edit_buttons { - return ' -