Skip to content

Commit

Permalink
Update #86bwwnckq - Update for Moodle 4.4
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentcornelis committed Apr 5, 2024
1 parent a16832c commit b195ebe
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 19 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ Types of changes
* **Fixed** for any bug fixes.
* **Security** in case of vulnerabilities.

## Version (4.4.0) - 2024-04-05
- Upgraded and refactored for Moodle 4.4

## Version (4.2.1) - 2024-04-05
- Fixed issue with saving and loading canvas

Expand Down
4 changes: 3 additions & 1 deletion ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@
defined('MOODLE_INTERNAL') || die;

$action = optional_param('action', '', PARAM_TEXT);
$data = (object)optional_param('data', [], PARAM_RAW);
$data = optional_param('data', '', PARAM_RAW);

$data = (object) json_decode($data, true);

// Set course and context.
$cm = get_coursemodule_from_id('gcanvas', $data->id, 0, false,
Expand Down
2 changes: 1 addition & 1 deletion amd/build/canvas.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion amd/build/canvas.min.js.map

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions amd/src/canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,9 @@ define(['jquery', 'core/notification'], function($, notification) {
data: {
sesskey: M.cfg.sesskey,
action: 'load_history',
data: {
data: JSON.stringify({
'id': opts.id,
}
}),
},
dataType: "json",
success: function(response) {
Expand Down Expand Up @@ -228,15 +228,15 @@ define(['jquery', 'core/notification'], function($, notification) {
data: {
sesskey: M.cfg.sesskey,
action: 'save_canvas',
data: {
data: JSON.stringify({
'id': opts.id,
'status': 'final',
'canvas_data': canvas.toDataURL({
multiplier: 1,
format: 'png'
}),
'json_data': JSON.stringify(canvas)
}
})
},
dataType: "json",
success: function(response) {
Expand Down Expand Up @@ -402,10 +402,10 @@ define(['jquery', 'core/notification'], function($, notification) {
data: {
sesskey: M.cfg.sesskey,
action: 'delete_attempt',
data: {
data: JSON.stringify({
'id': opts.id,
'attempt_id': $el.data('id'),
}
})
},
dataType: "json",
success: function(response) {
Expand Down Expand Up @@ -447,10 +447,10 @@ define(['jquery', 'core/notification'], function($, notification) {
data: {
sesskey: M.cfg.sesskey,
action: 'get_attempt',
data: {
data: JSON.stringify({
'id': opts.id,
'attempt_id': $el.data('id'),
}
})
},
dataType: "json",
success: function(response) {
Expand Down Expand Up @@ -511,7 +511,7 @@ define(['jquery', 'core/notification'], function($, notification) {
data: {
sesskey: M.cfg.sesskey,
action: 'upload_images',
data: formdata
data: JSON.stringify(formdata)
},
dataType: "json",
success: function(response) {
Expand Down Expand Up @@ -569,9 +569,9 @@ define(['jquery', 'core/notification'], function($, notification) {
data: {
sesskey: M.cfg.sesskey,
action: 'get_toolbar_images',
data: {
data: JSON.stringify({
'id': opts.id,
}
})
},
dataType: "json",
success: function(response) {
Expand Down Expand Up @@ -745,9 +745,9 @@ define(['jquery', 'core/notification'], function($, notification) {
data: {
sesskey: M.cfg.sesskey,
action: 'emoji',
data: {
data: JSON.stringify({
'id': opts.id,
}
})
},
dataType: "json",
success: function(response) {
Expand Down
4 changes: 3 additions & 1 deletion styles.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#page-mod-gcanvas-view #toolbar .item {
width: 100%;
max-width: 100%;
height: 40px;
max-height: 40px;
line-height: 40px;
vertical-align: middle;
margin-bottom: 5px;
Expand Down Expand Up @@ -208,4 +210,4 @@

#page-mod-gcanvas-view #select-a-image ul {
list-style: none;
}
}
4 changes: 2 additions & 2 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
defined('MOODLE_INTERNAL') || die();

$plugin->component = 'mod_gcanvas';
$plugin->release = '4.2.1';
$plugin->release = '4.4.0';
$plugin->version = 2024040500;
$plugin->requires = 2020061500;
$plugin->supported = [39, 402];
$plugin->supported = [39, 404];
$plugin->maturity = MATURITY_STABLE;

0 comments on commit b195ebe

Please sign in to comment.