[LON-CAPA-cvs] cvs: loncom /interface lonwhatsnew.pm
raeburn
lon-capa-cvs@mail.lon-capa.org
Wed, 01 Jun 2005 19:24:50 -0000
raeburn Wed Jun 1 15:24:50 2005 EDT
Modified files:
/loncom/interface lonwhatsnew.pm
Log:
Pass course domain and course number to subroutines. Correction to naming of db key for last reset.
Index: loncom/interface/lonwhatsnew.pm
diff -u loncom/interface/lonwhatsnew.pm:1.14 loncom/interface/lonwhatsnew.pm:1.15
--- loncom/interface/lonwhatsnew.pm:1.14 Tue May 24 11:54:19 2005
+++ loncom/interface/lonwhatsnew.pm Wed Jun 1 15:24:50 2005
@@ -1,5 +1,5 @@
#
-# $Id: lonwhatsnew.pm,v 1.14 2005/05/24 15:54:19 albertel Exp $
+# $Id: lonwhatsnew.pm,v 1.15 2005/06/01 19:24:50 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -105,10 +105,13 @@
degdiff => 'Degree of difficulty',
numstudents => 'Total number of students with submissions',
);
+ my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
+ my $crs = $env{'course.'.$env{'request.course.id'}.'.num'};
+
if ($command eq 'chgthreshold') {
- &display_config_box($r,$command,$tabbg,\%threshold_titles);
+ &display_config_box($r,$command,$tabbg,\%threshold_titles,$cdom,$crs);
} else {
- &display_actions_box($r,$command,\%threshold_titles);
+ &display_actions_box($r,$command,\%threshold_titles,$cdom,$crs);
}
$r->print(<<END_OF_BLOCK);
</td>
@@ -146,7 +149,7 @@
#-------------------------------
sub display_actions_box() {
- my ($r,$command,$threshold_titles) = @_;
+ my ($r,$command,$threshold_titles,$cdom,$crs) = @_;
my $rowColor1 = "#ffffff";
my $rowColor2 = "#eeeeee";
@@ -187,8 +190,6 @@
}
my $result;
- my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
- my $crs = $env{'course.'.$env{'request.course.id'}.'.num'};
if ($command eq 'reset') {
$result = &process_reset($cdom,$crs);
@@ -437,7 +438,7 @@
#-------------------------------
sub display_config_box() {
- my ($r,$command,$tabbg,$threshold_titles) = @_;
+ my ($r,$command,$tabbg,$threshold_titles,$cdom,$crs) = @_;
my %threshold = ();
my $rowColor1 = "#ffffff";
my $rowColor2 = "#eeeeee";
@@ -449,7 +450,7 @@
degdiff => 'Degree of difficulty',
numstudents => 'Total number of students with submissions',
);
- &get_curr_thresholds(\%threshold);
+ &get_curr_thresholds(\%threshold,$cdom,$crs);
$r->print('<br /><form name="thresholdform" method="post"><table border="0" cellpadding="2" cellspacing="4"><tr><td align="left" valign="top" width="45%">
<table border="0" cellpadding="0" cellspacing="0" bgcolor="#000000">
@@ -668,8 +669,8 @@
my $lastreset = 'None';
if ($$resethash{'version'}) {
for (my $version=1;$version<=$$resethash{'version'};$version++) {
- if (exists($$resethash{$version.':'.$part.'prev_attempts'})) {
- $lastreset = $$resethash{$version.':timestamp'};
+ if (exists($$resethash{$version.':'.$part."\0".'prev_attempts'})) {
+ $lastreset = $$resethash{$version.':timestamp'};
}
}
}
@@ -737,7 +738,7 @@
sub process_update {
my ($dom,$crs,$threshold_titles) = @_;
- my $setoutput = '<b>Changes to threshold(s):</b><br />';
+ my $setoutput = '<b>Changes to threshold(s) for problem tracking:</b><br />';
foreach (keys %env) {
next if ($_!~/^form\.(.+)\_setparmval$/);
my $name = $1;