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
integration
prechecker
Commits
7a677348
Commit
7a677348
authored
Nov 15, 2016
by
Eloy Lafuente
Committed by
Dan Poltawski
Nov 15, 2016
Browse files
Merge branch 'MDL-56724-master' of
git://github.com/damyon/moodle
parents
25898024
bf5dcc8a
Changes
6
Hide whitespace changes
Inline
Side-by-side
mod/choice/renderer.php
View file @
7a677348
...
...
@@ -44,7 +44,7 @@ class mod_choice_renderer extends plugin_renderer_base {
$disabled
=
empty
(
$options
[
'previewonly'
])
?
array
()
:
array
(
'disabled'
=>
'disabled'
);
$html
=
html_writer
::
start_tag
(
'form'
,
$attributes
);
$html
.
=
html_writer
::
start_tag
(
'ul'
,
array
(
'class'
=>
'choices
'
));
$html
.
=
html_writer
::
start_tag
(
'ul'
,
array
(
'class'
=>
'choices
list-unstyled unstyled'
));
$availableoption
=
count
(
$options
[
'options'
]);
$choicecount
=
0
;
...
...
@@ -59,6 +59,7 @@ class mod_choice_renderer extends plugin_renderer_base {
$option
->
attributes
->
type
=
'radio'
;
}
$option
->
attributes
->
id
=
'choice_'
.
$choicecount
;
$option
->
attributes
->
class
=
'm-x-1'
;
$labeltext
=
$option
->
text
;
if
(
!
empty
(
$option
->
attributes
->
disabled
))
{
...
...
@@ -82,8 +83,11 @@ class mod_choice_renderer extends plugin_renderer_base {
if
(
$availableoption
<
1
)
{
$html
.
=
html_writer
::
tag
(
'label'
,
get_string
(
'choicefull'
,
'choice'
));
}
else
{
$html
.
=
html_writer
::
empty_tag
(
'input'
,
array
(
'type'
=>
'submit'
,
'value'
=>
get_string
(
'savemychoice'
,
'choice'
),
'class'
=>
'button'
));
$html
.
=
html_writer
::
empty_tag
(
'input'
,
array
(
'type'
=>
'submit'
,
'value'
=>
get_string
(
'savemychoice'
,
'choice'
),
'class'
=>
'btn btn-primary'
));
}
if
(
!
empty
(
$options
[
'allowupdate'
])
&&
(
$options
[
'allowupdate'
]))
{
...
...
@@ -147,7 +151,7 @@ class mod_choice_renderer extends plugin_renderer_base {
$table
=
new
html_table
();
$table
->
cellpadding
=
0
;
$table
->
cellspacing
=
0
;
$table
->
attributes
[
'class'
]
=
'results names '
;
$table
->
attributes
[
'class'
]
=
'results names
table table-bordered
'
;
$table
->
tablealign
=
'center'
;
$table
->
summary
=
get_string
(
'responsesto'
,
'choice'
,
format_string
(
$choices
->
name
));
$table
->
data
=
array
();
...
...
@@ -223,6 +227,7 @@ class mod_choice_renderer extends plugin_renderer_base {
}
$userfullname
=
fullname
(
$user
,
$choices
->
fullnamecapability
);
$mediabody
=
''
;
if
(
$choices
->
viewresponsecapability
&&
$choices
->
deleterepsonsecapability
)
{
$checkboxid
=
'attempt-user'
.
$user
->
id
.
'-option'
.
$optionid
;
$attemptaction
=
html_writer
::
label
(
$userfullname
.
' '
.
$optionsnames
[
$optionid
],
...
...
@@ -234,16 +239,17 @@ class mod_choice_renderer extends plugin_renderer_base {
$attemptaction
.
=
html_writer
::
checkbox
(
'userid[]'
,
$user
->
id
,
''
,
null
,
array
(
'id'
=>
$checkboxid
));
}
$
data
.
=
html_writer
::
tag
(
'div'
,
$attemptaction
,
array
(
'class'
=>
'
attemptaction
'
));
$
mediabody
.
=
html_writer
::
tag
(
'div'
,
$attemptaction
,
array
(
'class'
=>
'
media-left p-t-1
'
));
}
$userimage
=
$this
->
output
->
user_picture
(
$user
,
array
(
'courseid'
=>
$choices
->
courseid
));
$data
.
=
html_writer
::
tag
(
'div'
,
$userimage
,
array
(
'class'
=>
'image'
));
$userlink
=
new
moodle_url
(
'/user/view.php'
,
array
(
'id'
=>
$user
->
id
,
'course'
=>
$choices
->
courseid
));
$name
=
html_writer
::
tag
(
'a'
,
$userfullname
,
array
(
'href'
=>
$userlink
,
'class'
=>
'username'
));
$data
.
=
html_writer
::
tag
(
'div'
,
$name
,
array
(
'class'
=>
'fullname'
));
$data
.
=
html_writer
::
tag
(
'div'
,
''
,
array
(
'class'
=>
'clearfloat'
));
$optionusers
.
=
html_writer
::
tag
(
'div'
,
$data
,
array
(
'class'
=>
'user'
));
$userimage
=
$this
->
output
->
user_picture
(
$user
,
array
(
'courseid'
=>
$choices
->
courseid
));
$mediabody
.
=
html_writer
::
tag
(
'div'
,
$userimage
,
array
(
'class'
=>
'media-left'
));
$userlink
=
new
moodle_url
(
'/user/view.php'
,
array
(
'id'
=>
$user
->
id
,
'course'
=>
$choices
->
courseid
));
$name
=
html_writer
::
tag
(
'a'
,
$userfullname
,
array
(
'href'
=>
$userlink
));
$mediabody
.
=
html_writer
::
tag
(
'div'
,
$name
,
array
(
'class'
=>
'media-body'
));
$data
.
=
html_writer
::
tag
(
'div'
,
$mediabody
,
array
(
'class'
=>
'media m-b-1'
));
$optionusers
.
=
$data
;
}
$cell
->
text
=
$optionusers
;
}
...
...
mod/choice/report.php
View file @
7a677348
...
...
@@ -257,19 +257,19 @@
$options
[
"id"
]
=
"
$cm->id
"
;
$options
[
"download"
]
=
"ods"
;
$button
=
$OUTPUT
->
single_button
(
new
moodle_url
(
"report.php"
,
$options
),
get_string
(
"downloadods"
));
$downloadoptions
[]
=
html_writer
::
tag
(
'li'
,
$button
,
array
(
'class'
=>
'reportoption'
));
$downloadoptions
[]
=
html_writer
::
tag
(
'li'
,
$button
,
array
(
'class'
=>
'reportoption
list-inline-item
'
));
$options
[
"download"
]
=
"xls"
;
$button
=
$OUTPUT
->
single_button
(
new
moodle_url
(
"report.php"
,
$options
),
get_string
(
"downloadexcel"
));
$downloadoptions
[]
=
html_writer
::
tag
(
'li'
,
$button
,
array
(
'class'
=>
'reportoption'
));
$downloadoptions
[]
=
html_writer
::
tag
(
'li'
,
$button
,
array
(
'class'
=>
'reportoption
list-inline-item
'
));
$options
[
"download"
]
=
"txt"
;
$button
=
$OUTPUT
->
single_button
(
new
moodle_url
(
"report.php"
,
$options
),
get_string
(
"downloadtext"
));
$downloadoptions
[]
=
html_writer
::
tag
(
'li'
,
$button
,
array
(
'class'
=>
'reportoption'
));
$downloadoptions
[]
=
html_writer
::
tag
(
'li'
,
$button
,
array
(
'class'
=>
'reportoption
list-inline-item
'
));
$downloadlist
=
html_writer
::
tag
(
'ul'
,
implode
(
''
,
$downloadoptions
));
$downloadlist
.
=
html_writer
::
tag
(
'div'
,
''
,
array
(
'class'
=>
'clearfloat'
));
echo
html_writer
::
tag
(
'div'
,
$downloadlist
,
array
(
'class'
=>
'downloadreport'
));
$downloadlist
=
html_writer
::
tag
(
'ul'
,
implode
(
''
,
$downloadoptions
)
,
array
(
'class'
=>
'list-inline inline'
)
);
$downloadlist
.
=
html_writer
::
tag
(
'div'
,
''
,
array
(
'class'
=>
'clearfloat'
));
echo
html_writer
::
tag
(
'div'
,
$downloadlist
,
array
(
'class'
=>
'downloadreport
m-t-1
'
));
}
echo
$OUTPUT
->
footer
();
mod/choice/styles.css
deleted
100644 → 0
View file @
25898024
.path-mod-choice
.results
{
border-collapse
:
separate
;
}
.path-mod-choice
.results
.data
{
vertical-align
:
top
;
white-space
:
nowrap
;
}
.path-mod-choice
.button
{
text-align
:
center
;
}
.path-mod-choice
.attemptcell
{
width
:
5px
;
white-space
:
nowrap
;
}
.path-mod-choice
.anonymous
,
.path-mod-choice
.names
{
margin-left
:
auto
;
margin-right
:
auto
;
width
:
100%
;
}
.path-mod-choice
.downloadreport
{
border-width
:
0
;
margin-left
:
10%
;
}
.path-mod-choice
.choiceresponse
{
width
:
100%
;
}
.path-mod-choice
.choiceresponse
.picture
{
width
:
10px
;
white-space
:
nowrap
;
}
.path-mod-choice
.choiceresponse
.fullname
{
width
:
100%
;
white-space
:
nowrap
;
}
.path-mod-choice
.responseheader
{
width
:
100%
;
text-align
:
center
;
margin-top
:
10px
;
}
.path-mod-choice
.choices
.option
label
{
vertical-align
:
top
;
}
.path-mod-choice
.choices
.option
input
{
vertical-align
:
middle
;
}
.path-mod-choice
.horizontal
,
.path-mod-choice
.vertical
{
margin-left
:
10%
;
margin-right
:
10%
;
}
.path-mod-choice
.horizontal
.choices
.option
{
padding-right
:
20px
;
display
:
inline-block
;
white-space
:
normal
;
}
.path-mod-choice
.horizontal
.choices
.button
{
margin-top
:
10px
;
}
.path-mod-choice
ul
.choices
li
{
list-style
:
none
;
}
.path-mod-choice
.results
{
text-align
:
center
;
}
.path-mod-choice
.results.anonymous
.graph.horizontal
{
vertical-align
:
middle
;
text-align
:
left
;
width
:
70%
;
}
.path-mod-choice
.results.anonymous
.graph.vertical
,
.path-mod-choice
.cell
{
vertical-align
:
bottom
;
text-align
:
center
;
}
.path-mod-choice
.results.names
.header
{
width
:
10%
;
white-space
:
normal
;
}
.path-mod-choice
.results.names
.cell
{
vertical-align
:
top
;
text-align
:
left
;
}
.path-mod-choice
.results.names
.user
,
.path-mod-choice
#yourselection
{
padding
:
5px
;
}
.path-mod-choice
.results.names
.user
.attemptaction
,
.path-mod-choice
.results.names
.user
.image
,
.path-mod-choice
.results.names
.user
.fullname
{
float
:
left
;
}
.path-mod-choice
.results.names
.user
.fullname
{
padding-left
:
5px
;
}
.path-mod-choice
.results
.data.header
{
width
:
10%
;
}
.path-mod-choice
.responseaction
{
text-align
:
center
;
}
.path-mod-choice
.results
.option
{
white-space
:
normal
;
}
.path-mod-choice
.response
{
overflow
:
auto
;
}
.path-mod-choice
.results
.option
,
.path-mod-choice
.results
.numberofuser
,
.path-mod-choice
.results
.percentage
{
font-weight
:
bold
;
font-size
:
108%
;
}
#page-mod-choice-report
.downloadreport
ul
li
{
list-style
:
none
;
padding
:
0
20px
;
float
:
left
;
}
.path-mod-choice
.clearfloat
{
float
:
none
;
clear
:
both
;
}
theme/boost/scss/moodle/modules.scss
View file @
7a677348
...
...
@@ -212,21 +212,6 @@ div#dock {
// Choice module
.path-mod-choice
{
.horizontal
.choices
{
margin
:
0
;
.option
{
display
:
inline-block
;
padding
:
10px
;
}
}
.results
.data
{
white-space
:
normal
;
}
}
// Lesson module
/** General styles (scope: all of lesson) **/
...
...
theme/bootstrapbase/less/moodle/modules.less
View file @
7a677348
...
...
@@ -291,15 +291,9 @@ div#dock {
// Choice module
.path-mod-choice {
.horizontal .choices {
margin: 0;
.option {
display: inline-block;
padding: 10px;
}
}
.results .data {
white-space: normal;
.media-left {
float: left;
padding-right: 1em;
}
}
...
...
theme/bootstrapbase/style/moodle.css
View file @
7a677348
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
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