version 1.258, 2012/01/03 00:28:17
|
version 1.264.8.1.2.3, 2023/07/06 22:23:14
|
Line 65 sub initialize_bridgetask {
|
Line 65 sub initialize_bridgetask {
|
sub proctor_check_auth { |
sub proctor_check_auth { |
my ($slot_name,$slot,$type)=@_; |
my ($slot_name,$slot,$type)=@_; |
my $user=$env{'form.proctorname'}; |
my $user=$env{'form.proctorname'}; |
|
$user =~ s/^\s+|\s+$//g; |
my $domain=$env{'form.proctordomain'}; |
my $domain=$env{'form.proctordomain'}; |
|
|
my @allowed=split(",",$slot->{'proctor'}); |
my @allowed=split(",",$slot->{'proctor'}); |
foreach my $possible (@allowed) { |
foreach my $possible (@allowed) { |
my ($puser,$pdom)=(split(':',$possible)); |
my ($puser,$pdom)=(split(':',$possible)); |
Line 118 sub check_in_sequence {
|
Line 119 sub check_in_sequence {
|
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 = |
$navmap->retrieveResources($map, sub { $_[0]->is_problem() },0,0); |
$navmap->retrieveResources($map, sub { $_[0]->is_problem() || $_[0]->is_tool() },0,0); |
my %old_history = %Apache::lonhomework::history; |
my %old_history = %Apache::lonhomework::history; |
my %old_results = %Apache::lonhomework::results; |
my %old_results = %Apache::lonhomework::results; |
|
|
foreach my $res (@resources) { |
foreach my $res (@resources) { |
&Apache::lonxml::debug("doing ".$res->src); |
&Apache::lonxml::debug("doing ".$res->src); |
&Apache::structuretags::initialize_storage($res->symb); |
&Apache::structuretags::initialize_storage($res->symb); |
my $type = ($res->is_task()) ? 'Task' : 'problem'; |
my $type; |
|
if ($res->is_task()) { |
|
$type = 'Task'; |
|
} elsif ($res->is_tool) { |
|
$type = 'tool'; |
|
} else { |
|
$type = 'problem'; |
|
} |
&create_new_version($type,$user,$domain,$slot_name); |
&create_new_version($type,$user,$domain,$slot_name); |
&Apache::structuretags::finalize_storage($res->symb); |
&Apache::structuretags::finalize_storage($res->symb); |
} |
} |
Line 159 sub create_new_version {
|
Line 167 sub create_new_version {
|
$domain = $env{'user.domain'}; |
$domain = $env{'user.domain'}; |
} |
} |
|
|
} elsif ($type eq 'problem') { |
} elsif (($type eq 'problem') || ($type eq 'tool')) { |
&Apache::lonxml::debug("authed $slot_name"); |
&Apache::lonxml::debug("authed $slot_name"); |
} |
} |
if (!defined($user) || !defined($domain)) { |
if (!defined($user) || !defined($domain)) { |
Line 252 sub add_grading_button {
|
Line 260 sub add_grading_button {
|
$size=scalar(keys(%sections))+2; |
$size=scalar(keys(%sections))+2; |
} |
} |
my $sec_select = "\n".'<select multiple="multiple" name="chosensections" size="'.$size.'">'."\n"; |
my $sec_select = "\n".'<select multiple="multiple" name="chosensections" size="'.$size.'">'."\n"; |
$sec_select .= "\t<option value='all' selected='selected'>all</option>\n"; |
$sec_select .= "\t".'<option value="all" selected="selected">'.&mt('all')."</option>\n"; |
foreach my $sec (sort {lc($a) cmp lc($b)} (keys(%sections))) { |
foreach my $sec (sort {lc($a) cmp lc($b)} (keys(%sections))) { |
$sec_select .= "\t<option value=\"$sec\">$sec</option>\n"; |
$sec_select .= "\t<option value=\"$sec\">$sec</option>\n"; |
} |
} |
$sec_select .= "\t<option value='none'>none</option>\n</select>\n"; |
$sec_select .= "\t".'<option value="none">'.&mt('none')."</option>\n</select>\n"; |
|
|
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 681 sub start_Task {
|
Line 689 sub start_Task {
|
$target eq 'tex') { |
$target eq 'tex') { |
if ($env{'form.markaccess'}) { |
if ($env{'form.markaccess'}) { |
my @interval=&Apache::lonnet::EXT("resource.0.interval"); |
my @interval=&Apache::lonnet::EXT("resource.0.interval"); |
&Apache::lonnet::set_first_access($interval[1]); |
my ($timelimit) = ($interval[0] =~ /^(\d+)/); |
|
&Apache::lonnet::set_first_access($interval[1],$timelimit); |
} |
} |
} |
} |
|
|
Line 719 sub start_Task {
|
Line 728 sub start_Task {
|
'slot' => $slot_name}); |
'slot' => $slot_name}); |
($version,$previous)=&get_version(); |
($version,$previous)=&get_version(); |
} |
} |
|
if (($target eq 'web') && ($version ne '') && ($slot_name ne '')) { |
|
if (ref($slot) eq 'HASH') { |
|
if ($slot->{'endtime'} > time()) { |
|
$result .= |
|
&Apache::lonhtmlcommon::set_due_date($slot->{'endtime'}); |
|
} |
|
} |
|
} |
|
|
my $status_id = 'LC_task_take'; |
my $status_id = 'LC_task_take'; |
if ($previous && $target eq 'answer') { |
if ($previous && $target eq 'answer') { |
$status_id = 'LC_task_answer'; |
$status_id = 'LC_task_answer'; |
Line 743 sub start_Task {
|
Line 760 sub start_Task {
|
} |
} |
my $msg; |
my $msg; |
if ($status eq 'UNAVAILABLE') { |
if ($status eq 'UNAVAILABLE') { |
$msg.='<h1>'.&mt('Unable to determine if this resource is open due to network problems. Please try again later.').'</h1>'; |
$msg.='<p class="LC_error">'.&mt('Unable to determine if this resource is open due to network problems. Please try again later.').'</p>'; |
} 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.='<p class="LC_warning">'.&mt('You are not currently signed up to work at this time and/or place.').'</p>'; |
$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.='<p class="LC_warning">'.&mt('You need the Proctor to validate you.'). |
'</h1>'.&proctor_validation_screen($slot); |
'</p>'.&proctor_validation_screen($slot); |
} elsif ($status eq 'WAITING_FOR_GRADE') { |
} elsif ($status eq 'WAITING_FOR_GRADE') { |
$msg.='<h1>'.&mt('Your submission is in the grading queue.').'</h1>'; |
$msg.='<p class="LC_info">'.&mt('Your submission is in the grading queue.').'</p>'; |
} elsif ($env{'form.donescreen'}) { |
} elsif ($env{'form.donescreen'}) { |
$result .= &done_screen($version); |
$result .= &done_screen($version); |
} elsif ($status eq 'NOT_YET_VIEWED') { |
} elsif ($status eq 'NOT_YET_VIEWED') { |
my $symb=&Apache::lonnet::symbread(); |
my $symb=&Apache::lonnet::symbread(); |
$msg.=&Apache::structuretags::firstaccess_msg($accessmsg,$symb); |
$msg.=&Apache::structuretags::firstaccess_msg($accessmsg,$symb); |
} else { |
} else { |
$msg.='<h1>'.&mt('Not open to be viewed').'</h1>'; |
$msg.='<p class="LC_warning">'.&mt('Not open to be viewed').'</p>'; |
} |
} |
if ($status eq 'CLOSED' || $status eq 'INVALID_ACCESS') { |
if ($status eq 'CLOSED' || $status eq 'INVALID_ACCESS') { |
$msg.='The problem '.$accessmsg; |
$msg.='The problem '.$accessmsg; |
Line 988 sub get_key_todo {
|
Line 1005 sub get_key_todo {
|
my $classlist=&get_limited_classlist(); |
my $classlist=&get_limited_classlist(); |
if (!&allow_grade_user($classlist->{$uname.':'.$udom})) { |
if (!&allow_grade_user($classlist->{$uname.':'.$udom})) { |
return (undef,'not_allowed', |
return (undef,'not_allowed', |
&mt('Requested student ([_1]) is in a section you aren\'t allowed to grade.',$uname.':'.$udom)); |
&mt("Requested student ([_1]) is in a section you aren't allowed to grade.",$uname.':'.$udom)); |
} |
} |
} |
} |
my $gradingkey=&encode_queue_key($symb,$udom,$uname); |
my $gradingkey=&encode_queue_key($symb,$udom,$uname); |
Line 1399 DONEBUTTON
|
Line 1416 DONEBUTTON
|
if ($canstore) { |
if ($canstore) { |
&Apache::structuretags::finalize_storage(); |
&Apache::structuretags::finalize_storage(); |
my @interval = &Apache::lonnet::EXT("resource.0.interval"); |
my @interval = &Apache::lonnet::EXT("resource.0.interval"); |
if ($interval[0] =~ /^\d+$/ && $interval[1] eq 'resource') { |
if ($interval[0] =~ /^\d+/ && $interval[1] eq 'resource') { |
my $key=$courseid."\0".$symb; |
my $key=$courseid."\0".$symb; |
my %times=&Apache::lonnet::get('firstaccesstimes', |
my %times=&Apache::lonnet::get('firstaccesstimes', |
[$key],$domain,$name); |
[$key],$domain,$name); |
Line 1788 sub show_queue {
|
Line 1805 sub show_queue {
|
$result.=(<<FORM); |
$result.=(<<FORM); |
<td>$status</td> |
<td>$status</td> |
<td> |
<td> |
<form style="display: inline" method="post"> |
<form style="display: inline" method="post" action=""> |
<input type="hidden" name="gradingkey" value="$ekey" /> |
<input type="hidden" name="gradingkey" value="$ekey" /> |
<input type="hidden" name="queue" value="$queue" /> |
<input type="hidden" name="queue" value="$queue" /> |
<input type="hidden" name="gradingaction" value="$action" /> |
<input type="hidden" name="gradingaction" value="$action" /> |
Line 2207 sub select_user {
|
Line 2224 sub select_user {
|
$result.=&Apache::loncommon::start_data_table_row(); |
$result.=&Apache::loncommon::start_data_table_row(); |
$result.=<<RESULT; |
$result.=<<RESULT; |
<td> |
<td> |
<form style="display: inline" method="post"> |
<form style="display: inline" method="post" action=""> |
<input type="hidden" name="gradingkey" value="$todo" /> |
<input type="hidden" name="gradingkey" value="$todo" /> |
<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" /> |
Line 3277 sub proctor_validation_screen {
|
Line 3294 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>$lt{'prus'}</td><td><input type="string" name="proctorname" value="$env{'form.proctorname'}" /></td></tr> |
<tr><td>$lt{'prus'}</td><td><input type="text" name="proctorname" value="$env{'form.proctorname'}" autocomplete="new-password" /></td></tr> |
<tr><td>$lt{'pasw'}</td><td><input type="password" name="proctorpassword" value="" /></td></tr> |
<tr><td>$lt{'pasw'}</td><td><input type="password" name="proctorpassword" value="" autocomplete="new-password" /></td></tr> |
<tr><td>$lt{'prdo'}</td><td><input type="string" name="proctordomain" value="$env{'form.proctordomain'}" /></td></tr> |
<tr><td>$lt{'prdo'}</td><td><input type="text" name="proctordomain" value="$env{'form.proctordomain'}" autocomplete="off" /></td></tr> |
</table> |
</table> |
<input type="submit" name="checkoutbutton" value="$lt{'vali'}" /><br /> |
<input type="submit" name="checkoutbutton" value="$lt{'vali'}" /><br /> |
<table border="1"> |
<table border="1"> |