Esempio n. 1
0
    def testShouldGiveZeroPointsOnEmptyAnswer(self):
        exercisePage = MyFirstExerciseGrader(self.driver)
        exercisePage.setText("")
        exercisePage.submit()

        self.assertEqual(exercisePage.getAllowedSubmissions(), '1 / 4')
        self.assertEqual(exercisePage.getExerciseScore(), '0 / 100')
        self.assertEqual(exercisePage.getNumberOfSubmitters(), '1')
Esempio n. 2
0
    def testShouldGiveFullPoints(self):
        exercisePage = MyFirstExerciseGrader(self.driver)
        exercisePage.setText("A+Hello")
        exercisePage.submit()

        self.assertEqual(exercisePage.getAllowedSubmissions(), '1 / 4')
        self.assertEqual(exercisePage.getExerciseScore(), '100 / 100')
        self.assertEqual(exercisePage.getNumberOfSubmitters(), '1')
    def testShouldGiveFullPoints(self):
        exercisePage = MyFirstExerciseGrader(self.driver)
        exercisePage.setText("A+Hello")
        exercisePage.submit()

        self.assertEqual(exercisePage.getAllowedSubmissions(), '1 / 4')
        self.assertEqual(exercisePage.getExerciseScore(), '100 / 100')
        self.assertEqual(exercisePage.getNumberOfSubmitters(), '1')
    def testShouldGiveZeroPointsOnEmptyAnswer(self):
        exercisePage = MyFirstExerciseGrader(self.driver)
        exercisePage.setText("")
        exercisePage.submit()

        self.assertEqual(exercisePage.getAllowedSubmissions(), '1 / 4')
        self.assertEqual(exercisePage.getExerciseScore(), '0 / 100')
        self.assertEqual(exercisePage.getNumberOfSubmitters(), '1')
Esempio n. 5
0
    def testShouldRejectAnswerIfMaxSubmissionsReached(self):
        i = 0
        while (i <= 4):
            exercisePage = MyFirstExerciseGrader(self.driver)
            exercisePage.submit()
            i += 1

        self.assertEqual(exercisePage.getAllowedSubmissions(), "4 / 4")
        self.assertEqual(exercisePage.getExerciseScore(), '0 / 100')
        self.assertEqual(exercisePage.getNumberOfSubmitters(), '1')
    def testShouldRejectAnswerIfMaxSubmissionsReached(self):
        i = 0
        while (i <= 4):
            exercisePage = MyFirstExerciseGrader(self.driver)
            exercisePage.submit()
            i += 1

        self.assertEqual(exercisePage.getAllowedSubmissions(), "4 / 4")
        self.assertEqual(exercisePage.getExerciseScore(), '0 / 100')
        self.assertEqual(exercisePage.getNumberOfSubmitters(), '1')
Esempio n. 7
0
    def testShouldGiveZeroPointsOnTwoSubsequentWrongAnswers(self):
        exercisePage = MyFirstExerciseGrader(self.driver)
        exercisePage.setText("+A olleH")
        exercisePage.submit()
        exercisePage = MyFirstExerciseGrader(self.driver)
        exercisePage.setText("Hell+A")
        exercisePage.submit()

        self.assertEqual(exercisePage.getAllowedSubmissions(), '2 / 4')
        self.assertEqual(exercisePage.getExerciseScore(), '0 / 100')
        self.assertEqual(exercisePage.getNumberOfSubmitters(), '1')
    def testShouldGiveZeroPointsOnTwoSubsequentWrongAnswers(self):
        exercisePage = MyFirstExerciseGrader(self.driver)
        exercisePage.setText("+A olleH")
        exercisePage.submit()
        exercisePage = MyFirstExerciseGrader(self.driver)
        exercisePage.setText("Hell+A")
        exercisePage.submit()

        self.assertEqual(exercisePage.getAllowedSubmissions(), '2 / 4')
        self.assertEqual(exercisePage.getExerciseScore(), '0 / 100')
        self.assertEqual(exercisePage.getNumberOfSubmitters(), '1')