Monday, May 28, 2012

Text Entry / Subjective Question - Apps 4 (2)

Apart from objective question as an evaluation method, we also have subjective question to evaluate students.  This subjective question is categorized as text enty question.  In this type of question, the student will type in what they think is the right answer, and the application will respond as to whether the answer is correct or not...

Test my application by clicking in the image



 In this application, I work with 6 layers.  Actually, the number of layers used are subjective.  I'll talk more about layers in the next post.

The layers, from top to bottom:
1) stop
2) response
3) button
4) answer
5) question
6) background

1) Create a layer and name it as "background".  Format the background colour or the background shapes of the application


2) Next, create the question layer.  In this layer, put in the questions that you want to test the student. Remember, these text questions are of static text type.

3) Third, create the answer layer.  In the answer layer, create the space for input text from the user. 

    Set the properties:
    - Embed -> all
    - Auto kern -> off (untick)
    - Options : Variable -> answer (this input text is defined as answer variable)


4) Fourth, create the button layer.  We can select the button from the various button in the library

    Go to Windows --> Common Libraries --> Buttons
    (Lots of buttons to select from)

    Drag the button on to the stage.

5) Behind the button, create the action script.  Take note that the correct answer for this question is "print client".  All other answers will be taken as incorrect answer.

    The response will come out whenever the user press on the button or <Enter> button.

   on (release) { if (answer == "print client") {response = "Congratulations! Your answer is correct!";
   } else {
   response = "Incorrect. Your answer "+ answer +" is incorrect. Please try again.";
  }
  }

  on (release, keyPress "<Enter>") {
  if (answer == "print client") {response = "Congratulations! Your answer is correct!";
  } else {
  response = "Incorrect. Your answer "+ answer +" is incorrect. Please try again.";
  }
  }

6) Create the response layer.  In this response layer, just create the dynamic text that will be labeled as response below the questions.

    Set the properties:
    - Embed -> all
    - Auto kern -> off (untick)
    - Options : Variable -> response (this dynamic text is defined as response variable)



7) Lastly create the stop layer.  Just a simple action script in the first frame of this layer, that is to stop the application, to define the answer and response variable, and to initialize the answer and response variable.

  stop();
  var answer;
  var response;
  answer =""
  response =""


Test my created question application here

1 comment: