[LON-CAPA-cvs] cvs: loncom /interface lonstatistics.pm /interface/statistics loncorrectproblemplot.pm lonproblemanalysis.pm lonproblemstatistics.pm lonstathelpers.pm lonstudentsubmissions.pm lonsubmissiontimeanalysis.pm
goltermann
goltermann at source.lon-capa.org
Thu May 3 07:21:34 EDT 2012
goltermann Thu May 3 11:21:34 2012 EDT
Modified files:
/loncom/interface lonstatistics.pm
/loncom/interface/statistics loncorrectproblemplot.pm
lonproblemanalysis.pm
lonproblemstatistics.pm
lonstathelpers.pm
lonstudentsubmissions.pm
lonsubmissiontimeanalysis.pm
Log:
- changed headlines to normal text with info/error/warning style where necessary
- changed tables to data tables to unify UI
-------------- next part --------------
Index: loncom/interface/lonstatistics.pm
diff -u loncom/interface/lonstatistics.pm:1.155 loncom/interface/lonstatistics.pm:1.156
--- loncom/interface/lonstatistics.pm:1.155 Tue Mar 20 16:03:54 2012
+++ loncom/interface/lonstatistics.pm Thu May 3 11:21:27 2012
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: lonstatistics.pm,v 1.155 2012/03/20 16:03:54 bisitz Exp $
+# $Id: lonstatistics.pm,v 1.156 2012/05/03 11:21:27 goltermann Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -846,9 +846,9 @@
#
if (! &Apache::lonmysql::verify_sql_connection()) {
my $serveradmin = $r->dir_config('lonAdmEMail');
- $r->print('<h2 class="LC_error">'.
+ $r->print('<p class="LC_error">'.
&mt('Unable to connect to database!').
- '</h2>');
+ '</p>');
$r->print('<p>'
.&mt('Please notify the server administrator [_1]',
,'<b>'.$serveradmin.'</b>')
Index: loncom/interface/statistics/loncorrectproblemplot.pm
diff -u loncom/interface/statistics/loncorrectproblemplot.pm:1.26 loncom/interface/statistics/loncorrectproblemplot.pm:1.27
--- loncom/interface/statistics/loncorrectproblemplot.pm:1.26 Wed Dec 21 21:25:51 2011
+++ loncom/interface/statistics/loncorrectproblemplot.pm Thu May 3 11:21:33 2012
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: loncorrectproblemplot.pm,v 1.26 2011/12/21 21:25:51 www Exp $
+# $Id: loncorrectproblemplot.pm,v 1.27 2012/05/03 11:21:33 goltermann Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -127,9 +127,9 @@
}
}
}
- $r->print('<h4>'.
+ $r->print('<p>'.
&Apache::lonstatistics::section_and_enrollment_description().
- '</h4>');
+ '</p>');
my ($starttime,$endtime) = &Apache::lonstathelpers::get_time_limits();
if (defined($starttime) || defined($endtime)) {
# Inform the user what the time limits on the data are.
@@ -146,7 +146,7 @@
$starttime,$endtime);
$r->print(&AnalyzeScoreData($score_data,$title,$total_weights));
} else {
- $r->print('<h3>'.&mt('Make a sequence selection from the "Sequences and Folders" menu and hit "Create Plot" to begin').'</h3>');
+ $r->print('<p>'.&mt('Make a sequence selection from the "Sequences and Folders" menu and hit "Create Plot" to begin').'</p>');
}
return;
}
@@ -170,7 +170,7 @@
#
# Basic check first
if (ref($score_data) ne 'ARRAY' || @$score_data < 1) {
- return '<h2>'.&mt('There is no data to plot').'</h2>';
+ return '<p class="LC_warning">'.&mt('There is no data to plot').'</p>';
}
#
# Determine which bins to use
@@ -192,7 +192,10 @@
'<p>'.
&mt('Problem weights do not reflect individual student settings.')
.'</p>'.
- '<table border="1">'."\n".'<tr><th>Range</th><th>Count</th></tr>'."\n";
+ &Apache::loncommon::start_data_table().
+ &Apache::loncommon::start_data_table_header_row().
+ "\n".'<th>Range</th><th>Count</th>'."\n".
+ &Apache::loncommon::end_data_table_header_row();
my $sum = 0;
while (my $bin = shift(@Bins)) {
push (@Xdata,$bin->{'start'});
@@ -201,12 +204,14 @@
if ($bin->{'count'} > $max) {
$max = $bin->{'count'};
}
- $Str.= '<tr><td>'.$bin->{'start'}.' - '.$bin->{'end'}.'</td>'.
- '<td>'.$bin->{'count'}.'</td></tr>'."\n";
+ $Str.= &Apache::loncommon::start_data_table_row().
+ '<td>'.$bin->{'start'}.' - '.$bin->{'end'}.'</td>'.
+ '<td>'.$bin->{'count'}.'</td>'.
+ &Apache::loncommon::end_data_table_row().'<br>';
}
# scale max to an integer.
$max = 5*(int($max/5)+1);
- $Str .= "</table><br />\n";
+ $Str .= &Apache::loncommon::end_data_table()."<br />\n";
$title = &HTML::Entities::decode($title);
$Str = "\n<p>".
&Apache::loncommon::DrawBarGraph($title.' ('.$sum.' students)',
Index: loncom/interface/statistics/lonproblemanalysis.pm
diff -u loncom/interface/statistics/lonproblemanalysis.pm:1.141 loncom/interface/statistics/lonproblemanalysis.pm:1.142
--- loncom/interface/statistics/lonproblemanalysis.pm:1.141 Wed Dec 21 21:25:51 2011
+++ loncom/interface/statistics/lonproblemanalysis.pm Thu May 3 11:21:33 2012
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: lonproblemanalysis.pm,v 1.141 2011/12/21 21:25:51 www Exp $
+# $Id: lonproblemanalysis.pm,v 1.142 2012/05/03 11:21:33 goltermann Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -146,7 +146,7 @@
my $resource = $current_problem->{'resource'};
$r->print('<h1>'.$resource->compTitle.'</h1>');
$r->print('<h3>'.$resource->src.'</h3>');
- $r->print('<h4>'.&Apache::lonstatistics::section_and_enrollment_description().'</h4>');
+ $r->print('<p>'.&Apache::lonstatistics::section_and_enrollment_description().'</p>');
if ($env{'form.show_prob'} eq 'true') {
$r->print('<hr />'
.&Apache::lonstathelpers::render_resource($resource)
Index: loncom/interface/statistics/lonproblemstatistics.pm
diff -u loncom/interface/statistics/lonproblemstatistics.pm:1.121 loncom/interface/statistics/lonproblemstatistics.pm:1.122
--- loncom/interface/statistics/lonproblemstatistics.pm:1.121 Thu Mar 15 20:53:18 2012
+++ loncom/interface/statistics/lonproblemstatistics.pm Thu May 3 11:21:33 2012
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: lonproblemstatistics.pm,v 1.121 2012/03/15 20:53:18 www Exp $
+# $Id: lonproblemstatistics.pm,v 1.122 2012/05/03 11:21:33 goltermann Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -741,17 +741,17 @@
return;
}
if (exists($env{'form.Excel'})) {
- $r->print('<h4>'.
+ $r->print('<p>'.
&Apache::lonstatistics::section_and_enrollment_description().
- '</h4>');
+ '</p>');
&Excel_output($r);
} else {
$r->print('<input type="submit" name="Excel" value="'.
&mt('Produce Excel Output').'" />'.' 'x5);
$r->rflush();
- $r->print('<h4>'.
+ $r->print('<p>'.
&Apache::lonstatistics::section_and_enrollment_description().
- '</h4>');
+ '</p>');
my $count = 0;
foreach my $seq (@sequences) {
my @resources =
@@ -795,17 +795,15 @@
$r->print('<h2>'.&mt('Sequence Statistics').
&Apache::loncommon::help_open_topic('Statistics_Sequence').
'</h2>');
- $r->print('<table border="0"><tr><td bgcolor="#777777">'."\n".
- '<table border="0" cellpadding="3">'."\n".
- '<tr bgcolor="#FFFFE6">');
+ $r->print(&Apache::loncommon::start_data_table().&Apache::loncommon::start_data_table_header_row());
$r->print(&sequence_html_header());
+ $r->print(&Apache::loncommon::end_data_table_header_row());
foreach my $seq (@sequences) {
last if ($c->aborted);
&compute_sequence_statistics($seq);
$r->print(&sequence_html_output($seq));
}
- $r->print('</table>');
- $r->print('</table>');
+ $r->print(&Apache::loncommon::end_data_table());
$r->rflush();
return;
}
@@ -821,22 +819,22 @@
sub output_html_by_sequence {
my ($r) = @_;
my $c = $r->connection();
- $r->print(&html_preamble());
+ $r->print('<br>'.&html_preamble());
#
foreach my $seq (@sequences) {
last if ($c->aborted);
$r->print("<h3>".$seq->compTitle."</h3>".
- '<table border="0"><tr><td bgcolor="#777777">'."\n".
- '<table border="0" cellpadding="3">'."\n".
- '<tr bgcolor="#FFFFE6">'.
- &statistics_table_header('no container')."</tr>\n");
+ &Apache::loncommon::start_data_table().
+ &Apache::loncommon::start_data_table_header_row().
+ &statistics_table_header('no container').
+ &Apache::loncommon::end_data_table_header_row()."\n");
my @Data = &compute_statistics_on_sequence($seq);
foreach my $data (@Data) {
- $r->print('<tr>'.&statistics_html_table_data($data,
- 'no container').
- "</tr>\n");
+ $r->print(&Apache::loncommon::start_data_table_row().
+ &statistics_html_table_data($data,'no container').
+ &Apache::loncommon::end_data_table_row()."\n");
}
- $r->print('</table>'."\n".'</table>'."\n");
+ $r->print(&Apache::loncommon::end_data_table()."\n");
$r->rflush();
}
return;
@@ -851,17 +849,17 @@
my $count=0;
foreach my $data (@StatsArray) {
if ($count++ % 50 == 0) {
- $r->print("</table>\n</table>\n");
- $r->print('<table border="0"><tr><td bgcolor="#777777">'."\n".
- '<table border="0" cellpadding="3">'."\n".
- '<tr bgcolor="#FFFFE6">'.
- '<tr bgcolor="#FFFFE6">'.
- &statistics_table_header().
- "</tr>\n");
- }
- $r->print('<tr>'.&statistics_html_table_data($data)."</tr>\n");
+ $r->print(&Apache::loncommon::end_data_table());
+ $r->print(&Apache::loncommon::start_data_table().
+ &Apache::loncommon::start_data_table_row().
+ &statistics_table_header().
+ &Apache::loncommon::end_data_table_row());
+ }
+ $r->print(&Apache::loncommon::start_data_table_row().
+ &statistics_html_table_data($data).
+ &Apache::loncommon::end_data_table_row());
}
- $r->print("</table>\n</table>\n");
+ $r->print(&Apache::loncommon::end_data_table_row());
return;
}
@@ -878,8 +876,8 @@
&Apache::lonlocal::locallocaltime($endtime)
).'</h3>';
}
- $Str .= "<h3>".&mt('Compiled on [_1]',
- &Apache::lonlocal::locallocaltime(time))."</h3>";
+ $Str .= "<p>".&mt('Compiled on [_1]',
+ &Apache::lonlocal::locallocaltime(time))."</p>";
return $Str;
}
@@ -897,7 +895,7 @@
foreach my $field (@Fields) {
next if ($options =~ /no $field->{'name'}/);
next if ($field->{'selected'} ne 'yes');
- $row .= '<td bgcolor="'.$field->{'color'}.'"';
+ $row .= '<td style="background-color:'.$field->{'color'}.'"';
if (exists($field->{'align'})) {
$row .= ' align="'.$field->{'align'}.'"';
}
Index: loncom/interface/statistics/lonstathelpers.pm
diff -u loncom/interface/statistics/lonstathelpers.pm:1.68 loncom/interface/statistics/lonstathelpers.pm:1.69
--- loncom/interface/statistics/lonstathelpers.pm:1.68 Wed Dec 21 21:25:51 2011
+++ loncom/interface/statistics/lonstathelpers.pm Thu May 3 11:21:33 2012
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: lonstathelpers.pm,v 1.68 2011/12/21 21:25:51 www Exp $
+# $Id: lonstathelpers.pm,v 1.69 2012/05/03 11:21:33 goltermann Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -90,10 +90,10 @@
my $rendered_problem = &Apache::lonnet::ssi_body($src.'?symb='.$symb);
$rendered_problem =~ s/<\s*form\s*/<nop /g;
$rendered_problem =~ s|(<\s*/form\s*>)|<\/nop>|g;
- return '<table bgcolor="ffffff"><tr><td>'.
- '<base href="'.$base.'" />'.
- $rendered_problem.
- '</td></tr></table>';
+ return &Apache::loncommon::start_data_table().
+ &Apache::loncommon::start_data_table_row().
+ '<td>'.'<base href="'.$base.'" />'.$rendered_problem.
+ '</td>'.&Apache::loncommon::end_data_table_row().&Apache::loncommon::end_data_table();
}
####################################################
Index: loncom/interface/statistics/lonstudentsubmissions.pm
diff -u loncom/interface/statistics/lonstudentsubmissions.pm:1.67 loncom/interface/statistics/lonstudentsubmissions.pm:1.68
--- loncom/interface/statistics/lonstudentsubmissions.pm:1.67 Tue Mar 20 17:52:23 2012
+++ loncom/interface/statistics/lonstudentsubmissions.pm Thu May 3 11:21:33 2012
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: lonstudentsubmissions.pm,v 1.67 2012/03/20 17:52:23 bisitz Exp $
+# $Id: lonstudentsubmissions.pm,v 1.68 2012/05/03 11:21:33 goltermann Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -196,9 +196,9 @@
$threshold = 10;
}
}
- $r->print('<h4>'.
+ $r->print('<p>'.
&Apache::lonstatistics::section_and_enrollment_description().
- '</h4>');
+ '</p>');
if (! scalar(@Problems) || ! defined($Problems[0])) {
$r->print(&mt('resource is undefined'));
} elsif (!$show_named && @Students < $threshold) {
@@ -414,7 +414,8 @@
qq{<th colspan="$student_column_count">\ </th>}.
$headers{'response'};
}
- my $full_header = $/.'<table>'.$/;
+ #my $full_header = $/.'<table>'.$/;
+ my $full_header = $/.&Apache::loncommon::start_data_table().$/;
$full_header .= '<tr align="left">'.$headers{'problem'}.'</tr>'.$/;
if ($nonempty_part_headers) {
$full_header .= '<tr align="left">'.$headers{'part'}.'</tr>'.$/;
@@ -425,11 +426,10 @@
# Main loop
my $count;
$r->print($/.$full_header.$/);
- my $row_class = 'odd'; # css
foreach my $student (@$students) {
my $student_row_data;
if ($count++ >= 30) {
- $r->print('</table>'.$/.$full_header.$/);
+ $r->print(&Apache::loncommon::end_data_table().$/.$full_header.$/);
$count = 0;
}
last if ($c->aborted());
@@ -527,11 +527,6 @@
next if (! $maxrow && ! scalar(@essays));
#
# Go through the problem data and output a row.
- if ($row_class eq 'even') {
- $row_class = 'odd';
- } else {
- $row_class = 'even';
- }
my $printed_something;
for (my $rows_output = 0;$rows_output<$maxrow;$rows_output++) {
my $html;
@@ -555,22 +550,23 @@
}
}
if (! $no_data) {
- $r->print(qq{<tr class="$row_class">$student_row_data$html</tr>}.$/);
+ $r->print(&Apache::loncommon::start_data_table_row().$student_row_data.$html.
+ &Apache::loncommon::end_data_table_row().$/);
$printed_something=1;
}
}
if (@essays) {
- my $tr = qq{<tr class="$row_class">};
+ my $tr = &Apache::loncommon::start_data_table_row();
my $td = qq{<td valign="top" class="essay" colspan="$total_col">};
if (! $printed_something) {
- $r->print($tr.$student_row_data.'</tr>'.$/);
+ $r->print($tr.$student_row_data.&Apache::loncommon::end_data_table_row().$/);
}
$r->print($tr.$td.
join('</td></tr>'.$/.$tr.$td, at essays).'</td></tr>'.$/);
undef(@essays);
}
} # end of student loop
- $r->print('</table>'.$/);
+ $r->print(&Apache::loncommon::end_data_table().$/);
return;
}
@@ -787,9 +783,9 @@
$lastprob = $prob;
}
if ($columncount > 255) {
- $r->print('<h1>'.&mt('Unable to complete request').'</h1>'.$/.
- '<p>'.&mt('LON-CAPA is unable to produce your Excel spreadsheet because your selections will result in more than 255 columns. Excel allows only 255 columns in a spreadsheet.').'</p>'.$/.
- '<p>'.&mt('Consider selecting fewer problems to generate reports on, or reducing the number of items per problem. Or use HTML or CSV output.').'</p>'.$/);
+ $r->print('<p class="LC_error">'.&mt('Unable to complete request').'</p>'.$/.
+ '<p class="LC_warning">'.&mt('LON-CAPA is unable to produce your Excel spreadsheet because your selections will result in more than 255 columns. Excel allows only 255 columns in a spreadsheet.').'</p>'.$/.
+ '<p class="LC_warning">'.&mt('Consider selecting fewer problems to generate reports on, or reducing the number of items per problem. Or use HTML or CSV output.').'</p>'.$/);
if (ref($lastprob)) {
$r->print('<p>'.&mt('The last problem that will fit in the current spreadsheet is [_1].',$lastprob->compTitle).'</p>');
}
@@ -799,14 +795,14 @@
#
# Print out a message telling them what we are doing
if (scalar(@$Problems) > 1) {
- $r->print('<h2>'.
+ $r->print('<p class="LC_info">'.
&mt('Preparing Excel spreadsheet of student responses to [_1] problems',
scalar(@$Problems)).
- '</h2>');
+ '</p>');
} else {
- $r->print('<h2>'.
+ $r->print('<p class="LC_info">'.
&mt('Preparing Excel spreadsheet of student responses').
- '</h2>');
+ '</p>');
}
$r->rflush();
#
@@ -1071,8 +1067,8 @@
my ($r,$problems,$students,$anoncounter,$show_named) = @_;
my $c = $r->connection();
#
- $r->print('<h2>'.
- &mt('Generating CSV report of student responses').'</h2>');
+ $r->print('<p class="LC_info">'.
+ &mt('Generating CSV report of student responses').'</p>');
#
# Progress window
my %prog_state=&Apache::lonhtmlcommon::Create_PrgWin($r,scalar(@$students));
Index: loncom/interface/statistics/lonsubmissiontimeanalysis.pm
diff -u loncom/interface/statistics/lonsubmissiontimeanalysis.pm:1.33 loncom/interface/statistics/lonsubmissiontimeanalysis.pm:1.34
--- loncom/interface/statistics/lonsubmissiontimeanalysis.pm:1.33 Wed Dec 21 21:25:51 2011
+++ loncom/interface/statistics/lonsubmissiontimeanalysis.pm Thu May 3 11:21:33 2012
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: lonsubmissiontimeanalysis.pm,v 1.33 2011/12/21 21:25:51 www Exp $
+# $Id: lonsubmissiontimeanalysis.pm,v 1.34 2012/05/03 11:21:33 goltermann Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -138,9 +138,9 @@
} else {
$r->print('<h1>'.$resource->compTitle.'</h1>');
$r->print('<h3>'.$resource->src.'</h3>');
- $r->print('<h4>'.
+ $r->print('<p>'.
&Apache::lonstatistics::section_and_enrollment_description().
- '</h4>');
+ '</p>');
$r->rflush();
$r->print('<hr />');
$r->print(&Apache::lonstathelpers::render_resource($resource));
@@ -278,24 +278,18 @@
#
# Build the data table
$htmltable = '<p>'.
- '<table rules="groups" frame="border" '.
- 'summary="Student submission data">'.
- '<thead>'.
- '<tr>'.
+ &Apache::loncommon::start_data_table().
+ &Apache::loncommon::start_data_table_header_row().
+ &Apache::loncommon::start_data_table_row().
'<th valign="bottom">'.&mt('Begin').'</th>'.
- '<th>'.(' 'x3).'</th>'.
'<th valign="bottom">'.&mt('End').'</th>'.
'<th valign="bottom">'.&mt('Submissions (plotted)').'</th>'.
- '<th>'.(' 'x3).'</th>'.
'<th valign="bottom">'.&mt('Correct Submissions (not plotted)').'</th>'.
- '<th>'.(' 'x3).'</th>'.
'<th valign="bottom">'.&mt('Cumulative Correct of those attempting the problem (not plotted)').'</th>'.
- '<th>'.(' 'x3).'</th>'.
'<th valign="bottom">'.&mt('Cumulative Percent Correct of those attempting the problem (not plotted)').'</th>'.
- '<th>'.(' 'x3).'</th>'.
'<th valign="bottom">'.&mt('Cumulative Percent Correct of selected students (plotted)').'</th>'.
- '</tr>'.
- '</thead>'.
+ &Apache::loncommon::end_data_table_row().
+ &Apache::loncommon::end_data_table_header_row().
'<tbody>';
my @CumulativeCorrect=(0);
my @corr_as_percent_of_selected;
@@ -308,28 +302,23 @@
sprintf('%3.1f',100*$CumulativeCorrect[$i]/scalar(@$students));
if ($Ydata[$i] != 0) {
next if (! defined($BinEnd[$i]) || $BinEnd[$i] == 0);
- $htmltable .=
- '<tr>'.
+ $htmltable .=
+ &Apache::loncommon::start_data_table_row().
'<td align="right"><span class="LC_nobreak">'.
&Apache::lonlocal::locallocaltime($BinEnd[$i]-$binsize).
'</span></td>'.
- '<td> </td>'.
'<td align="right"><span class="LC_nobreak">'.
&Apache::lonlocal::locallocaltime($BinEnd[$i]).'</td>'.
'</span></td>'.
'<td align="right">'.$Ydata[$i].(' 'x3).'</td>'.
- '<td> </td>'.
'<td align="right">'.$AnsData[$i].(' 'x3).'</td>'.
- '<td> </td>'.
'<td align="right">'.$CumulativeCorrect[$i].'</td>'.
- '<td> </td>'.
'<td align="right">'.$corr_as_percent_of_answering[$i].'</td>'.
- '<td> </td>'.
'<td align="right">'.$corr_as_percent_of_selected[$i].'</td>'.
- '</tr>'.$/;
+ &Apache::loncommon::end_data_table_row().$/;
}
}
- $htmltable .= '</tbody></table></p>';
+ $htmltable .= '</tbody>'.&Apache::loncommon::end_data_table().'</p>';
#
# Build the plot
my $title = '';#'Number of Submissions and Number Correct';
More information about the LON-CAPA-cvs
mailing list