version 1.33, 2005/05/27 21:13:46
|
version 1.48, 2005/09/14 21:03:48
|
Line 36 use Apache::File();
|
Line 36 use Apache::File();
|
use Apache::lonmenu; |
use Apache::lonmenu; |
use Apache::lonlocal; |
use Apache::lonlocal; |
use Apache::lonxml; |
use Apache::lonxml; |
|
use Apache::slotrequest(); |
use Time::HiRes qw( gettimeofday tv_interval ); |
use Time::HiRes qw( gettimeofday tv_interval ); |
|
|
BEGIN { |
BEGIN { |
Line 91 sub proctor_check_auth {
|
Line 92 sub proctor_check_auth {
|
sub get_version { |
sub get_version { |
my ($version,$previous); |
my ($version,$previous); |
if ($env{'form.previousversion'} && |
if ($env{'form.previousversion'} && |
|
$env{'form.previousversion'} ne 'current' && |
defined($Apache::lonhomework::history{'resource.'.$env{'form.previousversion'}.'.status'})) { |
defined($Apache::lonhomework::history{'resource.'.$env{'form.previousversion'}.'.status'})) { |
$version=$env{'form.previousversion'}; |
$version=$env{'form.previousversion'}; |
$previous=1; |
$previous=1; |
Line 129 sub add_previous_version_button {
|
Line 131 sub add_previous_version_button {
|
my $list='<option>'. |
my $list='<option>'. |
join("</option>\n<option>",@to_show). |
join("</option>\n<option>",@to_show). |
"</option>\n"; |
"</option>\n"; |
|
$list.='<option value="current">'.&mt('Current').'</option>'; |
$result.='<form name="getprevious" method="POST" action="'; |
$result.='<form name="getprevious" method="POST" action="'; |
my $uri=$env{'request.uri'}; |
my $uri=$env{'request.uri'}; |
if ($env{'request.enc'}) { $uri=&Apache::lonenc::encrypted($uri); } |
if ($env{'request.enc'}) { $uri=&Apache::lonenc::encrypted($uri); } |
Line 144 sub add_grading_button {
|
Line 147 sub add_grading_button {
|
my $result=' <input type="submit" name="gradeasubmission" value="'. |
my $result=' <input type="submit" name="gradeasubmission" value="'. |
&mt("Get a submission to grade").'" />'; |
&mt("Get a submission to grade").'" />'; |
$result.='<input type="hidden" name="grade_target" value="webgrade" />'; |
$result.='<input type="hidden" name="grade_target" value="webgrade" />'; |
if ( 1) { |
if (&Apache::lonnet::allowed('mgq',$env{'request.course.id'})) { |
#need a permissions for limitng this to 'powerful users' |
my ($entries,$ready,$locks)=&get_queue_counts('gradingqueue'); |
#check if review queue has items |
$result.='<p>'.&mt("Grading Queue has [_1] entries. [_2] of them are ready to be graded and [_3] of them are currently being graded",$entries,$ready,$locks); |
$result.=' <input type="submit" name="reviewasubmission" value="'. |
|
&mt("Select an entry from the review queue").'" />'."\n"; |
|
$result.=' <input type="submit" name="reviewagrading" value="'. |
$result.=' <input type="submit" name="reviewagrading" value="'. |
&mt("Select an entry from the grading queue").'" />'."\n"; |
&mt("Select an entry from the grading queue").'" /> </p>'."\n"; |
|
|
|
($entries,$ready,$locks)=&get_queue_counts('reviewqueue'); |
|
$result.='<p>'.&mt("Review Queue has [_1] entries. [_2] of them are ready to be graded and [_3] of them are currently being graded",$entries,$ready,$locks); |
|
$result.=' <input type="submit" name="reviewasubmission" value="'. |
|
&mt("Select an entry from the review queue").'" /> </p>'."\n"; |
} |
} |
return $result; |
return $result; |
} |
} |
|
|
sub add_request_another_attempt_button { |
sub add_request_another_attempt_button { |
|
my ($text)=@_; |
|
if (!$text) { $text="Request another attempt"; } |
my $result; |
my $result; |
$result.=' <input type="submit" name="requestattempt" value="'. |
my $symb=&Apache::lonnet::symbread(); |
&mt("Request another attempt").'" />'; |
my ($slot_name,$slot)=&Apache::slotrequest::check_for_reservation($symb); |
|
my $action='get_reservation'; |
|
if ($slot_name) { |
|
$text="Change reservation."; |
|
$action='change_reservation'; |
|
my $description=&Apache::slotrequest::get_description($slot_name, |
|
$slot); |
|
$result.=(<<STUFF); |
|
<p> Will be next available: $description </p> |
|
STUFF |
|
} |
|
|
|
if ($env{'request.enc'}) { $symb=&Apache::lonenc::encrypted($symb); } |
|
$symb=&Apache::lonnet::escape($symb); |
|
$result.='<form method="POST" action="/adm/slotrequest">'. |
|
'<input type="hidden" name="symb" value="'.$symb.'" />'. |
|
'<input type="hidden" name="command" value="'.$action.'" />'. |
|
'<input type="submit" name="requestattempt" value="'. |
|
&mt($text).'" />'. |
|
'</form>'; |
return $result; |
return $result; |
} |
} |
|
|
Line 194 sub start_Task {
|
Line 222 sub start_Task {
|
my $uri=$env{'request.uri'}; |
my $uri=$env{'request.uri'}; |
if ($env{'request.enc'}) { $uri=&Apache::lonenc::encrypted($uri); } |
if ($env{'request.enc'}) { $uri=&Apache::lonenc::encrypted($uri); } |
$body_tag_start.=$uri.'">'.&add_grading_button()."</form>"; |
$body_tag_start.=$uri.'">'.&add_grading_button()."</form>"; |
|
my $symb=&Apache::lonnet::symbread(); |
|
if (&Apache::lonnet::allowed('mgq',$env{'request.course.id'})) { |
|
$body_tag_start.='<form method="POST" action="/adm/slotrequest">'. |
|
'<input type="hidden" name="symb" value="'.$symb.'" />'. |
|
'<input type="hidden" name="command" value="showslots" />'. |
|
'<input type="submit" name="requestattempt" value="'. |
|
&mt('Show Slot list').'" />'. |
|
'</form>'; |
|
} |
} |
} |
} |
} |
if ($target eq 'web' || ($target eq 'grade' && !$env{'form.webgrade'}) || $target eq 'answer' || |
if ($target eq 'web' || ($target eq 'grade' && !$env{'form.webgrade'}) || $target eq 'answer' || |
Line 224 sub start_Task {
|
Line 261 sub start_Task {
|
$msg.='<h1>'.&mt('Unable to determine if this resource is open due to network problems. Please try again later.').'</h1>'; |
$msg.='<h1>'.&mt('Unable to determine if this resource is open due to network problems. Please try again later.').'</h1>'; |
} elsif ($status eq 'NOT_IN_A_SLOT') { |
} elsif ($status eq 'NOT_IN_A_SLOT') { |
$msg.='<h1>'.&mt('You are not currently signed up to work at this time and/or place.').'</h1>'; |
$msg.='<h1>'.&mt('You are not currently signed up to work at this time and/or place.').'</h1>'; |
|
$msg.=&add_request_another_attempt_button("Sign up for time to work."); |
} elsif ($status eq 'NEEDS_CHECKIN') { |
} elsif ($status eq 'NEEDS_CHECKIN') { |
$msg.='<h1>'.&mt('You need the Proctor to validate you.'). |
$msg.='<h1>'.&mt('You need the Proctor to validate you.'). |
'</h1>'.&proctor_validation_screen($slot); |
'</h1>'.&proctor_validation_screen($slot); |
Line 245 sub start_Task {
|
Line 283 sub start_Task {
|
} |
} |
} elsif ($target eq 'grade' && !$env{'form.webgrade'}) { |
} elsif ($target eq 'grade' && !$env{'form.webgrade'}) { |
if ($status eq 'NEEDS_CHECKIN') { |
if ($status eq 'NEEDS_CHECKIN') { |
if (&proctor_check_auth($slot_name,$slot)) { |
&proctor_check_auth($slot_name,$slot); |
#FIXME immeadiatly add this to the grading queue |
|
# with slot->{'endtime'} for when grading can |
|
# begin on this resource |
|
# FIXME I think the above is done by default, |
|
# need to check that |
|
# failure doesn't do this. |
|
} |
|
} |
} |
} |
} |
} elsif ($target eq 'web') { |
} elsif ($target eq 'web') { |
my $name= &Apache::structuretags::get_resource_name($parstack,$safeeval); |
my $name= &Apache::structuretags::get_resource_name($parstack,$safeeval); |
$result.="$head_tag_start<title>$name</title></head> |
$result.="$head_tag_start<title>$name</title></head> |
$body_tag_start \n $form_tag_start". |
$body_tag_start \n"; |
'<input type="hidden" name="submitted" value="yes" />'; |
|
$result.=&preserve_grade_info(); |
|
my ($version,$previous)=&get_version(); |
my ($version,$previous)=&get_version(); |
if ($Apache::lonhomework::history{"resource.$version.status"} eq 'fail') { |
if ($Apache::lonhomework::history{"resource.$version.status"} eq 'fail') { |
$result.='<h1><font color="red">'.&mt('Did not pass').'</font></h1>'; |
$result.='<h1><font color="red">'.&mt('Did not pass').'</font></h1>'; |
Line 271 sub start_Task {
|
Line 301 sub start_Task {
|
if ($Apache::lonhomework::history{"resource.$version.status"} eq 'pass') { |
if ($Apache::lonhomework::history{"resource.$version.status"} eq 'pass') { |
$result.='<h1><font color="green">'.&mt('Passed').'</font></h1>'; |
$result.='<h1><font color="green">'.&mt('Passed').'</font></h1>'; |
} |
} |
|
$result.=$form_tag_start. |
|
'<input type="hidden" name="submitted" value="yes" />'; |
|
$result.=&preserve_grade_info(); |
|
|
} |
} |
} elsif ( ($target eq 'grade' && $env{'form.webgrade'}) || |
} elsif ( ($target eq 'grade' && $env{'form.webgrade'}) || |
$target eq 'webgrade') { |
$target eq 'webgrade') { |
Line 428 sub end_Task {
|
Line 462 sub end_Task {
|
$result.="\n".'<table border="1">'. |
$result.="\n".'<table border="1">'. |
&Apache::inputtags::file_selector("$version.0", |
&Apache::inputtags::file_selector("$version.0", |
"bridgetask","*", |
"bridgetask","*", |
'portfolioonly'). |
'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>"; |
"</table>"; |
$result.=&Apache::inputtags::gradestatus('0'); |
$result.=&Apache::inputtags::gradestatus('0'); |
} |
} |
Line 497 sub end_Task {
|
Line 534 sub end_Task {
|
} |
} |
} elsif ($ungraded) { |
} elsif ($ungraded) { |
$Apache::lonhomework::results{"resource.$version.status"}='ungraded'; |
$Apache::lonhomework::results{"resource.$version.status"}='ungraded'; |
# FIXME if in review queue need to move back to grading queue |
|
if ($env{'form.queue'} eq 'reviewqueue') { |
if ($env{'form.queue'} eq 'reviewqueue') { |
&Apache::lonxml::debug("moving back."); |
&Apache::lonxml::debug("moving back."); |
&move_between_queues('reviewqueue','gradingqueue'); |
&move_between_queues('reviewqueue','gradingqueue'); |
Line 509 sub end_Task {
|
Line 545 sub end_Task {
|
$Apache::lonhomework::results{"resource.$version.0.solved"}='incorrect_by_override'; |
$Apache::lonhomework::results{"resource.$version.0.solved"}='incorrect_by_override'; |
$Apache::lonhomework::results{"resource.$version.0.award"}='INCORRECT'; |
$Apache::lonhomework::results{"resource.$version.0.award"}='INCORRECT'; |
$Apache::lonhomework::results{"resource.$version.0.awarded"}='0'; |
$Apache::lonhomework::results{"resource.$version.0.awarded"}='0'; |
&remove_from_queue($env{'form.queue'}); |
&remove_from_queue($env{'form.queue'}); |
|
|
|
my ($symb,$courseid,$udom,$uname)=&Apache::lonxml::whichuser(); |
|
$Apache::lonhomework::results{"resource.$version.0.bridgetask.portfiles"}= |
|
$Apache::lonhomework::history{"resource.$version.0.bridgetask.portfiles"}; |
|
&Apache::grades::version_portfiles( |
|
\%Apache::lonhomework::results, |
|
["$version.0.bridgetask"],$courseid, |
|
$symb,$udom,$uname, |
|
["$version.0.bridgetask"]); |
} else { |
} else { |
$Apache::lonhomework::results{"resource.$version.status"}='pass'; |
$Apache::lonhomework::results{"resource.$version.status"}='pass'; |
$Apache::lonhomework::results{"resource.$version.0.solved"}='correct_by_override'; |
$Apache::lonhomework::results{"resource.$version.0.solved"}='correct_by_override'; |
$Apache::lonhomework::results{"resource.$version.0.award"}='EXACT_ANS'; |
$Apache::lonhomework::results{"resource.$version.0.award"}='EXACT_ANS'; |
$Apache::lonhomework::results{"resource.$version.0.awarded"}='1'; |
$Apache::lonhomework::results{"resource.$version.0.awarded"}='1'; |
&remove_from_queue($env{'form.queue'}); |
&remove_from_queue($env{'form.queue'}); |
|
|
|
my ($symb,$courseid,$udom,$uname)=&Apache::lonxml::whichuser(); |
|
$Apache::lonhomework::results{"resource.$version.0.bridgetask.portfiles"}= |
|
$Apache::lonhomework::history{"resource.$version.0.bridgetask.portfiles"}; |
|
&Apache::grades::version_portfiles( |
|
\%Apache::lonhomework::results, |
|
["$version.0.bridgetask"],$courseid, |
|
$symb,$udom,$uname, |
|
["$version.0.bridgetask"]); |
} |
} |
$Apache::lonhomework::results{"resource.status"}= |
$Apache::lonhomework::results{"resource.status"}= |
$Apache::lonhomework::results{"resource.$version.status"}; |
$Apache::lonhomework::results{"resource.$version.status"}; |
Line 655 sub show_queue {
|
Line 709 sub show_queue {
|
my ($symb,$uname,$udom) = &decode_queue_key($key); |
my ($symb,$uname,$udom) = &decode_queue_key($key); |
my $title=&Apache::lonnet::gettitle($symb); |
my $title=&Apache::lonnet::gettitle($symb); |
$result.="<tr>"; |
$result.="<tr>"; |
|
my $slot=$queue{$key}->[0]; |
|
my %slot_data=&Apache::lonnet::get_slot($slot); |
if ($with_selects) { |
if ($with_selects) { |
my $ekey=&Apache::lonnet::escape($key); |
my $ekey=&Apache::lonnet::escape($key); |
my ($action,$description)=('select',&mt('Select')); |
my ($action,$description)=('select',&mt('Select')); |
Line 666 sub show_queue {
|
Line 722 sub show_queue {
|
($action,$description)=('unlock',&mt('Unlock')); |
($action,$description)=('unlock',&mt('Unlock')); |
} |
} |
} |
} |
$result.=(<<FORM); |
if (time > $slot_data{'endtime'}) { |
|
$result.=(<<FORM); |
<td> |
<td> |
<form method="POST"> |
<form method="POST"> |
<input type="hidden" name="gradingkey" value="$ekey" /> |
<input type="hidden" name="gradingkey" value="$ekey" /> |
Line 678 sub show_queue {
|
Line 735 sub show_queue {
|
</form> |
</form> |
</td> |
</td> |
FORM |
FORM |
|
|
|
} else { |
|
$result.='<td>'.&mt("In Progress").'</td>' |
|
} |
} |
} |
$result.="<td>$title</td><td>$uname</td>"; |
$result.="<td>$title</td><td>$uname</td>"; |
my $slot=$queue{$key}->[0]; |
|
my %slot_data=&Apache::lonnet::get_slot($slot); |
|
$result.='<td>queue entry</td><td>Slot: '.$slot.' End time: '. |
$result.='<td>queue entry</td><td>Slot: '.$slot.' End time: '. |
&Apache::lonlocal::locallocaltime($slot_data{'endtime'}). |
&Apache::lonlocal::locallocaltime($slot_data{'endtime'}). |
"</td></tr>"; |
"</td></tr>"; |
Line 691 FORM
|
Line 750 FORM
|
return $result; |
return $result; |
} |
} |
|
|
|
sub get_queue_counts { |
|
my ($queue)=@_; |
|
my $result; |
|
my ($symb,$cid,$udom,$uname)=&Apache::lonxml::whichuser(); |
|
my $cnum=$env{'course.'.$cid.'.num'}; |
|
my $cdom=$env{'course.'.$cid.'.domain'}; |
|
my $regexp="^$symb\0"; |
|
my %queue=&Apache::lonnet::dump($queue,$cdom,$cnum,$regexp); |
|
my ($tmp)=%queue; |
|
if ($tmp=~/^error: 2 /) { |
|
return (0,0,0); |
|
} |
|
my ($entries,$ready_to_grade,$locks)=(0,0,0); |
|
foreach my $key (sort(keys(%queue))) { |
|
if ($key=~/locked$/) { |
|
$locks++; |
|
} elsif ($key=~/timestamp$/) { |
|
#ignore |
|
} elsif ($key!~/(timestamp|locked)$/) { |
|
my ($symb,$uname,$udom) = &decode_queue_key($key); |
|
$entries++; |
|
my $slot=$queue{$key}->[0]; |
|
my %slot_data=&Apache::lonnet::get_slot($slot); |
|
if (time > $slot_data{'endtime'}) { |
|
$ready_to_grade++; |
|
} |
|
} |
|
} |
|
return ($entries,$ready_to_grade,$locks); |
|
} |
|
|
sub decode_queue_key { |
sub decode_queue_key { |
my ($key)=@_; |
my ($key)=@_; |
my ($symb,undef,$user) = split("\0",$key); |
my ($symb,undef,$user) = split("\0",$key); |
Line 897 sub get_instance {
|
Line 987 sub get_instance {
|
my $instance=&get_instance(); |
my $instance=&get_instance(); |
my $version=&get_version(); |
my $version=&get_version(); |
if ($target eq 'web') { |
if ($target eq 'web') { |
$result=$dimension{'intro'}.$dimension{$instance.'.text'}; |
@Apache::scripttag::parser_env = @_; |
|
$result.=&Apache::scripttag::xmlparse($dimension{'intro'}); |
|
@Apache::scripttag::parser_env = @_; |
|
$result.=&Apache::scripttag::xmlparse($dimension{$instance.'.text'}); |
if ($Apache::lonhomework::history{"resource.$version.status"} eq 'pass' || |
if ($Apache::lonhomework::history{"resource.$version.status"} eq 'pass' || |
$Apache::lonhomework::history{"resource.$version.status"} eq 'fail') { |
$Apache::lonhomework::history{"resource.$version.status"} eq 'fail') { |
foreach my $id (@{$dimension{$instance.'.criterias'}}) { |
foreach my $id (@{$dimension{$instance.'.criterias'}}) { |
Line 920 sub get_instance {
|
Line 1013 sub get_instance {
|
} |
} |
} |
} |
} elsif ($target eq 'webgrade') { |
} elsif ($target eq 'webgrade') { |
|
# in case of any side effects that we need |
|
@Apache::scripttag::parser_env = @_; |
|
&Apache::scripttag::xmlparse($dimension{'intro'}); |
|
@Apache::scripttag::parser_env = @_; |
|
&Apache::scripttag::xmlparse($dimension{$instance.'.text'}); |
foreach my $id (@{$dimension{$instance.'.criterias'}}) { |
foreach my $id (@{$dimension{$instance.'.criterias'}}) { |
my $link='criteria_'.$instance.'_'.$id; |
my $link='criteria_'.$instance.'_'.$id; |
my $status=$Apache::lonhomework::history{"resource.$version.$dim.$instance.$id.status"}; |
my $status=$Apache::lonhomework::history{"resource.$version.$dim.$instance.$id.status"}; |
$result.='<tr><td width="100%" valign="top">'. |
$result.='<tr><td width="100%" valign="top">'. |
'<a name="'.$link.'" />'. |
'<a name="'.$link.'" />'. |
'<a name="next_'.$last_link.'" />'. |
'<a name="next_'.$last_link.'" />'. |
'<br /><textarea enabled="false" style="width:100%" rows="8" width="25" wrap="hard">'.$dimension{$instance.'.criteria.'.$id}.'</textarea>'. |
'<br /><textarea enabled="false" style="width:100%" rows="8" width="25" wrap="hard">'; |
|
@Apache::scripttag::parser_env = @_; |
|
$result.=&Apache::scripttag::xmlparse($dimension{$instance.'.criteria.'.$id}); |
|
$result.='</textarea>'. |
#$dimension{$instance.'.criteria.'.$id}. |
#$dimension{$instance.'.criteria.'.$id}. |
'</td>'. |
'</td>'. |
'<td><nobr>Additional Comment for Student</nobr> <br />'. |
'<td><nobr>Additional Comment for Student</nobr> <br />'. |
'<textarea style="width:100%" rows="8" width="25" wrap="hard" name="HWVAL_comment_'.$link.'">'.&HTML::Entities::encode($Apache::lonhomework::history{"resource.$version.$dim.$instance.$id.comment"}).'</textarea>'. |
'<textarea style="width:100%" rows="8" width="25" wrap="hard" name="HWVAL_comment_'.$link.'">'.&HTML::Entities::encode($Apache::lonhomework::history{"resource.$version.$dim.$instance.$id.comment"}).'</textarea>'. |
'</td>'. |
'</td>'. |
'<td>'. |
'<td>'. |
'<nobr><label><input type="radio" name="HWVAL_'.$link.'" value="ungraded" '.($status eq 'ungraded' || !$status ? 'checked="checked"':'').'/>'.&mt('Ungraded').'</label></nobr><br />'. |
'<nobr><label><input type="radio" name="HWVAL_'.$link.'" value="ungraded" '.($status eq 'ungraded' || !$status ? 'checked="checked"':'').' />'.&mt('Ungraded').'</label></nobr><br />'. |
'<label><input type="radio" name="HWVAL_'.$link.'" value="pass" '.($status eq 'pass' ? 'checked="checked"':'').' />'.&mt('Pass').'</label><br />'. |
'<label><input type="radio" name="HWVAL_'.$link.'" value="pass" '.($status eq 'pass' ? 'checked="checked"':'').' />'.&mt('Pass').'</label><br />'. |
'<label><input type="radio" name="HWVAL_'.$link.'" value="fail" '.($status eq 'fail' ? 'checked="checked"':'').' />'.&mt('Fail').'</label><br />'. |
'<label><input type="radio" name="HWVAL_'.$link.'" value="fail" '.($status eq 'fail' ? 'checked="checked"':'').' />'.&mt('Fail').'</label><br />'. |
'<label><input type="radio" name="HWVAL_'.$link.'" value="review" '.($status eq 'review' ? 'checked="checked"':'').' />'.&mt('Review').'</label><br />'. |
'<label><input type="radio" name="HWVAL_'.$link.'" value="review" '.($status eq 'review' ? 'checked="checked"':'').' />'.&mt('Review').'</label><br />'. |
Line 949 sub get_instance {
|
Line 1050 sub get_instance {
|
$result.='<tr><td colspan="4">'; |
$result.='<tr><td colspan="4">'; |
my (undef,undef,$udom,$uname) = &Apache::lonxml::whichuser(); |
my (undef,undef,$udom,$uname) = &Apache::lonxml::whichuser(); |
my $file_url = '/uploaded/'.$udom.'/'.$uname.'/portfolio'; |
my $file_url = '/uploaded/'.$udom.'/'.$uname.'/portfolio'; |
foreach my $partial_file (split(',',$Apache::lonhomework::history{"resource.$version.bridgetask.portfiles"})) { |
foreach my $partial_file (split(',',$Apache::lonhomework::history{"resource.$version.0.bridgetask.portfiles"})) { |
my $file=$file_url.$partial_file; |
my $file=$file_url.$partial_file; |
&Apache::lonnet::allowuploaded('/adm/bridgetask',$file); |
&Apache::lonnet::allowuploaded('/adm/bridgetask',$file); |
$result.='<a href="'.$file.'" target="lonGRDs"><img src="'. |
$result.='<nobr><a href="'.$file.'" target="lonGRDs"><img src="'. |
&Apache::loncommon::icon($file).'" border=0"> '.$file. |
&Apache::loncommon::icon($file).'" border=0"> '.$file. |
'</a>'; |
'</a></nobr> '; |
} |
} |
$result.='</td></tr>'; |
$result.='</td></tr>'; |
$last_link=$link; |
$last_link=$link; |
Line 977 sub get_instance {
|
Line 1078 sub get_instance {
|
} elsif ($status eq 'ungraded') { |
} elsif ($status eq 'ungraded') { |
$ungraded++; |
$ungraded++; |
} else { |
} else { |
&Apache::lonxml::error("got weird status --$status--"); |
$ungraded++; |
} |
} |
} |
} |
if ($optional_passed < $dimension{$instance.'.optionalrequired'}) { |
if ($optional_passed < $dimension{$instance.'.optionalrequired'}) { |
Line 1006 sub start_IntroParagraph {
|
Line 1107 sub start_IntroParagraph {
|
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; |
my $result; |
my $result; |
if ($target eq 'web' || $target eq 'webgrade') { |
if ($target eq 'web' || $target eq 'webgrade') { |
if ($tagstack->[-2] eq 'Dimension' || $target eq 'webgrade') { |
if ($tagstack->[-2] eq 'Dimension') { |
&Apache::lonxml::startredirection(); |
$dimension{'intro'}=&Apache::lonxml::get_all_text('/introparagraph',$parser); |
|
|
|
} elsif ($target eq 'webgrade') { |
|
&Apache::lonxml::get_all_text('/introparagraph',$parser); |
} |
} |
|
|
} |
} |
return $result; |
return $result; |
} |
} |
|
|
sub end_IntroParagraph { |
sub end_IntroParagraph { |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; |
|
my $result; |
|
if ($target eq 'web' || $target eq 'webgrade') { |
|
if ($tagstack->[-2] eq 'Dimension' || $target eq 'webgrade') { |
|
$dimension{'intro'}=&Apache::lonxml::endredirection(); |
|
} |
|
} |
|
return $result; |
|
} |
} |
|
|
sub start_Instance { |
sub start_Instance { |
Line 1036 sub start_Instance {
|
Line 1133 sub start_Instance {
|
} |
} |
|
|
sub end_Instance { |
sub end_Instance { |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; |
|
return ''; |
|
} |
} |
|
|
sub start_InstanceText { |
sub start_InstanceText { |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; |
|
my $instance_id=$Apache::bridgetask::instance[-1]; |
|
my $text=&Apache::lonxml::get_all_text('/instancetext',$parser); |
if ($target eq 'web' || $target eq 'webgrade') { |
if ($target eq 'web' || $target eq 'webgrade') { |
&Apache::lonxml::startredirection(); |
$dimension{$instance_id.'.text'}=$text; |
} |
} |
return ''; |
return ''; |
} |
} |
|
|
sub end_InstanceText { |
sub end_InstanceText { |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; |
|
my $instance_id=$Apache::bridgetask::instance[-1]; |
|
if ($target eq 'web' || $target eq 'webgrade') { |
|
$dimension{$instance_id.'.text'}=&Apache::lonxml::endredirection(); |
|
} |
|
return ''; |
return ''; |
} |
} |
|
|
sub start_Criteria { |
sub start_Criteria { |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; |
if ($target eq 'web' || $target eq 'webgrade' || $target eq 'grade') { |
|
&Apache::lonxml::startredirection(); |
|
} |
|
return ''; |
|
} |
|
|
|
sub end_Criteria { |
|
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; |
|
my $instance_id=$Apache::bridgetask::instance[-1]; |
my $instance_id=$Apache::bridgetask::instance[-1]; |
|
my $criteria=&Apache::lonxml::get_all_text('/criteria',$parser); |
if ($target eq 'web' || $target eq 'webgrade' || $target eq 'grade') { |
if ($target eq 'web' || $target eq 'webgrade' || $target eq 'grade') { |
my $criteria=&Apache::lonxml::endredirection(); |
|
my $id=&get_id($parstack,$safeeval); |
my $id=&get_id($parstack,$safeeval); |
$dimension{$instance_id.'.criteria.'.$id}=$criteria; |
$dimension{$instance_id.'.criteria.'.$id}=$criteria; |
$dimension{$instance_id.'.criteria.'.$id.'.mandatory'}= |
$dimension{$instance_id.'.criteria.'.$id.'.mandatory'}= |
Line 1079 sub end_Criteria {
|
Line 1163 sub end_Criteria {
|
return ''; |
return ''; |
} |
} |
|
|
|
sub end_Criteria { |
|
} |
|
|
sub proctor_validation_screen { |
sub proctor_validation_screen { |
my ($slot) = @_; |
my ($slot) = @_; |
my (undef,undef,$domain,$user) = &Apache::lonxml::whichuser(); |
my (undef,undef,$domain,$user) = &Apache::lonxml::whichuser(); |
my $url=&Apache::lonnet::studentphoto($domain,$user,'jpg'); |
my $url=&Apache::lonnet::studentphoto($domain,$user,'jpg'); |
$user=$env{'form.proctorname'}; |
my $name=&Apache::loncommon::plainname($user,$domain); |
if ($env{'form.proctordomain'}) { $domain=$env{'form.proctordomain'}; } |
|
my $msg; |
my $msg; |
if ($env{'form.proctorpassword'}) { |
if ($env{'form.proctorpassword'}) { |
$msg='<p><font color="red">'.&mt("Failed to authenticate the proctor.") |
$msg='<p><font color="red">'.&mt("Failed to authenticate the proctor.") |
.'</font></p>'; |
.'</font></p>'; |
} |
} |
|
if (!$env{'form.proctordomain'}) { $env{'form.proctordomain'}=$domain; } |
my $result= (<<ENDCHECKOUT); |
my $result= (<<ENDCHECKOUT); |
<h2>Proctor Validation</h2> |
<h2>Proctor Validation</h2> |
<p>Your room's proctor needs to validate your access to this resource.</p> |
<p>Your room's proctor needs to validate your access to this resource.</p> |
Line 1098 sub proctor_validation_screen {
|
Line 1186 sub proctor_validation_screen {
|
<input type="hidden" name="validate" value="yes" /> |
<input type="hidden" name="validate" value="yes" /> |
<input type="hidden" name="submitted" value="yes" /> |
<input type="hidden" name="submitted" value="yes" /> |
<table> |
<table> |
<tr><td>Proctor's Username:</td><td><input type="string" name="proctorname" value="$user" /></td></tr> |
<tr><td>Proctor's Username:</td><td><input type="string" name="proctorname" value="$env{'form.proctorname'}" /></td></tr> |
<tr><td>Password:</td><td><input type="password" name="proctorpassword" value="" /></td></tr> |
<tr><td>Password:</td><td><input type="password" name="proctorpassword" value="" /></td></tr> |
<tr><td>Proctor's Domain:</td><td><input type="string" name="proctordomain" value="$domain" /></td></tr> |
<tr><td>Proctor's Domain:</td><td><input type="string" name="proctordomain" value="$env{'form.proctordomain'}" /></td></tr> |
</table> |
</table> |
<input type="submit" name="checkoutbutton" value="Validate" /><br /> |
<input type="submit" name="checkoutbutton" value="Validate" /><br /> |
Student who should be logged in is:<br /> |
<table border="1"> |
<img src="$url" /><br /> |
<tr><td> |
|
<table> |
|
<tr><td colspan="2">Student who should be logged in is:</td></tr> |
|
<tr><td>Name:</td><td>$name</td></tr> |
|
<tr><td>Student ID:</td><td>$env{'environment.id'}</td></tr> |
|
<tr><td>Usename</td><td>$user\@$domain</td></tr> |
|
<tr><td colspan="2"><img src="$url" /></td></tr> |
|
</table> |
|
</tr></td> |
|
</table> |
</form> |
</form> |
ENDCHECKOUT |
ENDCHECKOUT |
return $result; |
return $result; |