Permalink
Browse files

Question now stores the answer submitted by the player.

  • Loading branch information...
1 parent 0b4efbe commit 859e580796ff3ae1827047dd63983a50952a6aa6 John Conomikes committed Sep 23, 2011
Showing with 2 additions and 0 deletions.
  1. +2 −0 src/html5/src/Question.js
@@ -24,6 +24,7 @@ var PNode = require('PerspectiveNode').PerspectiveNode;
// Represents a single question to be answered by the player
var Question = PNode.extend({
correctAnswer : null, // The correct response
+ answer : null, // The answer provided by the player
answeredCorrectly: null, // Stores if question has been correctly/incorrectly (null=not answered)
coneL : null, // Holds the left delimiter
coneR : null, // Holds the left delimiter
@@ -87,6 +88,7 @@ var Question = PNode.extend({
// Called when the question is answered, sets and returns the result
answerQuestion: function(ans) {
if(this.get('answeredCorrectly') == null) {
+ this.set('answer', ans);
if(this.get('correctAnswer') == ans) {
this.set('answeredCorrectly', true);
return true;

0 comments on commit 859e580

Please sign in to comment.