Submitting Test Results to Google Drive - Accessing student name variable?

_ Community Member Posts: 82 ☆ Roadie ☆
Hi All,

When submitting test results to Google Drive, students are asked to provide their name at the beginning of the test - from what I can gather from the published HTML this is saved to the TrivantisUserName variable.

Does anybody know how I'm able to access this variable, to carry the name through for certificate generation? Currently I'm asking for their name twice which isn't great from a UX perspective.

I've tried the following to no avail:
  • VAR(TrivantisUserName)
  • VAR(username)
  • VAR(AICC_Student_Name)



  • cainam
    cainam Community Member Posts: 365 ♦ Idol ♦
    I'm not sure those are going to work when published to HTML vs SCORM or AICC which get the name from the LMS the course is launched from.  (I'm not positive if all 3 you list are reserved for that, or maybe just the last 2)

    I'm not sure I understand why you would ask for the name twice though even outside of that - if the first time you ask for the name, you are storing that via an Entry Field (from the Test & Survey tab), then you should be able to call up that same Field variable up when printing out the certificate.  e.g. you insert an Entry field with name: Entry_1, with associated variable name of: Entry_0001 (which would be the default), and then you call that same variable up in the certificate (change contents action to replace a regular text field with the variable data).

    So reading back - how are you asking students to provide their name at the beginning of the test?
    - Adam Cain
  • _
    _ Community Member Posts: 82 ☆ Roadie ☆
    Hi Adam,

    The name prompt that appears at the beginning of the test when both "Custom Results Submission (to Google Drive)" and "Prompt for Student's Name" are both enabled (see attached screenshot).

    So they enter their name at the beginning of the test, and this is stored in the TrivantisUserName variable (as opposed to an Entry_0001 or similar). Upon passing the test their name and results are uploaded to Google Drive.

    Once they've passed, they're directed to generate a certificate - my issue is that I need to prompt for their name again, as I can't seem to access the data stored in TrivantisUserName to reuse it! I could disable "Prompt for Student's Name" but then the associated entry in Google Drive would be nameless. We are indeed deploying to HTML so AICC_Student_Name would be no good, as you mentioned.

    I did find another question about this on the forums but no replies:

  • timk
    timk Community Member Posts: 1,236 ✭ Legend ✭
    I tested this successfully in Lectora 17.0.6:

    On: Show
    Action: Run javascript

    Of course you need a variable called "myusername" and use it in a Lectora action.
  • cainam
    cainam Community Member Posts: 365 ♦ Idol ♦
    I've used the form submission to Google docs before - never used the test results, and requiring student name.  If you can't access that variable later, maybe just don't use that checkbox, and require your own entry for student name that you know you can call up later.   Maybe just make that the first question in your test - a fill-in-the-blank question for student name that you can then call up later for the certificate?
    - Adam Cain
  • _
    _ Community Member Posts: 82 ☆ Roadie ☆
    @timk Thank you Tim!

    This approach worked - I'm now able to store the name in a custom variable to re-use as many times as I like.

    Would be great if the Custom Results Submission feature gave a bit more visibility into name and score submission but this works really nicely for my needs.