Search in sources :

Example 6 with Quiz

use of com.google.samples.apps.topeka.model.quiz.Quiz in project android-topeka by googlesamples.

the class CategoryAndroidTest method getQuizzes.

private static List<Quiz> getQuizzes() {
    List<Quiz> quizzes = new ArrayList<>();
    quizzes.add(new TrueFalseQuiz("huh?", true, false));
    quizzes.add(new FillBlankQuiz("so?", "yeah", "go", "stop", false));
    return quizzes;
}
Also used : FillBlankQuiz(com.google.samples.apps.topeka.model.quiz.FillBlankQuiz) Quiz(com.google.samples.apps.topeka.model.quiz.Quiz) TrueFalseQuiz(com.google.samples.apps.topeka.model.quiz.TrueFalseQuiz) FillBlankQuiz(com.google.samples.apps.topeka.model.quiz.FillBlankQuiz) ArrayList(java.util.ArrayList) TrueFalseQuiz(com.google.samples.apps.topeka.model.quiz.TrueFalseQuiz)

Example 7 with Quiz

use of com.google.samples.apps.topeka.model.quiz.Quiz in project android-topeka by googlesamples.

the class BaseQuizActivityTest method testCategory.

/**
     * End to end test for the given category.
     */
protected void testCategory() {
    final Category category = getCurrentCategory();
    onView(withId(R.id.fab_quiz)).perform(click());
    for (Quiz quiz : category.getQuizzes()) {
        SolveQuizUtil.solveQuiz(quiz);
        onView(allOf(withId(R.id.submitAnswer), isDisplayed())).check(matches(isDisplayed())).perform(click());
    }
}
Also used : Category(com.google.samples.apps.topeka.model.Category) Quiz(com.google.samples.apps.topeka.model.quiz.Quiz)

Example 8 with Quiz

use of com.google.samples.apps.topeka.model.quiz.Quiz in project android-topeka by googlesamples.

the class QuizAdapter method getView.

@Override
public View getView(int position, View convertView, ViewGroup parent) {
    final Quiz quiz = getItem(position);
    if (convertView instanceof AbsQuizView) {
        if (((AbsQuizView) convertView).getQuiz().equals(quiz)) {
            return convertView;
        }
    }
    convertView = getViewInternal(quiz);
    return convertView;
}
Also used : AlphaPickerQuiz(com.google.samples.apps.topeka.model.quiz.AlphaPickerQuiz) Quiz(com.google.samples.apps.topeka.model.quiz.Quiz) MultiSelectQuiz(com.google.samples.apps.topeka.model.quiz.MultiSelectQuiz) FillTwoBlanksQuiz(com.google.samples.apps.topeka.model.quiz.FillTwoBlanksQuiz) FillBlankQuiz(com.google.samples.apps.topeka.model.quiz.FillBlankQuiz) TrueFalseQuiz(com.google.samples.apps.topeka.model.quiz.TrueFalseQuiz) SelectItemQuiz(com.google.samples.apps.topeka.model.quiz.SelectItemQuiz) ToggleTranslateQuiz(com.google.samples.apps.topeka.model.quiz.ToggleTranslateQuiz) PickerQuiz(com.google.samples.apps.topeka.model.quiz.PickerQuiz) FourQuarterQuiz(com.google.samples.apps.topeka.model.quiz.FourQuarterQuiz) AbsQuizView(com.google.samples.apps.topeka.widget.quiz.AbsQuizView)

Aggregations

Quiz (com.google.samples.apps.topeka.model.quiz.Quiz)8 FillBlankQuiz (com.google.samples.apps.topeka.model.quiz.FillBlankQuiz)6 TrueFalseQuiz (com.google.samples.apps.topeka.model.quiz.TrueFalseQuiz)6 AlphaPickerQuiz (com.google.samples.apps.topeka.model.quiz.AlphaPickerQuiz)5 FillTwoBlanksQuiz (com.google.samples.apps.topeka.model.quiz.FillTwoBlanksQuiz)5 FourQuarterQuiz (com.google.samples.apps.topeka.model.quiz.FourQuarterQuiz)5 MultiSelectQuiz (com.google.samples.apps.topeka.model.quiz.MultiSelectQuiz)5 PickerQuiz (com.google.samples.apps.topeka.model.quiz.PickerQuiz)5 SelectItemQuiz (com.google.samples.apps.topeka.model.quiz.SelectItemQuiz)5 ToggleTranslateQuiz (com.google.samples.apps.topeka.model.quiz.ToggleTranslateQuiz)5 ContentValues (android.content.ContentValues)2 Category (com.google.samples.apps.topeka.model.Category)2 ArrayList (java.util.ArrayList)2 Cursor (android.database.Cursor)1 SQLiteDatabase (android.database.sqlite.SQLiteDatabase)1 Theme (com.google.samples.apps.topeka.model.Theme)1 AbsQuizView (com.google.samples.apps.topeka.widget.quiz.AbsQuizView)1