def enter_xml_in_advanced_problem(step, text): """ Edits an advanced problem (assumes only on page), types the provided XML, and saves the component. """ world.edit_component() type_in_codemirror(0, text) world.save_component()
def enter_xml_in_advanced_problem(_step, text): """ Edits an advanced problem (assumes only on page), types the provided XML, and saves the component. """ world.edit_component() type_in_codemirror(0, text) world.save_component()
def i_edit_blank_problem_for_annotation_response(_step): world.edit_component(1) text = """ <problem> <annotationresponse> <annotationinput><text>Text of annotation</text></annotationinput> </annotationresponse> </problem>""" type_in_codemirror(0, text) world.save_component()
def i_edit_blank_problem_for_annotation_response(_step): edit_css = """$('.component-header:contains("Blank Advanced Problem")').parent().find('a.edit-button').click()""" text = """ <problem> <annotationresponse> <annotationinput><text>Text of annotation</text></annotationinput> </annotationresponse> </problem>""" world.browser.execute_script(edit_css) world.wait_for_ajax_complete() type_in_codemirror(0, text) world.save_component()
def i_enter_bad_xml(step): world.edit_component() type_in_codemirror( 0, """<problem><h1>Smallest Canvas</h1> <p>You want to make the smallest canvas you can.</p> <multiplechoiceresponse> <choicegroup type="MultipleChoice"> <choice correct="false"><verbatim><canvas id="myCanvas" width = 10 height = 100> </canvas></verbatim></choice> <choice correct="true"><code><canvas id="myCanvas" width = 10 height = 10> </canvas></code></choice> </choicegroup> </multiplechoiceresponse> </problem>""") world.save_component(step)
def i_enter_bad_xml(step): world.edit_component() type_in_codemirror( 0, """<problem><h1>Smallest Canvas</h1> <p>You want to make the smallest canvas you can.</p> <multiplechoiceresponse> <choicegroup type="MultipleChoice"> <choice correct="false"><verbatim><canvas id="myCanvas" width = 10 height = 100> </canvas></verbatim></choice> <choice correct="true"><code><canvas id="myCanvas" width = 10 height = 10> </canvas></code></choice> </choicegroup> </multiplechoiceresponse> </problem>""" ) world.save_component(step)
def type_in_codemirror_plugin(_step, text): # Verify that raw code editor is not visible. assert world.css_has_class('.CodeMirror', 'is-inactive') # Verify that TinyMCE editor is present assert world.is_css_present('.tiny-mce') use_code_editor( lambda: type_in_codemirror(0, text, CODEMIRROR_SELECTOR_PREFIX))
def type_in_codemirror_plugin(step, text): # Verify that raw code editor is not visible. assert_true(world.css_has_class('.CodeMirror', 'is-inactive')) # Verify that TinyMCE editor is present assert_true(world.is_css_present('.tiny-mce')) use_code_editor( lambda: type_in_codemirror(0, text, CODEMIRROR_SELECTOR_PREFIX) )
def change_value(step, key, new_value): index = get_index_of(key) type_in_codemirror(index, new_value) press_the_notification_button(step, "Save") world.wait_for_ajax_complete()
def test_change_course_overview(_step): type_in_codemirror(0, "<h1>Overview</h1>")
def type_in_raw_editor(step, text): # Verify that CodeMirror editor is not hidden assert_false(world.css_has_class('.CodeMirror', 'is-inactive')) # Verify that TinyMCE Editor is not present assert_true(world.is_css_not_present('.tiny-mce')) type_in_codemirror(0, text)
def change_value(step, key, new_value): type_in_codemirror(get_index_of(key), new_value) press_the_notification_button(step, "Save")
def edit_latex_source(_step): open_high_level_source() type_in_codemirror(1, "hi") world.css_click('.hls-compile')
def type_in_codemirror_plugin(step, text): use_code_editor( lambda: type_in_codemirror(0, text, CODEMIRROR_SELECTOR_PREFIX) )
def change_text(text): type_in_codemirror(0, text) save_css = 'a.save-button' world.css_click(save_css)
def edit_the_value_of_a_policy_key(step): type_in_codemirror(get_index_of(DISPLAY_NAME_KEY), 'X')
def test_change_course_overview(_step): type_in_codemirror(0, "<h1>Overview</h1>")
def type_in_codemirror_plugin(step, text): use_code_editor( lambda: type_in_codemirror(0, text, CODEMIRROR_SELECTOR_PREFIX))
def type_in_raw_editor(_step, text): # Verify that CodeMirror editor is not hidden assert not world.css_has_class('.CodeMirror', 'is-inactive') # Verify that TinyMCE Editor is not present assert world.is_css_not_present('.tiny-mce') type_in_codemirror(0, text)
def edit_the_value_of_a_policy_key(step): type_in_codemirror(get_index_of(DISPLAY_NAME_KEY), 'X')
def change_value(step, key, new_value): index = get_index_of(key) type_in_codemirror(index, new_value) press_the_notification_button(step, "Save") world.wait_for_ajax_complete()
def change_value(step, key, new_value): type_in_codemirror(get_index_of(key), new_value) press_the_notification_button(step, "Save")
def edit_handouts(_step, text): type_in_codemirror(0, text)
def edit_handouts(_step, text): type_in_codemirror(0, text)
def edit_latex_source(_step): open_high_level_source() type_in_codemirror(1, "hi") world.css_click('.hls-compile')
def change_text(text): type_in_codemirror(0, text) save_css = 'a.save-button' world.css_click(save_css)