--- loncom/homework/lonsimpleproblemedit.pm 2009/08/17 19:46:49 1.25 +++ loncom/homework/lonsimpleproblemedit.pm 2009/10/16 17:23:51 1.28 @@ -1,7 +1,7 @@ # The LearningOnline Network # Simple Problem Parameter Setting "Editor" # -# $Id: lonsimpleproblemedit.pm,v 1.25 2009/08/17 19:46:49 www Exp $ +# $Id: lonsimpleproblemedit.pm,v 1.28 2009/10/16 17:23:51 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -141,11 +141,11 @@ sub foil { my $spell_link= &Apache::lonhtmlcommon::spelllink('simpleedit',"text$number"); return (< +
$lt{'foil'}
$lt{'value'}: $selectvalue$lt{'pos'}: $selectposition
$lt{'text'}:
- +
$spell_link
@@ -191,6 +191,9 @@ sub handler { # ------------------------------------------------ Prefix for everything stored $prefix=$env{'request.course.id'}.'.'.$symb.'.0.'; +#------------------------------------------------- Prefix for storing weight of Problem Parts + my $weightprefix=$env{'request.course.id'}.'.'.$symb.'.'; + # ---------------------------------------------------------- Anything to store? if (($symb) && (defined($env{'form.questiontype'}))) { @@ -216,11 +219,21 @@ sub handler { $storecontent{$prefix.$parm}=~s/\s+$//s; } } +# ---------------------------------------------------- Set weights of hidden parts to zero +# ------------------------------------------------------ and used part to 1 + $storecontent{$weightprefix.'essay.weight'}=0; + $storecontent{$weightprefix.'numerical.weight'}=0; + $storecontent{$weightprefix.'option.weight'}=0; + $storecontent{$weightprefix.'radio.weight'}=0; + $storecontent{$weightprefix.'string.weight'}=0; + $storecontent{$weightprefix.$env{'form.questiontype'}.'.weight'}=1; + + my $reply=&Apache::lonnet::cput ('resourcedata',\%storecontent, $env{'course.'.$env{'request.course.id'}.'.domain'}, $env{'course.'.$env{'request.course.id'}.'.num'}); - + &Apache::lonnet::devalidatecourseresdata( $env{'course.'.$env{'request.course.id'}.'.num'}, $env{'course.'.$env{'request.course.id'}.'.domain'}); @@ -305,7 +318,7 @@ sub handler { ':   '. &Apache::loncommon::select_form ($randomize,'randomize',%randomizes). - ''); + ''); # Option Response: Options if ($qtype eq 'option') { my $options=$qparms{$prefix.'options'};