Explore the community Forums Lectora Lectora Questions & Answers Character Counts in Entry Fields

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #435361 Score: 0
    Profile photo of Casey Bagby
    Casey Bagby
    Member
    beginner
    intermediate
    friend finder
    curious george
    wise owl
    contributor
    profile
    @cbagby5306

    We have a page in our course that is locked based on a character count. Once the student types 300 characters, the page unlocks, and they can move forward. Easy, right? We have used Wendy Miller’s suggested approach for MANY years and did not encounter problems until recently.

    https://www.trivantis.com/blog/lectora-advanced-adding-character-counter-entry-field/

    Some of our students are bypassing this character count; we are getting multiple “null” entries in our xAPI results. For testing purposes, I added this character count variable to my screen, so that I could watch the variable change as I typed. (Yes, our students have figured out that they can type 300 letter z’s and move on. This is not the issue.)

    Problem: If you use Wendy’s suggested method – create a separate character count variable – it doesn’t matter WHERE I type on the screen. That character count variable is changing. I can click anywhere on the Lectora screen OUTSIDE the entry field, and just poke keys at random. The entry field is empty – but that count is moving – and the page unlocks. This means – I could 100% send an empty Entry field to the LRS… giving me a “null” in my reports. This doesn’t happen often – but it happens.

    My question!! If Lectora is able to set a maximum character count on an Entry field, WHERE is Lectora saving THAT count? I want the characters to count based only upon what the user actually types IN the field. I want this ONE variable to control them all…yes, like Highlander.

    Am I making any sense to anyone? 🙂

     

    #435364 Score: 0
    Profile photo of Brian Robertson
    Brian Robertson
    Member
    beginner
    intermediate
    LUC16 Attendee
    curious george
    wise owl
    contributor
    8 pts
    @brobertson4402

    Try this. Although it doesn’t accommodate all the possible keystroke possibilities including arrow keys, backspace, delete, etc … it will count only changes to the entry field.  I’m using a character count of 10 rather than 300 in this example.

    Create a variable to hold your character count, i.e.  c1 with an initial value of 10.

    Add the following actions to your Entry Field:

    Trigger:  Select/Change
    Action:  Modify Variable
    Target:  C1
    Type:  Subtract from Variable
    Value: 1
    If:  C1 Not Equal To 1 (C1 equals 1 when the learner type the 10th keystroke)
    Else: enable the ‘Next’ button or whatever you want to happen when hitting the keystroke threshold

    Like I noted, this won’t allow for every possible keystroke but it will force the learner to type in the Entry Field.  Unfortunately the triggers available when adding an action to an Entry Field are limited.

     

    #435367 Score: 0
    Profile photo of Casey Bagby
    Casey Bagby
    Member
    beginner
    intermediate
    friend finder
    curious george
    wise owl
    contributor
    profile
    @cbagby5306

    Thank you, Brian!

    I think this just may work! I will test to see if I am able to add/subtract certain keystrokes.

    Casey

    #435398 Score: 0
    Profile photo of Tim K
    Tim K
    Member
    contributor
    beginner
    intermediate
    advanced
    friend finder
    junior moderator
    advocate
    wise owl
    curious george
    Group Member
    329 pts
    @timk

    My question!! If Lectora is able to set a maximum character count on an Entry field, WHERE is Lectora saving THAT count?

    The maximum length is a property of the field, it’s not a variable.

    It may be easier to use the length of the entry, instead of counting keystrokes and cope with all the different keys.

    #435409 Score: 0
    Profile photo of Casey Bagby
    Casey Bagby
    Member
    beginner
    intermediate
    friend finder
    curious george
    wise owl
    contributor
    profile
    @cbagby5306

    *Nerd Alert*

    I have to share. I just had a major geek moment. “Tim K replied to my question!” Hahaha!! Every time I have had an issue, I log on to the Forum, and something Tim K writes is very helpful!!

    I will open this file, and let you know what I find. Brian’s way above is better than what I have been doing, but I would like to avoid having to think about the minutiae of every keystroke. Thank you!!

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

You must be logged in to reply to this topic.