version 1.44, 2005/09/07 22:20:33
|
version 1.48, 2005/09/14 21:03:48
|
Line 462 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 984 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 1007 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 1039 sub get_instance {
|
Line 1053 sub get_instance {
|
foreach my $partial_file (split(',',$Apache::lonhomework::history{"resource.$version.0.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 1064 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 1093 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 1123 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 1166 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'); |
my $name=&Apache::loncommon::plainname($user,$domain); |
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 1188 sub proctor_validation_screen {
|
Line 1188 sub proctor_validation_screen {
|
<table> |
<table> |
<tr><td>Proctor's Username:</td><td><input type="string" name="proctorname" value="$env{'form.proctorname'}" /></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 /> |
<table border="1"> |
<table border="1"> |
Line 1196 sub proctor_validation_screen {
|
Line 1196 sub proctor_validation_screen {
|
<table> |
<table> |
<tr><td colspan="2">Student who should be logged in is:</td></tr> |
<tr><td colspan="2">Student who should be logged in is:</td></tr> |
<tr><td>Name:</td><td>$name</td></tr> |
<tr><td>Name:</td><td>$name</td></tr> |
<tr><td>Studnet ID:</td><td>$env{'environment.id'}</td></tr> |
<tr><td>Student ID:</td><td>$env{'environment.id'}</td></tr> |
<tr><td>Usename</td><td>$user\@$domain</td></tr> |
<tr><td>Usename</td><td>$user\@$domain</td></tr> |
<tr><td colspan="2"><img src="$url" /></td></tr> |
<tr><td colspan="2"><img src="$url" /></td></tr> |
</table> |
</table> |