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
moodle
moodle
Commits
4ffe7ac4
Commit
4ffe7ac4
authored
Feb 24, 2011
by
Tim Hunt
Browse files
MDL-47494 gapselect: Review and fix the format parameter to all calls to format_text.
parent
6ec101ac
Changes
3
Hide whitespace changes
Inline
Side-by-side
question/type/gapselect/questionbase.php
View file @
4ffe7ac4
...
...
@@ -97,12 +97,12 @@ abstract class qtype_gapselect_question_base extends question_graded_automatical
}
public
function
get_question_summary
()
{
$question
=
$this
->
html_to_text
(
$this
->
questiontext
);
$question
=
$this
->
html_to_text
(
$this
->
questiontext
,
$this
->
questiontextformat
);
$groups
=
array
();
foreach
(
$this
->
choices
as
$group
=>
$choices
)
{
$cs
=
array
();
foreach
(
$choices
as
$choice
)
{
$cs
[]
=
$this
->
html_to_text
(
$choice
->
text
);
$cs
[]
=
html_to_text
(
$choice
->
text
,
0
,
false
);
}
$groups
[]
=
'[['
.
$group
.
']] -> {'
.
implode
(
' / '
,
$cs
)
.
'}'
;
}
...
...
@@ -120,8 +120,8 @@ abstract class qtype_gapselect_question_base extends question_graded_automatical
foreach
(
$this
->
places
as
$place
=>
$group
)
{
if
(
array_key_exists
(
$this
->
field
(
$place
),
$response
)
&&
$response
[
$this
->
field
(
$place
)])
{
$choices
[]
=
'{'
.
$this
->
html_to_text
(
$this
->
get_selected_choice
(
$group
,
$response
[
$this
->
field
(
$place
)])
->
text
)
.
'}'
;
$choices
[]
=
'{'
.
html_to_text
(
$this
->
get_selected_choice
(
$group
,
$response
[
$this
->
field
(
$place
)])
->
text
,
0
,
false
)
.
'}'
;
$allblank
=
false
;
}
else
{
$choices
[]
=
'{}'
;
...
...
@@ -286,7 +286,7 @@ abstract class qtype_gapselect_question_base extends question_graded_automatical
$choiceno
=
$this
->
choiceorder
[
$group
][
$response
[
$fieldname
]];
$choice
=
$this
->
choices
[
$group
][
$choiceno
];
$parts
[
$place
]
=
new
question_classified_response
(
$choiceno
,
$this
->
html_to_text
(
$choice
->
text
),
$choiceno
,
html_to_text
(
$choice
->
text
,
0
,
false
),
$this
->
get_right_choice_for
(
$place
)
==
$response
[
$fieldname
]);
}
return
$parts
;
...
...
question/type/gapselect/questiontypebase.php
View file @
4ffe7ac4
...
...
@@ -297,7 +297,7 @@ abstract class qtype_gapselect_base extends question_type {
foreach
(
$question
->
choices
[
$group
]
as
$i
=>
$choice
)
{
$choices
[
$i
]
=
new
question_possible_response
(
$question
->
html_to_text
(
$choice
->
text
),
html_to_text
(
$choice
->
text
,
0
,
false
),
$question
->
rightchoices
[
$place
]
==
$i
);
}
$choices
[
null
]
=
question_possible_response
::
no_response
();
...
...
question/type/gapselect/rendererbase.php
View file @
4ffe7ac4
...
...
@@ -51,7 +51,7 @@ abstract class qtype_elements_embedded_in_question_text_renderer extends qtype_w
$result
=
''
;
$result
.
=
html_writer
::
tag
(
'div'
,
$question
->
format_text
(
$questiontext
,
$qa
,
'question'
,
'questiontext'
,
$question
->
id
),
$question
->
questiontextformat
,
$qa
,
'question'
,
'questiontext'
,
$question
->
id
),
array
(
'class'
=>
$this
->
qtext_classname
(),
'id'
=>
$qa
->
get_qt_field_name
(
''
)));
$result
.
=
$this
->
post_qtext_elements
(
$qa
,
$options
);
...
...
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