Exemplo n.º 1
0
 def test_id_to_question_dict_constructed_correctly(self):
     """Tests id_to_question dicts are constructed correctly."""
     course = self._get_sample_v15_course()
     tracker = UnitLessonCompletionTracker(course)
     assert_equals(
         tracker.get_id_to_questions_dict(),
         {
             'u.1.l.2.c.QN': {
                 'answer_counts': [0],
                 'label': 'Unit 1 Lesson 1, Question mcq_new',
                 'location': 'unit?unit=1&lesson=2',
                 'num_attempts': 0,
                 'score': 0
             },
             'u.1.l.2.c.QG.i.0': {
                 'answer_counts': [0],
                 'label': ('Unit 1 Lesson 1, Question Group question_group '
                           'Question mcq_new'),
                 'location': 'unit?unit=1&lesson=2',
                 'num_attempts': 0,
                 'score': 0
             },
             'u.1.l.2.c.QG.i.2': {
                 'answer_counts': [0],
                 'label': ('Unit 1 Lesson 1, Question Group question_group '
                           'Question mcq_new'),
                 'location': 'unit?unit=1&lesson=2',
                 'num_attempts': 0,
                 'score': 0
             }
         }
     )
     assert_equals(
         tracker.get_id_to_assessments_dict(),
         {
             's.4.c.QN2': {
                 'answer_counts': [0],
                 'label': 'New assessment, Question mcq_new',
                 'location': 'assessment?name=4',
                 'num_attempts': 0,
                 'score': 0
             },
             's.4.c.QG2.i.0': {
                 'answer_counts': [0],
                 'label': ('New assessment, Question Group question_group '
                           'Question mcq_new'),
                 'location': 'assessment?name=4',
                 'num_attempts': 0,
                 'score': 0
             },
             's.4.c.QG2.i.2': {
                 'answer_counts': [0],
                 'label': ('New assessment, Question Group question_group '
                           'Question mcq_new'),
                 'location': 'assessment?name=4',
                 'num_attempts': 0,
                 'score': 0
             }
         }
     )
Exemplo n.º 2
0
 def test_id_to_question_dict_constructed_correctly(self):
     """Tests id_to_question dicts are constructed correctly."""
     course = self._get_sample_v15_course()
     tracker = UnitLessonCompletionTracker(course)
     assert_equals(
         tracker.get_id_to_questions_dict(),
         {
             'u.1.l.2.c.QN': {
                 'answer_counts': [0],
                 'label': 'Unit 1 Lesson 1, Question mcq_new',
                 'location': 'unit?unit=1&lesson=2',
                 'num_attempts': 0,
                 'score': 0
             },
             'u.1.l.2.c.QG.i.0': {
                 'answer_counts': [0],
                 'label': ('Unit 1 Lesson 1, Question Group question_group '
                           'Question mcq_new'),
                 'location': 'unit?unit=1&lesson=2',
                 'num_attempts': 0,
                 'score': 0
             },
             'u.1.l.2.c.QG.i.2': {
                 'answer_counts': [0],
                 'label': ('Unit 1 Lesson 1, Question Group question_group '
                           'Question mcq_new'),
                 'location': 'unit?unit=1&lesson=2',
                 'num_attempts': 0,
                 'score': 0
             }
         }
     )
     assert_equals(
         tracker.get_id_to_assessments_dict(),
         {
             's.4.c.QN2': {
                 'answer_counts': [0],
                 'label': 'New assessment, Question mcq_new',
                 'location': 'assessment?name=4',
                 'num_attempts': 0,
                 'score': 0
             },
             's.4.c.QG2.i.0': {
                 'answer_counts': [0],
                 'label': ('New assessment, Question Group question_group '
                           'Question mcq_new'),
                 'location': 'assessment?name=4',
                 'num_attempts': 0,
                 'score': 0
             },
             's.4.c.QG2.i.2': {
                 'answer_counts': [0],
                 'label': ('New assessment, Question Group question_group '
                           'Question mcq_new'),
                 'location': 'assessment?name=4',
                 'num_attempts': 0,
                 'score': 0
             }
         }
     )
Exemplo n.º 3
0
    def get_student_completion_data(cls, course):
        """Retrieves student completion data for the course."""

        if GLOBAL_DEBUG:
            logging.debug('***RAM*** get_student_completion_data ' + str(course))
        completion_tracker = UnitLessonCompletionTracker(course)
        questions_dict = completion_tracker.get_id_to_questions_dict()
Exemplo n.º 4
0
    def get_student_completion_data(cls, course):
        """Retrieves student completion data for the course."""

        if GLOBAL_DEBUG:
            logging.debug('***RAM*** get_student_completion_data ' +
                          str(course))
        completion_tracker = UnitLessonCompletionTracker(course)
        questions_dict = completion_tracker.get_id_to_questions_dict()