version 1.139, 2006/04/10 18:08:11
|
version 1.147, 2006/05/12 01:18:50
|
Line 170 sub add_grading_button {
|
Line 170 sub add_grading_button {
|
my (undef,$cid)=&Apache::lonxml::whichuser(); |
my (undef,$cid)=&Apache::lonxml::whichuser(); |
my $cnum=$env{'course.'.$cid.'.num'}; |
my $cnum=$env{'course.'.$cid.'.num'}; |
my $cdom=$env{'course.'.$cid.'.domain'}; |
my $cdom=$env{'course.'.$cid.'.domain'}; |
my %sections; |
my %sections = &Apache::loncommon::get_sections($cdom,$cnum); |
my $numsections=&Apache::loncommon::get_sections($cdom,$cnum,\%sections); |
|
my $size=5; |
my $size=5; |
if (scalar(keys(%sections)) < 3) { |
if (scalar(keys(%sections)) < 3) { |
$size=scalar(keys(%sections))+2; |
$size=scalar(keys(%sections))+2; |
Line 214 sub add_grading_button {
|
Line 214 sub add_grading_button {
|
'gradingdomain'); |
'gradingdomain'); |
$result.=&Apache::loncommon::studentbrowser_javascript(); |
$result.=&Apache::loncommon::studentbrowser_javascript(); |
$result.= '</p>'; |
$result.= '</p>'; |
} |
} |
return $result; |
return $result; |
} |
} |
|
|
Line 349 sub webgrade_standard_info {
|
Line 349 sub webgrade_standard_info {
|
|
|
my %lt=&Apache::lonlocal::texthash('done' => 'Next Item', |
my %lt=&Apache::lonlocal::texthash('done' => 'Next Item', |
'stop' => 'Quit Grading', |
'stop' => 'Quit Grading', |
|
'fail' => 'Fail Rest', |
); |
); |
|
|
my $result=<<INFO; |
my $result=<<INFO; |
<div class="LC_GRADING_maincontrols"> |
<div class="LC_GRADING_maincontrols"> |
<input type="submit" name="next" value="$lt{'done'}" /> |
<input type="submit" name="next" value="$lt{'done'}" /> |
<input type="submit" name="stop" value="$lt{'stop'}" /> |
<input type="submit" name="stop" value="$lt{'stop'}" /> |
|
<input type="button" name="fail" value="$lt{'fail'}" |
|
onclick="javascript:onFailRest()" /> |
</div> |
</div> |
$file_list |
$file_list |
INFO |
INFO |
Line 375 sub start_Task {
|
Line 378 sub start_Task {
|
} |
} |
|
|
$Apache::lonhomework::parsing_a_task=1; |
$Apache::lonhomework::parsing_a_task=1; |
#should get back a <html> or the neccesary stuff to start XML/MathML |
|
my ($result,$head_tag_start,$body_tag_start,$form_tag_start)= |
|
&Apache::structuretags::page_start($target,$token,$tagstack,$parstack,$parser,$safeeval); |
|
|
|
$head_tag_start .= &style($target); |
|
$body_tag_start .= '<div class="LC_task">'."\n"; |
|
|
|
|
my $name; |
if ($target eq 'web' || $target eq 'webgrade') { |
if ($target eq 'web' || $target eq 'webgrade') { |
$head_tag_start.='<title>'. |
$name = &Apache::structuretags::get_resource_name($parstack,$safeeval); |
&Apache::structuretags::get_resource_name($parstack,$safeeval). |
} |
'</title>'; |
|
|
my ($result,$form_tag_start); |
|
if ($target eq 'web' || $target eq 'webgrade' || $target eq 'tex' |
|
|| $target eq 'edit') { |
|
($result,$form_tag_start) = |
|
&Apache::structuretags::page_start($target,$token,$tagstack, |
|
$parstack,$parser,$safeeval, |
|
$name,&style($target)); |
|
$result .= '<div class="LC_task">'."\n"; |
} |
} |
|
|
if ($target eq 'web' && $env{'request.state'} ne 'construct') { |
if ($target eq 'web' && $env{'request.state'} ne 'construct') { |
if ($Apache::lonhomework::modifygrades) { |
if ($Apache::lonhomework::queuegrade |
$body_tag_start.='<form name="gradesubmission" method="post" action="'; |
|| $Apache::lonhomework::modifygrades) { |
|
$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); } |
$body_tag_start.=$uri.'">'.&add_grading_button()."</form>"; |
$result.=$uri.'">'.&add_grading_button()."</form>"; |
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'})) { |
$body_tag_start.='<form method="post" name="slotrequest" action="/adm/slotrequest">'. |
$result.='<form method="post" name="slotrequest" action="/adm/slotrequest">'. |
'<input type="hidden" name="symb" value="'.$symb.'" />'. |
'<input type="hidden" name="symb" value="'.$symb.'" />'. |
'<input type="hidden" name="command" value="showslots" />'. |
'<input type="hidden" name="command" value="showslots" />'. |
'<input type="submit" name="requestattempt" value="'. |
'<input type="submit" name="requestattempt" value="'. |
Line 405 sub start_Task {
|
Line 412 sub start_Task {
|
my $target_id = |
my $target_id = |
&Apache::lonstathelpers::make_target_id({symb => $symb, |
&Apache::lonstathelpers::make_target_id({symb => $symb, |
part => '0'}); |
part => '0'}); |
$body_tag_start.='<form method="post" name="gradingstatus" action="/adm/statistics">'. |
$result.='<form method="post" name="gradingstatus" action="/adm/statistics">'. |
'<input type="hidden" name="problemchoice" value="'.$target_id.'" />'. |
'<input type="hidden" name="problemchoice" value="'.$target_id.'" />'. |
'<input type="hidden" name="reportSelected" value="grading_analysis" />'. |
'<input type="hidden" name="reportSelected" value="grading_analysis" />'. |
'<input type="submit" name="grading" value="'. |
'<input type="submit" name="grading" value="'. |
Line 428 sub start_Task {
|
Line 435 sub start_Task {
|
$expression.='$external::gradestatus="'.$Apache::lonhomework::history{"resource.$version.0.solved"}.'";'; |
$expression.='$external::gradestatus="'.$Apache::lonhomework::history{"resource.$version.0.solved"}.'";'; |
&Apache::run::run($expression,$safeeval); |
&Apache::run::run($expression,$safeeval); |
&Apache::lonxml::debug("Got $status"); |
&Apache::lonxml::debug("Got $status"); |
$body_tag_start.=&add_previous_version_button($status); |
$result.=&add_previous_version_button($status); |
if (!&show_task($status,$previous)) { |
if (!&show_task($status,$previous)) { |
my $bodytext=&Apache::lonxml::get_all_text("/task",$parser,$style); |
my $bodytext=&Apache::lonxml::get_all_text("/task",$parser,$style); |
if ( $target eq "web" ) { |
if ( $target eq "web" ) { |
$result.= $head_tag_start.'</head>'.$body_tag_start; |
|
if ($env{'request.state'} eq 'construct') { |
if ($env{'request.state'} eq 'construct') { |
$result.=$form_tag_start; |
$result.=$form_tag_start; |
} |
} |
Line 497 DONESCREEN
|
Line 503 DONESCREEN
|
} |
} |
} |
} |
} elsif ($target eq 'web') { |
} elsif ($target eq 'web') { |
$result.="$head_tag_start</head> |
|
$body_tag_start \n"; |
|
|
|
$result.=&preserve_grade_info(); |
$result.=&preserve_grade_info(); |
$result.=&internal_location(); |
$result.=&internal_location(); |
$result.=$form_tag_start. |
$result.=$form_tag_start. |
Line 510 DONESCREEN
|
Line 514 DONESCREEN
|
$target eq 'webgrade') { |
$target eq 'webgrade') { |
my $webgrade='yes'; |
my $webgrade='yes'; |
if ($target eq 'webgrade') { |
if ($target eq 'webgrade') { |
$result.=$head_tag_start. |
$result.= "\n".'<div class="LC_GRADING_task">'."\n". |
'</head>'.$body_tag_start. |
|
"\n".'<div class="LC_GRADING_task">'."\n". |
|
'<script type="text/javascript" |
'<script type="text/javascript" |
src="/res/adm/includes/task_grading.js"></script>'; |
src="/res/adm/includes/task_grading.js"></script>'; |
#$result.='<br />Review'.&show_queue('reviewqueue'); |
#$result.='<br />Review'.&show_queue('reviewqueue'); |
Line 596 DONESCREEN
|
Line 598 DONESCREEN
|
$result.="\n".'<div id="LC_GRADING_criterialist">'; |
$result.="\n".'<div id="LC_GRADING_criterialist">'; |
} |
} |
} elsif ($target eq 'edit') { |
} elsif ($target eq 'edit') { |
$result.=$head_tag_start."</head>".$body_tag_start.$form_tag_start. |
$result.=$form_tag_start. |
&Apache::structuretags::problem_edit_header(); |
&Apache::structuretags::problem_edit_header(); |
$Apache::lonxml::warnings_error_header= |
$Apache::lonxml::warnings_error_header= |
&mt("Editor Errors - these errors might not effect the running of the problem, but they will likely cause problems with further use of the Edit mode. Please use the EditXML mode to fix these errors.")."<br />"; |
&mt("Editor Errors - these errors might not effect the running of the problem, but they will likely cause problems with further use of the Edit mode. Please use the EditXML mode to fix these errors.")."<br />"; |
Line 844 DONEBUTTON
|
Line 846 DONEBUTTON
|
} |
} |
} |
} |
if ($target eq 'web') { |
if ($target eq 'web') { |
$result.="\n</div>\n".&Apache::lonxml::xmlend().'</html>'; |
$result.="\n</div>\n". |
|
&Apache::loncommon::end_page({'discussion' => 1}); |
} |
} |
} |
} |
if ($target eq 'grade' && !$env{'form.webgrade'} && !$previous) { |
if ($target eq 'grade' && !$env{'form.webgrade'} && !$previous) { |
Line 984 DONEBUTTON
|
Line 987 DONEBUTTON
|
#$result.='<input type="submit" name="save" value="'. |
#$result.='<input type="submit" name="save" value="'. |
# &mt('Save Partial Grade and Continue Grading').'" /> '; |
# &mt('Save Partial Grade and Continue Grading').'" /> '; |
$result.='</form>'."\n</div>\n</div>\n". |
$result.='</form>'."\n</div>\n</div>\n". |
&Apache::loncommon::endbodytag().'</html>'; |
&Apache::loncommon::end_page(); |
} elsif ($target eq 'meta') { |
} elsif ($target eq 'meta') { |
$result.=&Apache::response::meta_package_write('Task'); |
$result.=&Apache::response::meta_package_write('Task'); |
$result.=&Apache::response::meta_stores_write('solved','string', |
$result.=&Apache::response::meta_stores_write('solved','string', |