Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Visual Basic (https://www.askmehelpdesk.com/forumdisplay.php?f=469)
-   -   Remembering Ratings (https://www.askmehelpdesk.com/showthread.php?t=399406)

  • Sep 24, 2009, 06:05 AM
    ClaireGilb
    Remembering Ratings
    Hi,

    I am trying to re-programme a VB task and I need to make the following addition:
    The task involves the use of 2 rating scales. I want the participant to make their rating on the first scale and then, once the second scale comes up (after the participant is given additional information), I want for the scale to appear with the last rating as the starting point.

    e.g..
    If this is scale 1 as it appears

    ------------------------------X---------------------------------

    and the participant mvoes the X using the keypad to here on the first rating:

    ----X-----------------------------------------------------------

    I want for whenthe next scale comes, the code not to start with the X in the centre, but instead to start at the point where the participant last rated (in the first scale)

    I am trying to measure the difference in the ratings (of happiness) before and after a certain event.
    This is how the relevant (I think!) area of the trial code is looking

    '(9)Rate result
    '
    If Me.bRateObtainedOutcome Then
    Me.iHappinessStartTime = timeGetTime
    Me.fHappinessRating = doRating(Me.m_OutcomeRating)

    Me.iHappinessRatingTime = timeGetTime


    '(11) Rate regret
    '
    If Me.bRateAfterBothOutcomes Then
    Me.iRegretStartTime = timeGetTime
    Me.fRegretRating = doRating(Me.m_FinalRating)
    Me.iRegretRatingTime = timeGetTime
    End If

    Can anyone help me! I gather that it's something to do with creating a "remember" clause after the first rating or something like that...


    Claire
  • Sep 24, 2009, 07:49 AM
    Perito
    Quote:

    I want the participant to make their rating on the first scale and then, once the second scale comes up (after the participant is given additional information), I want the scale to appear with the last rating as the starting point.

    e.g..
    If this is scale 1 as it appears
    ------------------------------X---------------------------------

    and the participant moves the X using the keypad to here on the first rating:

    ----X-----------------------------------------------------------

    I want for when the next scale comes, the code not to start with the X in the centre, but instead to start at the point where the participant last rated (in the first scale)

    I am trying to measure the difference in the ratings (of happiness) before and after a certain event.

    I'm not sure where you're getting lost. It sounds very simple. You create a global variable (or a static local variable) and place the value in that variable. Then, when you display the second scale, you take the value from the global variable and use it.

    Private SavedHappiness as integer = 0

    '(9)Rate result
    '
    If Me.bRateObtainedOutcome Then
    Me.iHappinessStartTime = timeGetTime

    Me.fHappinessRating = doRating(Me.m_OutcomeRating)
    SavedHappiness = me.fHappinessRating ' save the happiness rating for later use.

    Me.iHappinessRatingTime = timeGetTime

    '(11) Rate regret
    '
    If Me.bRateAfterBothOutcomes Then
    Me.iRegretStartTime = timeGetTime

    ' I'm not sure what all this means. The final rating could be set to the saved happiness if this is what is called for the user to perform the rating.
    Me.m_FinalRating = SavedHappiness

    Me.fRegretRating = doRating(Me.m_FinalRating)
    Me.iRegretRatingTime = timeGetTime
    End If
  • Sep 24, 2009, 08:50 AM
    ClaireGilb
    thanks! But I'm still running into difficulty- something to do with integer vs double settings in the code I think.

    Private SavedHappiness As Integer = 0


    '(9)Rate result
    '

    If Me.bRateObtainedOutcome Then
    Me.iHappinessStartTime = timeGetTime
    Me.fHappinessRating = doRating(Me.m_OutcomeRating)
    SavedHappiness = CInt(Me.fHappinessRating) 'I had to convert to Integer to get the error message gone)
    Me.iHappinessRatingTime = timeGetTime
    '

    '(11) Rate regret

    If Me.bRateAfterBothOutcomes Then
    Me.iRegretStartTime = timeGetTime
    Me.m_FinalRating = SavedHappiness

    'error message here reads: Value of type 'Integer' cannot be converted to 'GameTask.Trial.Rating'.

    Me.fRegretRating = doRating(Me.m_FinalRating)
    Me.iRegretRatingTime = timeGetTime
    End If

    I've tried doing it all in double, but the same thing keeps happening- except it says 'double' in the above error instead of integer

    I am a VB novice- in case not already obvious! Any help is MUCH appreciated!

    Claire
  • Sep 25, 2009, 05:24 AM
    Perito

    What values does "GameTask.Trial.Rating" hold? I guess what I'm asking is what is its type. Until I understand that, I can't help you with converting something to that.

    You can declare SavedHappiness as type "double". Then you would use "CDBL()" to convert Me.fHappinessRating to SavedHappiness.

    Types are sometimes confusing to novices, but they're very important to programmers.
  • Sep 25, 2009, 06:10 AM
    ClaireGilb

    I just got it to work!
    Thanks a million for your help!

  • All times are GMT -7. The time now is 04:18 AM.