Retain variable value for all users???

mward09
mward09 Community Member, Lectora® Accessibility Group (LAUG) Member, eLearning Brothers® Partner Posts: 4 ☆ Roadie ☆
Hi I am trying to build a module in which actions will occur based on a single variable. However it is a community module so the variable should be the same for all users, as the group progresses so too does the variable unlocking additional features.

How do I modify the variable based on data the project managers can enter to the module (based on team progress) or can I code it to pull and set the variable value from a database?

Answers

  • andrew-robertson
    andrew-robertson Community Member Posts: 197 ☆ Superstar ☆
    In my experiences, SCORM and e-learning based materials is always silo'd so they cannot intercommunicate amongst users and their progress. This would require a customized solution that would store the data somewhere and then make it available for others to get. This could be through Rest API or a simple flat file stored on a server somewhere using some commands to read/write from the flat file.
    Andrew R.
    Developing content since 2010 using a mixed bag of tools.
  • carlfink
    carlfink Community Member Posts: 968 ✭ Legend ✭
    You might want to suggest "group project" features to ELB as a possible future enhancement. I can see uses for something like that.
  • mward09
    mward09 Community Member, Lectora® Accessibility Group (LAUG) Member, eLearning Brothers® Partner Posts: 4 ☆ Roadie ☆

    In my experiences, SCORM and e-learning based materials is always silo'd so they cannot intercommunicate amongst users and their progress. This would require a customized solution that would store the data somewhere and then make it available for others to get. This could be through Rest API or a simple flat file stored on a server somewhere using some commands to read/write from the flat file.

    Andrew I agree! We are working to try and allow the html file we are creating and posting to our intranet to call to and pull a value from our database. We have been able to do this previously using php code, which it seems that Lectora would allow us to do but we cannot seem to find the right "place" to put the code. Any ideas???

    Carl, Agreed! We are trying to leverage the Lectora functionality as an employee engagement tool for our department fitness challenge. We are picking "routes" around the globe and building interactive maps which would link to content at that milestone as we progress. We could just build it in html but the variable tools and media functionality in Lectora is much cleaner and easier to use!
  • carlfink
    carlfink Community Member Posts: 968 ✭ Legend ✭
    To the best of my knowledge, you can't use PHP directly in Lectora. (You can, of course, run it on your server, which might be what you meant.) Lectora directly supports JavaScript elements (although to my taste, it still isn't well-documented). It's pretty straightforward for JS to use the four acceptable REST commands (PUT, GET, POST, and the one I can't think of--I haven't actually done any REST development).
  • andrew-robertson
    andrew-robertson Community Member Posts: 197 ☆ Superstar ☆
    Affirmative. It would have been PHP on the server.
    Andrew R.
    Developing content since 2010 using a mixed bag of tools.
  • mward09
    mward09 Community Member, Lectora® Accessibility Group (LAUG) Member, eLearning Brothers® Partner Posts: 4 ☆ Roadie ☆
    Thank you all who contributed to this question! To close this out, we have been able to resolve this issue. We created a User-Variable called Distance and then if/then actions to show our "hiker" at various points on our map based on the variable value. We also enabled content when Distance equaled certain values.

    The variable is then modified using a PHP extension built in the Unit level of the module, and then once published to PHP and loaded to our web server we modify the code on the page to connect to our server side db field containing the value, and redefined the Distance variable value to pull from the field each time the page renders, this way whenever the page loads it connects to the db, pulls the value from the field and the content renders based on this number. It works in real time and fantastic!

    Thank you!

    Michael Ward