August 14, 2015 at 12:12 am #298670
I have a textbox. The contents of the textbox are determined by setting a variable during a Change Content action. The text is displayed correctly. However, I would like part (or all) of the text to be in BOLD (or one of the other html formatting commands).
I do not seem to be able to do this. Any html command that I insert is interpreted as text e.g. it appears as <B>. Is there some way that I can control all or part of the formatting of text displayed in the text box?
I have looked in the help file but could not discover an answer for this (maybe I did not use the magic words during my search).
AndrewAugust 14, 2015 at 2:17 am #298676
Sergey SnegirevMember339 pts@ssneg
Thank you. I will have to find another solution. The only way I seem to be able to set up the text box to receive formatted text (e.g. all bold) is to “initialise” it with some text in the right format and when I send the variable, the entire box is filled with the same thing e.g. all text is bold. Is there some other way to set the text box format?
On a related question, is it possible to generate text boxes programmatically i.e. have Lectora produce a text box through an action (and presumably format it also, to the extent that it is possible)?August 14, 2015 at 7:58 am #298688
Sergey SnegirevMember339 pts@ssneg
The only way I seem to be able to set up the text box to receive formatted text (e.g. all bold) is to “initialise” it with some text in the right format and when I send the variable, the entire box is filled with the same thing e.g. all text is bold. Is there some other way to set the text box format?
This is the way to do it, yes.
On a related question, is it possible to generate text boxes programmatically i.e. have Lectora produce a text box through an action (and presumably format it also, to the extent that it is possible)?
No, you cannot create objects via actions. At the end of the day, Lectora is a rapid authoring tool, not a HTML development IDE.This post has received 1 vote up.August 14, 2015 at 10:46 pm #298706
Thank you. I understand that it is a rapid authoring tool but it is sophisticated in many ways and we get to rely on that sophistication and the convenience of the system. For some reason that I do not understand, text manipulation through embedded strings seems to be problematic with tools like articulate and lectora (the ones I know best – very badly actually but I am learning) yet text manipulation can be so useful in giving feedback to learners (especially colour and font styles).
cheersAugust 18, 2015 at 10:06 am #298788
Hi, Andrew. Did you test your contents using preview in browser? I attached a sample question that uses html formatting in the feedback. It works fine when previewed in a browser, however, it shows the html tags in lectora’s preview or run mode.
Can you attach an example of what you have built?
DarrelAugust 18, 2015 at 10:07 am #298789August 18, 2015 at 10:53 am #298791
Thank you so much Darrel. That’s very interesting. Actually, I did try it in a browser served by an apache server. What I am actually building is a text variable and displaying it in a text block – not an alert box like the one which provides feedback in a quiz (like the one you created). That still does not work – even in a browser.
Hmm funny that the system appears to be inconsistent.August 18, 2015 at 11:16 am #298792
Darrel, here is your file which shows what I want to do. Does not work 🙁August 18, 2015 at 11:18 am #298794August 18, 2015 at 2:48 pm #298800
injecting styling code into a Lectora variable does not seem possible.
I’ll try more tomorrow.This post has received 1 vote up.
Attachments:August 18, 2015 at 6:31 pm #298812
Thank you Darrel 🙂 – That is clearly a good possibility – in many contexts. In the application I have in mind, lectora would have to read the display string from a php script and then do some work to transform some of the words into hotwords (more JS – making it more difficult to manage inside Lectora which is really not equipped for long external scripts) and then communicate clicks etc. back to the script etc… It may be simpler and more effective to just embed the php script inside lectora (i-frame style) to keep a uniform appearance – then, in due course, the script would have to report results back to lectora for record-keeping purposes. Not impossible especially with lectora’s built-in ability to post etc…
Any further ideas gratefully accepted. I very much appreciate the time that you are spending to help. Thank you! (klaatu barada nikto) 🙂August 20, 2015 at 6:41 pm #298897
Without knowing how many possible outcomes of your change contents actions there are, if only a few, you could add a text box with each variation of wording. Each text box would be initially hidden and use an action “on page show, show textbox X if variable =Y” It is a simplistic approach that is a bit tedious, but would allow you the versatility of formatting the text in each box uniquely.
VickiSeptember 29, 2015 at 12:16 pm #300206
Math NotermansMember129 pts@mnotermans5114
Using GSAP SplitText you could do what you want.
Steps to get it done would be:
– Get the source text from a textfield in Lectora
– Split the text in characters, words and/or lines- Each split element gets its own class.
– So when splitting check for the content you want formatted
– Set that content to another class
– Then all shows exactly as you want it.This post has received 1 vote up.
You must be logged in to reply to this topic.