October 17, 2016 at 4:11 pm #329712
Is is possible to save a Variable as a library object to use across multiple titles? I can’t seem to find where I can do that. I keep having to create the same variable over and over.October 17, 2016 at 6:15 pm #329717
I don’t think it’s possible with a library object per se, however, if you find that you have multiple variables that you use a lot I can think of 2 ways to get them into a new project without having to go through the Tools interface.
Method 1. Create all the variables and then save the project as a template.
Method 2. Edit the .awt file to add your own pre-built variables in Lectora’s xml format. Explained below. Before you say it’s too difficult, try it, it’s easier than it seems and will save you a ton of time of you do not want to go the template route.
Create the XML for the variables in something like notepad. Note in the example below I explained the tags in parentheses, do not include the explanations. It follows this format:
<variabledata> (This is the opening tag)
<variable id=”901″> (This is the opening variable tag and includes the id attribute. Every variable needs a unique id. I suggest starting at 900)
<name>student1</name> (The variable names goes between the name tags)
<initialvalue>Brad Pitt</initialvalue> (The initial Value)
</variable> (This closes the variable)
1. Open a new project do nothing but name it, save and close. Open the .awt file with a text editor (like notepad).
2. Normally variables are found between <variabledata> & </ variabledata> tags however since this project does not have any variables yet you will only find a single tag <variabledata /> (Notice the slash / is after the word variabledata in this empty tag).
3. Copy your xml, highlight the <variabledata /> line and paste your code over it. Save the .awt and close.
4. If you followed these steps correctly, when you open the .awt in lectora and look in Tools – Variables you should see all your newly added variables. Use normally.
DRSThis post has received 1 vote up.October 18, 2016 at 1:11 am #329745
Sergey SnegirevMember336 pts@ssneg
I think if you create an External HTML Object and attach variables to it (make them required), you can save the Ext HTML object as a library object and it will carry the variables with it.This post has received 2 votes up.October 18, 2016 at 7:04 am #329777
Lazaro PerezMember28 pts@sirwise23
Sergey is correct from what I recall.
If you create an empty text block and attach actions to it that touch that variable, you can save that object to the library.
If you insert that object it will create all the variables it touches as well.This post has received 1 vote up.October 18, 2016 at 10:03 am #329845
If either of you can get that to work, please post an example. I’ve tried many variations with no success.October 18, 2016 at 10:57 am #329874
Wow! I got the experts on this one. I’m impressed. I will try the object with the variables attached first as it will be easiest. I will be using it today and see if it works. If not – I’ll go with the XML version. In reading it, I can see it’s not difficult – just looks worse than it is.
Thank you everyone who weighed in!October 18, 2016 at 12:50 pm #329900
Lazaro PerezMember28 pts@sirwise23
Attached is a video of this working.This post has received 2 votes up.
Attachments:October 18, 2016 at 12:56 pm #329904
Well I’ll be darned. Great idea! I had just opened Lectora to start my project and try it. I watched your video. Wonderful! There are so many really smart people out here to help people like me look better than we really are. Thank you so much! I love this community!!October 18, 2016 at 4:07 pm #329933
Awesome, Lazaro! Thank you so much for the post. When I copied what yo did it worked perfectly. LOL, I spent about two hours trying different combos of html extension objects, text boxes, required variables, etc.. nothing worked. I still have no idea what I was doing wrong but with your (and credit to Sergey too) help all is good.
You must be logged in to reply to this topic.