[LON-CAPA-cvs] cvs: loncom /homework bridgetask.pm
raeburn
raeburn@source.lon-capa.org
Mon, 23 Aug 2010 03:24:01 -0000
raeburn Mon Aug 23 03:24:01 2010 EDT
Modified files:
/loncom/homework bridgetask.pm
Log:
- Improved student interface for managing files submitted to a bridgetask
over multiple tries.
Index: loncom/homework/bridgetask.pm
diff -u loncom/homework/bridgetask.pm:1.251 loncom/homework/bridgetask.pm:1.252
--- loncom/homework/bridgetask.pm:1.251 Thu Apr 1 00:37:15 2010
+++ loncom/homework/bridgetask.pm Mon Aug 23 03:24:01 2010
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# definition of tags that give a structure to a document
#
-# $Id: bridgetask.pm,v 1.251 2010/04/01 00:37:15 raeburn Exp $
+# $Id: bridgetask.pm,v 1.252 2010/08/23 03:24:01 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1085,14 +1085,21 @@
}
if ($status eq 'CAN_ANSWER' && !$previous &&
!$env{'form.donescreen'}) {
- $result.="\n".'<table border="1">'.
+ my ($portheader,$porttext);
+ if ($Apache::lonhomework::history{"resource.$version.0.bridgetask.portfiles"}) {
+ $portheader = &mt('Submit Additional Portfolio Files for Grading');
+ $porttext = &mt('Indicate which additional files from your portfolio are to be evaluated in grading this task.');
+ } else {
+ $portheader = &mt('Submit Portfolio Files for Grading');
+ $porttext = &mt('Indicate the files from your portfolio to be evaluated in grading this task.');
+ }
+ $result.="\n".'<p>'.&Apache::lonhtmlcommon::start_pick_box().
&Apache::inputtags::file_selector("$version.0",
"bridgetask","*",
'portfolioonly',
- '
-<h2>'.&mt('Submit Portfolio Files for Grading').'</h2>
-<p>'.&mt('Indicate the files from your portfolio to be evaluated in grading this task.').'</p>').
- "</table>";
+ '<h3>'.$portheader.'</h3><br />'.
+ $porttext.'<br />').
+ &Apache::lonhtmlcommon::end_pick_box().'</p>';
}
if (!$previous && $status ne 'SHOW_ANSWER' &&
&show_task($status,$previous)) {
@@ -1191,8 +1198,11 @@
if ($target eq 'grade' && !$env{'form.webgrade'} && !$previous
&& $status eq 'CAN_ANSWER') {
my $award='SUBMITTED';
+ my $uploadedflag=0;
+ my $totalsize=0;
+ my @deletions = &Apache::loncommon::get_env_multiple('form.HWFILE'.$version.'_0_bridgetask_delete');
&Apache::essayresponse::file_submission("$version.0",'bridgetask',
- 'portfiles',\$award);
+ \$award,\$uploadedflag,\$totalsize,\@deletions);
if ($award eq 'SUBMITTED' &&
$Apache::lonhomework::results{"resource.$version.0.bridgetask.portfiles"}) {
$Apache::lonhomework::results{"resource.0.tries"}=
@@ -1205,7 +1215,9 @@
$Apache::lonhomework::results{"resource.0.submission"}=
$Apache::lonhomework::results{"resource.$version.0.submission"}='';
} else {
- delete($Apache::lonhomework::results{"resource.$version.0.bridgetask.portfiles"});
+ unless($uploadedflag) {
+ delete($Apache::lonhomework::results{"resource.$version.0.bridgetask.portfiles"});
+ }
$award = '';
}
&Apache::lonhomework::showhash(%Apache::lonhomework::results);