--- loncom/homework/lonhomework.pm 2025/01/17 01:05:19 1.344.2.10.4.9 +++ loncom/homework/lonhomework.pm 2025/01/17 15:41:26 1.344.2.10.4.10 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Homework handler # -# $Id: lonhomework.pm,v 1.344.2.10.4.9 2025/01/17 01:05:19 raeburn Exp $ +# $Id: lonhomework.pm,v 1.344.2.10.4.10 2025/01/17 15:41:26 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -2028,13 +2028,15 @@ sub get_lti_score { my $iterator; if ($mapurl ne '') { my $map = $navmap->getResourceByUrl($mapurl); - my $firstres = $map->map_start(); - my $finishres = $map->map_finish(); - my $recursive = 1; - if ($pbscope eq 'nonrec') { - $recursive = 0; + if (ref($map) { + my $firstres = $map->map_start(); + my $finishres = $map->map_finish(); + my $recursive = 1; + if ($pbscope eq 'nonrec') { + $recursive = 0; + } + $iterator = $navmap->getIterator($firstres,$finishres,undef,$recursive); } - $iterator = $navmap->getIterator($firstres,$finishres,undef,$recursive); } else { $iterator = $navmap->getIterator(undef,undef,undef,1); }