Action Conditions

andrew-robertson
andrew-robertson Community Member Posts: 196 ☆ Superstar ☆
Hi there community -

Is there an easy way to include JQuery statements in the Set Action Conditions window?


The image above shows the if statement that I am trying to enact; more specifically the items on teh end that deal with the AICC_Student_ID and the AICC_Student_Name (proctor validation process we are doing).


The image above shows my Set Action Conditions that I am working with. When I publish the content with the above settings it gives me a bunch of quotes in locations I don't want and caused my if/then statement to not function as expected (see below for the actual output from Lectora).


Any thoughts? Tips? Tricks?
Andrew R.
Developing content since 2010 using a mixed bag of tools.

Best Answer

  • timk
    timk Community Member Posts: 1,205 ♦ Idol ♦
    Accepted Answer
    I don't think this field is a suitable place for custom scripts. ".equals()" is a Lectora function that will probably not accept anything but strings or references to Lectora variables as "VAR(myVariable)". Lectora variables always contain strings. Even if you found a way to produce the desired output, I wouldn't expect it to work.

    It should be better to do the jQuery part first and put the results into a Lectora variable that can be used in the condition. If it's an entry field that you want to check use the entry fields variable.

Answers

  • andrew-robertson
    andrew-robertson Community Member Posts: 196 ☆ Superstar ☆
    This is what I feared and was about to do, but since I do not have formal training Lectora and it is all learned as we go I figured I'd reach out and see.

    Thanks again as always.
    Andrew R.
    Developing content since 2010 using a mixed bag of tools.
  • wheels
    wheels Florida USACommunity Member, Administrator, Moderator, Rockstar Manager Posts: 598 eLearning ROCKSTAR Admin Team
    If that is a Lectora Entry field you can use it's associated variable something like: VAR(Entry_175023)