version 1.241, 2008/09/19 22:06:49
|
version 1.250, 2010/01/12 17:05:12
|
Line 82 sub proctor_check_auth {
|
Line 82 sub proctor_check_auth {
|
} |
} |
} |
} |
if ($authenticated) { |
if ($authenticated) { |
&check_in($type,$user,$domain,$slot_name); |
my $check = &check_in($type,$user,$domain,$slot_name); |
|
if ($check =~ /^error:/) { |
|
return 0; |
|
} |
return 1; |
return 1; |
} |
} |
} |
} |
Line 94 sub check_in {
|
Line 97 sub check_in {
|
my ($type,$user,$domain,$slot_name) = @_; |
my ($type,$user,$domain,$slot_name) = @_; |
my $useslots = &Apache::lonnet::EXT("resource.0.useslots"); |
my $useslots = &Apache::lonnet::EXT("resource.0.useslots"); |
if ( $useslots eq 'map_map') { |
if ( $useslots eq 'map_map') { |
&check_in_sequence($user,$domain,$slot_name); |
my $result = &check_in_sequence($user,$domain,$slot_name); |
|
if ($result =~ /^error: /) { |
|
return $result; |
|
} |
} else { |
} else { |
&create_new_version($type,$user,$domain,$slot_name); |
&create_new_version($type,$user,$domain,$slot_name); |
&Apache::structuretags::finalize_storage(); |
&Apache::structuretags::finalize_storage(); |
Line 105 sub check_in {
|
Line 111 sub check_in {
|
sub check_in_sequence { |
sub check_in_sequence { |
my ($user,$domain,$slot_name) = @_; |
my ($user,$domain,$slot_name) = @_; |
my $navmap = Apache::lonnavmaps::navmap->new(); |
my $navmap = Apache::lonnavmaps::navmap->new(); |
|
if (!defined($navmap)) { |
|
return 'error: '; |
|
} |
my ($symb) = &Apache::lonnet::whichuser(); |
my ($symb) = &Apache::lonnet::whichuser(); |
my ($map) = &Apache::lonnet::decode_symb($symb); |
my ($map) = &Apache::lonnet::decode_symb($symb); |
my @resources = |
my @resources = |
Line 306 sub add_request_another_attempt_button {
|
Line 315 sub add_request_another_attempt_button {
|
my ($slot_name,$slot)=&Apache::slotrequest::check_for_reservation($symb); |
my ($slot_name,$slot)=&Apache::slotrequest::check_for_reservation($symb); |
my $action='get_reservation'; |
my $action='get_reservation'; |
if ($slot_name) { |
if ($slot_name) { |
$text=&mt('Change reservation.'); |
$text=&mt('Change reservation'); |
$action='change_reservation'; |
$action='change_reservation'; |
my $description=&Apache::slotrequest::get_description($slot_name, |
my $description=&Apache::slotrequest::get_description($slot_name, |
$slot); |
$slot); |
Line 473 sub file_list {
|
Line 482 sub file_list {
|
my $file=$file_url.$partial_file; |
my $file=$file_url.$partial_file; |
$file=~s|/+|/|g; |
$file=~s|/+|/|g; |
&Apache::lonnet::allowuploaded('/adm/bridgetask',$file); |
&Apache::lonnet::allowuploaded('/adm/bridgetask',$file); |
$file_list.='<li><span style="white-space: nowrap;"><a href="'.$file.'?rawmode=1" target="lonGRDs"><img src="'. |
$file_list.='<li><span class="LC_nobreak"><a href="'.$file.'?rawmode=1" target="lonGRDs"><img src="'. |
&Apache::loncommon::icon($file).'" alt="file icon" border="0" /> '.$file. |
&Apache::loncommon::icon($file).'" alt="file icon" border="0" /> '.$file. |
'</a></span></li>'."\n"; |
'</a></span></li>'."\n"; |
} |
} |
Line 493 sub webgrade_standard_info {
|
Line 502 sub webgrade_standard_info {
|
|
|
my $file_list = &file_list($Apache::lonhomework::history{"resource.$version.0.bridgetask.portfiles"}); |
my $file_list = &file_list($Apache::lonhomework::history{"resource.$version.0.bridgetask.portfiles"}); |
|
|
my %lt=('done' => 'Next Item', |
my %lt = &Apache::lonlocal::texthash( |
'stop' => 'Quit Grading', |
'done' => 'Next Item', |
'fail' => 'Fail Rest', |
'stop' => 'Quit Grading', |
'cancel' => 'Cancel', |
'fail' => 'Fail Rest', |
'submit' => 'Submit Grades', |
'cancel' => 'Cancel', |
); |
'submit' => 'Submit Grades', |
%lt=&Apache::lonlocal::texthash(%lt); |
); |
|
|
my $result=<<INFO; |
my $result=<<INFO; |
<div class="LC_GRADING_maincontrols"> |
<div class="LC_GRADING_maincontrols"> |
Line 655 sub start_Task {
|
Line 664 sub start_Task {
|
if ($status eq 'CAN_ANSWER' && $version eq '') { |
if ($status eq 'CAN_ANSWER' && $version eq '') { |
# CAN_ANSWER mode, and no current version, unproctored access |
# CAN_ANSWER mode, and no current version, unproctored access |
# thus self-checkedin |
# thus self-checkedin |
&check_in('Task',undef,undef,$slot_name); |
my $check = &check_in('Task',undef,undef,$slot_name); |
|
if ($check =~ /^error: /) { |
|
my $symb=&Apache::lonnet::symbread(); |
|
&Apache::lonnet::logthis("Error during self-checkin of version $version of Task (symb: $symb) using slot: $slot_name"); |
|
} |
&add_to_queue('gradingqueue',{'type' => 'Task', |
&add_to_queue('gradingqueue',{'type' => 'Task', |
'time' => time, |
'time' => time, |
'slot' => $slot_name}); |
'slot' => $slot_name}); |
Line 685 sub start_Task {
|
Line 698 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."); |
$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 701 sub start_Task {
|
Line 714 sub start_Task {
|
} |
} |
$result.=$msg.'<br />'; |
$result.=$msg.'<br />'; |
} elsif ($target eq 'tex') { |
} elsif ($target eq 'tex') { |
$result.='\begin{document}\noindent \vskip 1 mm \begin{minipage}{\textwidth}\vskip 0 mm'; |
$result.='\noindent \vskip 1 mm \begin{minipage}{\textwidth}\vskip 0 mm'; |
if ($status eq 'UNAVAILABLE') { |
if ($status eq 'UNAVAILABLE') { |
$result.=&mt('Unable to determine if this resource is open due to network problems. Please try again later.').'\vskip 0 mm '; |
$result.=&mt('Unable to determine if this resource is open due to network problems. Please try again later.').'\vskip 0 mm '; |
} else { |
} else { |
Line 1295 DONEBUTTON
|
Line 1308 DONEBUTTON
|
$Apache::lonhomework::results{"resource.$version.0.solved"}; |
$Apache::lonhomework::results{"resource.$version.0.solved"}; |
} |
} |
&minimize_storage(); |
&minimize_storage(); |
&Apache::structuretags::finalize_storage(); |
my $canstore; |
|
if ($env{'form.gradingkey'}) { |
|
my ($symb,$courseid,$domain,$name) = |
|
&Apache::lonnet::whichuser(); |
|
my $todo=&unescape($env{'form.gradingkey'}); |
|
my ($keysymb,$uname,$udom)=&decode_queue_key($todo); |
|
if ($symb eq $keysymb) { |
|
if (($domain eq $udom) && ($name eq $uname)) { |
|
$canstore = 1; |
|
} |
|
} |
|
} |
|
if ($canstore) { |
|
&Apache::structuretags::finalize_storage(); |
|
} else { |
|
$result .= '<br /><div class="LC_error">'. |
|
&mt('Information extracted from the current gradingkey was for a different BT or user from those for which grading data are to be stored.').' '.&mt('No grading changes stored.').'</div><br />'; |
|
} |
|
|
# data stored, now handle queue |
# data stored, now handle queue |
if ($review) { |
if ($review) { |
if ($env{'form.queue'} eq 'reviewqueue') { |
if ($env{'form.queue'} eq 'reviewqueue') { |
Line 1382 DONEBUTTON
|
Line 1412 DONEBUTTON
|
} |
} |
&Apache::structuretags::reset_problem_globals('Task'); |
&Apache::structuretags::reset_problem_globals('Task'); |
undef($Apache::lonhomework::parsing_a_task); |
undef($Apache::lonhomework::parsing_a_task); |
|
if ( ($target eq 'grade' && $env{'form.webgrade'}) || |
|
$target eq 'webgrade') { |
|
delete($env{'form.grade_symb'}); |
|
delete($env{'form.grade_domain'}); |
|
delete($env{'form.grade_username'}); |
|
delete($env{'form.grade_courseid'}); |
|
} |
return $result; |
return $result; |
} |
} |
|
|
Line 2081 sub select_user {
|
Line 2118 sub select_user {
|
$seclist.='<input type="hidden" name="chosensections" |
$seclist.='<input type="hidden" name="chosensections" |
value="'.$sec.'" />'; |
value="'.$sec.'" />'; |
} |
} |
|
my $buttontext=&mt('Regrade'); |
$result.=&Apache::loncommon::start_data_table_row(); |
$result.=&Apache::loncommon::start_data_table_row(); |
$result.=<<RESULT; |
$result.=<<RESULT; |
<td> |
<td> |
Line 2089 sub select_user {
|
Line 2127 sub select_user {
|
<input type="hidden" name="queue" value="$queue" /> |
<input type="hidden" name="queue" value="$queue" /> |
<input type="hidden" name="webgrade" value="no" /> |
<input type="hidden" name="webgrade" value="no" /> |
<input type="hidden" name="regrade" value="yes" /> |
<input type="hidden" name="regrade" value="yes" /> |
<input type="submit" name="submit" value="Regrade" /> |
<input type="submit" name="submit" value="$buttontext" /> |
$seclist |
$seclist |
</form> |
</form> |
<td>$classlist->{$student}[&Apache::loncoursedata::CL_FULLNAME()] <tt>($student)</tt> Sec: $classlist->{$student}[&Apache::loncoursedata::CL_SECTION()]</td> |
<td>$classlist->{$student}[&Apache::loncoursedata::CL_FULLNAME()] <tt>($student)</tt> Sec: $classlist->{$student}[&Apache::loncoursedata::CL_SECTION()]</td> |
Line 2982 sub layout_webgrade_Criteria {
|
Line 3020 sub layout_webgrade_Criteria {
|
my $link=&link($id); |
my $link=&link($id); |
my $version = &get_version(); |
my $version = &get_version(); |
my $status = &get_criteria('status',$version,$dim,$id); |
my $status = &get_criteria('status',$version,$dim,$id); |
my %lt = ( 'ungraded' => 'Ungraded', |
my %lt = &Apache::lonlocal::texthash( |
'fail' => 'Fail', |
'ungraded' => 'Ungraded', |
'pass' => 'Pass', |
'fail' => 'Fail', |
'review' => 'Review', |
'pass' => 'Pass', |
'comment' => 'Additional Comment for Student', |
'review' => 'Review', |
); |
'comment' => 'Additional Comment for Student', |
%lt = &Apache::lonlocal::texthash(%lt); |
); |
my $comment = &get_criteria('comment',$version,$dim,$id); |
my $comment = &get_criteria('comment',$version,$dim,$id); |
$comment = &HTML::Entities::encode($comment,'<>"&'); |
$comment = &HTML::Entities::encode($comment,'<>"&'); |
my %checked; |
my %checked; |
foreach my $which ('ungraded','fail','pass','review') { |
foreach my $which ('ungraded','fail','pass','review') { |
if ($status eq $which) { $checked{$which} = 'checked="checked"'; } |
if ($status eq $which) { $checked{$which} = ' checked="checked"'; } |
} |
} |
if (!%checked) { $checked{'ungraded'} = 'checked="checked"'; } |
if (!%checked) { $checked{'ungraded'} = ' checked="checked"'; } |
my $buttons; |
my $buttons; |
foreach my $which ('ungraded','fail','pass','review') { |
foreach my $which ('ungraded','fail','pass','review') { |
$buttons .= <<END_BUTTON; |
$buttons .= <<END_BUTTON; |
<label class="LC_GRADING_$which"> |
<label class="LC_GRADING_$which"> |
<input type="radio" name="HWVAL_$link" value="$which" $checked{$which} /> |
<input type="radio" name="HWVAL_$link" value="$which"$checked{$which} /> |
$lt{$which} |
$lt{$which} |
</label> |
</label> |
END_BUTTON |
END_BUTTON |
Line 3143 sub proctor_validation_screen {
|
Line 3181 sub proctor_validation_screen {
|
'vali' => 'Validate', |
'vali' => 'Validate', |
'stui' => "Student who should be logged in is:", |
'stui' => "Student who should be logged in is:", |
'name' => "Name:", |
'name' => "Name:", |
'sid' => "Student ID:", |
'sid' => "Student/Employee ID:", |
'unam' => "Username:", |
'unam' => "Username:", |
); |
); |
my $result= (<<ENDCHECKOUT); |
my $result= (<<ENDCHECKOUT); |