version 1.13, 2002/08/13 00:37:18
|
version 1.17, 2002/08/14 21:51:51
|
Line 396 sub ProcessTopResourceMap {
|
Line 396 sub ProcessTopResourceMap {
|
$beenHere{'o:'.$partId.$currentResourceID}++; |
$beenHere{'o:'.$partId.$currentResourceID}++; |
if(defined($cache->{'OptionResponses'})) { |
if(defined($cache->{'OptionResponses'})) { |
$cache->{'OptionResponses'}.= ':::'. |
$cache->{'OptionResponses'}.= ':::'. |
$currentResourceID.':'. |
$currentSequence.':'.$currentResourceID.':'. |
$partId.':'.$responseId; |
$partId.':'.$responseId; |
} else { |
} else { |
$cache->{'OptionResponses'}= $currentResourceID. |
$cache->{'OptionResponses'}= $currentSequence.':'. |
':'.$partId.':'.$responseId; |
$currentResourceID.':'. |
|
$partId.':'.$responseId; |
} |
} |
} |
} |
} |
} |
Line 680 sub ExtractStudentData {
|
Line 681 sub ExtractStudentData {
|
my $totalProblems = 0; |
my $totalProblems = 0; |
my $problemsSolved = 0; |
my $problemsSolved = 0; |
my $numberOfParts = 0; |
my $numberOfParts = 0; |
|
my $totalAwarded = 0; |
foreach my $sequence (split(':', $data->{'orderedSequences'})) { |
foreach my $sequence (split(':', $data->{'orderedSequences'})) { |
foreach my $problemID (split(':', $data->{$sequence.':problems'})) { |
foreach my $problemID (split(':', $data->{$sequence.':problems'})) { |
my $problem = $data->{$problemID.':problem'}; |
my $problem = $data->{$problemID.':problem'}; |
Line 691 sub ExtractStudentData {
|
Line 693 sub ExtractStudentData {
|
foreach my $part (split(/\:/,$data->{$sequence.':'. |
foreach my $part (split(/\:/,$data->{$sequence.':'. |
$problemID. |
$problemID. |
':parts'})) { |
':parts'})) { |
|
$output->{$name.':'.$problemID.':'.$part.':tries'} = 0; |
|
$output->{$name.':'.$problemID.':'.$part.':awarded'} = 0; |
|
$output->{$name.':'.$problemID.':'.$part.':code'} = ' '; |
$totalProblems++; |
$totalProblems++; |
} |
} |
$output->{$name.':'.$problemID.':NoVersion'} = 'true'; |
$output->{$name.':'.$problemID.':NoVersion'} = 'true'; |
Line 791 sub ExtractStudentData {
|
Line 796 sub ExtractStudentData {
|
$partData{$part.':code'}; |
$partData{$part.':code'}; |
$output->{$name.':'.$problemID.':'.$part.':awarded'} = |
$output->{$name.':'.$problemID.':'.$part.':awarded'} = |
$partData{$part.':awarded'}; |
$partData{$part.':awarded'}; |
|
$totalAwarded += $partData{$part.':awarded'}; |
$output->{$name.':'.$problemID.':'.$part.':timestamp'} = |
$output->{$name.':'.$problemID.':'.$part.':timestamp'} = |
$partData{$part.':timestamp'}; |
$partData{$part.':timestamp'}; |
foreach my $response (split(':', $data->{$sequence.':'. |
foreach my $response (split(':', $data->{$sequence.':'. |
Line 813 sub ExtractStudentData {
|
Line 819 sub ExtractStudentData {
|
|
|
$output->{$name.':problemsSolved'} = $problemsSolved; |
$output->{$name.':problemsSolved'} = $problemsSolved; |
$output->{$name.':totalProblems'} = $totalProblems; |
$output->{$name.':totalProblems'} = $totalProblems; |
|
$output->{$name.':totalAwarded'} = $totalAwarded; |
|
|
return; |
return; |
} |
} |
Line 1016 sub DownloadStudentCourseData {
|
Line 1023 sub DownloadStudentCourseData {
|
if($status eq 'true') { |
if($status eq 'true') { |
&Apache::lonhtmlcommon::Create_PrgWin($r, $title, $heading); |
&Apache::lonhtmlcommon::Create_PrgWin($r, $title, $heading); |
} |
} |
my $count=1; |
|
|
my $displayString; |
|
my $count=0; |
foreach (@$students) { |
foreach (@$students) { |
if($c->aborted()) { return 'Aborted'; } |
if($c->aborted()) { return 'Aborted'; } |
|
|
if($status eq 'true') { |
if($status eq 'true') { |
|
$count++; |
my $displayString = $count.'/'.$studentCount.': '.$_; |
my $displayString = $count.'/'.$studentCount.': '.$_; |
&Apache::lonhtmlcommon::Update_PrgWin($displayString, $r); |
&Apache::lonhtmlcommon::Update_PrgWin($displayString, $r); |
} |
} |
Line 1055 sub DownloadStudentCourseData {
|
Line 1065 sub DownloadStudentCourseData {
|
next; |
next; |
} |
} |
} |
} |
$count++; |
|
} |
} |
if($status eq 'true') { &Apache::lonhtmlcommon::Close_PrgWin($r); } |
if($status eq 'true') { &Apache::lonhtmlcommon::Close_PrgWin($r); } |
|
|
Line 1087 sub DownloadStudentCourseDataSeparate {
|
Line 1096 sub DownloadStudentCourseDataSeparate {
|
if($status eq 'true') { |
if($status eq 'true') { |
&Apache::lonhtmlcommon::Create_PrgWin($r, $title, $heading); |
&Apache::lonhtmlcommon::Create_PrgWin($r, $title, $heading); |
} |
} |
my $count=1; |
my $count=0; |
|
my $displayString=''; |
foreach (@$students) { |
foreach (@$students) { |
if($c->aborted()) { |
if($c->aborted()) { |
untie(%downloadData); |
untie(%downloadData); |
Line 1095 sub DownloadStudentCourseDataSeparate {
|
Line 1105 sub DownloadStudentCourseDataSeparate {
|
} |
} |
|
|
if($status eq 'true') { |
if($status eq 'true') { |
my $displayString = $count.'/'.$studentCount.': '.$_; |
$count++; |
|
$displayString = $count.'/'.$studentCount.': '.$_; |
&Apache::lonhtmlcommon::Update_PrgWin($displayString, $r); |
&Apache::lonhtmlcommon::Update_PrgWin($displayString, $r); |
} |
} |
|
|
Line 1130 sub DownloadStudentCourseDataSeparate {
|
Line 1141 sub DownloadStudentCourseDataSeparate {
|
$downloadData{$_.':error'} = 'No course data for '.$_; |
$downloadData{$_.':error'} = 'No course data for '.$_; |
} |
} |
} |
} |
$count++; |
|
} |
} |
if($status eq 'true') { &Apache::lonhtmlcommon::Close_PrgWin($r); } |
if($status eq 'true') { &Apache::lonhtmlcommon::Close_PrgWin($r); } |
|
|
|
untie(%downloadData); |
return &CheckForResidualDownload($cacheDB, 'true', 'true', |
return &CheckForResidualDownload($cacheDB, 'true', 'true', |
$courseID, $r, $c); |
$courseID, $r, $c); |
} |
} |
Line 1143 sub CheckForResidualDownload {
|
Line 1154 sub CheckForResidualDownload {
|
|
|
my $residualFile = '/home/httpd/perl/tmp/'.$courseID.'DownloadFile.db'; |
my $residualFile = '/home/httpd/perl/tmp/'.$courseID.'DownloadFile.db'; |
if(!-e $residualFile) { |
if(!-e $residualFile) { |
return; |
return 'File does not exist'; |
} |
} |
|
|
my %downloadData; |
my %downloadData; |
my %cache; |
my %cache; |
unless(tie(%downloadData,'GDBM_File',$residualFile,&GDBM_READER(),0640) && |
unless(tie(%downloadData,'GDBM_File',$residualFile,&GDBM_READER(),0640)) { |
tie(%cache,'GDBM_File',$cacheDB,&GDBM_WRCREAT(),0640)) { |
return 'Can not tie database for check for residual download: tempDB'; |
return; |
} |
|
unless(tie(%cache,'GDBM_File',$cacheDB,&GDBM_WRCREAT(),0640)) { |
|
untie(%downloadData); |
|
return 'Can not tie database for check for residual download: cacheDB'; |
} |
} |
|
|
my @dataKeys=keys(%downloadData); |
my @dataKeys=keys(%downloadData); |