Explore the community Forums Lectora Lectora Questions & Answers Difference between .value and .getValue()?

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #318009 Score: 0
    Profile photo of Sergey Snegirev
    Sergey Snegirev
    Member
    contributor
    intermediate
    advanced
    friend finder
    lab member
    junior moderator
    advocate
    LUC16
    LUC16 Attendee
    wise owl
    335 pts
    @ssneg

    When accessing variable values via JavaScript, should I use VarMyLittleVariable.value or VarMyLittleVariable.getValue()? They seem to return same thing as far as I tested (see screenshot).

    #318063 Score: 0
    Profile photo of Jennifer Valley
    Jennifer Valley
    Member
    contributor
    beginner
    friend finder
    advanced
    lectora beginner
    verified member
    wise owl
    profile
    picture perfect
    curious george
    114 pts
    @jvalley4735

    I asked around for this question.  Essentially they are the same thing however .getValue() is the best to use.  When an override is in place it usually effects .value.

    #318065 Score: 0
    Profile photo of Sergey Snegirev
    Sergey Snegirev
    Member
    contributor
    intermediate
    advanced
    friend finder
    lab member
    junior moderator
    advocate
    LUC16
    LUC16 Attendee
    wise owl
    335 pts
    @ssneg

    Thank you! What is the ‘override’ you are referring to?

    #318081 Score: 0
    Profile photo of Jennifer Valley
    Jennifer Valley
    Member
    contributor
    beginner
    friend finder
    advanced
    lectora beginner
    verified member
    wise owl
    profile
    picture perfect
    curious george
    114 pts
    @jvalley4735

    When a variable value is changed due to an action.  Like when you answer a question and the question variable gets changed to correct.

    #318083 Score: 0
    Profile photo of Math Notermans
    Math Notermans
    Member
    contributor
    intermediate
    advanced
    friend finder
    junior moderator
    advocate
    LUC16 Attendee
    LUC16
    wise owl
    curious george
    115 pts
    @mnotermans5114

    Allthough a bit out of context… Tried to access CurrentView.getValue() but didnot get it back in Javascript. Testing it in Lectora itself, it was available… Any clues ?

    #318087 Score: 0
    Profile photo of Sergey Snegirev
    Sergey Snegirev
    Member
    contributor
    intermediate
    advanced
    friend finder
    lab member
    junior moderator
    advocate
    LUC16
    LUC16 Attendee
    wise owl
    335 pts
    @ssneg

    It’s VarCurrentView.getValue(), not CurrentView.getValue().

    #318102 Score: 0
    Profile photo of Math Notermans
    Math Notermans
    Member
    contributor
    intermediate
    advanced
    friend finder
    junior moderator
    advocate
    LUC16 Attendee
    LUC16
    wise owl
    curious george
    115 pts
    @mnotermans5114

    Oh yeah forgot that one…. and indeed it works now… before i banged my head against my screen and couldnt get it …. probably plain overlooking it… thx Sergey..

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.