diff --git a/common/lib/xmodule/xmodule/crowdsource_hinter.py b/common/lib/xmodule/xmodule/crowdsource_hinter.py index 664cf85f1a..8a238a1779 100644 --- a/common/lib/xmodule/xmodule/crowdsource_hinter.py +++ b/common/lib/xmodule/xmodule/crowdsource_hinter.py @@ -203,7 +203,7 @@ class CrowdsourceHinterModule(CrowdsourceHinterFields, XModule): if answer in self.hints: # Go through each hint, and add to index_to_hints for hint_id in hints_offered: - if hint_id is None: + if hint_id is not None: try: index_to_hints[i].append((self.hints[answer][str(hint_id)][0], hint_id)) except KeyError: diff --git a/common/lib/xmodule/xmodule/tests/test_crowdsource_hinter.py b/common/lib/xmodule/xmodule/tests/test_crowdsource_hinter.py index 31614c4849..c12fb1f160 100644 --- a/common/lib/xmodule/xmodule/tests/test_crowdsource_hinter.py +++ b/common/lib/xmodule/xmodule/tests/test_crowdsource_hinter.py @@ -207,6 +207,7 @@ class CrowdsourceHinterTest(unittest.TestCase): ) json_in = {'problem_name': '42.5'} out = m.get_feedback(json_in) + print out['index_to_hints'] self.assertTrue(len(out['index_to_hints'][0])==2) diff --git a/lms/djangoapps/instructor/tests/test_hint_manager.py b/lms/djangoapps/instructor/tests/test_hint_manager.py index 44e676dd83..1da83dcc43 100644 --- a/lms/djangoapps/instructor/tests/test_hint_manager.py +++ b/lms/djangoapps/instructor/tests/test_hint_manager.py @@ -50,13 +50,13 @@ class HintManagerTest(ModuleStoreTestCase): Set up mako middleware, which is necessary for template rendering to happen. """ course = CourseFactory.create(org='Me', number='19.002', display_name='test_course') - # mitxmako.middleware.MakoMiddleware() def test_student_block(self): """ Makes sure that students cannot see the hint management view. """ + nose.tools.set_trace() c = Client() user = UserFactory.create(username='robot', email='robot@edx.org', password='test') c.login(username='robot', password='test') diff --git a/lms/envs/test.py b/lms/envs/test.py index e9b683487e..d335fcd600 100644 --- a/lms/envs/test.py +++ b/lms/envs/test.py @@ -27,6 +27,8 @@ MITX_FEATURES['ENABLE_DISCUSSION_SERVICE'] = False MITX_FEATURES['ENABLE_SERVICE_STATUS'] = True +MITX_FEATURES['ENABLE_HINTER_INSTRUCTOR_VIEW'] = True + # Need wiki for courseware views to work. TODO (vshnayder): shouldn't need it. WIKI_ENABLED = True diff --git a/lms/templates/courseware/hint_manager.html b/lms/templates/courseware/hint_manager.html index 394792f892..ebd7091a09 100644 --- a/lms/templates/courseware/hint_manager.html +++ b/lms/templates/courseware/hint_manager.html @@ -15,7 +15,7 @@ function setup() { field = $("#field-label").html() changed_votes = [] - $(".votes").live('input', function() { + $(".votes").on('input', function() { changed_votes.push($(this)) }); @@ -43,9 +43,9 @@ 'field': field} for (var i=0; i