Page 1 of 1

Getting text segments from one card field to another

Posted: Mon Aug 13, 2012 3:13 pm
by cogscipixie
I'm a beginner with only some other programming training in E-Prime (an experimental psychology software program), so bear with me.

I am presenting text in smaller segments from a larger text on a separate card called "Read." I have placed the 2 larger texts and separated their segments into individual fields, so the 2 texts have 6 segments (Mountain1, Mountain2,... and Spider1, Spider2,...Spider6). These text segments are on card "text." For card "Read", I have a handler called "readPassage SetUp" in the stack script." When they go to card "read", based on their condition (1= Mountain Text first, 2 = Spider Text first), that first text segment of that specified text should show up in the field "segment." At the bottom of the read card, there is a button "Continue Reading." The reading itself is subject self-paced, but I want to record the study time for each segment. So not only do I need to seed an index based on the number of text segments they have gone through, but I need to have the script send them to the JOL (judgments of learning) page when they are complete reading one text. Does this make sense? I mainly need assistance with learning how to seed the index for the texts and how to call up the current text procedure. Here is the current code I have for the handler:

Code: Select all

on readPassageSetUp
   global index 
   put 1 into index
   --after you seed, then call up next procedure  
   
   -- the guts of the next procedure are next:
   if currtext = 1 then 
      put "Mountain" & index into currSeg
   else 
      put "Spider" & index into currSeg
   end if
   
      put card field "currSeg" of card "text" into field "segment" of card "Read"
      repeat with i = 1 to 6
         put currSeg into field "segment"
         go to card "Read"
         record 'time'
      end repeat
      
      if index > 6 then 
         --do next thing (JOLs for this next part) SEED JOL index
         get JOL
      else
         end if
      
end readPassageSetUp