version 1.107, 2015/03/30 22:29:24
|
version 1.115, 2020/05/20 16:55:52
|
Line 77 sub real_handler {
|
Line 77 sub real_handler {
|
} |
} |
|
|
my $cangrade=&Apache::lonnet::allowed('mgr'); |
my $cangrade=&Apache::lonnet::allowed('mgr'); |
|
my $showPoints = |
|
(($env{'course.'.$env{'request.course.id'}.'.grading'} eq 'standard') |
|
|| ($env{'course.'.$env{'request.course.id'}.'.grading'} eq 'categories')); |
|
|
|
my $reinitresult; |
|
|
unless ($cangrade) { |
unless ($cangrade) { |
# Check for critical messages and redirect if present. |
# Check for critical messages and redirect if present. |
my ($redirect,$url) = &Apache::loncommon::critical_redirect(300); |
my ($redirect,$url) = &Apache::loncommon::critical_redirect(300,'grades'); |
if ($redirect) { |
if ($redirect) { |
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
$r->header_out(Location => $url); |
$r->header_out(Location => $url); |
Line 89 sub real_handler {
|
Line 94 sub real_handler {
|
|
|
# Check if course needs to be re-initialized |
# Check if course needs to be re-initialized |
my $loncaparev = $r->dir_config('lonVersion'); |
my $loncaparev = $r->dir_config('lonVersion'); |
my ($result,@reinit) = &Apache::loncommon::needs_coursereinit($loncaparev); |
($reinitresult,my @reinit) = &Apache::loncommon::needs_coursereinit($loncaparev); |
|
|
if ($result eq 'switch') { |
if ($reinitresult eq 'switch') { |
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
$r->send_http_header; |
$r->send_http_header; |
$r->print(&Apache::loncommon::check_release_result(@reinit)); |
$r->print(&Apache::loncommon::check_release_result(@reinit)); |
return OK; |
return OK; |
} elsif ($result eq 'update') { |
} elsif ($reinitresult eq 'update') { |
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
my $cid = $env{'request.course.id'}; |
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $cnum = $env{'course.'.$cid.'.num'}; |
|
my $cdom = $env{'course.'.$cid.'.domain'}; |
|
&Apache::loncommon::content_type($r,'text/html'); |
|
$r->send_http_header; |
|
&startpage($r,$showPoints); |
|
my $preamble = '<div id="LC_update_'.$cid.'" class="LC_info">'. |
|
'<br />'. |
|
&mt('Your course session is being updated because of recent changes by course personnel.'). |
|
' '.&mt('Please be patient.').'<br /></div>'. |
|
'<div style="padding:0;clear:both;margin:0;border:0"></div>'; |
|
%prog_state = &Apache::lonhtmlcommon::Create_PrgWin($r,undef,$preamble); |
|
&Apache::lonhtmlcommon::Update_PrgWin($r,\%prog_state,&mt('Updating course')); |
|
$r->rflush(); |
my ($furl,$ferr) = &Apache::lonuserstate::readmap("$cdom/$cnum"); |
my ($furl,$ferr) = &Apache::lonuserstate::readmap("$cdom/$cnum"); |
|
&Apache::lonhtmlcommon::Update_PrgWin($r,\%prog_state,&mt('Finished')); |
|
&Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state); |
|
my $closure = <<ENDCLOSE; |
|
<script type="text/javascript"> |
|
// <![CDATA[ |
|
\$("#LC_update_$cid").hide('slow'); |
|
// ]]> |
|
</script> |
|
ENDCLOSE |
if ($ferr) { |
if ($ferr) { |
|
$r->print($closure.&Apache::loncommon::end_page()); |
my $requrl = $r->uri; |
my $requrl = $r->uri; |
$env{'user.error.msg'}="$requrl:bre:0:0:Course not initialized"; |
$env{'user.error.msg'}="$requrl:bre:0:0:Course not initialized"; |
$env{'user.reinit'} = 1; |
$env{'user.reinit'} = 1; |
return HTTP_NOT_ACCEPTABLE; |
return HTTP_NOT_ACCEPTABLE; |
|
} else { |
|
$r->print($closure); |
} |
} |
|
} elsif ((&Apache::loncommon::course_type() eq 'Placement') && |
|
(!$env{'request.role.adv'})) { |
|
my $furl = &Apache::lonpageflip::first_accessible_resource(); |
|
&Apache::loncommon::content_type($r,'text/html'); |
|
$r->header_out(Location => $furl); |
|
return REDIRECT; |
} |
} |
} |
} |
|
|
# Send header, don't cache this page |
unless ($reinitresult eq 'update') { |
&Apache::loncommon::no_cache($r); |
# Send header, don't cache this page |
$r->send_http_header; |
&Apache::loncommon::no_cache($r); |
|
$r->send_http_header; |
my $showPoints = |
&startpage($r,$showPoints); |
(($env{'course.'.$env{'request.course.id'}.'.grading'} eq 'standard') |
} |
|| ($env{'course.'.$env{'request.course.id'}.'.grading'} eq 'categories')); |
$r->rflush(); |
my $notshowSPRSlink = |
|
(($env{'course.'.$env{'request.course.id'}.'.grading'} eq 'external') |
|
|| ($env{'course.'.$env{'request.course.id'}.'.grading'} eq 'externalnototals')); |
|
my $notshowTotals= |
|
$env{'course.'.$env{'request.course.id'}.'.grading'} eq 'externalnototals'; |
|
my $showCategories= |
|
$env{'course.'.$env{'request.course.id'}.'.grading'} eq 'categories'; |
|
|
|
|
|
my $title = "Grading and Statistics";#$showPoints ? "Points Display" : "Completed Problems Display"; |
|
my $brcrum = [{href=>"/adm/quickgrades",text => "Points Display"}]; |
|
$r->print(&Apache::loncommon::start_page($title,undef, |
|
{'bread_crumbs' => $brcrum}) |
|
); |
|
|
|
&startGradeScreen($r,'quick'); |
&startGradeScreen($r,'quick'); |
|
|
Line 177 sub real_handler {
|
Line 198 sub real_handler {
|
if ($env{'form.udom'}) { $udom=$env{'form.udom'}; } |
if ($env{'form.udom'}) { $udom=$env{'form.udom'}; } |
if ($env{'form.id'}) { $stdid=$env{'form.id'}; } |
if ($env{'form.id'}) { $stdid=$env{'form.id'}; } |
if (($stdid) && ($udom)) { |
if (($stdid) && ($udom)) { |
$uname=(&Apache::lonnet::idget($udom,$stdid))[1]; |
$uname=(&Apache::lonnet::idget($udom,[$stdid],'ids'))[1]; |
} |
} |
if (($stdid) && (!$uname)) { |
if (($stdid) && (!$uname)) { |
$r->print('<p><span class="LC_warning">'.&mt("Unknown Student/Employee ID: [_1]",$stdid).'</span></p>'); |
$r->print('<p><span class="LC_warning">'.&mt("Unknown Student/Employee ID: [_1]",$stdid).'</span></p>'); |
Line 198 sub real_handler {
|
Line 219 sub real_handler {
|
} |
} |
$r->rflush(); |
$r->rflush(); |
|
|
|
my $notshowSPRSlink = |
|
(($env{'course.'.$env{'request.course.id'}.'.grading'} eq 'external') |
|
|| ($env{'course.'.$env{'request.course.id'}.'.grading'} eq 'externalnototals')); |
|
my $notshowTotals= |
|
$env{'course.'.$env{'request.course.id'}.'.grading'} eq 'externalnototals'; |
|
my $showCategories= |
|
$env{'course.'.$env{'request.course.id'}.'.grading'} eq 'categories'; |
|
|
my ($navmap,$totalParts,$totalPossible,$totalRight,$totalAttempted,$topLevelParts,$topLevelRight,$topLevelAttempted)= |
my ($navmap,$totalParts,$totalPossible,$totalRight,$totalAttempted,$topLevelParts,$topLevelRight,$topLevelAttempted)= |
&getData($showPoints,$uname,$udom); |
&getData($showPoints,$uname,$udom); |
|
|
Line 242 sub getAllStudentData {
|
Line 271 sub getAllStudentData {
|
} |
} |
} |
} |
|
|
|
sub startpage { |
|
my ($r,$showPoints) = @_; |
|
my $title = "Grading and Statistics";#$showPoints ? "Points Display" : "Completed Problems Display"; |
|
my $brcrum = [{href=>"/adm/quickgrades",text => "Points Display"}]; |
|
$r->print(&Apache::loncommon::start_page($title,undef, |
|
{'bread_crumbs' => $brcrum}) |
|
); |
|
} |
|
|
sub startGradeScreen { |
sub startGradeScreen { |
my ($r,$mode)=@_; |
my ($r,$mode)=@_; |
Line 256 sub startGradeScreen {
|
Line 293 sub startGradeScreen {
|
$env{'course.'.$env{'request.course.id'}.'.grading'} eq 'externalnototals'; |
$env{'course.'.$env{'request.course.id'}.'.grading'} eq 'externalnototals'; |
my $showCategories= |
my $showCategories= |
$env{'course.'.$env{'request.course.id'}.'.grading'} eq 'categories'; |
$env{'course.'.$env{'request.course.id'}.'.grading'} eq 'categories'; |
|
|
|
my $allowed_to_view = &Apache::lonnet::allowed('vgr',$env{'request.course.id'}); |
|
if ((!$allowed_to_view) && ($env{'request.course.sec'} ne '')) { |
|
$allowed_to_view = &Apache::lonnet::allowed('vgr', |
|
"$env{'request.course.id'}/$env{'request.course.sec'}"); |
|
} |
|
|
my $allowed_to_view = &Apache::lonnet::allowed('vgr',$env{'request.course.id'}); |
my $allowed_to_edit = &Apache::lonnet::allowed('mgr',$env{'request.course.id'}); |
my $allowed_to_edit = &Apache::lonnet::allowed('mgr',$env{'request.course.id'}); |
if (!$allowed_to_edit) && ($env{'request.course.sec'} ne '')) { |
|
$allowed_to_edit = &Apache::lonnet::allowed('mgr', |
|
"$env{'request.course.id'}/$env{'request.course.sec'}"); |
|
} |
|
|
if ($allowed_to_view) { |
if ($allowed_to_view) { |
my @notes; |
my @notes; |
Line 285 sub startGradeScreen {
|
Line 331 sub startGradeScreen {
|
&mt('Statistics and Reports').'</b></a></li>'); |
&mt('Statistics and Reports').'</b></a></li>'); |
|
|
$r->print("\n".'<li'.($mode eq 'chart'?' class="active"':'').'><a href="/adm/statistics?reportSelected=student_assessment"><b>'. |
$r->print("\n".'<li'.($mode eq 'chart'?' class="active"':'').'><a href="/adm/statistics?reportSelected=student_assessment"><b>'. |
&mt('Assessment Overview Chart').'</b></a></li>'); |
&mt('Assessment Chart').'</b></a></li>'); |
|
|
} |
} |
if ($allowed_to_edit) { |
if ($allowed_to_edit) { |
Line 407 sub getData {
|
Line 453 sub getData {
|
if ($curRes == $iterator->BEGIN_MAP()) {$depth++;} |
if ($curRes == $iterator->BEGIN_MAP()) {$depth++;} |
if ($curRes == $iterator->END_MAP()) { $depth--; } |
if ($curRes == $iterator->END_MAP()) { $depth--; } |
|
|
if (ref($curRes) && $curRes->is_problem() && !$curRes->randomout) |
if (ref($curRes) && $curRes->is_gradable() && !$curRes->randomout && |
|
($curRes->deeplink ne 'absent')) |
{ |
{ |
# Get number of correct, incorrect parts |
# Get number of correct, incorrect parts |
my $parts = $curRes->parts(); |
my $parts = $curRes->parts(); |