Explore the community Forums Lectora Lectora Questions & Answers Two questions about fill-in-the blank quizzes

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #300791 Score: 0
    Profile photo of Andrew Lian
    Andrew Lian
    Member
    beginner
    intermediate
    friend finder
    advanced
    contributor
    wise owl
    curious george
    profile
    12 pts
    @mlapl1

    Hello,

    I have two questions about fill-in-the blank quizzes:

    First: Is it possible to manipulate the  students’ answer with Javascript before it is submitted to Lectora for judgment? Specifically, what I need to know is whether the variable assigned to the Entry Field is the variable judged by Lectora (or does it have its own invisible variables?).

    Second: When a student re-does a fill-in-the blank question on a page with multiple fill-in-the blank questions and the answer is judged, the student’s answer remains visible but Lectora seems to forget it and when asked to judge the answer again, just ignores it unless the student actually re-types the answer. Any solutions for this? (I hope that makes sense).

    Thanks for any help.

    Andrew

     

    #300792 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
    116 pts
    @jvalley4735

    Answer 1: I know there is an associated Lectora variable that grades the question (Question_####).  I’m pretty sure that you can manipulate it before it reaches the LMS just from examples I’ve seen floating around. Here’s an example that was posted about adding javascript validation to an entry field which may be a good place to start:

    https://community.trivantis.com/shared-content/entry-field-validation-example/

    Answer 2: For all test questions you can select the option to retain the students answer in the test properties within the behavior tab.  Which means that each time they enter the test their answers are guaranteed to still be visible. It does do it for the whole test so if you’re okay with that it’s an easy on/off option.  Otherwise you can get into the question and under the properties is an option to retain the answer which will only apply it to that particular question.

    Hope that helps!

    #300799 Score: 0
    Profile photo of Andrew Lian
    Andrew Lian
    Member
    beginner
    intermediate
    friend finder
    advanced
    contributor
    wise owl
    curious george
    profile
    12 pts
    @mlapl1

    Hi Jennifer

    Thanks for your answers. I have tried out the first but not the second (yet).

    So… answer 1 does not seem to work.

    Please note that I am not trying to send the contents of the entry-field to an LMS but I would like the answer judged by the normal quiz evaluation process.

    Yes I can change the variable Question_#### but that is not the variable evaluated by the quiz system. In fact the quiz system seems to use a hidden variable. Specifically what I am trying to do is to remove extra spaces or punctuation as their presence triggers an “incorrect” response, even if the word is correct but has some extra spaces or punctuation. i.e. “hello” (the correct response) is not treated the same as “hello   ” (2 extra spaces – judged as incorrect). I was hoping to remove the extraneous spaces so that “hello” and “hello  ” would be judged as being the same.

    Any other thoughts?

    Cheers

     

    #300805 Score: 2
    Profile photo of Darrel Somoza
    Darrel Somoza
    Member
    contributor
    friend finder
    beginner
    intermediate
    junior moderator
    advanced
    wise owl
    curious george
    profile
    208 pts
    @Klaatu

    Hi, Andrew. Take a look at the attached. I think it does what you are looking for. The entry field HTML name gets “id” added to it. So to manipulate it with JavaScript “entry43” becomes “entry43id”. You can then grab the contents and strip away the unwanted spaces (or do whatever you want to it). You then need to put the value back in the entry field AND set the questions internal variable (for instance Question_001).  For some reason I find that you have to do both for this to work. I hope I explained this sufficiently.

    The cool thing about this is the spaces can be before, after or even mixed in with their answer.

     

    Darrel

     

     

    This post has received 2 votes up.
    Attachments:
    1. entryField.zip
    #300815 Score: 0
    Profile photo of Andrew Lian
    Andrew Lian
    Member
    beginner
    intermediate
    friend finder
    advanced
    contributor
    wise owl
    curious george
    profile
    12 pts
    @mlapl1

    Not just cool but super-cool. Using general pattern matching is great (and simple) but it also seems to solve my second question (at least in your example). Two birds with one stone! I will now try it out in  my title.

    Thanks so much Darrel.

    #300817 Score: 0
    Profile photo of Darrel Somoza
    Darrel Somoza
    Member
    contributor
    friend finder
    beginner
    intermediate
    junior moderator
    advanced
    wise owl
    curious george
    profile
    208 pts
    @Klaatu

    You’re very welcome. I’m glad I can help.

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

    You then need to put the value back in the entry field AND set the questions internal variable (for instance Question_001). For some reason I find that you have to do both for this to work. I hope I explained this sufficiently.

    The Question_0001 variable is updated on key press events. When you type your answer in the field, Question_0001 is immediately set to whatever is typed in the entry field. When you manipulate entry fields directly via javascript, no key press events are triggered so the variable doesn’t get updated. So you have to update it yourself.

    This post has received 2 votes up.
    #300893 Score: 0
    Profile photo of Andrew Lian
    Andrew Lian
    Member
    beginner
    intermediate
    friend finder
    advanced
    contributor
    wise owl
    curious george
    profile
    12 pts
    @mlapl1

    Thanks Sergey

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

You must be logged in to reply to this topic.