'.&Apache::loncommon::end_page());
}
-#
-# Go through the complete course and collect data
-#
sub getData {
@@ -268,17 +203,13 @@ sub getData {
# Create the nav map
my $navmap = Apache::lonnavmaps::navmap->new($uname,$udom);
- if (!defined($navmap)) {
- return ();
- }
-
my $res = $navmap->firstResource(); # temp resource to access constants
my $iterator = $navmap->getIterator(undef, undef, undef, 1);
my $depth = 1;
$iterator->next(); # ignore first BEGIN_MAP
my $curRes = $iterator->next();
-
+
# General overview of the following: Walk along the course resources.
# For every problem in the resource, tell its parent maps how many
# parts and how many parts correct it has. After that, each map will
@@ -311,11 +242,12 @@ sub getData {
my $stack = $iterator->getStack();
for my $part (@{$parts}) {
+ my $completionStatus = $curRes->getCompletionStatus($part);
my $dateStatus = $curRes->getDateStatus($part);
my $weight = $curRes->weight($part);
my $problemstatus = $curRes->problemstatus($part);
- if ($curRes->solved($part) eq 'excused') {
+ if ($completionStatus == $curRes->EXCUSED()) {
next;
}
if ($showPoints) {
@@ -337,8 +269,12 @@ sub getData {
$totalRight += $score;
$partsCount += $weight;
+ $curRes->{DATA}->{PROB_SCORE} += $score;
+ $curRes->{DATA}->{PROB_WEIGHT} += $weight;
+
if ($curRes->opendate($part) < $now) {
$totalPossible += $weight;
+ $curRes->{DATA}->{PROB_POSSIBLE} += $weight;
}
$totalParts += $weight;
} else {
@@ -387,8 +323,7 @@ sub getData {
}
$curRes = $iterator->next();
}
- return ($navmap,$totalParts,$totalPossible,$totalRight,$totalAttempted,
- $topLevelParts,$topLevelRight,$topLevelAttempted);
+ return ($navmap,$totalParts,$totalPossible,$totalRight,$totalAttempted,$topLevelParts,$topLevelRight,$topLevelAttempted);
}
#
@@ -397,8 +332,8 @@ sub getData {
sub outputTable {
- my ($r,$showPoints,$notshowTotals,$nostdtotals,$navmap,$totalParts,$totalPossible,
- $totalRight,$totalAttempted,$topLevelParts,$topLevelRight,$topLevelAttempted)=@_;
+ my ($r,$showPoints,$notshowTotals,
+ $navmap,$totalParts,$totalPossible,$totalRight,$totalAttempted,$topLevelParts,$topLevelRight,$topLevelAttempted)=@_;
my @start = (255, 255, 192);
my @end = (0, 192, 0);
@@ -483,103 +418,754 @@ sub outputTable {
# show totals (if applicable), close table
#
if ($showPoints) {
- unless ($nostdtotals) {
- my $maxHelpLink = &Apache::loncommon::help_open_topic("Quick_Grades_Possibly_Correct");
+ my $maxHelpLink = &Apache::loncommon::help_open_topic("Quick_Grades_Possibly_Correct");
- $title = $showPoints ? "Points" : "Parts Done";
- my $totaltitle = $showPoints ? &mt("Awarded Total Points") : &mt("Total Parts Done");
- $r->print(&Apache::loncommon::start_data_table_row()
- .'
'.$totaltitle.': '.$totalRight.' ');
- $r->print(&mt('Max Possible To Date')." $maxHelpLink: $totalPossible ");
- $title = $showPoints ? "Points" : "Parts";
- $r->print(&mt("Total $title In Course").': '.$totalParts.'
'); }
+ }
+# Re-adjust total points if force total
+ if ($categories{$id.'_totaltype'} eq 'typein') {
+ $totalpossible=1.*$categories{$id.'_total'};
+ }
+
+ if ($output) {
+ $r->print('
');
+ if ($cangrade) { $r->print(' '.&new_calc_rule_form($id)); }
+ $r->print('
'); }
+ if ($cangrade) {
+ if ($output) {
+ $r->print('');
}
- push(@notes,&mt('Students will see link to spreadsheet.')) if ($showSPRSlink);
- push(@notes,&Apache::lonhtmlcommon::coursepreflink(&mt('Grade display settings'),'grading'));
- $r->print(&Apache::loncommon::head_subbox(join(' ',@notes)));
- } elsif (!$allowed_to_edit) {
- if (!$showPoints && !$notshowSPRSlink ) {
- $r->print(&Apache::loncommon::head_subbox(
- &mt('This screen shows how many problems (or problem parts) you have completed'
- .', and how many you have not yet done.'
- .' You can also look at [_1]a detailed score sheet[_2].'
- ,'','')));
+ }
+ if ($output) {
+ $r->print('