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 .= '
';
- $Ptr .= '
Disc.
';
- $Ptr .= '
Number of Students had at least one discussion.';
- $Ptr .= '
';
-
- return $Ptr;
-}
-
-#---- END Problem Statistics Web Page ----------------------------------------
-
-#---- Problem Statistics Graph Web Page --------------------------------------
-
-# ------------------------------------------- Prepare data for Graphical chart
-
-sub GetGraphData {
- my $ylab = shift;
- my $Col;
- my $data='';
- my $count = 0;
- my $Max = 0;
- my $cid=$ENV{'request.course.id'};
- my $GraphDB = "/home/httpd/perl/tmp/$ENV{'user.name'}".
- "_$ENV{'user.domain'}_$cid\_graph.db";
- foreach (keys %GraphDat) {delete $GraphDat{$_};}
- if (-e "$GraphDB") {
- if (tie(%GraphDat,'GDBM_File',"$GraphDB",&GDBM_READER,0640)) {
- if ( $ylab eq 'DoDiff Graph' ) {
- $ylab = 'Degree-of-Difficulty';
- $Col = 0;
- }
- else {
- $ylab = 'Wrong-Percentage';
- $Col = 1;
- }
- foreach (sort NumericSort keys %GraphDat) {
- my @Temp=split(/\:/,$GraphDat{$_});
- my $inf = $Temp[$Col];
- if ( $Max < $inf ) {$Max = $inf;}
- $data .= $inf.',';
- $count++;
- }
- if ( $Max > 1 ) {
- $Max += (10 - $Max % 10);
- $Max = int($Max);
- }
- else { $Max = 1; }
- untie(%GraphDat);
- my $Course = $ENV{'course.'.$cid.'.description'};
- $Course =~ s/\ /"_"/eg;
- $GData=$Course.'&'.'Problems'.'&'.$ylab.'&'.$Max.'&'.$count.'&'.$data;
- }
- else {
- $r->print("Unable to tie hash to db file");
- }
- }
-}
-#---- Problem Analysis Web Page ----------------------------------------------
-
-sub IntervalOptions {
- my ($cache)=@_;
-
- my $interval = 1;
- for(my $n=1; $n<=7; $n++) {
- if($cache->{'Interval'} == $n) {
- $interval = $n;
- }
- }
-
- my $Ptr = ' Select number of intervals'."\n".
- ''."\n";
-
- return $Ptr;
+ #
+ return;
}
-sub OptionResponseTable {
- my ($cache)=@_;
- my $Str = '';
- $Str .= ' Option Response Problems in this course:'."\n";
- $Str .= '
'."\n";
- $Str .= "
\#
Problem Title
";
- $Str .= '
Resource
Analysis
'."\n";
-
- my $number=1;
- foreach (split(':::',$cache->{'OptionResponses'})) {
- my ($uri,$title,$part,$problem)=split('::',$_);
- my $Temp = ''.$title.'';
- $Str .= '
';
- $Str .= '
'.$number.'
';
- $Str .= '
'.$Temp.'
';
- $Str .= '
'.$uri.'
';
- $Str .= '
'."\n";
- $number++;
- }
- $Str .= '
'."\n";
- return $Str;
-}
+#######################################################
+#######################################################
-#---- END Problem Analysis Web Page ------------------------------------------
+=pod
-#---- Student Assessment Web Page --------------------------------------------
+=item get_students
-# ------ Create different Student Report
-sub StudentReport {
- my ($cache, $name)=@_;
+Returns a list of the selected students
- my $Str = '';
- if($cache->{$name.':error'} =~ /course/) {
- my ($username)=split(':',$name);
- $Str .= 'No course data for student ';
- $Str .= ''.$username.'. ';
- return $Str;
- }
+=cut
- $Str .= "
\#
Set Title
";
- $Str .= '
Results
Tries
'."\n";
-
- my $codes;
- my $attempts;
- foreach my $sequence (split(':', $cache->{'orderedSequences'})) {
- if($cache->{'StudentAssessmentMap'} ne 'All Maps' &&
- $cache->{'StudentAssessmentMap'} ne $cache->{$sequence.':title'}) {
- next;
- }
+#######################################################
+#######################################################
+sub get_students {
+ if (! @Students) {
+ &PrepareClasslist()
+ }
+ return @Students;
+}
- $Str .= '
'.$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;
- }
+=pod
- 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'}='-';
- }
+=item ¤t_student()
- # 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;
- }
+Returns a pointer to a hash containing data about the currently
+selected student.
- my $tries=0;
- my $code='U';
+=cut
- $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;
- }
- }
+#######################################################
+#######################################################
+sub current_student {
+ return $curr_student;
+}
- # 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 .= '
');
-
- $r->print(&ProblemStatisticsLegend());
-
- untie(%cache);
- foreach (@$students) {
- my $courseData =
- &Apache::loncoursedata::DownloadStudentCourseInformation($_,
- $courseID);
- last if ($c->aborted());
- if(tie(%cache,'GDBM_File',$cacheDB,&GDBM_WRCREAT,0640)) {
- &Apache::loncoursedata::ProcessStudentData(\%cache,
- $courseData, $_);
- untie(%cache);
+ #
+ # Build the form element
+ my $Str = "\n";
+ $Str .= '\n";
+ return $Str;
+}
- my ($upper, $lower) = &Discriminant($discriminantFactor);
- my %Header = (0,"Homework Sets Order",1,"#Stdnts",2,"Tries",3,"Mod",
- 4,"Mean",5,"#YES",6,"#yes",7,"%Wrng",8,"DoDiff",
- 9,"S.D.",10,"Skew.",11,"D.F.1st",12,"D.F.2nd", 13, "Disc.");
- &BuildStatisticsTable(\%cache, $discriminantFactor, \@list, \%Header,
- $students);
+##############################################
+##############################################
- untie(%cache);
+=pod
- return;
-}
+=item &MapSelect($elementname,$status,$numvisible,$restriction)
-sub BuildDiffGraph {
- my ($courseID)=@_;
+Returns html for a selection box allowing the user to choose one (or more)
+of the sequences in the course. The values of the sequences are the symbs.
+If the top sequence is selected, the value 'top' will result.
- my $graphData = &GetGraphData('DiffGraph', $courseID);
- $r->print('');
+=over 4
- return;
-}
+=item $elementname The name of the HTML form element
-sub BuildWrongGraph {
- my ($courseID)=@_;
+=item $status 'multiple' or 'single' selection box
- my $graphData = &GetGraphData('WrongGraph', $courseID);
- $r->print('');
+=item $numvisible The number of options to be visible
- return;
-}
+=item $restriction Code reference to subroutine which returns true or
+false. The code must expect a reference to a sequence data structure.
-sub BuildAnalyzePage {
- my ($cacheDB, $students, $courseID)=@_;
+=back
- my %cache;
- unless(tie(%cache,'GDBM_File',$cacheDB,&GDBM_READER,0640)) {
- $r->print('Unable to tie database.');
+=cut
+
+##############################################
+##############################################
+sub MapSelect {
+ my ($elementname,$status,$numvisible,$restriction)=@_;
+ if ($numvisible < 1) {
return;
}
+ #
+ # Set up array of selected items
+ &SetSelectedMaps($elementname);
+ #
+ # Set up the restriction call
+ if (! defined($restriction)) {
+ $restriction = sub { 1; };
+ }
+ #
+ # Build the form element
+ my $Str = "\n";
+ $Str .= '\n";
+ return $Str;
+}
- &ShowOpGraph(\%cache, $students, $courseID);
-
- untie(%cache);
+##############################################
+##############################################
- return;
-}
+=pod
-sub BuildProblemAnalysisPage {
- my ($cacheDB)=@_;
+=item &SectionSelect($elementname,$status,$numvisible)
- my %cache;
- unless(tie(%cache,'GDBM_File',$cacheDB,&GDBM_READER,0640)) {
- $r->print('Unable to tie database.');
- return;
- }
+Returns html for a selection box allowing the user to choose one (or more)
+of the sections in the course.
- $r->print(&IntervalOptions());
- $r->print(&OptionResponseTable(\%cache));
+Uses the package variables @Sections and @SelectedSections
+=over 4
- untie(%cache);
+=item $elementname The name of the HTML form element
- return;
-}
+=item $status 'multiple' or 'single' selection box
-sub BuildStudentAssessmentPage {
- my ($cacheDB, $students, $courseID, $c)=@_;
+=item $numvisible The number of options to be visible
- my %cache;
+=back
- my $Ptr = '';
- $Ptr .= '
';
- $r->print($Ptr);
+=cut
- unless(tie(%cache,'GDBM_File',$cacheDB,&GDBM_READER,0640)) {
- $r->print('Unable to tie database.');
+##############################################
+##############################################
+sub SectionSelect {
+ my ($elementname,$status,$numvisible)=@_;
+ if ($numvisible < 1) {
return;
}
-
- my $selectedName = $cache{'StudentAssessmentStudent'};
- for(my $index=0;
- ($selectedName ne 'All Students') && ($index<(scalar @$students));
- $index++) {
- my $fullname = $cache{$students->[$index].':fullname'};
- if($fullname eq $selectedName) {
- if($cache{'StudentAssessmentMove'} eq 'next') {
- if($index == ((scalar @$students) - 1)) {
- $selectedName = $students->[0];
- } else {
- $selectedName = $students->[$index+1];
- }
- } elsif($cache{'StudentAssessmentMove'} eq 'previous') {
- if($index == 0) {
- $selectedName = $students->[-1];
- } else {
- $selectedName = $students->[$index-1];
- }
- } else {
- $selectedName = $students->[$index];
+ #
+ # Make sure we have the data we need to continue
+ if (! @Sections) {
+ &PrepareClasslist()
+ }
+ #
+ # Build the form element
+ my $Str = "\n";
+ $Str .= '\n";
+ return $Str;
+}
- $Ptr .= '