diff --git a/cms/djangoapps/contentstore/tests/test_contentstore.py b/cms/djangoapps/contentstore/tests/test_contentstore.py index e40d7c57b9..ed95d81d67 100644 --- a/cms/djangoapps/contentstore/tests/test_contentstore.py +++ b/cms/djangoapps/contentstore/tests/test_contentstore.py @@ -9,7 +9,6 @@ from tempdir import mkdtemp_clean from fs.osfs import OSFS import copy from json import loads -import traceback from datetime import timedelta from django.contrib.auth.models import User @@ -397,7 +396,7 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase): # We had a bug where orphaned draft nodes caused export to fail. This is here to cover that case. draft_store.clone_item(vertical.location, Location(['i4x', 'edX', 'full', - 'vertical', 'no_references', 'draft'])) + 'vertical', 'no_references', 'draft'])) for child in vertical.get_children(): draft_store.clone_item(child.location, child.location) @@ -478,6 +477,12 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase): for child in vertical.get_children(): self.assertTrue(getattr(child, 'is_draft', False)) + # make sure that we don't have a sequential that is in draft mode + sequential = draft_store.get_item(Location(['i4x', 'edX', 'full', + 'sequential', 'Administrivia_and_Circuit_Elements', None])) + + self.assertFalse(getattr(sequential, 'is_draft', False)) + # verify that we have the private vertical test_private_vertical = draft_store.get_item(Location(['i4x', 'edX', 'full', 'vertical', 'vertical_66', None])) diff --git a/cms/templates/settings_graders.html b/cms/templates/settings_graders.html index 86be66c950..2e98409585 100644 --- a/cms/templates/settings_graders.html +++ b/cms/templates/settings_graders.html @@ -4,20 +4,20 @@ <%namespace name='static' file='static_content.html'/> <%! -from contentstore import utils +from contentstore import utils %> <%block name="jsextra"> - + - + @@ -97,7 +97,7 @@ from contentstore import utils
  1. - + Leeway on due dates
@@ -112,13 +112,13 @@ from contentstore import utils
    - -
+ +
New Assignment Type - +
diff --git a/common/lib/capa/capa/inputtypes.py b/common/lib/capa/capa/inputtypes.py index 5a89b69136..e253b61948 100644 --- a/common/lib/capa/capa/inputtypes.py +++ b/common/lib/capa/capa/inputtypes.py @@ -668,6 +668,8 @@ class MatlabInput(CodeInput): # Check if problem has been queued self.queuename = 'matlab' self.queue_msg = '' + # this is only set if we don't have a graded response + # the graded response takes precedence if 'queue_msg' in self.input_state and self.status in ['queued', 'incomplete', 'unsubmitted']: self.queue_msg = self.input_state['queue_msg'] if 'queuestate' in self.input_state and self.input_state['queuestate'] == 'queued': @@ -712,11 +714,23 @@ class MatlabInput(CodeInput): self.input_state['queuestate'] = None self.input_state['queuekey'] = None + def button_enabled(self): + """ Return whether or not we want the 'Test Code' button visible + + Right now, we only want this button to show up when a problem has not been + checked. + """ + if self.status in ['correct', 'incorrect']: + return False + else: + return True + def _extra_context(self): ''' Set up additional context variables''' extra_context = { 'queue_len': str(self.queue_len), - 'queue_msg': self.queue_msg + 'queue_msg': self.queue_msg, + 'button_enabled': self.button_enabled(), } return extra_context @@ -766,10 +780,6 @@ class MatlabInput(CodeInput): lms_key=queuekey, queue_name=self.queuename) - # save the input state - self.input_state['queuekey'] = queuekey - self.input_state['queuestate'] = 'queued' - # construct xqueue body student_info = {'anonymous_student_id': anonymous_student_id, 'submission_time': qtime} @@ -779,6 +789,10 @@ class MatlabInput(CodeInput): (error, msg) = qinterface.send_to_queue(header=xheader, body=json.dumps(contents)) + # save the input state if successful + if error == 0: + self.input_state['queuekey'] = queuekey + self.input_state['queuestate'] = 'queued' return {'success': error == 0, 'message': msg} diff --git a/common/lib/capa/capa/templates/matlabinput.html b/common/lib/capa/capa/templates/matlabinput.html index 6c02e8e68e..69e412f43e 100644 --- a/common/lib/capa/capa/templates/matlabinput.html +++ b/common/lib/capa/capa/templates/matlabinput.html @@ -33,9 +33,11 @@ ${queue_msg|n} + % if button_enabled:
- +
+ %endif