Home | History | Annotate | Download | only in quiz

Lines Matching defs:Question

25 import static com.example.android.wearable.quiz.Constants.QUESTION;
103 private PriorityQueue<Question> mFutureQuestions;
133 mFutureQuestions = new PriorityQueue<Question>(10);
212 private static class Question implements Comparable<Question> {
214 private String question;
219 public Question(String question, int questionIndex, String[] answers,
221 this.question = question;
227 public static Question fromJson(JSONObject questionObject, int questionIndex)
229 String question = questionObject.getString(JsonUtils.JSON_FIELD_QUESTION);
236 return new Question(question, questionIndex, answers, correctIndex);
240 public int compareTo(Question that) {
245 PutDataMapRequest request = PutDataMapRequest.create("/question/" + questionIndex);
247 dataMap.putString(QUESTION, question);
268 Question question = Question.fromJson(questionObject, mQuestionIndex++);
269 addQuestionDataItem(question);
270 setNewQuestionStatus(question.question);
275 * Adds a question (with answer choices) when user clicks on "Add Question."
278 // Retrieve the question and answers supplied by the user.
279 String question = questionEditText.getText().toString();
287 addQuestionDataItem(new Question(question, mQuestionIndex++, answers, correctAnswerIndex));
288 setNewQuestionStatus(question);
290 // Clear the edit boxes to let the user input a new question.
302 private void addQuestionDataItem(Question question) {
304 // Ask the question now.
305 Wearable.DataApi.putDataItem(mGoogleApiClient, question.toPutDataRequest());
308 // Enqueue the question to be asked in the future.
309 mFutureQuestions.add(question);
314 * Sets the question's status to be the default "unanswered." This will be updated when the
315 * user chooses an answer for the question on the wearable.
317 private void setNewQuestionStatus(String question) {
322 ((TextView) questionStatusElem.findViewById(R.id.question)).setText(question);
342 // Update the answered question's status.
348 // Update the deleted question's status by marking it as left blank.
360 * Updates the given question based on whether it was answered correctly or not.
361 * This involves changing the question's text color and changing the status text for it.
366 TextView questionText = (TextView) questionStatusElement.findViewById(R.id.question);
380 * Marks a question as "left blank" when its corresponding question notification is deleted.
385 TextView questionText = (TextView) questionStatusElement.findViewById(R.id.question);
396 * Asks the next enqueued question if it exists, otherwise ends the quiz.
408 // Ask next question by putting a DataItem that will be received on the wearable.
439 TextView questionText = (TextView) questionStatusElement.findViewById(R.id.question);
487 * Callback that marks a DataItem, which represents a question, as unanswered and not deleted.
500 // Ask the first question now.
508 mFutureQuestions.add(new Question(dataMap.getString(QUESTION),
521 * wearable will then remove any outstanding question notifications upon receiving this change.
556 * Removes quiz status views (i.e. the views describing the status of each question).