'Tests the internals of get_score. In keeping with the ScorableXBlock spec,
Capa modules store their score independently of the LCP internals, so it must
be explicitly updated.'

def test_get_score(self):

    student_answers = {'1_2_1': 'abcd'}
    correct_map = CorrectMap(answer_id='1_2_1', correctness='correct', npoints=0.9)
    module = CapaFactory.create(correct=True, override_get_score=False)
    module.lcp.correct_map = correct_map
    module.lcp.student_answers = student_answers
    self.assertEqual(module.get_score().raw_earned, 0.0)
    module.set_score(module.score_from_lcp())
    self.assertEqual(module.get_score().raw_earned, 0.9)
    other_correct_map = CorrectMap(answer_id='1_2_1', correctness='incorrect', npoints=0.1)
    other_module = CapaFactory.create(correct=False, override_get_score=False)
    other_module.lcp.correct_map = other_correct_map
    other_module.lcp.student_answers = student_answers
    self.assertEqual(other_module.get_score().raw_earned, 0.0)
    other_module.set_score(other_module.score_from_lcp())
    self.assertEqual(other_module.get_score().raw_earned, 0.1)
