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
cd0e2e89
Commit
cd0e2e89
authored
Jan 16, 2017
by
Dan Poltawski
Browse files
Merge branch 'MDL-57368-master-2' of
https://github.com/snake/moodle
parents
afcb0800
195f646d
Changes
7
Hide whitespace changes
Inline
Side-by-side
mod/feedback/item/captcha/lib.php
View file @
cd0e2e89
...
...
@@ -120,8 +120,9 @@ class feedback_item_captcha extends feedback_item_base {
$inputname
=
$item
->
typ
.
'_'
.
$item
->
id
;
if
(
$form
->
get_mode
()
!=
mod_feedback_complete_form
::
MODE_COMPLETE
)
{
// Span to hold the element id. The id is used for drag and drop reordering.
$form
->
add_form_element
(
$item
,
[
'static'
,
$inputname
,
$name
],
[
'static'
,
$inputname
,
$name
,
html_writer
::
span
(
''
,
''
,
[
'id'
=>
'feedback_item_'
.
$item
->
id
])
],
false
,
false
);
}
else
{
...
...
mod/feedback/item/feedback_item_class.php
View file @
cd0e2e89
...
...
@@ -294,7 +294,11 @@ class feedback_item_pagebreak extends feedback_item_base {
*/
public
function
complete_form_element
(
$item
,
$form
)
{
$form
->
add_form_element
(
$item
,
[
'static'
,
$item
->
typ
.
'_'
.
$item
->
id
,
''
,
'<hr class="feedback_pagebreak">'
]);
[
'static'
,
$item
->
typ
.
'_'
.
$item
->
id
,
''
,
html_writer
::
empty_tag
(
'hr'
,
[
'class'
=>
'feedback_pagebreak'
,
'id'
=>
'feedback_item_'
.
$item
->
id
])
]);
}
/**
...
...
mod/feedback/item/label/lib.php
View file @
cd0e2e89
...
...
@@ -194,6 +194,7 @@ class feedback_item_label extends feedback_item_base {
$context
->
id
,
'mod_feedback'
,
$filearea
,
$item
->
id
);
$formatoptions
=
array
(
'overflowdiv'
=>
true
,
'noclean'
=>
true
);
$output
=
format_text
(
$output
,
FORMAT_HTML
,
$formatoptions
);
$output
=
html_writer
::
div
(
$output
,
''
,
[
'id'
=>
'feedback_item_'
.
$item
->
id
]);
$inputname
=
$item
->
typ
.
'_'
.
$item
->
id
;
...
...
mod/feedback/item/multichoice/lib.php
View file @
cd0e2e89
...
...
@@ -342,6 +342,8 @@ class feedback_item_multichoice extends feedback_item_base {
$objs
[]
=
[
'advcheckbox'
,
$inputname
.
'['
.
$idx
.
']'
,
''
,
$label
,
null
,
array
(
0
,
$idx
)];
$form
->
set_element_type
(
$inputname
.
'['
.
$idx
.
']'
,
PARAM_INT
);
}
// Span to hold the element id. The id is used for drag and drop reordering.
$objs
[]
=
[
'static'
,
''
,
''
,
html_writer
::
span
(
''
,
''
,
[
'id'
=>
'feedback_item_'
.
$item
->
id
])];
$element
=
$form
->
add_form_group_element
(
$item
,
'group_'
.
$inputname
,
$name
,
$objs
,
$separator
,
$class
);
if
(
$tmpvalue
)
{
foreach
(
explode
(
FEEDBACK_MULTICHOICE_LINE_SEP
,
$tmpvalue
)
as
$v
)
{
...
...
@@ -357,6 +359,8 @@ class feedback_item_multichoice extends feedback_item_base {
foreach
(
$options
as
$idx
=>
$label
)
{
$objs
[]
=
[
'radio'
,
$inputname
.
'[0]'
,
''
,
$label
,
$idx
];
}
// Span to hold the element id. The id is used for drag and drop reordering.
$objs
[]
=
[
'static'
,
''
,
''
,
html_writer
::
span
(
''
,
''
,
[
'id'
=>
'feedback_item_'
.
$item
->
id
])];
$element
=
$form
->
add_form_group_element
(
$item
,
'group_'
.
$inputname
,
$name
,
$objs
,
$separator
,
$class
);
$form
->
set_element_default
(
$inputname
.
'[0]'
,
$tmpvalue
);
$form
->
set_element_type
(
$inputname
.
'[0]'
,
PARAM_INT
);
...
...
mod/feedback/item/multichoicerated/lib.php
View file @
cd0e2e89
...
...
@@ -312,6 +312,8 @@ class feedback_item_multichoicerated extends feedback_item_base {
foreach
(
$options
as
$idx
=>
$label
)
{
$objs
[]
=
[
'radio'
,
$inputname
,
''
,
$label
,
$idx
];
}
// Span to hold the element id. The id is used for drag and drop reordering.
$objs
[]
=
[
'static'
,
''
,
''
,
html_writer
::
span
(
''
,
''
,
[
'id'
=>
'feedback_item_'
.
$item
->
id
])];
$separator
=
$info
->
horizontal
?
' '
:
'<br>'
;
$class
.
=
' multichoicerated-'
.
(
$info
->
horizontal
?
'horizontal'
:
'vertical'
);
$el
=
$form
->
add_form_group_element
(
$item
,
'group_'
.
$inputname
,
$name
,
$objs
,
$separator
,
$class
);
...
...
mod/feedback/yui/dragdrop/dragdrop.js
View file @
cd0e2e89
...
...
@@ -167,12 +167,20 @@ YUI.add('moodle-mod_feedback-dragdrop', function(Y) {
if
(
!
drop
.
contains
(
drag
))
{
drop
.
appendChild
(
drag
);
}
myElements
=
''
;
var
childElement
;
var
elementId
;
var
elements
=
[];
drop
.
all
(
CSS
.
DRAGITEM
).
each
(
function
(
v
)
{
myElements
=
myElements
+
'
,
'
+
this
.
get_node_id
(
v
.
get
(
'
id
'
));
childElement
=
v
.
one
(
'
.felement
'
).
one
(
'
[id^="feedback_item_"]
'
);
if
(
childElement
)
{
elementId
=
this
.
get_node_id
(
childElement
.
get
(
'
id
'
));
if
(
elements
.
indexOf
(
elementId
)
==
-
1
)
{
elements
.
push
(
elementId
);
}
}
},
this
);
var
spinner
=
M
.
util
.
add_spinner
(
Y
,
dragnode
);
this
.
save_item_order
(
this
.
cmid
,
myE
lements
,
spinner
);
this
.
save_item_order
(
this
.
cmid
,
e
lements
.
toString
()
,
spinner
);
}
},
...
...
theme/boost/templates/core_form/element-template.mustache
View file @
cd0e2e89
{{
!
This
file
is
part
of
Moodle
-
http
:
//
moodle
.
org
/
Moodle
is
free
software
:
you
can
redistribute
it
and
/
or
modify
it
under
the
terms
of
the
GNU
General
Public
License
as
published
by
the
Free
Software
Foundation
,
either
version
3
of
the
License
,
or
(
at
your
option
)
any
later
version.
Moodle
is
distributed
in
the
hope
that
it
will
be
useful
,
but
WITHOUT
ANY
WARRANTY
;
without
even
the
implied
warranty
of
MERCHANTABILITY
or
FITNESS
FOR
A
PARTICULAR
PURPOSE.
See
the
GNU
General
Public
License
for
more
details.
You
should
have
received
a
copy
of
the
GNU
General
Public
License
along
with
Moodle.
If
not
,
see
<
http
:
//
www
.
gnu
.
org
/
licenses
/
>
.
}}
{{
!
@template
core_form
/
element-template
Template
for
the
form
element
wrapper
template.
Context
variables
required
for
this
template
:
*
label
*
required
*
advanced
*
helpbutton
*
error
*
element
*
id
*
name
Example
context
(
json
)
:
{
"label"
:
"Course full name"
,
"required"
:
true
,
"advanced"
:
false
,
"error"
:
null
,
"element"
:
{
"id"
:
"id_fullname"
,
"name"
:
"fullname"
}
}
}}
<div
class=
"form-group row
{{#
error
}}
has-danger
{{/
error
}}
fitem
{{#
advanced
}}
advanced
{{/
advanced
}}
{{{
element
.
extraclasses
}}}
"
>
<div
class=
"col-md-3"
>
<span
class=
"pull-xs-right text-nowrap"
>
...
...
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