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
5a9a2c61
Commit
5a9a2c61
authored
Nov 15, 2016
by
David Monllaó
Committed by
Dan Poltawski
Nov 15, 2016
Browse files
Merge branch 'MDL-56824-master' of
git://github.com/damyon/moodle
parents
39e7d46d
0f760528
Changes
5
Hide whitespace changes
Inline
Side-by-side
mod/lesson/pagetypes/branchtable.php
View file @
5a9a2c61
...
...
@@ -251,7 +251,9 @@ class lesson_page_type_branchtable extends lesson_page {
$formattextdefoptions
->
context
=
$answerpage
->
context
;
foreach
(
$answers
as
$answer
)
{
$data
=
"<input type=
\"
button
\"
name=
\"
$answer->id
\"
value=
\"
"
.
s
(
strip_tags
(
format_text
(
$answer
->
answer
,
FORMAT_MOODLE
,
$formattextdefoptions
)))
.
"
\"
disabled=
\"
disabled
\"
> "
;
$data
=
"<input type=
\"
button
\"
class=
\"
btn btn-secondary
\"
name=
\"
$answer->id
\"
"
.
"value=
\"
"
.
s
(
strip_tags
(
format_text
(
$answer
->
answer
,
FORMAT_MOODLE
,
$formattextdefoptions
)))
.
"
\"
"
.
"disabled=
\"
disabled
\"
> "
;
$data
.
=
get_string
(
'jumpsto'
,
'lesson'
,
$this
->
get_jump_name
(
$answer
->
jumpto
));
$answerdata
->
answers
[]
=
array
(
$data
,
""
);
$answerpage
->
answerdata
=
$answerdata
;
...
...
mod/lesson/pagetypes/matching.php
View file @
5a9a2c61
...
...
@@ -443,14 +443,16 @@ class lesson_page_type_matching extends lesson_page {
if
(
$useranswer
!=
null
)
{
$userresponse
=
explode
(
","
,
$useranswer
->
useranswer
);
$data
.
=
'<label class="accesshide" for="stu_answer_response_'
.
$n
.
'">'
.
get_string
(
'matchesanswer'
,
'lesson'
)
.
'</label>'
;
$data
.
=
"<select id=
\"
stu_answer_response_"
.
$n
.
"
\"
disabled=
\"
disabled
\"
><option selected=
\"
selected
\"
>"
;
$data
.
=
"<select class=
\"
custom-select
\"
id=
\"
stu_answer_response_"
.
$n
.
"
\"
"
.
"disabled=
\"
disabled
\"
><option selected=
\"
selected
\"
>"
;
if
(
array_key_exists
(
$i
,
$userresponse
))
{
$data
.
=
$userresponse
[
$i
];
}
$data
.
=
"</option></select>"
;
}
else
{
$data
.
=
'<label class="accesshide" for="answer_response_'
.
$n
.
'">'
.
get_string
(
'matchesanswer'
,
'lesson'
)
.
'</label>'
;
$data
.
=
"<select id=
\"
answer_response_"
.
$n
.
"
\"
disabled=
\"
disabled
\"
><option selected=
\"
selected
\"
>"
.
strip_tags
(
format_string
(
$answer
->
response
))
.
"</option></select>"
;
$data
.
=
"<select class=
\"
custom-select
\"
id=
\"
answer_response_"
.
$n
.
"
\"
"
.
"disabled=
\"
disabled
\"
><option selected=
\"
selected
\"
>"
.
strip_tags
(
format_string
(
$answer
->
response
))
.
"</option></select>"
;
}
if
(
$n
==
2
)
{
...
...
mod/lesson/pagetypes/numerical.php
View file @
5a9a2c61
...
...
@@ -204,7 +204,8 @@ class lesson_page_type_numerical extends lesson_page {
$total
=
$stats
[
"total"
];
unset
(
$stats
[
"total"
]);
foreach
(
$stats
as
$valentered
=>
$ntimes
)
{
$data
=
'<input type="text" size="50" disabled="disabled" readonly="readonly" value="'
.
s
(
$valentered
)
.
'" />'
;
$data
=
'<input class="form-control" type="text" size="50" '
.
'disabled="disabled" readonly="readonly" value="'
.
s
(
$valentered
)
.
'" />'
;
$percent
=
$ntimes
/
$total
*
100
;
$percent
=
round
(
$percent
,
2
);
$percent
.
=
"% "
.
get_string
(
"enteredthis"
,
"lesson"
);
...
...
@@ -216,7 +217,8 @@ class lesson_page_type_numerical extends lesson_page {
$i
++
;
}
else
if
(
$useranswer
!=
null
&&
(
$answer
->
id
==
$useranswer
->
answerid
||
(
$answer
==
end
(
$answers
)
&&
empty
(
$answerdata
))))
{
// get in here when what the user entered is not one of the answers
$data
=
'<input type="text" size="50" disabled="disabled" readonly="readonly" value="'
.
s
(
$useranswer
->
useranswer
)
.
'">'
;
$data
=
'<input class="form-control" type="text" size="50" '
.
'disabled="disabled" readonly="readonly" value="'
.
s
(
$useranswer
->
useranswer
)
.
'">'
;
if
(
isset
(
$pagestats
[
$this
->
properties
->
id
][
$useranswer
->
useranswer
]))
{
$percent
=
$pagestats
[
$this
->
properties
->
id
][
$useranswer
->
useranswer
]
/
$pagestats
[
$this
->
properties
->
id
][
"total"
]
*
100
;
$percent
=
round
(
$percent
,
2
);
...
...
mod/lesson/pagetypes/shortanswer.php
View file @
5a9a2c61
...
...
@@ -267,7 +267,8 @@ class lesson_page_type_shortanswer extends lesson_page {
$total
=
$stats
[
"total"
];
unset
(
$stats
[
"total"
]);
foreach
(
$stats
as
$valentered
=>
$ntimes
)
{
$data
=
'<input type="text" size="50" disabled="disabled" readonly="readonly" value="'
.
s
(
$valentered
)
.
'" />'
;
$data
=
'<input type="text" size="50" disabled="disabled" class="form-control" '
.
'readonly="readonly" value="'
.
s
(
$valentered
)
.
'" />'
;
$percent
=
$ntimes
/
$total
*
100
;
$percent
=
round
(
$percent
,
2
);
$percent
.
=
"% "
.
get_string
(
"enteredthis"
,
"lesson"
);
...
...
@@ -279,7 +280,8 @@ class lesson_page_type_shortanswer extends lesson_page {
$i
++
;
}
else
if
(
$useranswer
!=
null
&&
(
$answer
->
id
==
$useranswer
->
answerid
||
$answer
==
end
(
$answers
)))
{
// get in here when what the user entered is not one of the answers
$data
=
'<input type="text" size="50" disabled="disabled" readonly="readonly" value="'
.
s
(
$useranswer
->
useranswer
)
.
'">'
;
$data
=
'<input type="text" size="50" disabled="disabled" class="form-control" '
.
'readonly="readonly" value="'
.
s
(
$useranswer
->
useranswer
)
.
'">'
;
if
(
isset
(
$pagestats
[
$this
->
properties
->
id
][
$useranswer
->
useranswer
]))
{
$percent
=
$pagestats
[
$this
->
properties
->
id
][
$useranswer
->
useranswer
]
/
$pagestats
[
$this
->
properties
->
id
][
"total"
]
*
100
;
$percent
=
round
(
$percent
,
2
);
...
...
mod/lesson/report.php
View file @
5a9a2c61
...
...
@@ -451,7 +451,9 @@ if ($action === 'delete') {
$checklinks
=
'<a href="javascript: checkall();">'
.
get_string
(
'selectall'
)
.
'</a> / '
;
$checklinks
.
=
'<a href="javascript: checknone();">'
.
get_string
(
'deselectall'
)
.
'</a>'
;
$checklinks
.
=
html_writer
::
label
(
'action'
,
'menuaction'
,
false
,
array
(
'class'
=>
'accesshide'
));
$checklinks
.
=
html_writer
::
select
(
array
(
'delete'
=>
get_string
(
'deleteselected'
)),
'action'
,
0
,
array
(
''
=>
'choosedots'
),
array
(
'id'
=>
'actionid'
,
'class'
=>
'autosubmit'
));
$options
=
array
(
'delete'
=>
get_string
(
'deleteselected'
));
$attributes
=
array
(
'id'
=>
'actionid'
,
'class'
=>
'custom-select m-l-1 autosubmit'
);
$checklinks
.
=
html_writer
::
select
(
$options
,
'action'
,
0
,
array
(
''
=>
'choosedots'
),
$attributes
);
$PAGE
->
requires
->
yui_module
(
'moodle-core-formautosubmit'
,
'M.core.init_formautosubmit'
,
array
(
array
(
'selectid'
=>
'actionid'
,
'nothing'
=>
false
))
...
...
@@ -664,7 +666,7 @@ if ($action === 'delete') {
$table
->
head
=
array
();
$table
->
align
=
array
(
'right'
,
'left'
);
$table
->
attributes
[
'class'
]
=
'compacttable generaltable'
;
$table
->
attributes
[
'class'
]
=
'compacttable generaltable
form-inline
'
;
$params
=
array
(
"lessonid"
=>
$lesson
->
id
,
"userid"
=>
$userid
);
if
(
!
$grades
=
$DB
->
get_records_select
(
"lesson_grades"
,
"lessonid = :lessonid and userid = :userid"
,
$params
,
"completed"
,
"*"
,
$try
,
1
))
{
...
...
@@ -706,7 +708,7 @@ if ($action === 'delete') {
$table
->
align
=
array
(
'left'
,
'left'
);
$table
->
size
=
array
(
'70%'
,
null
);
$table
->
attributes
[
'class'
]
=
'compacttable generaltable'
;
$table
->
attributes
[
'class'
]
=
'compacttable generaltable
form-inline
'
;
foreach
(
$answerpages
as
$page
)
{
unset
(
$table
->
data
);
...
...
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