# | '. - "\n".'Problem Title | '. - "\n".'Resource | '. - "\n".'Address | '. - "\n".'
---|---|---|---|
$P_No | ". - "\n"."".$Temp." | ". - "\n"."".$hash{'src_'.$rid}." | ". - "\n"."".''.' | '. - "\n"."
# | '. - "\n".'Set Title | '. - "\n".'Results | '. - "\n".'Tries | '. - "\n".'
---|---|---|---|
$SetNo | ". - "\n"."$Set | ". - "\n"."$PtrCod | ". - "\n"."$PtrTry | ". - "\n"."
P# | '."\n"; - for ( my $nIdx=0; $nIdx < $ColNo; $nIdx++ ) { - $Result .= ''.''.' | '."\n"; + my $Result = "\n".'
---|
P# | '."\n"; + for(my $nIndex=0; $nIndex < (scalar (keys %$headings)); $nIndex++) { + $Result .= ''.''.' | '."\n"; } $Result .= "\n".'
---|
'. - ' #Stdnts: Total Number of Students opened the problem.'; + # Looping through all the versions of each part, starting with the + # oldest version. Basically, it gets the most recent + # set of grade data for each part. + for(my $Version=1; $Version<=$LatestVersion; $Version++) { + foreach my $part (split(/\:/,$cache->{$sequence.':'. + $problemID. + ':parts'})) { + + if(!defined($cache->{$name.":$Version:$problem". + ":resource.$part.solved"})) { + # No grade for this submission, so skip + next; + } + + my $tries=0; + my $time=0; + my $awarded=0; + $Discussed=0; + my $code='U'; + + $awarded = $cache->{$name. + "$Version:$problem:resource.". + "$part.awarded"}; + $partData{$part.':awarded'} = ($awarded) ? $awarded : 0; + $totalAwarded += $awarded; + + $tries = $cache->{$name.":$Version:$problem". + ":resource.$part.tries"}; + $partData{$part.':tries'} = ($tries) ? $tries : 0; + $partData{$part.':wrong'} = $partData{$part.':tries'}; + $totalTries += $tries; + + my $val = $cache->{$name.":$Version:$problem". + ":resource.$part.solved"}; + if ($val eq 'correct_by_student') {$code = 'C';} + elsif ($val eq 'correct_by_override') {$code = 'O';} + elsif ($val eq 'incorrect_attempted') {$code = 'I';} + elsif ($val eq 'incorrect_by_override'){$code = 'I';} + elsif ($val eq 'excused') {$code = 'x';} + $partData{$part.':code'}=$code; + + if($partData{$part.':wrong'} ne 0 && + ($code eq 'C' || $code eq 'O')) { + $partData{$part.':wrong'}--; + } + } + } - $r->print($Ptr); - - $r->print('Output CSV format: print(' checked'); } - $r->print('>'); - - $r->rflush(); - - if ((-e "$CacheDB")&&($ENV{'form.sort'} ne 'Recalculate Statistics')) { - if (tie(%CachData,'GDBM_File',"$CacheDB",&GDBM_READER,0640)) { - tie(%GraphDat,'GDBM_File',$GraphDB,&GDBM_WRCREAT,0640); - &Cache_Statistics(); - } - else { - $r->print("Unable to tie hash to db file"); - } - } - else { - if (tie(%CachData,'GDBM_File',$CacheDB,&GDBM_WRCREAT,0640)) { - tie(%GraphDat,'GDBM_File',$GraphDB,&GDBM_WRCREAT,0640); - foreach (keys %DiscFac) {delete $CachData{$_};} - foreach (keys %CachData) {delete $CachData{$_};} - $DiscFlag=0; - &Build_Statistics(); - } - else { - $r->print("Unable to tie hash to db file"); - } - } + # Loop through all the parts for the current problem in the + # correct order and prepare the output + foreach (split(/\:/,$cache->{$sequence.':'.$problemID. + ':parts'})) { + my $Yes = 0; + if($partData{$_.':code'} eq 'C' || + $partData{$_.':code'} eq 'O') { + $Yes=1; + } + #my $ptr = "$hash{'title_'.$ResId}"; + my $ptr = $tempProblemOrder.'&'.$problemID; -# $r->print('Total instances of the problems : '.($p_count*($#students+1))); - untie(%CachData); - untie(%GraphDat); -} + if($_ > 1) { + $ptr .= "*(part $_)"; + $Dis .= '&'; + } + my ($pr_no,$dod)=split('&',$ptr); + my $DoDiff=$DoDiff{$dod}; +# $r->print('
'. - ' Tries : Total Number of Tries for solving the problem.
'. - ' Mod : Maximunm Number of Tries for solving the problem.
'. - ' Mean : Average Number of the tries. [ Tries / #Stdnts ]
'. - ' #YES : Number of students solved the problem correctly.
'. - ' #yes : Number of students solved the problem by override.
'. - ' %Wrng : Percentage of students tried to solve the problem but'. - ' still incorrect. [ 100*((#Stdnts-(#YES+#yes))/#Stdnts) ]
'. -# ' DoDiff : Degree of Difficulty of the problem. [ Tries/(#YES+#yes+0.1) ]
'. Kashy formula - ' DoDiff : Degree of Difficulty of the problem. [ 1 - ((#YES+#yes) / Tries) ]
'. #Gerd formula - ' S.D. : Standard Deviation of the tries.'. - '[ sqrt(sum((Xi - Mean)^2)) / (#Stdnts-1)'. - ' where Xi denotes every student\'s tries ]
'. - ' Skew. : Skewness of the students tries.'. - ' [ (sqrt( sum((Xi - Mean)^3) / #Stdnts)) / (S.D.^3) ]
'. - ' Dis.F. : Discrimination Factor: A Standard for '. - 'evaluating the problem according to a Criterion
'. - ' [Applied Criterion in %27 Upper Students - '. - 'Applied the same Criterion in %27 Lower Students]
'. - ' 1st Criterion for Sorting the Students: '. - 'Sum of Partial Credit Awarded / Total Number of Tries
'. - ' 2nd Criterion for Sorting the Students: '. - 'Total number of Correct Answers / Total Number of Tries'. - '
'; + $Ptr .= '#Stdnts: | '; + $Ptr .= 'Total Number of Students opened the problem.'; + $Ptr .= ' |
'; + $Ptr .= 'Tries: | '; + $Ptr .= 'Total Number of Tries for solving the problem.'; + $Ptr .= ' |
'; + $Ptr .= 'Mod: | '; + $Ptr .= 'Maximunm Number of Tries for solving the problem.'; + $Ptr .= ' |
'; + $Ptr .= 'Mean: | '; + $Ptr .= 'Average Number of the tries. [ Tries / #Stdnts ]'; + $Ptr .= ' |
'; + $Ptr .= '#YES: | '; + $Ptr .= 'Number of students solved the problem correctly.'; + $Ptr .= ' |
'; + $Ptr .= '#yes: | '; + $Ptr .= 'Number of students solved the problem by override.'; + $Ptr .= ' |
'; + $Ptr .= '%Wrng: | '; + $Ptr .= 'Percentage of students tried to solve the problem '; + $Ptr .= 'but still incorrect. [ 100*((#Stdnts-(#YES+#yes))/#Stdnts) ]'; + $Ptr .= ' |
';
+# Kashy formula
+# ' DoDiff : Degree of Difficulty of the problem. '. +# '[ Tries/(#YES+#yes+0.1) ] '. + #Gerd formula + $Ptr .= 'DoDiff: | ';
+ $Ptr .= 'Degree of Difficulty of the problem. '; + $Ptr .= '[ 1 - ((#YES+#yes) / Tries) ]'; + $Ptr .= ' |
'; + $Ptr .= 'S.D.: | '; + $Ptr .= 'Standard Deviation of the tries. '; + $Ptr .= '[ sqrt(sum((Xi - Mean)^2)) / (#Stdnts-1) '; + $Ptr .= 'where Xi denotes every student\'s tries ]'; + $Ptr .= ' |
'; + $Ptr .= 'Skew.: | '; + $Ptr .= 'Skewness of the students tries.'; + $Ptr .= '[(sqrt( sum((Xi - Mean)^3) / #Stdnts)) / (S.D.^3)]'; + $Ptr .= ' |
'; + $Ptr .= 'Dis.F.: | '; + $Ptr .= 'Discrimination Factor: A Standard for evaluating the ';
+ $Ptr .= 'problem according to a Criterion '; + $Ptr .= '[Applied Criterion in %27 Upper Students - '; + $Ptr .= 'Applied the same Criterion in %27 Lower Students] '; + $Ptr .= '1st Criterion for Sorting the Students: '; + $Ptr .= 'Sum of Partial Credit Awarded / Total Number of Tries '; + $Ptr .= '2nd Criterion for Sorting the Students: '; + $Ptr .= 'Total number of Correct Answers / Total Number of Tries'; + $Ptr .= ' |
Disc. | '; + $Ptr .= 'Number of Students had at least one discussion.'; + $Ptr .= ' |
\# | Problem Title | "; + $Str .= 'Resource | Analysis |
---|---|---|---|
'.$number.' | '; + $Str .= ''.$Temp.' | '; + $Str .= ''.$uri.' | '; + $Str .= '
\# | Set Title | "; + $Str .= 'Results | Tries |
---|---|---|---|
'.$sequence.' | '; + $Str .= ''.$cache->{$sequence.':title'}.' | '; + + $codes = ''; + $attempts = ''; + foreach my $problemID (split(':', $cache->{$sequence.':problems'})) { + my $problem = $cache->{$problemID.':problem'}; + my $LatestVersion = $cache->{$name.':version:'.$problem}; + + # Output dashes for all the parts of this problem if there + # is no version information about the current problem. + if(!$LatestVersion) { + foreach my $part (split(/\:/,$cache->{$sequence.':'. + $problemID. + ':parts'})) { + $codes .= "-,"; + $attempts .= "0,"; + } + next; + } + + my %partData=undef; + # Initialize part data, display skips correctly + # Skip refers to when a student made no submissions on that + # part/problem. + foreach my $part (split(/\:/,$cache->{$sequence.':'. + $problemID. + ':parts'})) { + $partData{$part.':tries'}=0; + $partData{$part.':code'}='-'; + } + + # Looping through all the versions of each part, starting with the + # oldest version. Basically, it gets the most recent + # set of grade data for each part. + for(my $Version=1; $Version<=$LatestVersion; $Version++) { + foreach my $part (split(/\:/,$cache->{$sequence.':'. + $problemID. + ':parts'})) { + + if(!defined($cache->{$name.":$Version:$problem". + ":resource.$part.solved"})) { + # No grade for this submission, so skip + next; + } + + my $tries=0; + my $code='U'; + + $tries = $cache->{$name.":$Version:$problem". + ":resource.$part.tries"}; + $partData{$part.':tries'}=($tries) ? $tries : 0; + + my $val = $cache->{$name.":$Version:$problem". + ":resource.$part.solved"}; + if ($val eq 'correct_by_student') {$code = 'Y';} + elsif ($val eq 'correct_by_override') {$code = 'y';} + elsif ($val eq 'incorrect_attempted') {$code = 'N';} + elsif ($val eq 'incorrect_by_override'){$code = 'N';} + elsif ($val eq 'excused') {$code = 'x';} + $partData{$part.':code'}=$code; + } + } + + # Loop through all the parts for the current problem in the + # correct order and prepare the output + foreach (split(/\:/,$cache->{$sequence.':'.$problemID. + ':parts'})) { + $codes .= $partData{$_.':code'}.','; + $attempts .= $partData{$_.':tries'}.','; + } + } + $codes =~ s/,$//; + $attempts =~ s/,$//; + $Str .= ''.$codes.' | '; + $Str .= ''.$attempts.' | '; + $Str .= '
Select Map | '."\n"; + $Ptr .= ''; + $Ptr .= &Apache::lonhtmlcommon::MapOptions(\%cache, 'ProblemStatistics'); + $Ptr .= ' |
Select Map | '."\n"; + $Ptr .= ''; + $Ptr .= &Apache::lonhtmlcommon::MapOptions(\%cache, 'StudentAssessment'); + $Ptr .= ' | ||||||
Select Student | '."\n"; + $Ptr .= ''."\n"; + $Ptr .= &Apache::lonhtmlcommon::StudentOptions(\%cache, $students, + $selectedName, + 'StudentAssessment'); + $Ptr .= ' | ||||||
';
+ $Ptr .= 'print($Ptr);
+
+ if($selectedName eq 'No Student Selected') {
+ $r->print('WARNING: '); + $r->print('Please select a student'); + return; + } + + my $selected=0; + foreach (@$students) { + next if ($_ ne $selectedName && + $selectedName ne 'All Students'); + $selected = 1; + my $courseData = + &Apache::loncoursedata::DownloadStudentCourseInformation($_, + $courseID); + last if ($c->aborted()); + if(tie(%cache,'GDBM_File',$cacheDB,&GDBM_WRCREAT,0640)) { + &Apache::loncoursedata::ProcessStudentData(\%cache, + $courseData, $_); + if(!$c->aborted()) { $r->print(&StudentReport(\%cache, $_)); } + untie(%cache); + } } - $CurSec = $ENV{'form.section'}; - if ( $CurSec eq '' ) { - $CurSec = 'All Sections'; - $OpSel4 = 'selected'; + if($selected == 0) { + $r->print('WARNING: '); + $r->print('Please select a student'); + return; + } + + return; +} + +sub BuildClasslist { + my ($cacheDB,$students,$studentInformation,$headings,$spacePadding)=@_; + + my %cache; + unless(tie(%cache,'GDBM_File',$cacheDB,&GDBM_READER,0640)) { + return 'Unable to tie database.'; + } + + my $Str=''; + $Str .= '
'; - $Ptr .= ''; - $Ptr .= ' Select Map '."\n". - ''; - $Ptr .= ' '; -# ----------------------------------- Loading the Sections Combobox - $Ptr .= ' Select Section'."\n". - ''."\n"; - $r->print( $Ptr ); + if($GoToPage eq 'Activity Log') { + &Activity(); + } elsif($GoToPage eq 'Problem Statistics') { + &BuildProblemStatisticsPage($cacheDB, $students, $courseID, $c); + } elsif($GoToPage eq 'Problem Analysis') { + &BuildProblemAnalysisPage($cacheDB); + } elsif($GoToPage eq 'Student Assessment') { + &BuildStudentAssessmentPage($cacheDB, $students, $courseID, $c); + } elsif($GoToPage eq 'Analyze') { + &BuildAnalyzePage($cacheDB, $students, $courseID); + } elsif($GoToPage eq 'DoDiffGraph') { + &BuildDiffGraph($courseID); + } elsif($GoToPage eq 'PercentWrongGraph') { + &BuildWrongGraph($courseID); + } elsif($GoToPage eq 'Class list') { + $r->print(&BuildClasslist($cacheDB, $students, \@studentInformation, + \@headings, $spacePadding)); + } + + $r->print(''."\n"); + $r->print("\n".' |