open-craft / xblock-vectordraw

An XBlock for creating vector drawing exercises
GNU Affero General Public License v3.0
2 stars 3 forks source link

Disable scroll when "drawmode" enabled. #12

Closed bdero closed 8 years ago

bdero commented 8 years ago

This is a port of the change from https://github.com/open-craft/jsinput-vectordraw/pull/31.

Testing instructions (Using an Android or IOS browser):

  1. Setup a devstack.
  2. Install this xblock on this branch into the edxapp Python virtualenv.

    # In the same directory as your Vagrantfile:
    vagrant ssh -- sudo -u edxapp /edx/bin/pip.edxapp install -e git+https://github.com/open-craft/xblock-vectordraw.git@bdero/disable-scroll-during-draw#egg=vectordraw-xblock
  3. Run Studio
  4. Navigate to a course, and then "Settings > Advanced Settings".
  5. Update the "Advanced Module List" field to contain ["vectordraw"].
  6. Click "Save Changes".
  7. Navigate to the outline and create a new Section, Subsection, and Unit. You will be redirected to the Unit authoring view.
  8. Select "Advanced > Vector Drawing" to create a new Vector Drawing problem.
  9. Click "Edit".
  10. Set the "Vectors" field with the following block:

    [
    {
        "name": "1",
        "description": "Vector 1",
        "coords": [
            [
                2.6877256317689535,
                1.3971119133574006
            ],
            [
                2.6877256317689535,
                4.397111913357403
            ]
        ],
        "type": "vector",
        "render": false,
        "length_factor": 1,
        "length_units": "",
        "base_angle": 0,
        "style": {
            "pointSize": 1,
            "pointColor": "red",
            "width": 4,
            "color": "blue",
            "label": null,
            "labelColor": "black"
        },
        "tail": [
            2.6877256317689535,
            1.3971119133574006
        ],
        "tip": [
            2.6877256317689535,
            4.397111913357403
        ],
        "length": 3.000000000000002,
        "angle": 90
    },
    {
        "name": "2",
        "description": "Vector 2",
        "coords": [
            [
                -1,
                1
            ],
            [
                -0.9999999999999998,
                4
            ]
        ],
        "type": "vector",
        "render": false,
        "length_factor": 1,
        "length_units": "",
        "base_angle": 0,
        "style": {
            "pointSize": 1,
            "pointColor": "red",
            "width": 4,
            "color": "blue",
            "label": null,
            "labelColor": "black"
        },
        "tail": [
            -1,
            1
        ],
        "tip": [
            -0.9999999999999998,
            4
        ],
        "length": 3,
        "angle": 90
    }
    ]
  11. Set the "Expected result" field to the following block:

    {
    "1": {
        "tail": [
            2.69,
            1.4
        ],
        "tail_tolerance": 1,
        "tip": [
            2.69,
            4.4
        ],
        "tip_tolerance": 1
    },
    "2": {
        "tail": [
            -1,
            1
        ],
        "tail_tolerance": 1,
        "tip": [
            -0.9999999999999998,
            4
        ],
        "tip_tolerance": 1
    }
    }
  12. Click "Save".
  13. Click "Publish".
  14. Launch a browser on a mobile device (note that the Chromium device emulator will not work for this test) and navigate to the Vector Drawing problem in the LMS.
  15. Tap and drag to create two new vectors. Observe that the browser window does not scroll as you slide your finger to initialize the new vector.
pomegranited commented 8 years ago

@bdero The PR description contains install instructions for the wrong branch. Could you please update it?

pomegranited commented 8 years ago

@bdero Your fix works great! I'll approve once you've fixed these minor issues.

bdero commented 8 years ago

@pomegranited Thanks for the review! I addressed your comments. Do you want to take a second pass or do you think this is good for me to merge?

pomegranited commented 8 years ago

@bdero Thanks for addressing my comments! You're good to squash and merge.

:+1: