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()
Ejemplo n.º 2
0
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()
Ejemplo n.º 3
0
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()
Ejemplo n.º 5
0
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)
Ejemplo n.º 6
0
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)
Ejemplo n.º 7
0
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))
Ejemplo n.º 8
0
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()
Ejemplo n.º 10
0
def test_change_course_overview(_step):
    type_in_codemirror(0, "<h1>Overview</h1>")
Ejemplo n.º 11
0
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)
Ejemplo n.º 12
0
def change_value(step, key, new_value):
    type_in_codemirror(get_index_of(key), new_value)
    press_the_notification_button(step, "Save")
Ejemplo n.º 13
0
def edit_latex_source(_step):
    open_high_level_source()
    type_in_codemirror(1, "hi")
    world.css_click('.hls-compile')
Ejemplo n.º 14
0
def type_in_codemirror_plugin(step, text):
    use_code_editor(
        lambda: type_in_codemirror(0, text, CODEMIRROR_SELECTOR_PREFIX)
    )
Ejemplo n.º 15
0
def change_text(text):
    type_in_codemirror(0, text)
    save_css = 'a.save-button'
    world.css_click(save_css)
Ejemplo n.º 16
0
def edit_the_value_of_a_policy_key(step):
    type_in_codemirror(get_index_of(DISPLAY_NAME_KEY), 'X')
Ejemplo n.º 17
0
def test_change_course_overview(_step):
    type_in_codemirror(0, "<h1>Overview</h1>")
Ejemplo n.º 18
0
def type_in_codemirror_plugin(step, text):
    use_code_editor(
        lambda: type_in_codemirror(0, text, CODEMIRROR_SELECTOR_PREFIX))
Ejemplo n.º 19
0
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')
Ejemplo n.º 21
0
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()
Ejemplo n.º 22
0
def change_value(step, key, new_value):
    type_in_codemirror(get_index_of(key), new_value)
    press_the_notification_button(step, "Save")
Ejemplo n.º 23
0
def edit_handouts(_step, text):
    type_in_codemirror(0, text)
Ejemplo n.º 24
0
def edit_handouts(_step, text):
    type_in_codemirror(0, text)
Ejemplo n.º 25
0
def edit_latex_source(_step):
    open_high_level_source()
    type_in_codemirror(1, "hi")
    world.css_click('.hls-compile')
Ejemplo n.º 26
0
def change_text(text):
    type_in_codemirror(0, text)
    save_css = 'a.save-button'
    world.css_click(save_css)