Skip navigation
Costas_B
Currently Being Moderated

Use values of field members from different movies

May 23, 2012 6:39 AM

Hi all,

 

i'm using a different movie in each exercise i'm creating, e.g. exer1.dir, exer2.dir etc etc. I'm putting the same global variable for the students grade in each movie to a field member e.g. field member -> score1 for movie exer1.dir ,  field member -> score 2 for movie exer2.dir etc .

 

How can i gather all the values from the field members in each movie and put them in a new field member that will contain all these values?

 

 

Thank you in advance,

 

Costas--

 
Replies
  • Currently Being Moderated
    May 23, 2012 6:53 AM   in reply to Costas_B

    You could use setPref to store the values locally, and getPref to retrieve them.

     
    |
    Mark as:
  • Currently Being Moderated
    May 23, 2012 1:35 PM   in reply to Costas_B

    You could use a (single) global property list:

    -- #movie script (in the first movie)

    global gScores

     

    on prepareMovie

      if voidP(gScores) then gScores = [:]

    end

     

    -- when you need to store a value

    global gScores

     

    --... (within some handler definition)

    gScores["score1"] = 50

    --... etc.

     
    |
    Mark as:
  • Currently Being Moderated
    May 25, 2012 6:21 AM   in reply to Costas_B

    It might be easier to use a linear list instead of a property list.

     

    global gScores

     

    on prepareMovie

      if voidP(gScores) then gScores = []

    end

    --------------------------------------------

     

    Later.....

     

     

    gScores[1] = 50

    gScores[2] = 30

    gScores[3] = 80

    gScores[4] = 62

     

     

    Output scores.....

     

    repeat with Cnt = 1 to gScores.count

       put "Score " & Cnt & " = " & gScores[Cnt]

    end repeat

     
    |
    Mark as:
  • Currently Being Moderated
    May 25, 2012 7:38 PM   in reply to Costas_B

    q: the number 50 in what is referring? The grade of the student?

    Yes ...

     

    Also ,at the last page where i want all the grades from all exercises how shall i retrieve the values of "score1", "score2"....etc ? Calling gScores["score1"]..etc ?

    ... and yes

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points