version 1.199, 2006/11/09 20:42:43
|
version 1.200, 2006/11/09 21:31:11
|
Line 234 sub add_grading_button {
|
Line 234 sub add_grading_button {
|
if (scalar(keys(%sections)) < 3) { |
if (scalar(keys(%sections)) < 3) { |
$size=scalar(keys(%sections))+2; |
$size=scalar(keys(%sections))+2; |
} |
} |
my $sec_select = '<select multiple="multiple" name="chosensections" size="'.$size.'">'."\n"; |
my $sec_select = "\n".'<select multiple="multiple" name="chosensections" size="'.$size.'">'."\n"; |
$sec_select .= "<option value='all' selected='selected'>all</option>\n"; |
$sec_select .= "\t<option value='all' selected='selected'>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 .= "<option value=\"$sec\">$sec</option>\n"; |
$sec_select .= "\t<option value=\"$sec\">$sec</option>\n"; |
} |
} |
$sec_select .= "<option value='none'>none</option></select>\n"; |
$sec_select .= "\t<option value='none'>none</option>\n</select>\n"; |
|
|
my $result=' <input type="submit" name="gradeasubmission" value="'. |
my $result="\n\t".'<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.="\n\t".'<input type="hidden" name="grade_target" value="webgrade" />'; |
if (&Apache::lonnet::allowed('mgq',$env{'request.course.id'})) { |
if (&Apache::lonnet::allowed('mgq',$env{'request.course.id'})) { |
my ($entries,$ready,$locks)=&get_queue_counts('gradingqueue'); |
my ($entries,$ready,$locks)=&get_queue_counts('gradingqueue'); |
$result.='<table><tr>'; |
$result.="\n\t".'<table>'."\n\t\t".'<tr>'; |
$result.='<td rowspan="4">Specify a section: </td><td rowspan="4">'.$sec_select.'</td>'; |
$result.="\n\t\t\t".'<td rowspan="4">Specify a section: </td>'. |
$result.='<td>'.' <input type="submit" name="reviewagrading" value="'. |
"\n\t\t\t".'<td rowspan="4">'.$sec_select."\n\t\t\t".'</td>'; |
|
$result.="\n\t\t\t".'<td>'.'<input type="submit" name="reviewagrading" value="'. |
&mt("Select an entry from the grading queue:").'" /> '; |
&mt("Select an entry from the grading queue:").'" /> '; |
|
|
$result.= &mt("[_1] entries, [_2] ready, [_3] being graded",$entries,$ready,$locks).' </td></tr>'."\n"; |
$result.= "\n\t\t\t\t".&mt("[_1] entries, [_2] ready, [_3] being graded",$entries,$ready,$locks).'</td>'."\n\t\t".'</tr>'."\n"; |
|
|
($entries,$ready,$locks)=&get_queue_counts('reviewqueue'); |
($entries,$ready,$locks)=&get_queue_counts('reviewqueue'); |
$result.='<tr><td>'. |
$result.="\n\t\t".'<tr>'. |
' <input type="submit" name="reviewasubmission" value="'. |
"\n\t\t\t".'<td>'. |
|
"\n\t\t\t\t".'<input type="submit" name="reviewasubmission" value="'. |
&mt("Select an entry from the review queue:").'" /> '; |
&mt("Select an entry from the review queue:").'" /> '; |
$result.=&mt("[_1] entries, [_2] ready, [_3] being graded", |
$result.=&mt("[_1] entries, [_2] ready, [_3] being graded", |
$entries,$ready,$locks).'</td></tr>'."\n"; |
$entries,$ready,$locks).'</td>'."\n\t\t".'</tr>'."\n"; |
$result.='<tr><td> <input type="submit" name="regradeasubmission" value="'. |
$result.="\n\t\t".'<tr>'. |
&mt("List of user's grade status").'" /> </td></tr></table>'."\n"; |
"\n\t\t\t".'<td>'. |
$result.='<p> <input type="submit" name="regradeaspecificsubmission" value="'. |
"\n\t\t\t\t".'<input type="submit" name="regradeasubmission" value="'. |
&mt("Regrade specific user:").'" />'."\n"; |
&mt("List of user's grade status").'" /> </td>' |
$result.='<input type="text" size="12" name="gradinguser" />'; |
."\n\t\t".'</tr>' |
|
."\n\t".'</table>'."\n"; |
|
$result.="\n\t".'<p>'. |
|
"\n\t\t".'<input type="submit" name="regradeaspecificsubmission" value="'. |
|
&mt("Regrade specific user:").'" />'; |
|
$result.= "\n\t\t".'<input type="text" size="12" name="gradinguser" />'; |
$result.=&Apache::loncommon::select_dom_form($env{'user.domain'}, |
$result.=&Apache::loncommon::select_dom_form($env{'user.domain'}, |
'gradingdomain'); |
'gradingdomain'); |
$result.=' '. |
$result.=' '. |
Line 271 sub add_grading_button {
|
Line 278 sub add_grading_button {
|
'gradinguser', |
'gradinguser', |
'gradingdomain'); |
'gradingdomain'); |
$result.=&Apache::loncommon::studentbrowser_javascript(); |
$result.=&Apache::loncommon::studentbrowser_javascript(); |
$result.= '</p>'; |
$result.= '</p>'."\n"; |
} |
} |
return $result; |
return $result; |
} |
} |
Line 295 sub add_request_another_attempt_button {
|
Line 302 sub add_request_another_attempt_button {
|
my $description=&Apache::slotrequest::get_description($slot_name, |
my $description=&Apache::slotrequest::get_description($slot_name, |
$slot); |
$slot); |
$result.=(<<STUFF); |
$result.=(<<STUFF); |
<p> Will be next available: $description </p> |
<p> Will be next available: $description </p> |
STUFF |
STUFF |
} |
} |
|
|
if ($env{'request.enc'}) { $symb=&Apache::lonenc::encrypted($symb); } |
if ($env{'request.enc'}) { $symb=&Apache::lonenc::encrypted($symb); } |
$symb=&escape($symb); |
$symb=&escape($symb); |
$result.='<form method="post" action="/adm/slotrequest">'. |
$result.= |
'<input type="hidden" name="symb" value="'.$symb.'" />'. |
"\n\t".'<form method="post" action="/adm/slotrequest">'."\n\t\t". |
'<input type="hidden" name="command" value="'.$action.'" />'. |
'<input type="hidden" name="symb" value="'.$symb.'" />'."\n\t\t". |
|
'<input type="hidden" name="command" value="'.$action.'" />'."\n\t\t". |
'<input type="submit" name="requestattempt" value="'. |
'<input type="submit" name="requestattempt" value="'. |
&mt($text).'" />'. |
&mt($text).'" />'."\n\t". |
'</form>'; |
'</form>'."\n"; |
return $result; |
return $result; |
} |
} |
|
|
Line 584 sub start_Task {
|
Line 592 sub start_Task {
|
$result.='<form name="gradesubmission" method="post" action="'; |
$result.='<form name="gradesubmission" 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); } |
$result.=$uri.'">'.&add_grading_button()."</form>"; |
$result.=$uri.'">'.&add_grading_button()."</form>\n"; |
my $symb=&Apache::lonnet::symbread(); |
my $symb=&Apache::lonnet::symbread(); |
if (&Apache::lonnet::allowed('mgq',$env{'request.course.id'})) { |
if (&Apache::lonnet::allowed('mgq',$env{'request.course.id'})) { |
$result.='<form method="post" name="slotrequest" action="/adm/slotrequest">'. |
$result.='<form method="post" name="slotrequest" action="/adm/slotrequest">'. |
Line 683 sub start_Task {
|
Line 691 sub start_Task {
|
|
|
$result.=&preserve_grade_info(); |
$result.=&preserve_grade_info(); |
$result.=&internal_location(); |
$result.=&internal_location(); |
$result.=$form_tag_start. |
$result.=$form_tag_start."\t". |
'<input type="hidden" name="submitted" value="yes" />'; |
'<input type="hidden" name="submitted" value="yes" />'; |
&Apache::lonxml::startredirection(); |
&Apache::lonxml::startredirection(); |
} |
} |
Line 1042 DONEBUTTON
|
Line 1050 DONEBUTTON
|
} |
} |
$start_time=&Apache::lonlocal::locallocaltime($start_time); |
$start_time=&Apache::lonlocal::locallocaltime($start_time); |
|
|
my $status = "\n<div class='LC_$bt_status LC_criteria'>\n"; |
my $status = |
|
"\n<div class='LC_$bt_status LC_criteria'>\n\t"; |
|
|
if ($bt_status eq 'pass') { |
if ($bt_status eq 'pass') { |
$status.='<h2>You passed the '.$title.' given on '. |
$status.='<h2>You passed the '.$title.' given on '. |
Line 1055 DONEBUTTON
|
Line 1064 DONEBUTTON
|
$status.=&add_request_another_attempt_button(); |
$status.=&add_request_another_attempt_button(); |
} |
} |
} |
} |
$status.='</div>'; |
$status.="\n".'</div>'."\n"; |
my $dim = $top; |
my $dim = $top; |
my %counts = &get_counts($dim,undef,$parstack, |
my %counts = &get_counts($dim,undef,$parstack, |
$safeeval); |
$safeeval); |
$status.="\n<div class='LC_$bt_status LC_criteria LC_task_overall_status'><p>". |
$status.="\n<div class='LC_$bt_status LC_criteria LC_task_overall_status'>\n\t<p>". |
&question_status_message(\%counts,-1). |
&question_status_message(\%counts,-1). |
"</p></div>\n"; |
"</p>\n</div>\n"; |
|
|
|
|
foreach my $id (@{$dimension{$dim}{'criterias'}}) { |
foreach my $id (@{$dimension{$dim}{'criterias'}}) { |
Line 2215 sub end_Dimension {
|
Line 2224 sub end_Dimension {
|
if (&Apache::lonxml::get_param('Mandatory',$parstack,$safeeval) eq 'N') { |
if (&Apache::lonxml::get_param('Mandatory',$parstack,$safeeval) eq 'N') { |
$mandatory='Optional'; |
$mandatory='Optional'; |
} |
} |
my $dim_info="<div class='LC_$dim_status LC_question_grade'>\n"; |
my $dim_info= |
|
"\n<div class='LC_$dim_status LC_question_grade'>\n\t"; |
my $question = ('sub' x $dimension{$dim}{'depth'}).'question'; |
my $question = ('sub' x $dimension{$dim}{'depth'}).'question'; |
$question =~ s/^(.)/uc($1)/e; |
$question =~ s/^(.)/uc($1)/e; |
if ($dim_status eq 'pass') { |
if ($dim_status eq 'pass') { |
Line 2227 sub end_Dimension {
|
Line 2237 sub end_Dimension {
|
my %counts = &get_counts($dim,$instance,$parstack, |
my %counts = &get_counts($dim,$instance,$parstack, |
$safeeval); |
$safeeval); |
|
|
$dim_info.="\n<p>" |
$dim_info.="\n\t<p>" |
.&question_status_message(\%counts, |
.&question_status_message(\%counts, |
$dimension{$dim}{'depth'}) |
$dimension{$dim}{'depth'}) |
."</p>\n</div>"; |
."</p>\n</div>\n"; |
|
|
foreach my $id (@{$dimension{$dim}{$instance.'.criterias'}}, |
foreach my $id (@{$dimension{$dim}{$instance.'.criterias'}}, |
@{$dimension{$dim}{'criterias'}}) { |
@{$dimension{$dim}{'criterias'}}) { |
Line 2504 sub grading_history {
|
Line 2514 sub grading_history {
|
$entry.=' comment: "'.$Apache::lonhomework::history{"$t:$scope.comment"}.'"'; |
$entry.=' comment: "'.$Apache::lonhomework::history{"$t:$scope.comment"}.'"'; |
} |
} |
if ($entry) { |
if ($entry) { |
$result.= "<li>$grader : $entry </li>"; |
$result.= "\n\t\t<li>\n\t\t\t$grader :\n\t\t\t $entry \n\t\t</li>"; |
} |
} |
} |
} |
if ($result) { |
if ($result) { |
return '<ul class="LC_GRADING_pastgrading">'.$result.'</ul>'; |
return "\n\t".'<ul class="LC_GRADING_pastgrading">'.$result. |
|
"\n\t".'</ul>'."\n"; |
} |
} |
return ''; |
return ''; |
} |
} |
Line 2621 sub layout_web_Criteria {
|
Line 2632 sub layout_web_Criteria {
|
my $status_display=$status; |
my $status_display=$status; |
$status_display=~s/^([a-z])/uc($1)/e; |
$status_display=~s/^([a-z])/uc($1)/e; |
my $criteria_info.= |
my $criteria_info.= |
'<div class="LC_'.$status.' LC_criteria"><h4>' |
'<div class="LC_'.$status.' LC_criteria">'."\n\t".'<h4>' |
.$mandatory.' Criteria</h4><p>'; |
.$mandatory.' Criteria</h4>'."\n\t".'<p>'."\n"; |
$criteria_info.= $criteria; |
$criteria_info.= $criteria; |
$criteria_info.='</p><p class="LC_grade">'.$status_display.'</p>'; |
$criteria_info.="\n\t".'</p>'. |
|
"\n\t".'<p class="LC_grade">'.$status_display.'</p>'; |
if ($comment =~ /\w/) { |
if ($comment =~ /\w/) { |
$criteria_info.='<p class="LC_comment">'. |
$criteria_info.= |
&mt('Comment: [_1]',$comment).'</p>'; |
"\n\t". |
|
'<p class="LC_comment">'.&mt('Comment: [_1]',$comment).'</p>'; |
} |
} |
$criteria_info.='</div>'; |
$criteria_info.="\n".'</div>'."\n"; |
|
|
return $criteria_info; |
return $criteria_info; |
} |
} |
|
|
Line 2638 sub layout_webgrade_Criteria {
|
Line 2652 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 $result = |
my %lt = ( 'ungraded' => 'Ungraded', |
'<div class="LC_GRADING_criteria">'."\n". |
'fail' => 'Fail', |
'<div class="LC_GRADING_criteriatext">'."\n". |
'pass' => 'Pass', |
$criteria. |
'review' => 'Review', |
'</div>'."\n". |
'comment' => 'Additional Comment for Student', |
'<div class="LC_GRADING_grade">'."\n". |
); |
'<label class="LC_GRADING_ungraded"> |
%lt = &Apache::lonlocal::texthash(%lt); |
<input type="radio" name="HWVAL_'.$link.'" value="ungraded" '.($status eq 'ungraded' || !$status ? 'checked="checked"':'').' />'. |
my $comment = &get_criteria('comment',$version,$dim,$id); |
&mt('Ungraded'). |
$comment = &HTML::Entities::encode($comment,'<>"&'); |
'</label>'."\n". |
my %checked; |
'<label class="LC_GRADING_fail"> |
foreach my $which ('ungraded','fail','pass','review') { |
<input type="radio" name="HWVAL_'.$link.'" value="fail" '.($status eq 'fail' ? 'checked="checked"':'').' />'. |
if ($status eq $which) { $checked{$which} = 'checked="checked"'; } |
&mt('Fail'). |
} |
'</label>'."\n". |
if (!%checked) { $checked{'ungraded'} = 'checked="checked"'; } |
'<label class="LC_GRADING_pass"> |
|
<input type="radio" name="HWVAL_'.$link.'" value="pass" '.($status eq 'pass' ? 'checked="checked"':'').' />'. |
my $result = <<END_CRITERIA; |
&mt('Pass'). |
<div class="LC_GRADING_criteria"> |
'</label>'."\n". |
<div class="LC_GRADING_criteriatext"> |
'<label class="LC_GRADING_review"> |
$criteria |
<input type="radio" name="HWVAL_'.$link.'" value="review" '.($status eq 'review' ? 'checked="checked"':'').' />'. |
</div> |
&mt('Review'). |
<div class="LC_GRADING_grade"> |
'</label>'."\n". |
<label class="LC_GRADING_ungraded"> |
'</div>'."\n". |
<input type="radio" name="HWVAL_$link" value="ungraded" $checked{'ungraded'} /> |
'<label class="LC_GRADING_comment">'.&mt('Additional Comment for Student')."\n". |
$lt{'ungraded'} |
'<textarea class="LC_GRADING_comment_area" name="HWVAL_comment_'.$link.'">'.&HTML::Entities::encode(&get_criteria('comment',$version,$dim,$id),'<>"&').'</textarea>'."\n". |
</label> |
'</label>'."\n". |
<label class="LC_GRADING_fail"> |
'</div>'."\n". |
<input type="radio" name="HWVAL_$link" value="fail" $checked{'fail'} /> |
&grading_history($version,$dim,$id); |
$lt{'fail'} |
|
</label> |
|
<label class="LC_GRADING_pass"> |
|
<input type="radio" name="HWVAL_$link" value="pass" $checked{'pass'} /> |
|
$lt{'pass'} |
|
</label> |
|
<label class="LC_GRADING_review"> |
|
<input type="radio" name="HWVAL_$link" value="review" $checked{'review'} /> |
|
$lt{'review'} |
|
</label> |
|
</div> |
|
<label class="LC_GRADING_comment"> |
|
$lt{'comment'} |
|
<textarea class="LC_GRADING_comment_area" name="HWVAL_comment_$link">$comment</textarea> |
|
</label> |
|
</div> |
|
END_CRITERIA |
|
$result .= &grading_history($version,$dim,$id); |
return $result; |
return $result; |
} |
} |
|
|