--- loncom/interface/lonuserutils.pm 2024/08/31 20:02:12 1.222 +++ loncom/interface/lonuserutils.pm 2025/01/13 00:57:39 1.224 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Utility functions for managing LON-CAPA user accounts # -# $Id: lonuserutils.pm,v 1.222 2024/08/31 20:02:12 raeburn Exp $ +# $Id: lonuserutils.pm,v 1.224 2025/01/13 00:57:39 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -3714,9 +3714,11 @@ END foreach my $item (@{$keylist}) { $in{$item} = $sdata->[$index{$item}]; } - my $clickers = (&Apache::lonnet::userenvironment($in{'domain'},$in{'username'},'clickers'))[1]; - if ($clickers!~/\w/) { $clickers='-'; } - $in{'clicker'} = $clickers; + if (grep(/^clicker$/,@cols)) { + my $clickers = (&Apache::lonnet::userenvironment($in{'domain'},$in{'username'},'clickers'))[1]; + if ($clickers!~/\w/) { $clickers='-'; } + $in{'clicker'} = $clickers; + } my $role = $in{'role'}; $in{'role'}=&Apache::lonnet::plaintext($sdata->[$index{'role'}],$crstype); unless ($mode eq 'excel') { @@ -3838,10 +3840,7 @@ END } elsif ($item eq 'clicker') { if (($context eq 'course') && ($mode ne 'autoenroll')) { if ($env{'form.showrole'} eq 'st' || $env{'form.showrole'} eq 'Any') { - my $clickers = - (&Apache::lonnet::userenvironment($in{'domain'},$in{'username'},'clickers'))[1]; - if ($clickers!~/\w/) { $clickers='-'; } - $r->print('