Skip to content

Commit c842f20

Browse files
committed
Add in "nolink" span tags round inputs, validation and PRT to stop auto-linking and address #1675.
1 parent 34bf87b commit c842f20

1 file changed

Lines changed: 14 additions & 4 deletions

File tree

renderer.php

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,19 @@ public function formulation_and_controls(question_attempt $qa, question_display_
7070
foreach ($question->inputs as $name => $input) {
7171
$questiontext = str_replace(
7272
"[[input:{$name}]]",
73-
"[[pnMNEYMWDx:{$name}]]",
73+
"<span class=\"nolink\">[[InMNEYMWDx:{$name}]]</span>",
74+
$questiontext
75+
);
76+
$questiontext = str_replace(
77+
"[[validation:{$name}]]",
78+
"<span class=\"nolink\">[[VnMNEYMWDx:{$name}]]</span>",
7479
$questiontext
7580
);
7681
}
7782
foreach ($question->prts as $index => $prt) {
7883
$questiontext = str_replace(
7984
"[[feedback:{$index}]]",
80-
"[[GDBBdLBJLg:{$index}]]",
85+
"<span class=\"nolink\">[[GDBBdLBJLg:{$index}]]</span>",
8186
$questiontext
8287
);
8388
}
@@ -93,14 +98,19 @@ public function formulation_and_controls(question_attempt $qa, question_display_
9398
// Restore inputnames.
9499
foreach ($question->inputs as $name => $input) {
95100
$questiontext = str_replace(
96-
"[[pnMNEYMWDx:{$name}]]",
101+
"<span class=\"nolink\">[[InMNEYMWDx:{$name}]]</span>",
97102
"[[input:{$name}]]",
98103
$questiontext
99104
);
105+
$questiontext = str_replace(
106+
"<span class=\"nolink\">[[VnMNEYMWDx:{$name}]]</span>",
107+
"[[validation:{$name}]]",
108+
$questiontext
109+
);
100110
}
101111
foreach ($question->prts as $index => $prt) {
102112
$questiontext = str_replace(
103-
"[[GDBBdLBJLg:{$index}]]",
113+
"<span class=\"nolink\">[[GDBBdLBJLg:{$index}]]</span>",
104114
"[[feedback:{$index}]]",
105115
$questiontext
106116
);

0 commit comments

Comments
 (0)