Featured Categories
-
Lectora®
Lectora® is the most trusted authoring tool in the world. Rock out your creativity! Author courses any way you like. Lectora adheres to best practices for Accessibility and Web Content Accessibility Guidelines (WCAG), offers responsive authoring for eLearning, and publishes to any LMS (Learning Management System).
-
CenarioVR®
Experience virtual reality through CenarioVR®, our training and virtual reality (VR) authoring software that allows you to create immersive learning in minutes! No coding required!
-
Rockstar Learning Platform®
Our Rockstar Learning Platform® has all the features you’ll love. Help your employees be better at their jobs, more valuable to your company, and most effective in servicing your customers.
-
The Training Arcade®
Level up your learner engagement with the Training Arcade®! The Training Arcade is a library of fun, mobile-ready, casual games that can be rapidly customized with your content to create effective gaming!
-
ELB Learning Content
Did you know that our AssetLibrary™ has over 120 million engaging, interactive, and awe-inspiring templates and assets to help you become an eLearning Rockstar®?
Seperate First name from AICC_STUDENT_NAME

Haven't been on here in a while. I know I have seen notes n this before but I can't find it.
I am trying display the students first name but the AICC_Student_Name only pulls LastName, FirstName.
Is there a way with variables to strip off the LastName, and only display the firstname?
I can probably manage this if I use a flash file to read the AICC_Student_name variable, strip out what I don't need, write the first name to a new variable, and then use Lectora read the variable.
Since I do plan on doing some development for an LMS that uses iPads, I was trying to avoid the flash route though.
Anyone ever manage this?
Comments
-
Do you need to pull the name from AIC_Student_Name? What about having the first name be its own variable and then asking them for their name at the start of the course?
I think how you plan to have the first name show in the course depends on what you are doing with it. If it is just for customization (e.g., a guide says something like "Hi FIRSTNAME, let's learn do something!") then a new variable would work well for that. -
Haven't tried it yet, but using javascript and the split() method.
It should look something like this (variables aren't correct, just used as an example):
var studentname = varaicc_studnet_name.split(",");
var firstname = studentname[1];
[/CODE]
the variable "firstname" should then only hold the students first name for you to use anywhere
hopefully this gives you a starting place, let me know if you have any trouble with it! (someone else on here might be able to give you a better answer too)[CODE]
var studentname = varaicc_studnet_name.split(",");
var firstname = studentname[1];
[/CODE]
the variable "firstname" should then only hold the students first name for you to use anywhere
hopefully this gives you a starting place, let me know if you have any trouble with it! (someone else on here might be able to give you a better answer too) -
It can be done in three steps:
1.
Create a textfield that's initially invisible
Add an action
On: Page show
Action: Change content
Target: This object
Value: VAR(AICC_Student_Name)
2.
Create two variables
-> lastname
-> firstname
3.
Add an action on page level
On: Show
Action: Run JavaScript
Javascript:
var username = VarAICC_Student_Name.getValue().split(", ");
Varlastname.set(username[0]);
Varfirstname.set(username[1]);
"lastname" now contains the users' lastname (i.e. everything before the ", ") "firstname" contains the users' firstname. Both variables can now be used throughout the course.
Tim -
Hey guys, i need really help, i did exactly the three steps from Tim, but it doesnt work. Has anyone an idea? i have Lectora inspire 17.0.2. The strange thing is, that in Lectora online, the first name appears at beginning but in inspire it doesnt work.
var username = AICC_Student_Name.getValue().split(",",2);
Varlastname.set(username[0]);
Varfirstname.set(username[1]);
alert(username);
greetings marcel -
Hey Tim, thx :-)
i tried it but its the same like before, is there maybe something false in my variablemanager... -
Ok, here's my title, I tested in moodle 3.0.
Damit sollte es funktionieren.
Tim -
Hey Tim, super, danke dir :-) ist es aber auch möglich nur den Vornamen anzeigen zu lassen, quasi...."Hi Marcel"....das wäre nämlich genial :-)
-
Hi Marcel,
I'll return to English as the community is international.
The whole sense of the script is to have both parts of the name in two separate variables. The message displays
"Hi VAR(firstname) VAR(lastname)" If you remove the part about the lastname, it'll show "Hi Marcel".
There's a German group http://community.trivantis.com/groups/lectora-user-im-deutschsprachigen-raum/forum/
Tim -
Hi Tim, thx for your help, i tried it and have again the strange result but with both variables it works.
"hi 0" is now the message
-
-
Hm, did you change anything else? "0" is the initial value of the variable, so the "Display Message" action is working alright. Seems more like the script isn't setting the name. You didn't remove the action to "Modify variable" "username" did you? Did you test in your LMS? Did you uncheck "Publish for Seamless Play" when publishing to Scorm? (Sorry, actually I don't know what it's called in German) These are the three reasons I can think of causing the script to not get the name.
Here's another sample, I tested in moodle (now 3.1.5). The textfield displays the firstname only, the message still displays both parts.
Tim -
Hey Tim, thx, this works, a little bit strange, maybe i forgot something, i had a lot to do the last days but tomorrow i will work further on my little project :-) i had last week another little problem, when i pasted a textfield with some text, i had another format result. That means, that the textformat in the editor view is not the same like in the Preview mode. Do you have an idea why? For me its very bad, because i have to place exactly symbols beside terms in my text
nice greetings, Marcel -
Hi Tim,
thx for your fast answer, yes the formatting of the text itself is different.
you can see it in the two pictures....really strange -
-
Not only will things look different in preview versus editor mode, but even when you publish it might look different in different browsers. Just try and publish, then test in IE, FF, Chrome and Edge ( and if you dare even Safari ). If the look and feel of your texts and formatting is everywhere exact the same, you are very lucky. In most cases there will be differences, and if you need to get them all 100% the same, your in for quite some work. Back to the issue at hand, the difference in preview versus editor mode. I do think you should ignore both. What counts is your final output, being HTML. So publish and test that.... thats what the endresult will be. Preview in browser targetting your favourite browser for me often gives the closest result compared to a publish.
~Math
Categories
- 35.9K All Categories
- 110 ✫ Announcements
- 33.2K Lectora®
- 31.1K Lectora Discussions
- 29K Lectora Desktop
- 2K Lectora Online
- 2K Lectora Feature Requests
- 71 Lectora User Groups
- 36 Lectora Accessibility User Group (LAUG)
- 27 ELB Learning Content
- 27 ELB Learning Content Discussions
- 346 CenarioVR®
- 205 CenarioVR Discussions
- 141 CenarioVR Feature Requests
- 44 Rockstar Learning Platform®
- 41 Rockstar Learning Platform Discussions
- 108 CourseMill®
- 108 CourseMill Discussions
- 48 ReviewLink®
- 48 ReviewLink Discussions
- 7 The Training Arcade®
- 7 The Training Arcade Discussions
- 938 All Things eLearning
- 39 eLearning Development
- 546 Learning Management System (LMS) Integration
- 333 Web Accessibility
- 1.2K ♪ The Green Room
- 9 Additional Learning Products