Commit 4071a57f by Felix Sun Committed by Carlos Andrés Rocha

Fixed broken tests. Made the hint manager enabled in testing environments -…

Fixed broken tests.  Made the hint manager enabled in testing environments - this lets us test the hint manager.
parent bc2cab2f
......@@ -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:
......
......@@ -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)
......
......@@ -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')
......
......@@ -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
......
......@@ -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<changed_votes.length; i++) {
data_dict[i] = [$(changed_votes[i]).parent().attr("data-problem"),
$(changed_votes[i]).parent().attr("data-answer"),
$(changed_votes[i]).parent().attr("data-pk"),
$(changed_votes[i]).val()];
$(changed_votes[i]).parent().attr("data-answer"),
$(changed_votes[i]).parent().attr("data-pk"),
$(changed_votes[i]).val()];
}
$.ajax(window.location.pathname, {
type: "POST",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment