--- loncom/interface/lonparmset.pm 2011/01/15 21:49:37 1.510
+++ loncom/interface/lonparmset.pm 2012/05/06 22:09:14 1.522
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set parameters for assessments
#
-# $Id: lonparmset.pm,v 1.510 2011/01/15 21:49:37 www Exp $
+# $Id: lonparmset.pm,v 1.522 2012/05/06 22:09:14 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -137,33 +137,41 @@ javascript function 'pjump'.
=item extractResourceInformation() :
-Given the course data hash, extractResourceInformation extracts lots of information about the course's resources into a variety of hashes.
+ extractResourceInformation extracts lots of information about all of the the course's resources into a variety of hashes.
Input: See list below:
-=item * B : An array that will contain all of the ids in the course.
+=item * B : Current username
-=item * B : hash, id->type, where "type" contains the extension of the file, thus, I.
+=item * B : Domain of current user.
-=item * B : hash, id->key list, will contain a comma separated list of the meta-data keys available for the given id
+=item * b : hash, name of parameter->display value (what is the display value?)
+Outputs: See list below:
-=item * B : hash, part identification->text representation of part, where the text representation is "[Part $part]"
+=item * B (out) : An array that will contain all of the ids in the course.
-=item * B : hash, full key to part->display value (what's display value?)
+=item * B(out) : hash, id->type, where "type" contains the extension of the file, thus, I.
-=item * B : hash, ???
+=item * B (out) : hash, id->key list, will contain a comma separated list of the meta-data keys available for the given id
-=item * B : ???
+=item * B (out) : hash, name of parameter->display value (what is the display value?)
-=item * B : hash, ???
+=item * B (out) : hash, part identification->text representation of part, where the text representation is "[Part $part]"
+
+=item * B (out) : hash, ???
=item * B : ??
=item * B : hash, id->full sym?
+=item * B
+
+=item * B
+
+=item * B
+=item * B
=item isdateparm()
@@ -196,8 +204,8 @@ Input: See list below:
Show assessment data and parameters. This is a large routine that should
be simplified and shortened... someday.
-Inputs: $r
-
+Inputs: $r - the Apache request object.
+
Returns: nothing
Variables used (guessed by Jeremy):
@@ -805,6 +813,7 @@ sub valout {
&date_sanity_info($value);
} else {
$result = $value;
+ $result=~s/\,/\, /gs;
$result = &HTML::Entities::encode($result,'"<>&');
}
}
@@ -846,16 +855,10 @@ sub page_js {
return(<
// "pclose()",
- 'onload' => "showHide_courseContent(); group_or_section('cgroup')",
- );
+ my %loaditems = (
+ 'onload' => "group_or_section('cgroup')",
+ );
+ if (!$psymb) {
+ $loaditems{'onload'} = "showHide_courseContent(); group_or_section('cgroup')";
+ }
if ((($env{'form.command'} eq 'set') && ($env{'form.url'})
&& (!$env{'form.dis'})) || ($env{'form.symb'})) {
@@ -1165,6 +1171,7 @@ sub extractResourceInformation {
$$typep{$id}=$1;
$$keyp{$id}='';
$$uris{$id}=$srcf;
+
foreach my $key (split(/\,/,&Apache::lonnet::metadata($srcf,'allpossiblekeys'))) {
next if ($key!~/^parameter_/);
@@ -1288,8 +1295,9 @@ sub parmmenu {
}
function checkdisset() {
- checkthis('discussend','pscat');
+ checkthis('discussend','pscat');
checkthis('discusshide','pscat');
+ checkthis('discussvote','pscat');
}
function checkcontdates() {
@@ -1353,6 +1361,8 @@ sub lookUpTableParameter {
'contentopen' => 'time_settings',
'contentclose' => 'time_settings',
'discussend' => 'time_settings',
+ 'printopendate' => 'time_settings',
+ 'printclosedate' => 'time_settings',
'weight' => 'grading',
'handgrade' => 'grading',
'maxtries' => 'tries',
@@ -1384,6 +1394,9 @@ sub lookUpTableParameter {
'acc' => 'misc',
'maxcollaborators' => 'misc',
'scoreformat' => 'misc',
+ 'lenient' => 'grading',
+ 'retrypartial' => 'tries',
+ 'discussvote' => 'misc',
);
}
@@ -1931,8 +1944,11 @@ sub standardkeyorder {
'parameter_0_tol' => 16,
'parameter_0_sig' => 17,
'parameter_0_turnoffunit' => 18,
- 'parameter_0_discussend' => 19,
- 'parameter_0_discusshide' => 20);
+ 'parameter_0_discussend' => 19,
+ 'parameter_0_discusshide' => 20,
+ 'parameter_0_discussvote' => 21,
+ 'parameter_0_printopendate' => 22,
+ 'parameter_0_printclosedate' => 23);
}
@@ -1940,6 +1956,9 @@ sub assessparms {
my $r=shift;
+
+
+# -------------------------------------------------------- Variable declaration
my @ids=();
my %symbp=();
my %mapp=();
@@ -1947,9 +1966,6 @@ sub assessparms {
my %keyp=();
my %uris=();
my %maptitles=();
-
-# -------------------------------------------------------- Variable declaration
-
my %allmaps=();
my %alllevs=();
@@ -1968,14 +1984,16 @@ sub assessparms {
my %allparms;
my %allparts;
+# ------------------------------------------------------------------------------
+
#
# Order in which these parameters will be displayed
#
my %keyorder=&standardkeyorder();
- @ids=();
- %symbp=();
- %typep=();
+# @ids=();
+# %symbp=(); # These seem defined above already.
+# %typep=();
my $message='';
@@ -1995,7 +2013,7 @@ sub assessparms {
my @psprt=&Apache::loncommon::get_env_multiple('form.psprt');
- if (!@psprt) { $psprt[0]='0'; }
+ if (!@psprt) { $psprt[0]='all'; }
if (($env{'form.part'}) && ($psprt[0] ne 'all')) { $psprt[0]=$env{'form.part'}; }
my $pssymb='';
@@ -2097,8 +2115,10 @@ sub assessparms {
my $chome = $env{'course.'.$env{'request.course.id'}.'.home'};
my ($got_chostname,$chostname,$cmajor,$cminor);
my $totalstored = 0;
+
+
for (my $i=0;$i<=$#markers;$i++) {
- my ($needsrelease,$needsnewer);
+ my ($needsrelease,$needsnewer,$name);
if ($markers[$i] =~ /^[\d.]+\&0_availablestudent\&(1|2|3)$/) {
my (@ok_slots,@fail_slots,@del_slots);
my $courseopt=&Apache::lonnet::get_courseresdata($cnum,$cdom);
@@ -2129,22 +2149,23 @@ sub assessparms {
}
}
}
- } elsif ($markers[$i] =~ /_type\&\d+$/) {
+ } elsif ($markers[$i] =~ /_(type|lenient|retrypartial|discussvote)\&\d+$/) {
+ $name = $1;
$needsrelease =
- $Apache::lonnet::needsrelease{'parameter:type:'.$values[$i]};
+ $Apache::lonnet::needsrelease{"parameter:$name:$values[$i]"};
if ($needsrelease) {
unless ($got_chostname) {
- ($chostname,$cmajor,$cminor) = &questiontype_release_vars();
+ ($chostname,$cmajor,$cminor) = ¶meter_release_vars();
$got_chostname = 1;
}
- $needsnewer = &questiontype_releasecheck($values[$i],
- $needsrelease,
- $chostname,
- $cmajor,$cminor);
+ $needsnewer = ¶meter_releasecheck($name,$values[$i],
+ $needsrelease,
+ $chostname,
+ $cmajor,$cminor);
}
}
if ($needsnewer) {
- $message .= &oldversion_warning($values[$i],$chostname,$cmajor,
+ $message .= &oldversion_warning($name,$values[$i],$chostname,$cmajor,
$cminor,$needsrelease);
} else {
$message.=&storeparm(split(/\&/,$markers[$i]),
@@ -2168,7 +2189,7 @@ sub assessparms {
if ($psprt[0] eq "all" || !@psprt) {@psprt = (keys %allparts);}
# ------------------------------------------------------------------ Start page
- &startpage($r);
+ &startpage($r,$pssymb);
foreach ('tolerance','date_default','date_start','date_end',
'date_interval','int','float','string') {
@@ -2244,7 +2265,7 @@ COURSECONTENTSCRIPT
# Update Display Button
$r->print('