[LON-CAPA-cvs] cvs: loncom /homework bridgetask.pm
albertel
lon-capa-cvs@mail.lon-capa.org
Thu, 01 Jun 2006 19:20:56 -0000
albertel Thu Jun 1 15:20:56 2006 EDT
Modified files:
/loncom/homework bridgetask.pm
Log:
- data tabling
Index: loncom/homework/bridgetask.pm
diff -u loncom/homework/bridgetask.pm:1.158 loncom/homework/bridgetask.pm:1.159
--- loncom/homework/bridgetask.pm:1.158 Tue May 30 08:45:36 2006
+++ loncom/homework/bridgetask.pm Thu Jun 1 15:20:56 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# definition of tags that give a structure to a document
#
-# $Id: bridgetask.pm,v 1.158 2006/05/30 12:45:36 www Exp $
+# $Id: bridgetask.pm,v 1.159 2006/06/01 19:20:56 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1257,12 +1257,20 @@
my %queue=&Apache::lonnet::dump($queue,$cdom,$cnum,$regexp);
my ($tmp)=%queue;
if ($tmp=~/^error: 2 /) {
- return "\n<h3>Current Queue - $queue</h3><table border='1'><tr><td>Empty</td></tr></table>";
+ return "\n<h3>Current Queue - $queue</h3>".
+ &Apache::loncommon::start_data_table().
+ &Apache::loncommon::start_data_table_row().
+ '<td>'.&mt('Empty').'</td>'.
+ &Apache::loncommon::end_data_table_row().
+ &Apache::loncommon::end_data_table();
}
my $title=&Apache::lonnet::gettitle($symb);
- $result.="\n<h3>Current Queue - $title $queue </h3><table border='1'><tr>";
+ $result.="\n<h3>Current Queue - $title $queue </h3>".
+ &Apache::loncommon::start_data_table().
+ &Apache::loncommon::start_data_table_header_row();
if ($with_selects) { $result.="<th>Status</th><th></th>"; }
- $result.="<th>user</th><th>data</th></tr>";
+ $result.="<th>user</th><th>data</th>".
+ &Apache::loncommon::end_data_table_header_row();
foreach my $key (sort(keys(%queue))) {
my ($symb,$uname,$udom) = &decode_queue_key($key);
if (!defined($classlist->{$uname.':'.$udom})) { next; }
@@ -1277,14 +1285,15 @@
}
if ($key=~/locked$/ && !$with_selects) {
- $result.="<tr><td>$uname</td>";
+ $result.= &Apache::loncommon::start_data_table_row().
+ "<td>$uname</td>";
$result.='<td>'.$queue{$key}.'</td></tr>';
} elsif ($key=~/timestamp$/ && !$with_selects) {
- $result.="<tr><td></td>";
+ $result.=&Apache::loncommon::start_data_table_row()."<td></td>";
$result.='<td>'.
&Apache::lonlocal::locallocaltime($queue{$key})."</td></tr>";
} elsif ($key!~/(timestamp|locked)$/) {
- $result.="<tr>";
+ $result.= &Apache::loncommon::start_data_table_row();
my ($end_time,$slot_text);
if (my $slot=&slotted_access($queue{$key})) {
my %slot_data=&Apache::lonnet::get_slot($slot);
@@ -1336,10 +1345,10 @@
" <tt>($uname:$udom)</tt> </td>";
$result.='<td>'.$slot_text.' End time: '.
&Apache::lonlocal::locallocaltime($end_time).
- "</td></tr>";
+ "</td>".&Apache::loncommon::end_data_table_row();
}
}
- $result.="</table><hr />\n";
+ $result.= &Apache::loncommon::end_data_table()."<hr />\n";
return $result;
}
@@ -1643,7 +1652,7 @@
$result.='<p> Showing only sections <tt>'.join(', ',@chosen_sections).
'</tt>.</p> '."\n";
}
- $result.='<table border="1">';
+ $result.=&Apache::loncommon::start_data_table();
foreach my $student (sort {lc($classlist->{$a}[&Apache::loncoursedata::CL_FULLNAME()]) cmp lc($classlist->{$b}[&Apache::loncoursedata::CL_FULLNAME()]) } (keys(%$classlist))) {
my ($uname,$udom) = split(/:/,$student);
@@ -1668,7 +1677,8 @@
my $todo =
&escape(&encode_queue_key($symb,$udom,$uname));
if ($cannot_grade) {
- $result.='<tr><td> </td><td>'.$classlist->{$student}[&Apache::loncoursedata::CL_FULLNAME()].
+ $result.=&Apache::loncommon::start_data_table_row().
+ '<td> </td><td>'.$classlist->{$student}[&Apache::loncoursedata::CL_FULLNAME()].
'</td><td>';
} else {
my $seclist;
@@ -1676,8 +1686,8 @@
$seclist.='<input type="hidden" name="chosensections"
value="'.$sec.'" />';
}
+ $result.=&Apache::loncommon::start_data_table_row();
$result.=<<RESULT;
-<tr>
<td>
<form style="display: inline" method="post">
<input type="hidden" name="gradingkey" value="$todo" />
@@ -1726,9 +1736,9 @@
} else {
$result.=" ";
}
- $result.= '</td></tr>';
+ $result.= '</td>'.&Apache::loncommon::end_data_table_row();
}
- $result.='</table>';
+ $result.=&Apache::loncommon::end_data_table();
return $result;
}