net.neurowork.mobile.android.fw.levels.impl
Class Results

java.lang.Object
  extended by net.neurowork.mobile.android.fw.levels.impl.Results

public class Results
extends java.lang.Object

Class for save and show quiz results.

Author:
neurowork

Constructor Summary
Results()
          Constructor for default penalty Results objects
Results(double penalty)
          Constructor
 
Method Summary
 float[] getResults()
          Return results of your quiz.
 float getScore()
          Return the final score based on the correct or incorrect questions and their weight and penalties.
 int getTotalQuestions()
          Return how many questions the Results class have.
 int getTotalWeight()
          Return the total weight of all quiz questions.
 void setAnswer(int weight, boolean correct)
          Set the result of a quiz answer
 void setTotalWeight(int totalWeight)
          Set the total weight of your quiz for calculate the correct results.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Results

public Results()
Constructor for default penalty Results objects


Results

public Results(double penalty)
Constructor

Parameters:
penalty - Penalty percentage. From 0 to 1. Default value = 0.25
Method Detail

setAnswer

public void setAnswer(int weight,
                      boolean correct)
Set the result of a quiz answer

Parameters:
weight - Weight of the quiz answer
correct - If the answer was correct or incorrect

getTotalQuestions

public int getTotalQuestions()
Return how many questions the Results class have.

Returns:
Total number of questions

setTotalWeight

public void setTotalWeight(int totalWeight)
Set the total weight of your quiz for calculate the correct results. You should call this method before call getResults() for receiving a correct result.

Parameters:
totalQuestions -

getResults

public float[] getResults()
Return results of your quiz. You should call this method after finish your quiz. If you call getResults() without setting the total question number, you will receive the average supposing the total questions number is the total questions answered.

Returns:
A four components vector with results. The first component is the final score based on the correct or incorrect questions and their weight and penalties. The second component is the total Weight. The third component is the number of correct answers. And the fourth component is is the number of incorrect answers

getTotalWeight

public int getTotalWeight()
Return the total weight of all quiz questions.

Returns:

getScore

public float getScore()
Return the final score based on the correct or incorrect questions and their weight and penalties.

Returns: