--- loncom/homework/bridgetask.pm 2005/05/03 00:05:41 1.14
+++ loncom/homework/bridgetask.pm 2006/06/13 21:34:28 1.171
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# definition of tags that give a structure to a document
#
-# $Id: bridgetask.pm,v 1.14 2005/05/03 00:05:41 albertel Exp $
+# $Id: bridgetask.pm,v 1.171 2006/06/13 21:34:28 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -36,37 +36,54 @@ use Apache::File();
use Apache::lonmenu;
use Apache::lonlocal;
use Apache::lonxml;
+use Apache::slotrequest();
use Time::HiRes qw( gettimeofday tv_interval );
+use lib '/home/httpd/lib/perl/';
+use LONCAPA;
+
BEGIN {
- &Apache::lonxml::register('Apache::bridgetask',('Task','IntroParagraph','Dimension','Instance','InstanceText','Criteria','ClosingParagraph'));
+ &Apache::lonxml::register('Apache::bridgetask',('Task','IntroParagraph','Dimension','Question','QuestionText','Setup','Instance','InstanceText','Criteria','ClosingParagraph'));
}
+my %dimension;
sub initialize_bridgetask {
# id of current Dimension, 0 means that no dimension is current
# (inside '."\n";
+ $result.='';
+ $result.=&Apache::loncommon::select_dom_form($env{'user.domain'},
+ 'gradingdomain');
+ $result.=' '.
+ &Apache::loncommon::selectstudent_link('gradesubmission',
+ 'gradinguser',
+ 'gradingdomain');
+ $result.=&Apache::loncommon::studentbrowser_javascript();
+ $result.= '".&mt("Showing previous version [_1]",$version).
+ "
\n";
+ }
+ my @to_show;
+ foreach my $test_version (1..$Apache::lonhomework::history{'resource.0.version'}) {
+ if (defined($Apache::lonhomework::history{'resource.'.$test_version.'.0.status'})) {
+ push(@to_show,$test_version);
+ }
+ }
+ my $list='\n\n";
+ $list.='';
+ $result.='";
return $result;
}
sub add_grading_button {
- my $result;
- $result.=' '."\n";
+ $sec_select .= "\n";
+ foreach my $sec (sort {lc($a) cmp lc($b)} (keys(%sections))) {
+ $sec_select .= "\n";
+ }
+ $sec_select .= "\n";
+
+ my $result=' ';
$result.='';
+ if (&Apache::lonnet::allowed('mgq',$env{'request.course.id'})) {
+ my ($entries,$ready,$locks)=&get_queue_counts('gradingqueue');
+ $result.='
'."\n";
+ $result.='';
+ $result.=' '."\n";
+
+ ($entries,$ready,$locks)=&get_queue_counts('reviewqueue');
+ $result.='Specify a section: '.$sec_select.' ';
+ $result.=''.' ';
+
+ $result.= &mt("[_1] entries, [_2] ready, [_3] being graded",$entries,$ready,$locks).' '."\n";
+ $result.=''.
+ ' ';
+ $result.=&mt("[_1] entries, [_2] ready, [_3] being graded",
+ $entries,$ready,$locks).'
'. + &mt('Student submitted [_1] [_2] the deadline. + (Submission was at [_3], end of period was [_4].)', + $info,$when,scalar(localtime($submissiontime)), + scalar(localtime($slot{'endtime'}))). + '
'; + } + return $result; +} + +sub file_list { + my ($files,$uname,$udom) = @_; + if (!defined($uname) || !defined($udom)) { + (undef,undef,$udom,$uname) = &Apache::lonxml::whichuser(); + } + my $file_url = '/uploaded/'.$udom.'/'.$uname.'/portfolio/'; + + my $file_list="Submitted non-existant file $file
\n"; + } else { + $file = ''.$file.''; + $msg .= "Submitted file $file
\n"; + } + $files .= ''.&mt('Message sent to user: [_1]', + $message_status).'
'; + } + if ($setting eq 'student_and_user_notes_screen') { + $comment_status = + &Apache::lonmsg::store_instructor_comment($subject.''.&mt('Message sent to instructor: [_1]', + $comment_status).'
'; + } + return <Files submitted: $files
+You are now done with this Bridge Task
+Found '. + &Apache::lonnet::gettitle($symb).' for '.$uname.' at '.$udom.' |
'. + &mt('Return to resource').'
'; + if ($status_code eq 'stop') { + $result.=''.&mt("Stopped grading.").''.$back; + } elsif ($status_code eq 'cancel') { + $result.=''.&mt("Cancelled grading.").''.$back; + } elsif ($status_code eq 'never_versioned') { + $result.=''. + &mt("Requested user has never accessed the task."). + ''.$back; + } elsif ($status_code =~ /still_open:(.*)/) { + my $date = &Apache::lonlocal::locallocaltime($1); + $result.=''. + &mt("Task is still open, will close at [_1].",$date). + ''.$back; + } elsif ($status_code eq 'lock_failed') { + $result.=''.&mt("Failed to lock the requested record.") + .''.$back; + } elsif ($status_code eq 'unlock') { + $result.=''.&mt("Unlocked the requested record.") + .''.$back; + $result.=&show_queue($env{'form.queue'},1); + } elsif ($status_code eq 'show_list') { + $result.=&show_queue($env{'form.queue'},1); + } elsif ($status_code eq 'select_user') { + $result.=&select_user(); + } elsif ($status_code eq 'unable') { + $result.=''.&mt("Unable to aqcuire a user to grade.").''.$back; + } elsif ($status_code eq 'not_allowed') { + $result.=''.&mt('Not allowed to grade the requested user.').' '.$msg.''.$back; + } else { + $result.=''.&mt("No user to be graded.").''.$back; } } + $webgrade='no'; } - } elsif ($target eq 'webgrade') { - $result.=$head_tag_start.$body_tag_start.$form_tag_start. - 'Yahoo!'; - $result.=&show_queue(); - $result.=&get_from_queue(); - + if (!$todo || $env{'form.cancel'}) { + my $bodytext=&Apache::lonxml::get_all_text("/task",$parser,$style); + } + if ($target eq 'webgrade' && defined($env{'form.queue'})) { + if ($webgrade eq 'yes') { + $result.=&submission_time_stamp(); + } + $result.=$form_tag_start; + $result.=''; + $result.=''; + if ($env{'form.regrade'}) { + $result.=''; + } + if ($env{'form.chosensections'}) { + my @chosen_sections= + &Apache::loncommon::get_env_multiple('form.chosensections'); + foreach my $sec (@chosen_sections) { + $result.=''; + } + } + if ($webgrade eq 'yes') { $result.=&webgrade_standard_info(); } + } + if ($target eq 'webgrade') { + $result.="\n".'".&mt('You needed to pass all of the [_1] mandatory components and [_2] of the [_3] optional components, of which you passed [_4].',$man_count,$opt_req,$opt_count,$opt_passed)."