';
+Build up the classlist information. The classlist information is kept in
+the following package variables:
- return $Ptr;
-}
+=over
-sub ProblemStatisticsLegend {
- my $Ptr = '';
- $Ptr = '
';
- $Ptr .= '
';
- $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 .= '
';
-
- return $Ptr;
-}
-
-#---- END Problem Statistics Web Page ----------------------------------------
-
-#---- Problem Statistics Graph Web Page --------------------------------------
-
-sub GetGraphData {
- my ($whichGraph, $courseID)=@_;
- my $Col=0;
- my $graphTitle='';
- my $data='';
- my $count = 0;
- my $Max = 0;
- my $graphData='Graph data does not exist.';
- my $GraphDB = "/home/httpd/perl/tmp/$ENV{'user.name'}".
- "_$ENV{'user.domain'}_$courseID\_graph.db";
- if(-e $GraphDB) {
- if(tie(%GraphDat,'GDBM_File',"$GraphDB",&GDBM_READER,0640)) {
- if($whichGraph eq 'DiffGraph') {
- $graphTitle = 'Degree-of-Difficulty';
- $Col = 0;
- } else {
- $graphTitle = '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.'.$courseID.'.description'};
- $Course =~ s/\ /"_"/eg;
- $graphData = $Course.'&'.'Problems'.'&'.$graphTitle.'&'.$Max.'&';
- $graphData .= $count.'&'.$data;
- } else {
- $graphData = "Unable to tie hash to db file";
- }
- }
+=item @FullClasslist
- return $graphData;
-}
+=item @Students
-#---- END Problem Statistics Graph Web Page ----------------------------------
+=item @Sections
-#---- Problem Analysis Web Page ----------------------------------------------
+=item @SelectedSections
-sub IntervalOptions {
- my ($cache)=@_;
+=item %StudentData
- my $interval = 1;
- for(my $n=1; $n<=7; $n++) {
- if($cache->{'Interval'} == $n) {
- $interval = $n;
+=item @SelectedStudentData
+
+=item $curr_student
+
+=item $prev_student
+
+=item $next_student
+
+=back
+
+$curr_student, $prev_student, and $next_student may not be defined, depending
+upon the calling context.
+
+=cut
+
+#######################################################
+#######################################################
+sub PrepareClasslist {
+ my %Sections;
+ &clear_classlist_variables();
+ #
+ # Retrieve the classlist
+ my $cid = $ENV{'request.course.id'};
+ my $cdom = $ENV{'course.'.$cid.'.domain'};
+ my $cnum = $ENV{'course.'.$cid.'.num'};
+ my ($classlist,$field_names) = &Apache::loncoursedata::get_classlist($cid,
+ $cdom,$cnum);
+ if (exists($ENV{'form.Section'})) {
+ if (ref($ENV{'form.Section'})) {
+ @SelectedSections = @{$ENV{'form.Section'}};
+ } elsif ($ENV{'form.Section'} !~ /^\s*$/) {
+ @SelectedSections = ($ENV{'form.Section'});
+ }
+ }
+ @SelectedSections = ('all') if (! @SelectedSections);
+ foreach (@SelectedSections) {
+ if ($_ eq 'all') {
+ @SelectedSections = ('all');
+ }
+ }
+ #
+ # Deal with instructors with restricted section access
+ if ($ENV{'request.course.sec'} !~ /^\s*$/) {
+ @SelectedSections = ($ENV{'request.course.sec'});
+ }
+ #
+ # Set up %StudentData
+ @StudentDataOrder = qw/fullname username domain id section status/;
+ foreach my $field (@StudentDataOrder) {
+ $StudentData{$field}->{'title'} = $field;
+ $StudentData{$field}->{'base_width'} = length($field);
+ $StudentData{$field}->{'width'} =
+ $StudentData{$field}->{'base_width'};
+ }
+ #
+ # get the status requested
+ my $requested_status = 'Active';
+ $requested_status = $ENV{'form.Status'} if (exists($ENV{'form.Status'}));
+ #
+ # Process the classlist
+ while (my ($student,$student_data) = each (%$classlist)) {
+ my $studenthash = ();
+ for (my $i=0; $i< scalar(@$field_names);$i++) {
+ my $field = $field_names->[$i];
+ # Store the data
+ $studenthash->{$field}=$student_data->[$i];
+ # Keep track of the width of the fields
+ next if (! exists($StudentData{$field}));
+ my $length = length($student_data->[$i]);
+ if ($StudentData{$field}->{'width'} < $length) {
+ $StudentData{$field}->{'width'} = $length;
+ }
+ }
+ push (@FullClasslist,$studenthash);
+ #
+ # Build up a list of sections
+ my $section = $studenthash->{'section'};
+ if (! defined($section) || $section =~/^\s*$/ || $section == -1) {
+ $studenthash->{'section'} = 'none';
+ $section = $studenthash->{'section'};
+ }
+ $Sections{$section}++;
+ #
+ # Only put in the list those students we are interested in
+ foreach my $sect (@SelectedSections) {
+ if ( (($sect eq 'all') ||
+ ($section eq $sect)) &&
+ (($studenthash->{'status'} eq $requested_status) ||
+ ($requested_status eq 'Any'))
+ ){
+ push (@Students,$studenthash);
+ last;
+ }
}
}
-
- my $Ptr = ' Select number of intervals'."\n".
- ''."\n";
-
- return $Ptr;
+ #
+ if (exists($ENV{'form.StudentData'})) {
+ if (ref($ENV{'form.StudentData'}) eq 'ARRAY') {
+ @SelectedStudentData = @{$ENV{'form.StudentData'}};
+ } else {
+ @SelectedStudentData = ($ENV{'form.StudentData'});
+ }
+ } else {
+ @SelectedStudentData = ('username');
+ }
+ foreach (@SelectedStudentData) {
+ if ($_ eq 'all') {
+ @SelectedStudentData = ('all');
+ last;
+ }
+ }
+ #
+ 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
-sub MapOptions {
- my ($cache, $page)=@_;
- my $Ptr = '