Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plugins bot
moodle-plugins-snapshots
Commits
d574114a
Commit
d574114a
authored
Dec 21, 2016
by
Dan Poltawski
Browse files
MDL-57490 scorm: convert legacy js to jquery
parent
6db06d0e
Changes
3
Hide whitespace changes
Inline
Side-by-side
mod/scorm/report/basic/classes/report.php
View file @
d574114a
...
...
@@ -492,10 +492,20 @@ class report extends \mod_scorm\report {
if
(
$candelete
)
{
echo
\
html_writer
::
start_tag
(
'table'
,
array
(
'id'
=>
'commands'
));
echo
\
html_writer
::
start_tag
(
'tr'
)
.
\
html_writer
::
start_tag
(
'td'
);
echo
\
html_writer
::
link
(
'javascript:select_all_in(\'DIV\', null, \'scormtablecontainer\');'
,
get_string
(
'selectall'
,
'scorm'
))
.
' / '
;
echo
\
html_writer
::
link
(
'javascript:deselect_all_in(\'DIV\', null, \'scormtablecontainer\');'
,
get_string
(
'selectnone'
,
'scorm'
));
echo
\
html_writer
::
link
(
'#'
,
get_string
(
'selectall'
,
'scorm'
),
array
(
'id'
=>
'checkattempts'
));
echo
' / '
;
echo
\
html_writer
::
link
(
'#'
,
get_string
(
'selectnone'
,
'scorm'
),
array
(
'id'
=>
'uncheckattempts'
));
$PAGE
->
requires
->
js_amd_inline
(
"
require(['jquery'], function($) {
$('#checkattempts').click(function(e) {
$('#attemptsform').find('input:checkbox').prop('checked', true);
e.preventDefault();
});
$('#uncheckattempts').click(function(e) {
$('#attemptsform').find('input:checkbox').prop('checked', false);
e.preventDefault();
});
});"
);
echo
' '
;
echo
\
html_writer
::
empty_tag
(
'input'
,
array
(
'type'
=>
'submit'
,
'value'
=>
get_string
(
'deleteselected'
,
'scorm'
),
...
...
mod/scorm/report/interactions/classes/report.php
View file @
d574114a
...
...
@@ -582,10 +582,20 @@ class report extends \mod_scorm\report {
if
(
$candelete
)
{
echo
\
html_writer
::
start_tag
(
'table'
,
array
(
'id'
=>
'commands'
));
echo
\
html_writer
::
start_tag
(
'tr'
)
.
\
html_writer
::
start_tag
(
'td'
);
echo
\
html_writer
::
link
(
'javascript:select_all_in(\'DIV\', null, \'scormtablecontainer\');'
,
get_string
(
'selectall'
,
'scorm'
))
.
' / '
;
echo
\
html_writer
::
link
(
'javascript:deselect_all_in(\'DIV\', null, \'scormtablecontainer\');'
,
get_string
(
'selectnone'
,
'scorm'
));
echo
\
html_writer
::
link
(
'#'
,
get_string
(
'selectall'
,
'scorm'
),
array
(
'id'
=>
'checkattempts'
));
echo
' / '
;
echo
\
html_writer
::
link
(
'#'
,
get_string
(
'selectnone'
,
'scorm'
),
array
(
'id'
=>
'uncheckattempts'
));
$PAGE
->
requires
->
js_amd_inline
(
"
require(['jquery'], function($) {
$('#checkattempts').click(function(e) {
$('#attemptsform').find('input:checkbox').prop('checked', true);
e.preventDefault();
});
$('#uncheckattempts').click(function(e) {
$('#attemptsform').find('input:checkbox').prop('checked', false);
e.preventDefault();
});
});"
);
echo
' '
;
echo
\
html_writer
::
empty_tag
(
'input'
,
array
(
'type'
=>
'submit'
,
'value'
=>
get_string
(
'deleteselected'
,
'scorm'
),
...
...
mod/scorm/report/objectives/classes/report.php
View file @
d574114a
...
...
@@ -582,10 +582,20 @@ class report extends \mod_scorm\report {
if
(
$candelete
)
{
echo
\
html_writer
::
start_tag
(
'table'
,
array
(
'id'
=>
'commands'
));
echo
\
html_writer
::
start_tag
(
'tr'
)
.
\
html_writer
::
start_tag
(
'td'
);
echo
\
html_writer
::
link
(
'javascript:select_all_in(\'DIV\', null, \'scormtablecontainer\');'
,
get_string
(
'selectall'
,
'scorm'
))
.
' / '
;
echo
\
html_writer
::
link
(
'javascript:deselect_all_in(\'DIV\', null, \'scormtablecontainer\');'
,
get_string
(
'selectnone'
,
'scorm'
));
echo
\
html_writer
::
link
(
'#'
,
get_string
(
'selectall'
,
'scorm'
),
array
(
'id'
=>
'checkattempts'
));
echo
' / '
;
echo
\
html_writer
::
link
(
'#'
,
get_string
(
'selectnone'
,
'scorm'
),
array
(
'id'
=>
'uncheckattempts'
));
$PAGE
->
requires
->
js_amd_inline
(
"
require(['jquery'], function($) {
$('#checkattempts').click(function(e) {
$('#attemptsform').find('input:checkbox').prop('checked', true);
e.preventDefault();
});
$('#uncheckattempts').click(function(e) {
$('#attemptsform').find('input:checkbox').prop('checked', false);
e.preventDefault();
});
});"
);
echo
' '
;
echo
\
html_writer
::
empty_tag
(
'input'
,
array
(
'type'
=>
'submit'
,
'value'
=>
get_string
(
'deleteselected'
,
'scorm'
),
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment