LTI Custom Parameters ( instructorcustomparameters ) Passing

LTI Custom Parameters ( instructorcustomparameters ) Passing

Mark Lapsley發表於
Number of replies: 5

I have created a LTI bridge to our survey tool Qualtrics. 

I am using the external tool activity  and have created a config file  for the bridge  so  details can be set  e.g. url to pass and some account details  like     lis_result_sourcedid

i would like to set some custom parameters  e.g the survey id  in the  instructorcustomparameters feild and this to  be populated in the file 

I was look for some help on doing this if I set the survey id in the config file i can add it using $this->launchParams["survey_id"]  i have  created a function  below to build the url need 

    public function launch()

    {

        // Any parameters that have been specified by the Tool Consumer can be passed to Qualtrics to allow for customization.

        $urlParams = array(

            "SID" => $this->launchParams["survey_id"]

        );

        foreach ($this->launchParams as $key => $val) {

            if (Config::get("custom_pass_all") || in_array($key, Config::get("custom_pass_params")))

                $urlParams[$key] = $val;

        }

        // Build the request to the Qualtrics endpoint.

        $url = $this->launchParams["custom_qualtrics_url"];

        $query = http_build_query($urlParams);

        // Perform the redirect.

        header("Location: " . $url . "?" . $query);

    }

Any help or advice would be great

評比平均分數: -
In reply to Mark Lapsley

Re: LTI Custom Parameters ( instructorcustomparameters ) Passing

Jake Dallimore發表於
Core developers的相片 Moodle HQ的相片 Particularly helpful Moodlers的相片 Peer reviewers的相片 Plugin developers的相片 Testers的相片
Hi Mark,

I'm not 100% clear on the specific bit you're asking for help with, so I'll try to get this clear first. Apologies if I've missed something obvious.

First up, Moodle definitely supports setting custom params, as it seems you're aware. These will be sent in the launch data as you'd expect.

Then, it sounds like you're doing something on the tool side (or whatever part of this bridge is receiving the LTI launch), to kind of juggle these params into a meaningful internal URL (i.e. take custom params a,b,c and make a URL like qualtrics.test?a=x&b=y&c=z), presumably because Qualtrics doesn't provide an LTI implementation. Am I right so far? 

It's really then this bit that I'm then confused about:
 
I would like to set some custom parameters  e.g the survey id  in the  instructorcustomparameters feild and this to  be populated in the file 
 
What file are you referring to? A file that lives on the tool? 
評比平均分數:Useful (1)
In reply to Jake Dallimore

Re: LTI Custom Parameters ( instructorcustomparameters ) Passing

Mark Lapsley發表於
HI Jake

you are definitely right with Qualtrics there is no plugin or LTI integration with Moodle, i manged to resolve the issue by changing it to bult the query in the custom parameter so now in the custom parameter is

survey_id=SV_9ugh7IxBRCndy33

instead of

SV_9ugh7IxBRCndy33

but thanks for you help we now can use Qualtrics with Moodle

always appreciate you help

Mark
In reply to Mark Lapsley

Re: LTI Custom Parameters ( instructorcustomparameters ) Passing

David Siemens發表於

Hello Mark, we are trying to get Qualtrics to work.  Would you be willing to provide some guidance.  We are also looking at the custom parameters and I’m at a lose as to what I need for those parameters.

thanks for any help,

Dave

In reply to David Siemens

Re: LTI Custom Parameters ( instructorcustomparameters ) Passing

Liam Moran發表於
Core developers的相片
If Qualtrics doesn't provide an endpoint for LTI authentication by Moodle and instead has unauthenticated survey urls, you can accomplish what you want with a URL Resource activity as said above.
 
Create your link to the survey with a URL activity instead of an LTI activity, including any fixed url-encoded parameters like survey_id=xx_xxxxxx, then expand the URL variables submenu to enter any student-specific parameter names in the text field and select the field you want sent for that parameter under the User section of the "Choose a variable..."  selector.

That lets you generate individualized links for students like https://example.com/survey?id=foo&user=bar&course=ItsAllGreekToMe where user expects a student's username and course expects some identifier for a course like a Moodle internal UID or a course short name. LTI isn't needed for this use case, if indeed what you want to do is simply to generate links specific to individuals. (And those URL activities can be linked to from within other course activities or notification emails via autolinking).
In reply to David Siemens

Re: LTI Custom Parameters ( instructorcustomparameters ) Passing

Mark Lapsley發表於

Hi Dave

Yes  happy to help   what are you using to  link to  Qualtrics?  Iam using  LTI   script that i customised to work with moodle  what the issue you are having ?

Thnaks

nark