diff --git a/.pylintrc b/.pylintrc index 9ea1e62ad4..2f2be69eb0 100644 --- a/.pylintrc +++ b/.pylintrc @@ -34,6 +34,7 @@ load-plugins= # multiple time (only on the command line, not in the configuration file where # it should appear only once). disable= +# C0301: Line too long # W0141: Used builtin function 'map' # W0142: Used * or ** magic # R0201: Method could be a function @@ -42,7 +43,7 @@ disable= # R0903: Too few public methods (1/2) # R0904: Too many public methods # R0913: Too many arguments - W0141,W0142,R0201,R0901,R0902,R0903,R0904,R0913 + C0301,W0141,W0142,R0201,R0901,R0902,R0903,R0904,R0913 [REPORTS] diff --git a/cms/static/sass/elements/_header.scss b/cms/static/sass/elements/_header.scss index e8df37f57f..b7fb381f2e 100644 --- a/cms/static/sass/elements/_header.scss +++ b/cms/static/sass/elements/_header.scss @@ -132,7 +132,7 @@ // specific elements - course nav .nav-course { - width: 335px; + width: 285px; margin-top: -($baseline/4); @include font-size(14); diff --git a/common/lib/capa/capa/inputtypes.py b/common/lib/capa/capa/inputtypes.py index 2febfbd5d2..b4e9fe1654 100644 --- a/common/lib/capa/capa/inputtypes.py +++ b/common/lib/capa/capa/inputtypes.py @@ -1140,12 +1140,13 @@ registry.register(DesignProtein2dInput) class EditAGeneInput(InputTypeBase): """ - An input type for editing a gene. Integrates with the genex java applet. + An input type for editing a gene. + Integrates with the genex GWT application. Example: - - """ + + """ template = "editageneinput.html" tags = ['editageneinput'] @@ -1155,9 +1156,7 @@ class EditAGeneInput(InputTypeBase): """ Note: width, height, and dna_sequencee are required. """ - return [Attribute('width'), - Attribute('height'), - Attribute('dna_sequence'), + return [Attribute('genex_dna_sequence'), Attribute('genex_problem_number') ] diff --git a/common/lib/capa/capa/templates/editageneinput.html b/common/lib/capa/capa/templates/editageneinput.html index 3465c62593..5da422ce12 100644 --- a/common/lib/capa/capa/templates/editageneinput.html +++ b/common/lib/capa/capa/templates/editageneinput.html @@ -13,7 +13,7 @@ % endif
- + diff --git a/common/lib/xmodule/xmodule/modulestore/xml_importer.py b/common/lib/xmodule/xmodule/modulestore/xml_importer.py index 113389d77a..e6c4bc8bc9 100644 --- a/common/lib/xmodule/xmodule/modulestore/xml_importer.py +++ b/common/lib/xmodule/xmodule/modulestore/xml_importer.py @@ -419,12 +419,12 @@ def remap_namespace(module, target_location_namespace): return module -def validate_no_non_editable_metadata(module_store, course_id, category, allowed=[]): +def validate_no_non_editable_metadata(module_store, course_id, category, allowed=None): ''' Assert that there is no metadata within a particular category that we can't support editing - However we always allow display_name and 'xml_attribtues' + However we always allow 'display_name' and 'xml_attribtues' ''' - allowed = allowed + ['xml_attributes', 'display_name'] + _allowed = (allowed if allowed is not None else []) + ['xml_attributes', 'display_name'] err_cnt = 0 for module_loc in module_store.modules[course_id]: @@ -432,7 +432,7 @@ def validate_no_non_editable_metadata(module_store, course_id, category, allowed if module.location.category == category: my_metadata = dict(own_metadata(module)) for key in my_metadata.keys(): - if key not in allowed: + if key not in _allowed: err_cnt = err_cnt + 1 print ': found metadata on {0}. Studio will not support editing this piece of metadata, so it is not allowed. Metadata: {1} = {2}'. format(module.location.url(), key, my_metadata[key]) diff --git a/common/static/js/capa/edit-a-gene.js b/common/static/js/capa/edit-a-gene.js index bd6d10cc64..eb404de881 100644 --- a/common/static/js/capa/edit-a-gene.js +++ b/common/static/js/capa/edit-a-gene.js @@ -12,22 +12,49 @@ } } - //NOTE: - // Genex uses six global functions: - // genexSetDNASequence (exported from GWT) - // genexSetClickEvent (exported from GWT) - // genexSetKeyEvent (exported from GWT) - // genexSetProblemNumber (exported from GWT) + // NOTE: + // Genex uses 8 global functions, all prefixed with genex: + // 6 are exported from GWT: + // genexSetInitialDNASequence + // genexSetDNASequence + // genexGetDNASequence + // genexSetClickEvent + // genexSetKeyEvent + // genexSetProblemNumber // // It calls genexIsReady with a deferred command when it has finished // initialization and has drawn itself - // genexStoreAnswer(answer) is called when the GWT [Store Answer] button - // is clicked + // genexStoreAnswer(answer) is called each time the DNA sequence changes + // through user interaction + + //Genex does not call the following function + genexGetInputField = function() { + var problem = $('#genex_container').parents('.problem'); + return problem.find('input[type="hidden"][name!="genex_dna_sequence"][name!="genex_problem_number"]'); + }; genexIsReady = function() { - //Load DNA sequence - var dna_sequence = $('#dna_sequence').val(); - genexSetDNASequence(dna_sequence); + var input_field = genexGetInputField(); + var genex_saved_state = input_field.val(); + var genex_initial_dna_sequence; + var genex_dna_sequence; + + //Get the sequence from xml file + genex_initial_dna_sequence = $('#genex_dna_sequence').val(); + //Call this function to set the value used by reset button + genexSetInitialDNASequence(genex_initial_dna_sequence); + + if (genex_saved_state === '') { + //Load DNA sequence from xml file + genex_dna_sequence = genex_initial_dna_sequence; + } + else { + //Load DNA sequence from saved value + genex_saved_state = JSON.parse(genex_saved_state); + genex_dna_sequence = genex_saved_state.genex_dna_sequence; + } + + genexSetDNASequence(genex_dna_sequence); //Now load mouse and keyboard handlers genexSetClickEvent(); genexSetKeyEvent(); @@ -35,10 +62,9 @@ var genex_problem_number = $('#genex_problem_number').val(); genexSetProblemNumber(genex_problem_number); }; - genexStoreAnswer = function(ans) { - var problem = $('#genex_container').parents('.problem'); - var input_field = problem.find('input[type="hidden"][name!="dna_sequence"][name!="genex_problem_number"]'); - input_field.val(ans); + genexStoreAnswer = function(answer) { + var input_field = genexGetInputField(); + var value = {'genex_dna_sequence': genexGetDNASequence(), 'genex_answer': answer}; + input_field.val(JSON.stringify(value)); }; -}).call(this); - +}).call(this); \ No newline at end of file diff --git a/common/static/js/capa/genex/3F4ADBED36D589545A9300A1EA686D36.cache.html b/common/static/js/capa/genex/3F4ADBED36D589545A9300A1EA686D36.cache.html deleted file mode 100644 index c5ad0d1b89..0000000000 --- a/common/static/js/capa/genex/3F4ADBED36D589545A9300A1EA686D36.cache.html +++ /dev/null @@ -1,639 +0,0 @@ - - - - \ No newline at end of file diff --git a/common/static/js/capa/genex/46DBCB09BEC38A6DEE76494C6517111B.cache.html b/common/static/js/capa/genex/46DBCB09BEC38A6DEE76494C6517111B.cache.html new file mode 100644 index 0000000000..054ef6c31a --- /dev/null +++ b/common/static/js/capa/genex/46DBCB09BEC38A6DEE76494C6517111B.cache.html @@ -0,0 +1,641 @@ + + + + \ No newline at end of file diff --git a/common/static/js/capa/genex/557C7018CDCA52B163256408948A1722.cache.html b/common/static/js/capa/genex/557C7018CDCA52B163256408948A1722.cache.html new file mode 100644 index 0000000000..3862093b1b --- /dev/null +++ b/common/static/js/capa/genex/557C7018CDCA52B163256408948A1722.cache.html @@ -0,0 +1,651 @@ + + + + \ No newline at end of file diff --git a/common/static/js/capa/genex/73F4B6D6D466BAD6850A60128DF5B80D.cache.html b/common/static/js/capa/genex/73F4B6D6D466BAD6850A60128DF5B80D.cache.html deleted file mode 100644 index d5441b656e..0000000000 --- a/common/static/js/capa/genex/73F4B6D6D466BAD6850A60128DF5B80D.cache.html +++ /dev/null @@ -1,649 +0,0 @@ - - - - \ No newline at end of file diff --git a/common/static/js/capa/genex/866AF633CAA7EA4DA7E906456CDEC65A.cache.html b/common/static/js/capa/genex/866AF633CAA7EA4DA7E906456CDEC65A.cache.html new file mode 100644 index 0000000000..472502dde2 --- /dev/null +++ b/common/static/js/capa/genex/866AF633CAA7EA4DA7E906456CDEC65A.cache.html @@ -0,0 +1,627 @@ + + + \ No newline at end of file diff --git a/common/static/js/capa/genex/8F9C3F1A91187AA8391FD08BA7F8716D.cache.html b/common/static/js/capa/genex/8F9C3F1A91187AA8391FD08BA7F8716D.cache.html new file mode 100644 index 0000000000..f488b6fcf6 --- /dev/null +++ b/common/static/js/capa/genex/8F9C3F1A91187AA8391FD08BA7F8716D.cache.html @@ -0,0 +1,641 @@ + + + + \ No newline at end of file diff --git a/common/static/js/capa/genex/A016796CF7FB22261AE1160531B5CF82.cache.html b/common/static/js/capa/genex/A016796CF7FB22261AE1160531B5CF82.cache.html new file mode 100644 index 0000000000..f799ecf5b7 --- /dev/null +++ b/common/static/js/capa/genex/A016796CF7FB22261AE1160531B5CF82.cache.html @@ -0,0 +1,653 @@ + + + + \ No newline at end of file diff --git a/common/static/js/capa/genex/BA18AC23ACC5016C5D0799E864BBDFFE.cache.html b/common/static/js/capa/genex/BA18AC23ACC5016C5D0799E864BBDFFE.cache.html deleted file mode 100644 index 261aa02849..0000000000 --- a/common/static/js/capa/genex/BA18AC23ACC5016C5D0799E864BBDFFE.cache.html +++ /dev/null @@ -1,639 +0,0 @@ - - - - \ No newline at end of file diff --git a/common/static/js/capa/genex/C7B18436BA03373FB13ED589C2CCF417.cache.html b/common/static/js/capa/genex/C7B18436BA03373FB13ED589C2CCF417.cache.html deleted file mode 100644 index 13d25ddf09..0000000000 --- a/common/static/js/capa/genex/C7B18436BA03373FB13ED589C2CCF417.cache.html +++ /dev/null @@ -1,649 +0,0 @@ - - - - \ No newline at end of file diff --git a/common/static/js/capa/genex/E1A9A95677AFC620CAD5759B7ACC3E67.cache.html b/common/static/js/capa/genex/E1A9A95677AFC620CAD5759B7ACC3E67.cache.html deleted file mode 100644 index 7078dee4f8..0000000000 --- a/common/static/js/capa/genex/E1A9A95677AFC620CAD5759B7ACC3E67.cache.html +++ /dev/null @@ -1,625 +0,0 @@ - - - \ No newline at end of file diff --git a/common/static/js/capa/genex/F28D6C3D881F6C18E3357AAB004477EF.cache.html b/common/static/js/capa/genex/F28D6C3D881F6C18E3357AAB004477EF.cache.html new file mode 100644 index 0000000000..0c242fde9c --- /dev/null +++ b/common/static/js/capa/genex/F28D6C3D881F6C18E3357AAB004477EF.cache.html @@ -0,0 +1,651 @@ + + + + \ No newline at end of file diff --git a/common/static/js/capa/genex/FF175D5583BDD5ACF40C7F0AFF9A374B.cache.html b/common/static/js/capa/genex/FF175D5583BDD5ACF40C7F0AFF9A374B.cache.html deleted file mode 100644 index ca07bf3292..0000000000 --- a/common/static/js/capa/genex/FF175D5583BDD5ACF40C7F0AFF9A374B.cache.html +++ /dev/null @@ -1,651 +0,0 @@ - - - - \ No newline at end of file diff --git a/common/static/js/capa/genex/genex.nocache.js b/common/static/js/capa/genex/genex.nocache.js index fe892a53dc..f457e80b6c 100644 --- a/common/static/js/capa/genex/genex.nocache.js +++ b/common/static/js/capa/genex/genex.nocache.js @@ -1,4 +1,4 @@ -function genex(){var P='',xb='" for "gwt:onLoadErrorFn"',vb='" for "gwt:onPropertyErrorFn"',ib='"><\/script>',Z='#',Xb='.cache.html',_='/',lb='//',Qb='3F4ADBED36D589545A9300A1EA686D36',Rb='73F4B6D6D466BAD6850A60128DF5B80D',Wb=':',pb='::',dc='