Exemple #1
0
 public static Quiz test2() {
   Quiz quiz = new Quiz();
   quiz.setName("This has responses");
   Response r1 = new Response(new Displayable[] {new Text("Great job!"), new Video("1.mpg")});
   Response r2 =
       new Response(
           new Displayable[] {
             new Text("Not quite right"), new Video("2.mpg"),
           });
   /*
   QuestionContainer qc = new QuestionContainer(
   	new Displayable[] {
   		new Text("Fill in the following code"),
   		new FillIn(1, 1, 1),
   		new Text("class A "),
   		new FillIn(2, 1, 1, "{"),
   		new Text("\n  "),
   		new FillIn(3, 1, 1, "private"),
   		new Text(" int x;\n  "),
   		new FillIn(4, 1, 1, "public"),
   		new FillIn(5, 1, 1, "A"),
   		new Text("() {\n"),
   		new Text("  x = 2;\n}\n")
   	}
   );
   quiz.addQuestionContainer(qc);
   */
   return quiz;
 }
Exemple #2
0
 // Standard Choice with multipledropdown, multiple radio and multianswers
 public static Quiz test4() {
   Quiz quiz = new Quiz();
   quiz.setName("Multiple- Quiz");
   QuestionContainer qc =
       new QuestionContainer(
           new Displayable[] {
             new Text("Can all birds fly ?"),
             new MultiChoiceDropdown(1, 5, "Poll"),
             new Text("What is the complexity of BubbleSort ?"),
             new MultiChoiceDropdown(1, 5, "Complexity", 2),
             new Text("What is the complexity of QuickSort?"),
             new MultiChoiceRadio(1, 5, "Complexity"),
             new Text("What are the colors of an apple ?"),
             new MultiAnswer(1, 5, "Colors", new int[] {2, 3}),
             new Text("Name the insects:"),
             new MultiAnswer(1, 5, "Insects", new int[] {3, 4, 5})
           });
   quiz.addQuestionContainer(qc);
   return quiz;
 }
Exemple #3
0
 public static Quiz test3() {
   Quiz quiz = new Quiz();
   quiz.setName("Multimedia Quiz");
   QuestionContainer qc =
       new QuestionContainer(
           new Displayable[] {
             new Video("video1.mp4", 480, 360, "video/mp4"),
             new Text("What is this video about ?"),
             new MultiChoiceDropdown(
                 4,
                 5,
                 new Answer[] {new Answer("Train"), new Answer("Cable Car"), new Answer("Bus")}),
             new Audio("audio1.mp3", "audio/mpeg"),
             new Text("What animal sounds like this ?"),
             new MultiChoiceDropdown(
                 4, 5, new Answer[] {new Answer("Cat"), new Answer("Dog"), new Answer("Horse")})
           });
   quiz.addQuestionContainer(qc);
   return quiz;
 }
Exemple #4
0
  public static Quiz test1() {
    Quiz quiz = new Quiz();
    quiz.setId(1);
    quiz.setName("Animals");
    // for multiChoiceDropDown
    QuestionContainer qc =
        new QuestionContainer(
            new Displayable[] {
              new Text("What is a dinosaur?"),
              new MultiChoiceDropdown(
                  1,
                  1,
                  new Answer[] {
                    new Answer("T-Rex", true), new Answer("Shark"), new Answer("mouse")
                  })
            });
    quiz.addQuestionContainer(qc);

    // for Equation and Fillin, no WarningPattern
    Var x = new Var("x", 0, 99, 1);
    Var y = new Var("y", 0, 99, 1);
    HashMap<String, Var> map = new HashMap<String, Var>();
    map.put("x", x);
    map.put("y", y);
    Equation eq = new Equation("x+y", map);

    qc =
        new QuestionContainer(
            new Displayable[] {new Text("What is "), eq, new Text("?"), new FillIn(3, 1, 1)});
    quiz.addQuestionContainer(qc);

    // for Equation and Fillin, with WarningPattern
    Var x1 = new Var("x1", 0, 99, 1);
    Var y1 = new Var("y1", 0, 99, 1);
    HashMap<String, Var> map1 = new HashMap<String, Var>();
    map.put("x1", x1);
    map.put("y1", y1);
    Equation eq1 = new Equation("x1+y1", map);

    qc =
        new QuestionContainer(
            new Displayable[] {
              new Text("What is "),
              eq1,
              new Text("?"),
              new FillIn(40, 1, 1, null, new NumberWarningPattern(3), null, null)
            });
    quiz.addQuestionContainer(qc);

    qc =
        new QuestionContainer(
            new Displayable[] {
              new Video("1.mpg"),
              new Text("Describe the main character in the video in 200 words or less"),
              new Essay()
            });
    quiz.addQuestionContainer(qc);

    qc =
        new QuestionContainer(
            new Displayable[] {
              new Text("Listen to the audio clip and write down the words"),
              new Audio("1.mp3"),
              new FillIn(5, 1, 1)
            });
    quiz.addQuestionContainer(qc);

    // create two random 3x3 matrices filled with integers [-3..3]
    Matrix m1 = new Matrix(3, 3, -3, 3);
    Matrix m2 = new Matrix(3, 3, -3, 3);
    // create a 3x3 matrix worth 1 point, level 1
    MatrixQuestion m3 = new MatrixQuestion(1, 1, 3, 3);
    quiz.addQuestionContainer(
        qc =
            new QuestionContainer(
                new Displayable[] {
                  new Text("Solve the matrix addition"), m1, new Text("+"), m2, m3
                }));

    return quiz;
  }