Picture of Rob Mausser
_globals._learnerInfo.firstname in item body
by Rob Mausser - Friday, 12 June 2020, 2:10 AM
 

It appears that _globals._learnerInfo.firstname only works in the component body. Is it possible to get it working in _items body text.

It seems that in a components items, the _globals._learnerInfo.firstname doesnt work. 

Anyway to get it to work?

 

Thanks

Picture of Rob Mausser
Re: _globals._learnerInfo.firstname in item body
by Rob Mausser - Monday, 15 June 2020, 2:11 PM
 

So is it not possible to have the users name in item body of components?

Picture of Oliver Foster
Re: _globals._learnerInfo.firstname in item body
by Oliver Foster - Monday, 15 June 2020, 2:51 PM
 

It is possible but you'd have to change the template and possibly the javascript for the component in question.

 

Which component is it?

Picture of Rob Mausser
Re: _globals._learnerInfo.firstname in item body
by Rob Mausser - Monday, 15 June 2020, 8:03 PM
 

https://github.com/ExultCorp/adapt-contrib-clickAndLearn

Its quite an old component  but it seems to run fine in Adapt 4.4.0 

We also wanted it to work on this component

https://github.com/KingsOnline/adapt-chat

So that the one chat would be "you" 

Picture of Oliver Foster
Re: _globals._learnerInfo.firstname in item body
by Oliver Foster - Tuesday, 16 June 2020, 8:59 AM
 

https://github.com/ExultCorp/adapt-contrib-clickAndLearn/blob/master/templates/clickAndLearn.hbs#L39 and https://github.com/ExultCorp/adapt-contrib-clickAndLearn/blob/master/templates/clickAndLearn.hbs#L27 need to be `{{{compile body}}}` and `{{{compile text}}}` accordingly. That way the body and title values get compiled as templates.

adapt-chat you'd have to work out for yourself. I can't give you the solution by just scanning the code I'm afraid. It's too complicated for me to do that.

 

Picture of Rob Mausser
Re: _globals._learnerInfo.firstname in item body
by Rob Mausser - Tuesday, 16 June 2020, 2:26 PM
 

Thanks so much for your help!!

Picture of Oliver Foster
Re: _globals._learnerInfo.firstname in item body
by Oliver Foster - Tuesday, 16 June 2020, 3:03 PM
 

No probs. Good luck.