Skip to content

Commit

Permalink
fixed grade render
Browse files Browse the repository at this point in the history
  • Loading branch information
amir-qayyum-khan committed Apr 4, 2018
1 parent 1cb2c26 commit 89e88be
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions edx_sga/sga.py
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,7 @@ def student_state(self):
"max_score": self.max_score(),
"upload_allowed": self.upload_allowed(submission_data=submission),
"solution": solution,
'weight': self.weight,
"base_asset_url": StaticContent.get_base_url_path_for_course_assets(self.location.course_key),
}

Expand Down
3 changes: 2 additions & 1 deletion edx_sga/tests/integration_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def test_student_view(self, fragment, render_template):
"""
Test student view renders correctly.
"""
block = self.make_one("Custom name")
block = self.make_one("Custom name", weight=12)
self.personalize(block, **self.make_student(block, 'fred'))
fragment = block.student_view()
render_template.assert_called_once()
Expand All @@ -256,6 +256,7 @@ def test_student_view(self, fragment, render_template):
self.assertEqual(student_state['upload_allowed'], True)
self.assertEqual(student_state['max_score'], 100)
self.assertEqual(student_state['graded'], None)
assert student_state['weight'] == 12
fragment.add_css.assert_called_once_with(
DummyResource("static/css/edx_sga.css"))
fragment.initialize_js.assert_called_once_with(
Expand Down

0 comments on commit 89e88be

Please sign in to comment.