Esempio n. 1
0
    def test_one_group_problem(self):
        """
        Verify that grade export works when only the Group A user
        partition receives a problem.  We expect to see a column for
        the homework where student_a's entry includes their grade, and
        student b's entry shows a 0.
        """
        problem_a_url = 'problem_a_url'
        self.define_option_problem(problem_a_url, parent=self.vertical_a)

        self.submit_student_answer(self.student_a.username, problem_a_url, [OPTION_1, OPTION_1])

        with patch('lms.djangoapps.instructor_task.tasks_helper._get_current_task'):
            result = upload_grades_csv(None, None, self.course.id, None, 'graded')
            self.verify_csv_task_success(result)
            self.verify_grades_in_csv(
                [
                    {
                        self.student_a: {
                            u'Grade': '1.0',
                            u'Homework': '1.0',
                        },
                    },
                    {
                        self.student_b: {
                            u'Grade': '0.0',
                            u'Homework': u'Not Available',
                        }
                    },
                ],
                ignore_other_columns=True
            )
Esempio n. 2
0
    def test_one_group_problem(self):
        """
        Verify that grade export works when only the Group A user
        partition receives a problem.  We expect to see a column for
        the homework where student_a's entry includes their grade, and
        student b's entry shows a 0.
        """
        problem_a_url = 'problem_a_url'
        self.define_option_problem(problem_a_url, parent=self.vertical_a)

        self.submit_student_answer(self.student_a.username, problem_a_url,
                                   [OPTION_1, OPTION_1])

        with patch(
                'lms.djangoapps.instructor_task.tasks_helper._get_current_task'
        ):
            result = upload_grades_csv(None, None, self.course.id, None,
                                       'graded')
            self.verify_csv_task_success(result)
            self.verify_grades_in_csv([{
                self.student_a: {
                    'grade': '1.0',
                    'HW': '1.0'
                }
            }, {
                self.student_b: {
                    'grade': '0.0',
                    'HW': '0.0'
                }
            }],
                                      ignore_other_columns=True)
Esempio n. 3
0
    def test_both_groups_problems(self):
        """
        Verify that grade export works when each user partition
        receives (different) problems.  Each user's grade on their
        particular problem should show up in the grade report.
        """
        problem_a_url = 'problem_a_url'
        problem_b_url = 'problem_b_url'
        self.define_option_problem(problem_a_url, parent=self.vertical_a)
        self.define_option_problem(problem_b_url, parent=self.vertical_b)
        # student A will get 100%, student B will get 50% because
        # OPTION_1 is the correct option, and OPTION_2 is the
        # incorrect option
        self.submit_student_answer(self.student_a.username, problem_a_url, [OPTION_1, OPTION_1])
        self.submit_student_answer(self.student_b.username, problem_b_url, [OPTION_1, OPTION_2])

        with patch('lms.djangoapps.instructor_task.tasks_helper._get_current_task'):
            result = upload_grades_csv(None, None, self.course.id, None, 'graded')
            self.verify_csv_task_success(result)
            self.verify_grades_in_csv(
                [
                    {self.student_a: {'grade': '1.0', 'HW': '1.0'}},
                    {self.student_b: {'grade': '0.5', 'HW': '0.5'}}
                ],
                ignore_other_columns=True
            )
Esempio n. 4
0
    def test_both_groups_problems(self):
        """
        Verify that grade export works when each user partition
        receives (different) problems.  Each user's grade on their
        particular problem should show up in the grade report.
        """
        problem_a_url = 'problem_a_url'
        problem_b_url = 'problem_b_url'
        self.define_option_problem(problem_a_url, parent=self.vertical_a)
        self.define_option_problem(problem_b_url, parent=self.vertical_b)
        # student A will get 100%, student B will get 50% because
        # OPTION_1 is the correct option, and OPTION_2 is the
        # incorrect option
        self.submit_student_answer(self.student_a.username, problem_a_url,
                                   [OPTION_1, OPTION_1])
        self.submit_student_answer(self.student_b.username, problem_b_url,
                                   [OPTION_1, OPTION_2])

        with patch(
                'lms.djangoapps.instructor_task.tasks_helper._get_current_task'
        ):
            result = upload_grades_csv(None, None, self.course.id, None,
                                       'graded')
            self.verify_csv_task_success(result)
            self.verify_grades_in_csv(
                [
                    {
                        self.student_a: {
                            u'Grade': '1.0',
                            u'Homework': '1.0',
                        }
                    },
                    {
                        self.student_b: {
                            u'Grade': '0.5',
                            u'Homework': '0.5',
                        }
                    },
                ],
                ignore_other_columns=True,
            )