## Class rotation.Trial

- java.lang.Object
- - rotation.Trial

- Enclosing class:
    rotation

      public static class rotation.Trial
      extends java.lang.Object

  This class resembles one trial of the study experiment.
  See Also:
    `rotation.DesignContainer`

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `boolean` | `suffled`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `rotation.Trial()`
    `rotation.Trial(int v1, int v2, int v3, int v4)` The constructor for trial.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `checkCorrectness()` This function checks the correctness of user's answer.
    `void` | `drawShapes(java.awt.Graphics g)` Draws shapes of the trial.
    `void` | `printLog()` Log the results into debug or file according subject's number.
    `void` | `setTrialNumber(int num)` Set the trialNumber -variable of this trial which tells this trials index.
    `void` | `trialResponse()` This captures the time user went choosing the answer.
    `boolean` | `userPressedKey(int keyCode)` The user had pressed a key.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### suffled

          public boolean suffled

  - ### Constructor Detail

    - #### rotation.Trial

          public rotation.Trial()

    - #### rotation.Trial

          public rotation.Trial(int v1,
                        int v2,
                        int v3,
                        int v4)

      The constructor for trial. This takes care of calling the methods generating shapes and gathering the trials information about what's right answer and what are the rotations etc.
      Parameters:
        `v1` - . .
        `v2` - .. ..
        `v3` - ... ...
        `v4` - .... ....

  - ### Method Detail

    - #### setTrialNumber

          public void setTrialNumber(int num)

      Set the trialNumber -variable of this trial which tells this trials index.
      Parameters:
        `num` - The trial number.

    - #### printLog

          public void printLog()

      Log the results into debug or file according subject's number. Filename is made from subjectnumber. This is called after trial is done to make sure all informatin is complete. Does io exception if something went horribly wrong.

    - #### trialResponse

          public void trialResponse()

      This captures the time user went choosing the answer. This should be called right after key press.
      See Also:
        `rotation.getTestTimeMs()`, `rotation.getScreenTimeMs()`, `#trialResponse2()`

    - #### checkCorrectness

          public void checkCorrectness()

      This function checks the correctness of user's answer. This should be called after user had pressed button.

    - #### userPressedKey

          public boolean userPressedKey(int keyCode)

      The user had pressed a key. Testing if it was S or D and reacting to that.
      Parameters:
        `keyCode` - the key code user pressed
      Returns:
        if he pressed s or d return true, otherwise return false to recognize he pressed wrong button false.

    - #### drawShapes

          public void drawShapes(java.awt.Graphics g)

      Draws shapes of the trial. Ie two shapes in different angles.
      Parameters:
        `g` - Graphics to draw the stuff.