Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Individual timers for each question, Capturing word count at various intervals

  • GreenFlux
  • GreenFlux's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 4 months ago #144048 by GreenFlux
Hello,

New LimeSurvey user, just trying to figure out if this is the right platform for my project, which involves testing student's reading comprehension and writing abilities.

I'd like to be able to capture the 'progress' of a long text field and save 'snapshots' of the text at regular intervals as the student is composing their response. Would it be possible to take a text field that's still being edited, and save it's current value (along with corresponding timestamp) every X number of seconds?

Perhaps there could be some hidden question/field that the snapshots get dumped into, without the user seeing multiple versions of the one question.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 4 months ago #144070 by tpartner
Yes, you could place several long-text questions on the same page and use JavaScript to hide all but the first one and periodically load the contents of the visible question into one of the hidden questions.

What LimeSurvey version are you using and what time interval would you want?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • GreenFlux
  • GreenFlux's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 4 months ago #144080 by GreenFlux
I'm currently testing with the free version hosted here with LimeSurvey, whatever version number that is. If I can figure out this timer issue and do decide to go forward with using this platform then I will set up my own server using the current/sable version.

I would want the time interval to be every 60 seconds, and capture a snapshot of their text each time. From the user's perspective, I'd like it to be as seemless as possible, as if they're just continuing to work in the same field the entire time.

I just noticed some timer controls in the question 'Advanced settings/Timer' section. One of the options is to 'move on without warning' when the timer expires. It seems like that would do most of what I need. How could I capture that data before moving on to the next question, then autofill the next question with that data?
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 4 months ago #144086 by holch
But if you redirect them automatically to the next question it will not be "seamless", they will clearly notice that a new page is loading.

If it should be seamless, Tpartners approach is probably a lot better because the will probably not even notice that the text has been saved in one of the other hidden questions.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • GreenFlux
  • GreenFlux's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 4 months ago #144090 by GreenFlux
True, but it sounds like an easier approach that makes use of existing features instead of writing JavaScript for all of it. I'm new to this platform and don't know much JavaScript so if there' a way to achieve the same result and avoid adding my own code then that's something worth considering.

The user experience is definitely important though. I think I'll try using the native timer and see how noticeable it is, but I'm still interested in learning how it would be done with JavaScript as well.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 4 months ago #144112 by Joffm
Hi, Greenflux,
considering your goal of "testing student's reading comprehension and writing abilities." I am longing to know how you partial out the bias of typewriting skills of the students.
That's because of your time criteria.

Best regards
Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • GreenFlux
  • GreenFlux's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 4 months ago #144113 by GreenFlux
That's totally up to the client. I have nothing to do with the testing evaluation criteria. I'm just trying to find a platform that can offer the features the client has requested.

I thought it was kind of interesting that they wanted to see the snapshots as well, instead of only grading the final submitted version. It must have some statistical significance to their research but I couldn't tell you what they do with it from there.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 4 months ago - 7 years 4 months ago #144131 by tpartner
I don't think that any existing features will accomplish this.

Regarding the JavaScript approach...

1) Place several long-text questions in the same group directly after the existing long-text question.

2) Add the following script to the existing long-text question - adjust "snapShotInterval" as necessary. It will hide the new long-text questions and sequentially load them with the value of the visible long-text at the prescribed interval.
Code:
<script type="text/javascript" charset="utf-8">  
  $(document).ready(function() {
 
    // Identify the questions
    var thisQuestion = $('#question{QID}');
    var hiddenQuestions = $(thisQuestion).nextAll('.text-long');
    var textArea1 = $('textarea.form-control', thisQuestion);
 
    // Hide the hidden questions
    $(hiddenQuestions).hide();
 
    // Set the timer interval (in milliseconds)
    var snapShotInterval = 60000; 
 
    // Start the timer
    var snapShotTimer = setInterval(snapShot, snapShotInterval);
    function snapShot() {
      // Find all empty hidden textareas
      var nextTextArea = $('textarea.form-control', hiddenQuestions).filter(function(e) {
        return $(this).val() === '';
      });
      // Load the value of the first textarea into the first empty hidden textarea
      if(nextTextArea.length > 0) {
        $(nextTextArea).first().val($(textArea1).val());
      }
      // Abort the timer when there are no more hidden textareas
      else {
        clearInterval(snapShotTimer);
      }
    }
    });
</script>

Sample survey attached:

File Attachment:

File Name: limesurvey...-2-3.lss
File Size:16 KB

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 7 years 4 months ago by tpartner.
The following user(s) said Thank You: GreenFlux
The topic has been locked.
  • GreenFlux
  • GreenFlux's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 4 months ago #144135 by GreenFlux
Thanks tpartner! I appreciate the help. I just made a small donation to LimeSurvey.

I won't have a chance to test this until next week but I'll let you know how it goes when I get to it.
The topic has been locked.
  • GreenFlux
  • GreenFlux's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 4 months ago #144267 by GreenFlux
tpartner, thank you for writing the script! It worked great and was super simple to set up. I appreciate you taking the time to write it.

Looks like I may need to learn some JavaScript now. I'm really liking this platform. I just set up my own Linux server for it.

Thanks again!
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose