--- loncom/interface/lonnavmaps.pm 2022/06/27 20:35:51 1.560 +++ loncom/interface/lonnavmaps.pm 2023/04/04 23:15:48 1.563 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Navigate Maps Handler # -# $Id: lonnavmaps.pm,v 1.560 2022/06/27 20:35:51 raeburn Exp $ +# $Id: lonnavmaps.pm,v 1.563 2023/04/04 23:15:48 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -549,6 +549,10 @@ my %colormap = $resObj->EXCUSED => '#3333FF', $resObj->PAST_DUE_ANSWER_LATER => '', $resObj->PAST_DUE_NO_ANSWER => '', + $resObj->PAST_DUE_ATMPT_ANS => '', + $resObj->PAST_DUE_ATMPT_NOANS => '', + $resObj->PAST_DUE_NO_ATMT_ANS => '', + $resObj->PAST_DUE_NO_ATMT_NOANS => '', $resObj->ANSWER_OPEN => '#006600', $resObj->OPEN_LATER => '', $resObj->TRIES_LEFT => '', @@ -694,10 +698,10 @@ sub getDescription { return &Apache::lonhtmlcommon::direct_parm_link(&mt("Open, no due date"),$res->symb(),'duedate',$part).$slotinfo; } } - if ($status == $res->PAST_DUE_ANSWER_LATER) { + if (($status == $res->PAST_DUE_ANSWER_LATER) || ($status == $res->PAST_DUE_ATMPT_ANS) || ($status == $res->PAST_DUE_NO_ATMT_ANS)) { return &mt("Answer open [_1]",&Apache::lonhtmlcommon::direct_parm_link(&timeToHumanString($answer,'start'),$res->symb(),'answerdate',$part)); } - if ($status == $res->PAST_DUE_NO_ANSWER) { + if (($status == $res->PAST_DUE_NO_ANSWER) || ($status == $res->PAST_DUE_ATMPT_NOANS) || ($status == $res->PAST_DUE_NO_ATMT_NOANS)) { if ($res->is_practice()) { return &mt("Closed [_1]",&Apache::lonhtmlcommon::direct_parm_link(&timeToHumanString($due,'start'),$res->symb(),'answerdate,duedate',$part)); } else { @@ -1020,8 +1024,12 @@ sub render_resource { if ($it->{CONDITION}) { $nowOpen = !$nowOpen; } - - my $folderType = $resource->is_sequence() ? 'folder' : 'page'; + my $folderType; + if (&advancedUser() && $resource->is_missing_map()) { + $folderType = 'none'; + } else { + $folderType = $resource->is_sequence() ? 'folder' : 'page'; + } my $title=$resource->title; $title=~s/\"/\&qout;/g; if (!$params->{'resource_no_folder_link'}) { @@ -3078,8 +3086,12 @@ sub recursed_crumbs { my $pc = $map->map_pc(); next if ((!$pc) || ($pc == 1)); push(@links,$map); - push(@revmapinfo,{'href' => $env{'request.use_absolute'}.$map->link().'?navmap=1','text' => $map->title(),'no_mt' => 1,}); - $totallength += length($map->title()); + my $text = $map->title(); + if ($text eq '') { + $text = '...'; + } + push(@revmapinfo,{'href' => $env{'request.use_absolute'}.$map->link().'?navmap=1','text' => $text,'no_mt' => 1,}); + $totallength += length($text); } my $numlinks = scalar(@links); if ($numlinks) { @@ -3091,7 +3103,11 @@ sub recursed_crumbs { } @revmapinfo = (); foreach my $map (@links) { - my $showntitle = &truncate_crumb_text($map->title(),$avg); + my $title = $map->title(); + if ($title eq '') { + $title = '...'; + } + my $showntitle = &truncate_crumb_text($title,$avg); if ($showntitle ne '') { push(@revmapinfo,{'href' => $env{'request.use_absolute'}.$map->link().'?navmap=1','text' => $showntitle,'no_mt' => 1,}); } @@ -4797,6 +4813,11 @@ sub is_sequence { return $self->navHash("is_map_", 1) && $self->navHash("map_type_" . $self->map_pc()) eq 'sequence'; } +sub is_missing_map { + my $self=shift; + return $self->navHash("is_map_", 1) && + $self->navHash("map_type_" . $self->map_pc()) eq 'none'; +} sub is_survey { my $self = shift(); my $part = shift(); @@ -5698,7 +5719,6 @@ The problem will be opened later. Open and not yet due. - =item * B: The due date has passed, but the answer date has not yet arrived. @@ -5711,6 +5731,26 @@ The due date has passed and there is no The answer date is here. +=item * B: + +No dates have been set for this problem at all. + +=item * B: + +The due date has passed, feedback is suppressed, the problem was attempted, and the answer date has not yet arrived. + +=item * B: + +The due date has passed, feedback is suppressed, the problem was attempted, and there is no answer opening date set. + +=item * B: + +The due date has passed, feedback is suppressed, the problem was not attempted, and the answer date has not yet arrived. + +=item * B: + +The due date has passed, feedback is suppressed, the problem was not attempted, and there is no answer opening date set. + =item * B: The information is unknown due to network failure. @@ -5726,6 +5766,10 @@ sub PAST_DUE_NO_ANSWER { return 2; } sub PAST_DUE_ANSWER_LATER { return 3; } sub ANSWER_OPEN { return 4; } sub NOTHING_SET { return 5; } +sub PAST_DUE_ATMPT_ANS { return 6; } +sub PAST_DUE_ATMPT_NOANS { return 7; } +sub PAST_DUE_NO_ATMT_ANS { return 8; } +sub PAST_DUE_NO_ATMT_NOANS { return 9; } sub NETWORK_FAILURE { return 100; } # getDateStatus gets the date status for a given problem part. @@ -5929,6 +5973,26 @@ set. The problem is past due, not considered correct, and an answer date in the future is set. +=item * B: + +The problem is past due, feedback is suppressed, the problem was +attempted and an answer date in the future is set. + +=item * B: + +The problem is past due, feedback is suppressed, the problem was +attempted and no answer date is set. + +=item * B: + +The problem is past due, feedback is suppressed, the problem was +not attempted and an answer date in the future is set. + +=item * B: + +The problem is past due, feedback is suppressed, the problem was +not attempted and no answer date is set. + =item * B: The problem is past due, not correct, and the answer is now available. @@ -6012,7 +6076,18 @@ sub status { if ($completionStatus == CORRECT || $completionStatus == CORRECT_BY_OVERRIDE || $completionStatus == CORRECT_BY_PASSBACK ) { - if ( $suppressFeedback ) { return ANSWER_SUBMITTED } + if ( $suppressFeedback ) { + if ($dateStatus == PAST_DUE_ANSWER_LATER || + $dateStatus == PAST_DUE_NO_ANSWER ) { + if ($dateStatus == PAST_DUE_ANSWER_LATER) { + return PAST_DUE_ATMPT_ANS; + } else { + return PAST_DUE_ATMPT_NOANS; + } + } else { + return ANSWER_SUBMITTED; + } + } my $awarded=$self->awarded($part); if ($awarded < 1 && $awarded > 0) { return PARTIALLY_CORRECT; @@ -6052,7 +6127,23 @@ sub status { if ($dateStatus == PAST_DUE_ANSWER_LATER || $dateStatus == PAST_DUE_NO_ANSWER ) { - return $suppressFeedback ? ANSWER_SUBMITTED : $dateStatus; + if ($suppressFeedback) { + if ($completionStatus == NOT_ATTEMPTED) { + if ($dateStatus == PAST_DUE_ANSWER_LATER) { + return PAST_DUE_NO_ATMT_ANS; + } else { + return PAST_DUE_NO_ATMT_NOANS; + } + } else { + if ($dateStatus == PAST_DUE_ANSWER_LATER) { + return PAST_DUE_ATMPT_ANS; + } else { + return PAST_DUE_ATMPT_NOANS; + } + } + } else { + return $dateStatus; + } } if ($dateStatus == ANSWER_OPEN) { @@ -6298,6 +6389,10 @@ my %compositeToSimple = EXCUSED() => CORRECT, PAST_DUE_NO_ANSWER() => INCORRECT, PAST_DUE_ANSWER_LATER() => INCORRECT, + PAST_DUE_ATMPT_ANS() => ATTEMPTED, + PAST_DUE_ATMPT_NOANS() => ATTEMPTED, + PAST_DUE_NO_ATMT_ANS() => CLOSED, + PAST_DUE_NO_ATMT_NOANS() => CLOSED, ANSWER_OPEN() => INCORRECT, OPEN_LATER() => CLOSED, TRIES_LEFT() => OPEN, 500 Internal Server Error

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at root@localhost to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.