diff --git a/client/protocols/grading.py b/client/protocols/grading.py index e0f54773..fbcce0b6 100644 --- a/client/protocols/grading.py +++ b/client/protocols/grading.py @@ -42,28 +42,15 @@ def grade(questions, messages, env=None, verbose=True): locked = 0 analytics = {} - # Check if analytics info is in messages. - if 'analytics' in messages: - started = messages['analytics']['started'] - else: - started = None # The environment in which to run the tests. for test in questions: - # run test if the question is not detected, or question detected and started - if (started is None - or test.name not in started - or started[test.name]): - - log.info('Running tests for {}'.format(test.name)) - results = test.run(env) - passed += results['passed'] - failed += results['failed'] - locked += results['locked'] - analytics[test.name] = results - else: - print('It looks like you haven\'t started {}. Skipping the tests.'.format(test.name)) - print() + log.info('Running tests for {}'.format(test.name)) + results = test.run(env) + passed += results['passed'] + failed += results['failed'] + locked += results['locked'] + analytics[test.name] = results if not verbose and (failed > 0 or locked > 0): # Stop at the first failed test diff --git a/tests/protocols/grading_test.py b/tests/protocols/grading_test.py index 1831319e..2a22fbd5 100644 --- a/tests/protocols/grading_test.py +++ b/tests/protocols/grading_test.py @@ -40,7 +40,7 @@ def testOnInteract_withTests(self): self.assignment.specified_tests = [test] self.assertIsInstance(self.callRun(), dict) - def testRun_skipTestsWhenQuestionNotStarted(self): + def testRun_AfterAnalytics(self): test1 = mock.Mock(spec=models.Test) test1.run.return_value = { 'passed': 1, @@ -58,17 +58,12 @@ def testRun_skipTestsWhenQuestionNotStarted(self): self.assignment.specified_tests = [test1, test2] messages = { - 'analytics': { - 'started': { - 'test1': False, - 'test2': True - } - } + 'analytics': {} } self.proto.run(messages) self.assertIn('grading', messages) results = messages['grading'] - self.assertNotIn('test1', results) + self.assertIn('test1', results) self.assertIn('test2', results)