Commit 63022831 by kimth

Drop unnecessary .keys()

parent b4b8f6bc
...@@ -298,7 +298,7 @@ class CodeResponseTest(unittest.TestCase): ...@@ -298,7 +298,7 @@ class CodeResponseTest(unittest.TestCase):
with open(problem_file) as input_file: with open(problem_file) as input_file:
test_lcp = lcp.LoncapaProblem(input_file.read(), '1', system=i4xs) test_lcp = lcp.LoncapaProblem(input_file.read(), '1', system=i4xs)
answer_ids = sorted(test_lcp.get_question_answers().keys()) answer_ids = sorted(test_lcp.get_question_answers())
num_answers = len(answer_ids) num_answers = len(answer_ids)
# CodeResponse requires internal CorrectMap state. Build it now in the unqueued state # CodeResponse requires internal CorrectMap state. Build it now in the unqueued state
...@@ -326,7 +326,7 @@ class CodeResponseTest(unittest.TestCase): ...@@ -326,7 +326,7 @@ class CodeResponseTest(unittest.TestCase):
with open(problem_file) as input_file: with open(problem_file) as input_file:
test_lcp = lcp.LoncapaProblem(input_file.read(), '1', system=i4xs) test_lcp = lcp.LoncapaProblem(input_file.read(), '1', system=i4xs)
answer_ids = sorted(test_lcp.get_question_answers().keys()) answer_ids = sorted(test_lcp.get_question_answers())
num_answers = len(answer_ids) num_answers = len(answer_ids)
# CodeResponse requires internal CorrectMap state. Build it now in the queued state # CodeResponse requires internal CorrectMap state. Build it now in the queued state
...@@ -383,7 +383,7 @@ class CodeResponseTest(unittest.TestCase): ...@@ -383,7 +383,7 @@ class CodeResponseTest(unittest.TestCase):
with open(problem_file) as input_file: with open(problem_file) as input_file:
test_lcp = lcp.LoncapaProblem(input_file.read(), '1', system=i4xs) test_lcp = lcp.LoncapaProblem(input_file.read(), '1', system=i4xs)
answer_ids = sorted(test_lcp.get_question_answers().keys()) answer_ids = sorted(test_lcp.get_question_answers())
num_answers = len(answer_ids) num_answers = len(answer_ids)
# CodeResponse requires internal CorrectMap state. Build it now in the unqueued state # CodeResponse requires internal CorrectMap state. Build it now in the unqueued state
...@@ -396,7 +396,6 @@ class CodeResponseTest(unittest.TestCase): ...@@ -396,7 +396,6 @@ class CodeResponseTest(unittest.TestCase):
# CodeResponse requires internal CorrectMap state. Build it now in the queued state # CodeResponse requires internal CorrectMap state. Build it now in the queued state
cmap = CorrectMap() cmap = CorrectMap()
answer_ids = sorted(test_lcp.get_question_answers().keys())
num_answers = len(answer_ids) num_answers = len(answer_ids)
for i in range(num_answers): for i in range(num_answers):
queuekey = 1000 + i queuekey = 1000 + i
......
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