diff --git a/common/lib/xmodule/xmodule/js/fixtures/combined-open-ended.html b/common/lib/xmodule/xmodule/js/fixtures/combined-open-ended.html deleted file mode 100644 index ae2c195a85..0000000000 --- a/common/lib/xmodule/xmodule/js/fixtures/combined-open-ended.html +++ /dev/null @@ -1,128 +0,0 @@ -
-
-
-

Problem 1

-
-

Status

-
-
-
- Step 1 (Problem complete) : 1 / 1 - -
-
- Step 2 (Being scored) : None / 1 - -
-
-
-
-
-

Problem

-
-
-
-
-
-
- Some prompt. -
- -
-
- Submitted for grading. -
- - -
- -
-
-
-
- - -
- -
- -
-
-
-
- - -
- - -
- - - - Edit - / - QA -
-
- - Staff Debug Info - -
- - - - - -
-
diff --git a/common/lib/xmodule/xmodule/js/fixtures/combinedopenended-with-markdown.html b/common/lib/xmodule/xmodule/js/fixtures/combinedopenended-with-markdown.html deleted file mode 100644 index b5c74e00f9..0000000000 --- a/common/lib/xmodule/xmodule/js/fixtures/combinedopenended-with-markdown.html +++ /dev/null @@ -1,6 +0,0 @@ -
-
- - -
-
diff --git a/common/lib/xmodule/xmodule/js/fixtures/combinedopenended-without-markdown.html b/common/lib/xmodule/xmodule/js/fixtures/combinedopenended-without-markdown.html deleted file mode 100644 index 66d0fec2bc..0000000000 --- a/common/lib/xmodule/xmodule/js/fixtures/combinedopenended-without-markdown.html +++ /dev/null @@ -1,5 +0,0 @@ -
-
- -
-
diff --git a/common/lib/xmodule/xmodule/js/fixtures/rubric.html b/common/lib/xmodule/xmodule/js/fixtures/rubric.html deleted file mode 100644 index 20a17260fa..0000000000 --- a/common/lib/xmodule/xmodule/js/fixtures/rubric.html +++ /dev/null @@ -1,321 +0,0 @@ -
-
-

Open Response Assessment

-
-
-
-
-
- - - - - -
-
- Open Response -
-
-
- Assessments: -
-
- -
-
- -
- Peer -
-
-
- -
-
-
- -
-
-
-
- Show Question -
-
-
-
-
- -
-
-
- Response -
-
- -
-
- -
- -
- - - - -
- - -
-
-
-
- - -
-
- -
-
-
-
- Submitted Rubric -
-
- - Scored rubric from grader 1 -
-
- - -Ideas -
-
    - -
  • -
    - - 0 points : -Difficult for the reader to discern the main idea. Too brief or too repetitive to establish or maintain a focus. - - -
    -
  • - - - - - - -
- - -Content -
-
    - -
  • -
    - - 0 points : -Includes little information with few or no details or unrelated details. Unsuccessful in attempts to explore any facets of the topic. - - -
    -
  • - - - - - - -
- - -Organization -
-
    - -
  • -
    - - 0 points : -Ideas organized illogically, transitions weak, and response difficult to follow. - - -
    -
  • - - - - -
- - -Style -
-
    - -
  • -
    - - 0 points : -Contains limited vocabulary, with many words used incorrectly. Demonstrates problems with sentence patterns. - - -
    -
  • - - - - -
- - -Voice -
-
    - -
  • -
    - - 0 points : -Demonstrates language and tone that may be inappropriate to task and reader. - - -
    -
  • - - - - -
-
- - -
- -
-
- - - -
-
- -
-
-
-
\ No newline at end of file diff --git a/common/lib/xmodule/xmodule/js/spec/combinedopenended/display_spec.coffee b/common/lib/xmodule/xmodule/js/spec/combinedopenended/display_spec.coffee deleted file mode 100644 index f90728728a..0000000000 --- a/common/lib/xmodule/xmodule/js/spec/combinedopenended/display_spec.coffee +++ /dev/null @@ -1,170 +0,0 @@ -describe 'Rubric', -> - beforeEach -> - spyOn Logger, 'log' - # load up some fixtures - loadFixtures 'rubric.html' - jasmine.Clock.useMock() - @element = $('.combined-open-ended') - @location = @element.data('location') - - describe 'constructor', -> - beforeEach -> - @rub = new Rubric @element - - it 'rubric should properly grab the element', -> - expect(@rub.el).toEqual @element - - describe 'initialize', -> - beforeEach -> - @rub = new Rubric @element - @rub.initialize @location - - it 'rubric correctly sets location', -> - expect($(@rub.rubric_sel).data('location')).toEqual @location - - it 'rubric correctly read', -> - expect(@rub.categories.length).toEqual 5 - -describe 'CombinedOpenEnded', -> - beforeEach -> - spyOn Logger, 'log' - # load up some fixtures - loadFixtures 'combined-open-ended.html' - jasmine.Clock.useMock() - @element = $('.course-content') - - - describe 'constructor', -> - beforeEach -> - spyOn(Collapsible, 'setCollapsibles') - @combined = new CombinedOpenEnded @element - - it 'set the element', -> - expect(@combined.el).toEqual @element - - it 'get the correct values from data fields', -> - expect(@combined.ajax_url).toEqual '/courses/MITx/6.002x/2012_Fall/modx/i4x://MITx/6.002x/combinedopenended/CombinedOE' - expect(@combined.state).toEqual 'assessing' - expect(@combined.task_count).toEqual 2 - expect(@combined.task_number).toEqual 1 - - it 'subelements are made collapsible', -> - expect(Collapsible.setCollapsibles).toHaveBeenCalled() - - - describe 'poll', -> - # We will store default window.setTimeout() function here. - oldSetTimeout = null - - beforeEach => - # setup the spies - @combined = new CombinedOpenEnded @element - spyOn(@combined, 'reload').andCallFake -> return 0 - - # Store original window.setTimeout() function. If we do not do this, then - # all other tests that rely on code which uses window.setTimeout() - # function might (and probably will) fail. - oldSetTimeout = window.setTimeout - # Redefine window.setTimeout() function as a spy. - window.setTimeout = jasmine.createSpy().andCallFake (callback, timeout) -> return 5 - - afterEach => - # Reset the default window.setTimeout() function. If we do not do this, - # then all other tests that rely on code which uses window.setTimeout() - # function might (and probably will) fail. - window.setTimeout = oldSetTimeout - - it 'polls at the correct intervals', => - fakeResponseContinue = state: 'not done' - spyOn($, 'postWithPrefix').andCallFake (url, callback) -> callback(fakeResponseContinue) - @combined.poll() - expect(window.setTimeout).toHaveBeenCalledWith(@combined.poll, 10000) - expect(window.queuePollerID).toBe(5) - - xit 'polling stops properly', => - fakeResponseDone = state: "done" - spyOn($, 'postWithPrefix').andCallFake (url, callback) -> callback(fakeResponseDone) - @combined.poll() - expect(window.queuePollerID).toBeUndefined() - expect(window.setTimeout).not.toHaveBeenCalled() - - describe 'rebind', -> - # We will store default window.setTimeout() function here. - oldSetTimeout = null - - beforeEach -> - @combined = new CombinedOpenEnded @element - spyOn(@combined, 'queueing').andCallFake -> return 0 - spyOn(@combined, 'skip_post_assessment').andCallFake -> return 0 - - # Store original window.setTimeout() function. If we do not do this, then - # all other tests that rely on code which uses window.setTimeout() - # function might (and probably will) fail. - oldSetTimeout = window.setTimeout - # Redefine window.setTimeout() function as a spy. - window.setTimeout = jasmine.createSpy().andCallFake (callback, timeout) -> return 5 - - afterEach => - # Reset the default window.setTimeout() function. If we do not do this, - # then all other tests that rely on code which uses window.setTimeout() - # function might (and probably will) fail. - window.setTimeout = oldSetTimeout - - it 'when our child is in an assessing state', -> - @combined.child_state = 'assessing' - @combined.rebind() - expect(@combined.answer_area.attr("disabled")).toBe("disabled") - expect(@combined.submit_button.val()).toBe("Submit assessment") - expect(@combined.queueing).toHaveBeenCalled() - - it 'when our child state is initial', -> - @combined.child_state = 'initial' - @combined.rebind() - expect(@combined.answer_area.attr("disabled")).toBeUndefined() - expect(@combined.submit_button.val()).toBe("Submit") - - it 'when our child state is post_assessment', -> - @combined.child_state = 'post_assessment' - @combined.rebind() - expect(@combined.answer_area.attr("disabled")).toBe("disabled") - expect(@combined.submit_button.val()).toBe("Submit post-assessment") - - it 'when our child state is done', -> - spyOn(@combined, 'next_problem').andCallFake -> - @combined.child_state = 'done' - @combined.rebind() - expect(@combined.answer_area.attr("disabled")).toBe("disabled") - expect(@combined.next_problem_button).toBe(":visible") - - describe 'next_problem', -> - beforeEach -> - @combined = new CombinedOpenEnded @element - @combined.child_state = 'done' - - it 'handling a successful call', -> - fakeResponse = - success: true - html: "dummy html" - allow_reset: false - spyOn($, 'postWithPrefix').andCallFake (url, val, callback) -> callback(fakeResponse) - spyOn(@combined, 'reinitialize') - spyOn(@combined, 'rebind') - @combined.next_problem() - expect($.postWithPrefix).toHaveBeenCalled() - expect(@combined.reinitialize).toHaveBeenCalledWith(@combined.element) - expect(@combined.rebind).toHaveBeenCalled() - expect(@combined.answer_area.val()).toBe('') - expect(@combined.child_state).toBe('initial') - - it 'handling an unsuccessful call', -> - fakeResponse = - success: false - error: 'This is an error' - spyOn($, 'postWithPrefix').andCallFake (url, val, callback) -> callback(fakeResponse) - @combined.next_problem() - expect(@combined.errors_area.html()).toBe(fakeResponse.error) - - - - - diff --git a/common/lib/xmodule/xmodule/js/spec/combinedopenended/edit_spec.coffee b/common/lib/xmodule/xmodule/js/spec/combinedopenended/edit_spec.coffee deleted file mode 100644 index cb1efd5a94..0000000000 --- a/common/lib/xmodule/xmodule/js/spec/combinedopenended/edit_spec.coffee +++ /dev/null @@ -1,139 +0,0 @@ -describe 'OpenEndedMarkdownEditingDescriptor', -> - describe 'save stores the correct data', -> - it 'saves markdown from markdown editor', -> - loadFixtures 'combinedopenended-with-markdown.html' - @descriptor = new OpenEndedMarkdownEditingDescriptor($('.combinedopenended-editor')) - saveResult = @descriptor.save() - expect(saveResult.metadata.markdown).toEqual('markdown') - expect(saveResult.data).toEqual('\nmarkdown\n') - it 'clears markdown when xml editor is selected', -> - loadFixtures 'combinedopenended-with-markdown.html' - @descriptor = new OpenEndedMarkdownEditingDescriptor($('.combinedopenended-editor')) - @descriptor.createXMLEditor('replace with markdown') - saveResult = @descriptor.save() - expect(saveResult.nullout).toEqual(['markdown']) - expect(saveResult.data).toEqual('replace with markdown') - it 'saves xml from the xml editor', -> - loadFixtures 'combinedopenended-without-markdown.html' - @descriptor = new OpenEndedMarkdownEditingDescriptor($('.combinedopenended-editor')) - saveResult = @descriptor.save() - expect(saveResult.nullout).toEqual(['markdown']) - expect(saveResult.data).toEqual('xml only') - - describe 'advanced editor opens correctly', -> - it 'click on advanced editor should work', -> - loadFixtures 'combinedopenended-with-markdown.html' - @descriptor = new OpenEndedMarkdownEditingDescriptor($('.combinedopenended-editor')) - spyOn(@descriptor, 'confirmConversionToXml').andReturn(true) - expect(@descriptor.confirmConversionToXml).not.toHaveBeenCalled() - e = jasmine.createSpyObj('e', [ 'preventDefault' ]) - @descriptor.onShowXMLButton(e) - expect(e.preventDefault).toHaveBeenCalled() - expect(@descriptor.confirmConversionToXml).toHaveBeenCalled() - expect($('.editor-bar').length).toEqual(0) - - describe 'insertPrompt', -> - it 'inserts the template if selection is empty', -> - revisedSelection = OpenEndedMarkdownEditingDescriptor.insertPrompt('') - expect(revisedSelection).toEqual(OpenEndedMarkdownEditingDescriptor.promptTemplate) - it 'recognizes html in the prompt', -> - revisedSelection = OpenEndedMarkdownEditingDescriptor.insertPrompt('[prompt]

Hello

[prompt]') - expect(revisedSelection).toEqual('[prompt]

Hello

[prompt]') - - describe 'insertRubric', -> - it 'inserts the template if selection is empty', -> - revisedSelection = OpenEndedMarkdownEditingDescriptor.insertRubric('') - expect(revisedSelection).toEqual(OpenEndedMarkdownEditingDescriptor.rubricTemplate) - it 'recognizes a proper rubric', -> - revisedSelection = OpenEndedMarkdownEditingDescriptor.insertRubric('[rubric]\n+1\n-1\n-2\n[rubric]') - expect(revisedSelection).toEqual('[rubric]\n+1\n-1\n-2\n[rubric]') - - describe 'insertTasks', -> - it 'inserts the template if selection is empty', -> - revisedSelection = OpenEndedMarkdownEditingDescriptor.insertTasks('') - expect(revisedSelection).toEqual(OpenEndedMarkdownEditingDescriptor.tasksTemplate) - it 'recognizes a proper task string', -> - revisedSelection = OpenEndedMarkdownEditingDescriptor.insertTasks('[tasks](Self)[tasks]') - expect(revisedSelection).toEqual('[tasks](Self)[tasks]') - - describe 'markdownToXml', -> - # test default templates - it 'converts prompt to xml', -> - data = OpenEndedMarkdownEditingDescriptor.markdownToXml("""[prompt] -

Prompt!

- This is my super awesome prompt. - [prompt] - """) - data = data.replace(/[\t\n\s]/gmi,'') - expect(data).toEqual(""" - - -

Prompt!

- This is my super awesome prompt. -
-
- """.replace(/[\t\n\s]/gmi,'')) - - it 'converts rubric to xml', -> - data = OpenEndedMarkdownEditingDescriptor.markdownToXml("""[rubric] - + 1 - -1 - -2 - + 2 - -1 - -2 - +3 - -1 - -2 - -3 - [rubric] - """) - data = data.replace(/[\t\n\s]/gmi,'') - expect(data).toEqual(""" - - - - - 1 - - - - - 2 - - - - - 3 - - - - - - - - """.replace(/[\t\n\s]/gmi,'')) - - it 'converts tasks to xml', -> - data = OpenEndedMarkdownEditingDescriptor.markdownToXml("""[tasks] - (Self), ({1-2}AI), ({1-4}AI), ({1-2}Peer - [tasks] - """) - data = data.replace(/[\t\n\s]/gmi,'') - equality_list = """ - - - - - - ml_grading.conf - - - ml_grading.conf - - - peer_grading.conf - - - """ - expect(data).toEqual(equality_list.replace(/[\t\n\s]/gmi,''))