@@ -122,6 +122,9 @@ protected function question_survey_display($response, $dependants=[], $blankques
122
122
}
123
123
$ contents = questionnaire_choice_values ($ choice ->content );
124
124
$ radio ->label = $ value .format_text ($ contents ->text , FORMAT_HTML , ['noclean ' => true ]).$ contents ->image ;
125
+ if (!empty ($ this ->qlegend )) {
126
+ $ radio ->alabel = strip_tags ("{$ this ->qlegend } {$ radio ->label }" );
127
+ }
125
128
} else { // Radio button with associated !other text field.
126
129
$ othertext = $ choice ->other_choice_display ();
127
130
$ cname = choice::id_other_choice_name ($ id );
@@ -143,6 +146,10 @@ protected function question_survey_display($response, $dependants=[], $blankques
143
146
$ radio ->ovalue = format_string (stripslashes ($ odata ));
144
147
}
145
148
$ radio ->olabel = 'Text for ' .format_text ($ othertext , FORMAT_HTML , ['noclean ' => true ]);
149
+ if (!empty ($ this ->qlegend )) {
150
+ $ radio ->alabel = strip_tags ("{$ this ->qlegend } {$ radio ->label }" );
151
+ $ radio ->aolabel = strip_tags ("{$ this ->qlegend } {$ radio ->olabel }" );
152
+ }
146
153
}
147
154
$ choicetags ->qelements [] = (object )['choice ' => $ radio ];
148
155
}
@@ -164,6 +171,9 @@ protected function question_survey_display($response, $dependants=[], $blankques
164
171
}
165
172
$ content = get_string ('noanswer ' , 'questionnaire ' );
166
173
$ radio ->label = format_text ($ content , FORMAT_HTML , ['noclean ' => true ]);
174
+ if (!empty ($ this ->qlegend )) {
175
+ $ radio ->alabel = strip_tags ("{$ this ->qlegend } {$ radio ->label }" );
176
+ }
167
177
168
178
$ choicetags ->qelements [] = (object )['choice ' => $ radio ];
169
179
}
@@ -213,6 +223,9 @@ protected function response_survey_display($response) {
213
223
} else {
214
224
$ chobj ->content = ($ choice ->content === '' ? $ id : format_text ($ choice ->content , FORMAT_HTML , ['noclean ' => true ]));
215
225
}
226
+ if (!empty ($ this ->qlegend )) {
227
+ $ chobj ->alabel = strip_tags ("{$ this ->qlegend } {$ chobj ->content }" );
228
+ }
216
229
$ resptags ->choices [] = $ chobj ;
217
230
}
218
231
0 commit comments