# The LearningOnline Network with CAPA
# definition of tags that give a structure to a document
#
# $Id: bridgetask.pm,v 1.152 2006/05/16 21:21:31 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
# This file is part of the LearningOnline Network with CAPA (LON-CAPA).
#
# LON-CAPA is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# LON-CAPA is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with LON-CAPA; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# /home/httpd/html/adm/gpl.txt
#
# http://www.lon-capa.org/
#
###
package Apache::bridgetask;
use strict;
use Apache::lonnet;
use Apache::File();
use Apache::lonmenu;
use Apache::lonlocal;
use Apache::lonxml;
use Apache::slotrequest();
use Time::HiRes qw( gettimeofday tv_interval );
BEGIN {
&Apache::lonxml::register('Apache::bridgetask',('Task','IntroParagraph','Dimension','Question','Instance','InstanceText','Criteria','ClosingParagraph'));
}
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 (undef,$cid)=&Apache::lonxml::whichuser();
my $cnum=$env{'course.'.$cid.'.num'};
my $cdom=$env{'course.'.$cid.'.domain'};
my %sections = &Apache::loncommon::get_sections($cdom,$cnum);
my $size=5;
if (scalar(keys(%sections)) < 3) {
$size=scalar(keys(%sections))+2;
}
my $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="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 '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'; 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)."
Showing only sections '.join(', ',@chosen_sections). '.
'."\n"; } my $regexp="^$symb\0"; my %queue=&Apache::lonnet::dump($queue,$cdom,$cnum,$regexp); my ($tmp)=%queue; if ($tmp=~/^error: 2 /) { return "\nEmpty |
Status | "; } $result.=" | user | data |
---|---|---|---|
$uname | "; $result.=''.$queue{$key}.' | ||
"; $result.=' | '. &Apache::lonlocal::locallocaltime($queue{$key})." | ||
Showing only sections '.join(', ',@chosen_sections). '.
'."\n"; } $result.=''.$fullname->{$student}. ' | ';
} else {
my $seclist;
foreach my $sec (@chosen_sections) {
$seclist.='';
}
my $studentdis = $student;
$studentdis =~ tr/:/@/;
$result.=<
| $fullname->{$student} ($studentdis) |
RESULT
}
if ($status{'status'} eq 'pass') {
$result .= ''.&mt('Passed').'';
} elsif ($status{'status'} eq 'fail') {
$result .= ''.&mt('Failed').'';
} elsif ($status{'status'} eq 'review') {
$result .= ''.&mt('Under Review').'';
} elsif ($status{'status'} eq 'ungraded') {
$result .= &mt('Ungraded');
} elsif ($status{'status'} ne '') {
$result .= ''.&mt('Unknown Status').'';
} else {
$result.=" ";
}
if ($status{'version'}) {
$result .= ' '.&mt('Version').' '.$status{'version'};
}
if ($status{'grader'}) {
$result .= ' '.&mt('(Graded by [_1])',$status{'grader'}).' ';
}
$result.= ' | ';
if ($status{'reviewqueue'} eq 'enqueued') {
$result .= &mt('Awaiting Review');
} elsif ($status{'reviewqueue'} eq 'locked') {
$result .= &mt('Under Review');
} elsif ($status{'reviewqueue'} eq 'in_progress') {
$result .= &mt('Still being worked on.');
} elsif ($status{'gradingqueue'} eq 'enqueued') {
$result .= &mt('Awaiting Grading');
} elsif ($status{'gradingqueue'} eq 'locked') {
$result .= &mt('Being Graded');
} elsif ($status{'gradingqueue'} eq 'in_progress') {
$result .= &mt('Still being worked on.');
} else {
$result.=" ";
}
$result.= ' | |
".&mt('You passed [_1] of the [_2] mandatory components and [_3] of the [_4] optional components, of which you were required to pass [_5].',$man_passed,$man_count,$opt_passed,$opt_count,$opt_req)."
\n'; @Apache::scripttag::parser_env = @_; $result.=&Apache::scripttag::xmlparse($dimension{'criteria.'.$id}); $result.='
'.$status_display.'
'; if ($Apache::lonhomework::history{"resource.$version.0.$dim.$id.comment"}) { $result.=''.&mt('Comment: [_1]',$Apache::lonhomework::history{"resource.$version.0.$dim.$id.comment"}).'
'; } $result.=''.&mt("Failed to authenticate the proctor.") .'
'; } if (!$env{'form.proctordomain'}) { $env{'form.proctordomain'}=$domain; } my $result= (<Your room's proctor needs to validate your access to this resource.
$msgProctor's Username: | |
Password: | |
Proctor's Domain: |
|
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at root@localhost to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.