--- loncom/homework/lonhomework.pm 2017/04/03 13:01:43 1.368 +++ loncom/homework/lonhomework.pm 2017/12/22 02:00:39 1.369 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Homework handler # -# $Id: lonhomework.pm,v 1.368 2017/04/03 13:01:43 raeburn Exp $ +# $Id: lonhomework.pm,v 1.369 2017/12/22 02:00:39 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -190,7 +190,7 @@ sub proctor_checked_in { if ($type eq 'Task') { my $version=$Apache::lonhomework::history{'resource.0.version'}; $key ="resource.$version.0.checkedin"; - } elsif ($type eq 'problem') { + } elsif (($type eq 'problem') || ($type eq 'tool')) { $key ='resource.0.checkedin'; } # backward compatability, used to be username@domain, @@ -205,7 +205,6 @@ sub proctor_checked_in { return 1; } } - return 0; } @@ -350,7 +349,7 @@ sub check_slot_access { $is_correct = ($Apache::lonhomework::history{"resource.$version.0.status"} eq 'pass' || $Apache::lonhomework::history{"resource.0.solved"} =~ /^correct_/ ); - } elsif ($type eq 'problem') { + } elsif (($type eq 'problem') || ($type eq 'tool')) { if ((ref($partlist) eq 'ARRAY') && (@{$partlist} > 0)) { my ($numcorrect,$numgraded) = (0,0); foreach my $part (@{$partlist}) { @@ -410,7 +409,7 @@ sub check_slot_access { # used to gain access to it to work on it, until the due date is reached, and the # problem then becomes CLOSED. Therefore return the slotstatus - # (which will be one of: NOT_IN_A_SLOT, RESERVABLE, RESERVABLE_LATER, or NOTRESERVABLE). - if (!defined($slot_name) && $type eq 'problem') { + if (!defined($slot_name) && (($type eq 'problem') || ($type eq 'tool'))) { if ($slotstatus eq 'NOT_IN_A_SLOT') { if (!$num_usable_slots) { if ($env{'request.course.id'}) { @@ -501,7 +500,7 @@ sub check_slot_access { } if (($is_correct) && ($blockip ne 'answer')) { - if ($type eq 'problem') { + if (($type eq 'problem') || ($type eq 'tool')) { return ($status); } return ('SHOW_ANSWER');