Skip to content

Commit

Permalink
fix: Strips HTML from quiz names to fix #439. (#446 - Thanks @garemoko)
Browse files Browse the repository at this point in the history
  • Loading branch information
garemoko authored and ryasmi committed Feb 21, 2019
1 parent f6b6c8d commit 5853986
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function essay(array $config, \stdClass $event, \stdClass $questionattempt, \std
'definition' => [
'type' => 'http://adlnet.gov/expapi/activities/cmi.interaction',
'name' => [
$lang => $question->questiontext,
$lang => utils\get_string_html_removed($question->questiontext)
],
'interactionType' => 'long-fill-in',
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function gapselect(array $config, \stdClass $event, \stdClass $questionattempt,
'definition' => [
'type' => 'http://adlnet.gov/expapi/activities/cmi.interaction',
'name' => [
$lang => $question->questiontext,
$lang => utils\get_string_html_removed($question->questiontext)
],
'interactionType' => 'sequencing',
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function ($reduction, $selection) {
'definition' => [
'type' => 'http://adlnet.gov/expapi/activities/cmi.interaction',
'name' => [
$lang => $question->questiontext,
$lang => utils\get_string_html_removed($question->questiontext)
],
'interactionType' => 'matching',
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function numerical(array $config, \stdClass $event, \stdClass $questionattempt,
'definition' => [
'type' => 'http://adlnet.gov/expapi/activities/cmi.interaction',
'name' => [
$lang => $question->questiontext,
$lang => utils\get_string_html_removed($question->questiontext)
],
'interactionType' => 'numeric',
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function ($reduction, $selection) {
'definition' => [
'type' => 'http://adlnet.gov/expapi/activities/cmi.interaction',
'name' => [
$lang => $question->questiontext,
$lang => utils\get_string_html_removed($question->questiontext)
],
'interactionType' => 'matching',
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function shortanswer(array $config, \stdClass $event, \stdClass $questionattempt
'definition' => [
'type' => 'http://adlnet.gov/expapi/activities/cmi.interaction',
'name' => [
$lang => $question->questiontext,
$lang => utils\get_string_html_removed($question->questiontext)
],
'interactionType' => 'fill-in',
]
Expand Down
2 changes: 1 addition & 1 deletion tests/mod_quiz/attempt_submitted/gapselect/statements.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
"definition": {
"type": "http:\/\/adlnet.gov\/expapi\/activities\/cmi.interaction",
"name": {
"en": "<p>Example [[1]] missing [[2]] words [[3]]<\/p>"
"en": "Example [[1]] missing [[2]] words [[3]]"
},
"interactionType": "sequencing"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
"definition": {
"type": "http:\/\/adlnet.gov\/expapi\/activities\/cmi.interaction",
"name": {
"en": "<p>Example Random short-answer matching question<br><\/p>"
"en": "Example Random short-answer matching question"
},
"interactionType": "matching"
}
Expand Down

0 comments on commit 5853986

Please sign in to comment.