Atto: Sketch

atto_sketch
Maintained by Picture of Matthew DavidsonMatthew Davidson
Simple image "paint like" editor for atto.
504 sites
388 downloads
16 fans
Current versions available: 1

Description

Adds a simple "Paint" like program to the atto editor. Features include simple shape tools, drawing, typing, colors, undo/redo. Utilizes the open source "Literally Canvas" image editor. http://literallycanvas.com/


Installation

Create the lib/editor/atto/plugins/sketch folder and place all files there. Run through standard Moodle update/install process.


Use

Set cursor in the editor and click the sketch icon. The editor will open full screen. Use a stylus, finger or mouse to create/edit image. Click "Insert Sketch" to add to editor.

* When used with the Quiz essay question type, please be advised that the essay response format must be set to "HTML-Editor with filepicker" for full functionality.


Screenshots

Screenshot #0
Screenshot #1

Contributors

Picture of Matthew Davidson
Matthew Davidson (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS

Comments

  • Picture of Chris Kenniburg
    Wed, Aug 2, 2017, 7:42 PM
    I downloaded this and I am getting the error that sketch.html is not found. When I looked at the code it was calling for /lib/editor/atto/etc. I believe you want to put a ".." in front of the first '/' so its ../lib/editor/atto/ etc That fixed it for my dev site. I am using the 2017080100 version of the plugin.
  • Picture of Matthew Davidson
    Wed, Aug 2, 2017, 8:07 PM
    Chris,
    Thank you for your comment. I made the change that removes the .. because I found in my testing that it didn't work in some places of Moodle. I'll look into it today and see what I can do about the path.
  • Picture of Matthew Davidson
    Wed, Aug 2, 2017, 8:56 PM
    Chris, I've just released a hotfix release 2017080200 that should solve this issue.
  • Picture of Rob Johnson
    Wed, Aug 9, 2017, 1:27 AM
    I also see the canvas area not expanding to full screen in the Adaptable theme (ver 1.5 and Moodle 3.2). If I switch to the More theme, it expands as expected.
  • Picture of Matthew Davidson
    Wed, Aug 9, 2017, 1:47 AM
    Rob, Are you making any kind of alterations to the setup. I've installed Moodle 3.2 and Adaptable theme 1.5 and haven't been able to recreate this issue.
  • Picture of Enrique Castro
    Fri, Aug 11, 2017, 2:15 AM
    Hi Matthew. I have just installed Sketch in our system at ULPGC (moodle 3.1 with theme adaptable 1.3.3 buy customized). Sketch is working properly usually. We are interested on Sketch as an image annotator. Most of the time if you have an image selected and launch Sketch you can edit on it without trouble.
    a) But sometimes, mostly when de image is large, only a portion in shown, the rest of the canvas is blank /(white). it seems like a curtain NOT descending.
    b) When the image is small and NOT fills the canvas, the generated image is not cropped, there is a lot of bank space

    Where can I change the dimensions of the javascript dialogue and canvas in code?? I've tried the css included but without success.
  • Picture of Matthew Davidson
    Fri, Aug 11, 2017, 2:22 AM
    Enrique, yes, I've encountered these problems before. I believe they are issues with the drawing software that is used. See http://literallycanvas.com/. It is possible that these bugs could be known issues there or my need to be posted with them. Some of the sizes are overwritten via javascript in line 215 range of https://github.com/Syxton/atto_sketch/blob/db7f4bf700fe4d9ef378ccfa0d97214c23fc3645/yui/build/moodle-atto_sketch-button/moodle-atto_sketch-button-debug.js (has to be rebuilt from the src directory and compiled)
  • Picture of Andreas Schenkel
    Mon, Aug 21, 2017, 12:01 AM
    Is there a way to support moodle mobile app so that the images are also displayed in the app?
  • Picture of Enrique Castro
    Fri, Aug 25, 2017, 4:25 AM
    Hi Matthew, thanks for your tip. I've been changing some sizes, and looks better (in my opinion) .
    But I have realized a problem that's a showstopper for us.

    Sketch works well on pages managed by teachers. It works also on forum posts, and the raw data is saved to database. BUT on display the content is filtered out by format_text() function in forum_print_post(). The only way to show it in the discussion page is to use "noclean". That's not acceptable for a production site.

    As I commented, we are interested on Sketch as an image annotator. Te purpose is to allow students (or teachers) to add marks and signs to an existing image. I'lve lived a s a teacher many moments of "ahh, I'd it in front of my eyes without knowing where to look at" by students. So, having Sketch working in forum pages is a must.

    In addition. Currently Sketch return a base64 encoded text embedded, That may scare most users, in my opinion. Both problems would be solved if the return from Sketch would be a file in the editor area, and a link to that in the editor text ¿Is that possible, feasible?
  • Picture of Matthew Davidson
    Fri, Aug 25, 2017, 8:12 PM
    @Enrique I will look into this today. If true, that is very strange because the content it returns is an tag.
  • Picture of Thomas LE MONS
    Fri, Sep 1, 2017, 5:55 PM
    Hello Matthew,
    I would like to use Sketch for a maths test. Nevertheless, the image created with sktech in a "comment question" (Test Plugin") appears in the preview BUT NOT in the final answer that has to be noted by the teacher.
    Do you have a solution? Is it an editor problem?
  • Picture of Matthew Davidson
    Fri, Sep 1, 2017, 8:11 PM
    @Thomas Le MONS @Enrique Castro Ok, so I now understand what is going on. Moodle uses a code cleaner called HTMLPurify in places where students can also enter data. (glossary, forums, quiz questions, etc). Part of the code cleanup is removing the data:image/png:base64 string that this plugin uses. The fix is very easy, but requires a core change. See https://tracker.moodle.org/browse/MDL-59997 In the workaround section it will have 2 ways around this issue. Hint, don't use the first workaround. smile I am working on getting this fixed in Moodle as soon as possible.
  • Picture of Enrique Castro
    Fri, Sep 1, 2017, 11:51 PM
    Hi Matthew, I'n sorry I was NOT clearer in my first message. Yes, the problem is the cleaning by the function format_text().
    But that cleaning is there for a reason. Input from students, even form teachers, MUST be cleaned. People tend to copy-paste any type of things. We have had some incidents with teachers inadvertently pasting hidden malicious scripts, or just inconvenient advertisements.
    A much better way to deal with the issue would be to store the image file in the editor draft filearea. But it's a significant more work, I understand.

  • Picture of Matthew Davidson
    Fri, Sep 1, 2017, 11:55 PM
    @Enrique Castro Thanks again for the feedback. I have been looking into ways to do what you are requesting. However with the change I've submitted in MDL-59997, it would be strictly allowing only 3 mime types. I've search all over about security issues with Data URI and the only issues I've seen are with text mime types. So I've submitted it to Moodle with "possible" security questions, to see what they think.
  • Picture of Rob Johnson
    Tue, Sep 5, 2017, 4:55 AM
    Hi Matthew,
    I have not altered the setup in any way. I was using Firefox as my browser.
Please login to post comments