--- loncom/interface/groupsort.pm 2016/11/22 13:51:29 1.75 +++ loncom/interface/groupsort.pm 2017/05/30 15:16:38 1.77 @@ -2,7 +2,7 @@ # The LON-CAPA group sort handler # Allows for sorting prior to import into RAT. # -# $Id: groupsort.pm,v 1.75 2016/11/22 13:51:29 raeburn Exp $ +# $Id: groupsort.pm,v 1.77 2017/05/30 15:16:38 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -205,7 +205,9 @@ sub handler { # permissions checking my ($allowed,$canedit,$context,$cid); - if ($env{'form.readfile'} =~ m{^/uploaded/($match_domain)/($match_courseid)/}) { + if ($env{'form.readfile'} eq '') { + $allowed = 1; + } elsif ($env{'form.readfile'} =~ m{^/uploaded/($match_domain)/($match_courseid)/}) { my ($cdom,$cnum) = ($1,$2); $cid = $cdom.'_'.$cnum; $context = 'course'; @@ -219,8 +221,6 @@ sub handler { (&Apache::lonnet::allowed('bro',$env{'form.readfile'}))) { $allowed = 1; } - } elsif (($env{'form.readfile'} eq '') && ($env{'form.acts'} ne '')) { - $allowed = 1; } if ($allowed) { if ($env{'form.mode'} eq 'rat') { @@ -243,7 +243,7 @@ sub handler { unless ($allowed) { if ($context eq 'course') { - if ($env{'request.course.id'} eq $cid) { + if ($env{'request.course.id'} eq $cid) { $env{'user.error.msg'}= "/adm/groupsort::0:1:Course environment gone, reinitialize the course"; } else { @@ -268,7 +268,7 @@ sub handler { } else { $noedit = &js_escape(&mt('You do not have rights to edit map contents.')); } - } + } if (($env{'form.readfile'})) { $begincondition='if (eval("document.forms.groupsort.include"+num+".checked")) {'; $endcondition='}'; @@ -294,7 +294,7 @@ ENDSMP $finishimport=(<