public class Task
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected double |
attemptPercentage
the attemtp percentage
|
protected java.lang.String |
description
description of the task
|
protected java.lang.String[] |
expectedAnswers
answers in the tasl
|
protected java.lang.String[] |
givenAnswers
the submitted answers
|
protected double |
minPassPercentage
the inimum pass percentage, 100.0 = 100%
|
protected int |
numOfAttempts
the number of attempts needed
|
protected java.lang.String[] |
questions
questions in the task
|
protected java.lang.String |
title
title of the task
|
protected Timer |
tracker
the time tracker
|
Constructor and Description |
---|
Task(java.lang.String title,
java.lang.String description,
java.lang.String[] questions,
java.lang.String[] expectedAnswers,
double minPassPercentage)
Constructs the task object.
|
Modifier and Type | Method and Description |
---|---|
double |
getAttemptPercentage()
Gets the attempt percentage.
|
java.lang.String |
getDescription()
Gets the description of the task.
|
double |
getMinPassPercentage()
Gets the minimum pass percentage for the quiz.
|
int |
getNumOfAttempts()
Gets the number of attempts.
|
java.lang.String[] |
getQuestions()
Gets the questions in the quiz.
|
int |
getTime()
Gets the time elapsed since the start.
|
java.lang.String |
getTitle()
Gets the title of the task.
|
void |
start()
Starts the timer for this task.
|
boolean |
submit(java.lang.String[] givenAnswers)
Checks the answers for errors.
|
protected java.lang.String title
protected java.lang.String description
protected java.lang.String[] questions
protected java.lang.String[] expectedAnswers
protected java.lang.String[] givenAnswers
protected double minPassPercentage
protected double attemptPercentage
protected int numOfAttempts
protected Timer tracker
public Task(java.lang.String title, java.lang.String description, java.lang.String[] questions, java.lang.String[] expectedAnswers, double minPassPercentage)
title
- The title of the task.description
- The description of the task.questions
- The questions needed to be answered for
this task.expectedAnswers
- The expected answers that are required.minPassPercentage
- The minimum pass percentage for the
questions.public java.lang.String getTitle()
public double getAttemptPercentage()
public int getNumOfAttempts()
public java.lang.String getDescription()
public java.lang.String[] getQuestions()
public double getMinPassPercentage()
public void start()
public boolean submit(java.lang.String[] givenAnswers)
givenAnswers
- The given answers to checkpublic int getTime()