--- loncom/interface/lonhelper.pm 2005/01/03 13:45:31 1.90 +++ loncom/interface/lonhelper.pm 2005/01/16 08:20:38 1.93 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # .helper XML handler to implement the LON-CAPA helper # -# $Id: lonhelper.pm,v 1.90 2005/01/03 13:45:31 foxr Exp $ +# $Id: lonhelper.pm,v 1.93 2005/01/16 08:20:38 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1871,16 +1871,28 @@ sub start_option { if (!defined($paramHash->{OPTION_TEXTS})) { $paramHash->{OPTION_TEXTS} = [ ]; $paramHash->{OPTION_VARS} = [ ]; - + } + # OPTION_TEXTS is a list of the text attribute + # values used to create column headings. + # OPTION_VARS is a list of the variable names, used to create the checkbox + # inputs. # We're ok with empty elements. as place holders # Although the 'variable' element should really exist. + # + my $option_texts = $paramHash->{OPTION_TEXTS}; my $option_vars = $paramHash->{OPTION_VARS}; - push(@$option_texts, $token->[2]{'text'}); push(@$option_vars, $token->[2]{'variable'}); + # Need to create and declare the option variables as well to make them + # persistent. + # + my $varname = $token->[2]{'variable'}; + $helper->declareVar($varname); + + return ''; } @@ -1989,9 +2001,10 @@ BUTTONS my $resource_name = HTML::Entities::encode(&$valueFunc($resource),"<>&\"'"); if($option_vars) { - foreach my $var (@$option_vars) { + foreach my $option_var (@$option_vars) { $col .= - " "; } } @@ -2111,7 +2124,7 @@ sub start_student { $helper->declareVar($paramHash->{'variable'}); $paramHash->{'multichoice'} = $token->[2]{'multichoice'}; $paramHash->{'coursepersonnel'} = $token->[2]{'coursepersonnel'}; - $paramHash->{'sctiveonly'} = $token->[2]{'activeonly'}; + $paramHash->{'activeonly'} = $token->[2]{'activeonly'}; if (defined($token->[2]{'nextstate'})) { $paramHash->{NEXTSTATE} = $token->[2]{'nextstate'}; } @@ -2181,13 +2194,25 @@ SCRIPT $buttons = < - -
- -
- -  - + + + + + + + + + + + + + + + + + + +


 

BUTTONS } @@ -2997,6 +3022,9 @@ will make a "Finish Helper" button that which is useful for the Course Initialization helper so the users never see the old values taking effect. +If the parameter "restartCourse" is not true a 'Finish' Button will be +presented that takes the user back to whatever was defined as + =cut no strict; @@ -3094,8 +3122,12 @@ sub render { $result .= ''; } + my $actionURL = $self->{EXIT_PAGE}; + my $targetURL = ''; + my $finish=&mt('Finish'); if ($self->{'restartCourse'}) { - my $targetURL = '/adm/menu'; + my $actionURL = '/adm/roles'; + $targetURL = '/adm/menu'; if ($ENV{'course.'.$ENV{'request.course.id'}.'.url'}=~/^uploaded/) { $targetURL = '/adm/coursedocs'; } else { @@ -3104,25 +3136,24 @@ sub render { if ($ENV{'course.'.$ENV{'request.course.id'}.'.clonedfrom'}) { $targetURL = '/adm/parmset?overview=1'; } - my $previous = HTML::Entities::encode(&mt("<- Previous"), '<>&"'); - my $next = HTML::Entities::encode(&mt("Next ->"), '<>&"'); - $result .= "
\n" . - "
\n" . - "" . - "" . - "\n" . - "\n\n" . - "
"; + my $finish=&mt('Finish Course Initialization'); } + my $previous = HTML::Entities::encode(&mt("<- Previous"), '<>&"'); + my $next = HTML::Entities::encode(&mt("Next ->"), '<>&"'); + $result .= "
\n" . + "
\n" . + "" . + "" . + "\n" . + "\n\n" . + "
"; return $result; } sub overrideForm { - my $self = shift; - return $self->{'restartCourse'}; + return 1; } 1;