--- loncom/interface/lonparmset.pm 2010/04/13 21:47:24 1.495
+++ loncom/interface/lonparmset.pm 2011/10/07 15:25:40 1.505.2.1
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set parameters for assessments
#
-# $Id: lonparmset.pm,v 1.495 2010/04/13 21:47:24 raeburn Exp $
+# $Id: lonparmset.pm,v 1.505.2.1 2011/10/07 15:25:40 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1214,8 +1214,9 @@ sub isdateparm {
}
#
-# This function prints a list of parameters, which were selected. It also display a link from which you can
-# hide or show the complete parameter list, from which you can choose your parameters.
+# parmmenu displays a list of the selected parameters.
+# It also offers a link to show/hide the complete parameter list
+# from which you can select all desired parameters.
#
sub parmmenu {
my ($r,$allparms,$pscat,$keyorder)=@_;
@@ -1290,6 +1291,8 @@ sub parmmenu {
checkdates();
checkthis('weight','pscat');
checkthis('maxtries','pscat');
+ checkthis('type','pscat');
+ checkthis('problemstatus','pscat');
}
function hideParms() {
@@ -1319,7 +1322,7 @@ ENDSCRIPT
$r->print(&mt('Selected Parameters:').' ');
#print out all possible parms and hide them by default
- $r->print('
'grading',
'maxtries' => 'tries',
'hinttries' => 'tries',
+ 'randomizeontries' => 'tries',
'type' => 'problem_appearance',
'problemstatus' => 'problem_appearance',
'display' => 'problem_appearance',
@@ -1685,13 +1689,13 @@ sub displaymenu {
}
sub mapmenu {
- my ($r,$allmaps,$pschp,$maptitles, $symbp)=@_;
+ my ($r,$allmaps,$pschp,$maptitles,$symbp)=@_;
my %allmaps_inverted = reverse %$allmaps;
my $navmap = Apache::lonnavmaps::navmap->new();
my $tree=[];
my $treeinfo={};
if (defined($navmap)) {
- my $it=$navmap->getIterator(undef,undef,undef,1,undef,undef);
+ my $it=$navmap->getIterator(undef,undef,undef,1,1,undef);
my $curRes;
my $depth = 0;
my %parent = ();
@@ -1736,35 +1740,57 @@ sub mapmenu {
$r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Enclosing Map or Folder'),'','',' id="mapmenu"'));
if ((ref($tree) eq 'ARRAY') && (ref($treeinfo) eq 'HASH')) {
my $icon = '';
- $r->print(&Apache::loncommon::start_data_table()
- .&Apache::loncommon::start_data_table_row()
- .'
'.$icon
- .'
'
- .&Apache::loncommon::end_data_table_row()
+ my $whitespace =
+ '';
+
+ # Info about selectable folders/maps
+ $r->print(
+ '
'
+ .&mt('You can only select maps and folders which have modifiable settings.')
+ .' '.&Apache::loncommon::help_open_topic('Parameter_Set_Folder')
+ .'
';
}
return $result;
}
@@ -4398,6 +4555,49 @@ sub check_for_course_info {
return 0;
}
+sub questiontype_release_vars {
+ my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
+ my $chome = $env{'course.'.$env{'request.course.id'}.'.home'};
+ my $chostname = &Apache::lonnet::hostname($chome);
+ my ($cmajor,$cminor) =
+ split(/\./,&Apache::lonnet::get_server_loncaparev($cdom,$chome));
+ return ($chostname,$cmajor,$cminor);
+}
+
+sub questiontype_releasecheck {
+ my ($questiontype,$needsrelease,$chostname,$cmajor,$cminor) = @_;
+ my $needsnewer;
+ my ($needsmajor,$needsminor) = split(/\./,$needsrelease);
+ if (($cmajor < $needsmajor) ||
+ ($cmajor == $needsmajor && $cminor < $needsminor)) {
+ $needsnewer = 1;
+ } else {
+ &Apache::lonnet::update_released_required($Apache::lonnet::needsrelease{'parameter:type:'.$questiontype});
+ }
+ return $needsnewer;
+}
+
+sub oldversion_warning {
+ my ($questiontype,$chostname,$cmajor,$cminor,$needsrelease) = @_;
+ my $desc;
+ if (ref($strings{'string_questiontype'}) eq 'ARRAY') {
+ foreach my $possibilities (@{ $strings{'string_questiontype'} }) {
+ next unless (ref($possibilities) eq 'ARRAY');
+ my ($name, $description) = @{ $possibilities };
+ if ($name eq $questiontype) {
+ $desc = $description;
+ last;
+ }
+ }
+ }
+ return '
'.
+ &mt('Question Type was [_1]not[_2] set to [_3].',
+ '','','"'.$desc.'"').' '.
+ &mt('LON-CAPA version ([_1]) installed on home server ([_2]) does not meet version requirements ([_3] or newer).',
+ $cmajor.'.'.$cminor,$chostname,
+ $needsrelease).
+ '