--- loncom/interface/lonnavmaps.pm 2025/02/03 03:04:24 1.570 +++ loncom/interface/lonnavmaps.pm 2025/06/28 14:34:46 1.576 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Navigate Maps Handler # -# $Id: lonnavmaps.pm,v 1.570 2025/02/03 03:04:24 raeburn Exp $ +# $Id: lonnavmaps.pm,v 1.576 2025/06/28 14:34:46 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -637,6 +637,7 @@ sub getDescription { my $open = $res->opendate($part); my $due = $res->duedate($part); + my $overdue = $res->overduedate($part); my $answer = $res->answerdate($part); if ($status == $res->NETWORK_FAILURE) { @@ -690,11 +691,20 @@ sub getDescription { } if ($status == $res->OPEN) { if ($due) { - if ($res->is_practice()) { - return &mt("Closes [_1]",&Apache::lonhtmlcommon::direct_parm_link(&timeToHumanString($due,'start'),$res->symb(),'duedate',$part)).$slotinfo; - } else { - return &mt("Due [_1]",&Apache::lonhtmlcommon::direct_parm_link(&timeToHumanString($due,'end'),$res->symb(),'duedate',$part)).$slotinfo; - } + my $now = time; + if (($now >= $due) && ($overdue) && ($now < $overdue)) { + if ($res->is_practice()) { + return &mt("Closes [_1]",&Apache::lonhtmlcommon::direct_parm_link(&timeToHumanString($overdue,'start'),$res->symb(),'duedate',$part)).$slotinfo; + } else { + return &mt("Grace period ends [_1]",&Apache::lonhtmlcommon::direct_parm_link(&timeToHumanString($overdue,'end'),$res->symb(),'grace',$part)).$slotinfo; + } + } else { + if ($res->is_practice()) { + return &mt("Closes [_1]",&Apache::lonhtmlcommon::direct_parm_link(&timeToHumanString($due,'start'),$res->symb(),'duedate',$part)).$slotinfo; + } else { + return &mt("Due [_1]",&Apache::lonhtmlcommon::direct_parm_link(&timeToHumanString($due,'end'),$res->symb(),'duedate',$part)).$slotinfo; + } + } } else { return &Apache::lonhtmlcommon::direct_parm_link(&mt("Open, no due date"),$res->symb(),'duedate',$part).$slotinfo; } @@ -1380,13 +1390,17 @@ sub cmp_title { sub render { my $args = shift; &Apache::loncommon::get_unprocessed_cgi($ENV{QUERY_STRING}); - my $result = ''; # Configure the renderer. my $cols = $args->{'cols'}; if (!defined($cols)) { # no columns, no nav maps. return ''; } + my $legend = ''; + my $tools = ''; + my $result = ''; + my $tools_printed = 0; + my $tablestarted = 0; my $navmap; if (defined($args->{'navmap'})) { $navmap = $args->{'navmap'}; @@ -1573,7 +1587,7 @@ sub render { my $curRes; my $foundJump = 0; my $counter = 0; - + while (($curRes = $mapIterator->next()) && !$foundJump) { if (ref($curRes)) { $counter++; } # Speed up display after course initialization @@ -1604,14 +1618,15 @@ sub render { # Print key? if ($printKey) { my $location = &Apache::loncommon::lonhttpdurl("/adm/lonMisc"); - $result .= ''. - ''. - '
Key:    '. - ' '.&mt('Unread Discussion'). - ''. - '   '. - &mt('New message (click to open)'). - '
'."\n"; + $legend = '
'."\n". + ''.&mt('Key').':'. + '  '. + ' '.&mt('Unread Discussion'). + '  '. + ' '. + &mt('New message (click to open)'). + '
'. + '
'."\n"; } if ($printCloseAll && !$args->{'resource_no_folder_link'}) { @@ -1631,9 +1646,9 @@ sub render { "location.href='$link'",$text); } } else { - $result.= ''.&mt($text).''; + $tools = ''.&mt($text).''; } - $result .= "\n"; + $tools .= "\n"; } # Check for any unread discussions in all resources. @@ -1645,7 +1660,7 @@ sub render { my $time=time; my $submit = &mt($markread); my $querystr = &HTML::Entities::encode($ENV{'QUERY_STRING'},'<>&"'); - $result .= (<