--- loncom/interface/lonexttool.pm 2017/12/30 19:51:30 1.15 +++ loncom/interface/lonexttool.pm 2018/01/01 01:29:38 1.16 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Launch External Tool Provider (LTI) # -# $Id: lonexttool.pm,v 1.15 2017/12/30 19:51:30 raeburn Exp $ +# $Id: lonexttool.pm,v 1.16 2018/01/01 01:29:38 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -110,10 +110,9 @@ sub handler { width => $toolsettings{'width'}, height => $toolsettings{'height'}, }; - $toolhash{'crslabel'} = $toolsettings{'crslabel'}; - $toolhash{'crstitle'} = $toolsettings{'crstitle'}; - $toolhash{'crsappend'} = $toolsettings{'crsappend'}; - $toolhash{'gradable'} = $toolsettings{'gradable'}; + foreach my $item (qw(crslabel crstitle crsappend gradable incdom)) { + $toolhash{$item} = $toolsettings{$item}; + } $is_tool = 1; } } @@ -225,7 +224,7 @@ sub lti_params { my ($r,$cnum,$cdom,$idx,$submittext,$toolsref) = @_; my ($version,$context_type,$msgtype,$toolname,$passback,$roster,$locale, $crslabel,$crstitle,$gradesecret,$rostersecret,%fields,%rolesmap, - %display,%custom,@userlangs); + %display,%custom,@userlangs,$incdom); if (ref($toolsref) eq 'HASH') { $version = $toolsref->{'version'}; $toolname = $toolsref->{'title'}; @@ -234,6 +233,7 @@ sub lti_params { $roster = $toolsref->{'roster'}; $rostersecret = $toolsref->{'rostersecret'}; $msgtype = $toolsref->{'messagetype'}; + $incdom = $toolsref->{'incdom'}; if (ref($toolsref->{'fields'}) eq 'HASH') { %fields = %{$toolsref->{'fields'}}; } @@ -403,7 +403,11 @@ sub lti_params { $ltiparams{'lis_person_contact_email_primary'} = $contact_email; } if ($fields{'user'}) { - $ltiparams{'lis_person_sourcedid'} = $uname.':'.$udom; + if ($incdom) { + $ltiparams{'lis_person_sourcedid'} = $uname.':'.$udom; + } else { + $ltiparams{'lis_person_sourcedid'} = $uname; + } } if (keys(%custom)) { foreach my $key (keys(%custom)) {