Direct output to back-end server

I am new to Lectora, and investigating the feasibility of directly outputting activity variables to databases via PHP

I am familiar with SCORM and LMS products.   However the background is that we have a large body of existing back-end LMS functionality in PHP and mySQL

From study of previous postings, I can see that Lectora variables can be exposed to Javascript – so far, so good!

The missing bit is how to export from Javascript to PHP, and it seems to me that this is either going to be a GET/POST with loading of a new PHP script, or something like Ajax

Has anybody been down a similar route before?

All suggestions much appreciated

Comments

  • klaatu
    klaatu Community Member Posts: 988
    I haven't had the need to do this with Lectora, however, I'd say Ajax and JSON would work for you. I'd use jQuery as well.
  • timk
    timk Community Member Posts: 1,197 ♦ Idol ♦
    You could try to use a Lectora Form element. Even if you don't need the form itself, you can check "Include ALL variable values (Test and Title)" to POST (or GET) all values to a "Custom Script", e.g. PHP, via a "Submit form" action.
  • rkreitman5694
    rkreitman5694 Community Member Posts: 2
    Thanks for the advice.

    With some assistance I have assembled a solution using Ajax and JQuery, and it seems to be working well

    I have been able to extend the life of a custom LMS database
  • klaatu
    klaatu Community Member Posts: 988
    Awesome, great news.