@@ -187,15 +187,17 @@ public function run_all_tests_for_context(context $context, $categoryid = null)
187
187
global $ OUTPUT ;
188
188
189
189
// Load the necessary data.
190
+ $ coursename = $ context ->get_context_name (true , true );
190
191
$ categories = $ this ->get_categories_for_context ($ context ->id );
191
192
$ questiontestsurl = new moodle_url ('/question/type/coderunner/questiontestrun.php ' );
192
193
if ($ context ->contextlevel == CONTEXT_COURSE ) {
193
- $ questiontestsurl -> param ( 'courseid ' , $ context ->instanceid ) ;
194
+ $ qparams [ 'courseid ' ] = $ context ->instanceid ;
194
195
} else if ($ context ->contextlevel == CONTEXT_MODULE ) {
195
- $ questiontestsurl -> param ( 'cmid ' , $ context ->instanceid ) ;
196
+ $ qparams [ 'cmid ' ] = $ context ->instanceid ;
196
197
} else {
197
- $ questiontestsurl -> param ( 'courseid ' , SITEID ) ;
198
+ $ qparams [ 'courseid ' ] = SITEID ;
198
199
}
200
+ $ questiontestsurl ->params ($ qparams );
199
201
$ numpasses = 0 ;
200
202
$ failingtests = [];
201
203
$ missinganswers = [];
@@ -233,12 +235,17 @@ public function run_all_tests_for_context(context $context, $categoryid = null)
233
235
// Report the result, and record failures for the summary.
234
236
echo " $ message</li> " ;
235
237
flush (); // Force output to prevent timeouts and show progress.
238
+ $ qparams ['category ' ] = $ currentcategoryid . ', ' . $ context ->id ;
239
+ $ qparams ['lastchanged ' ] = $ question ->id ;
240
+ $ qparams ['qperpage ' ] = 1000 ;
241
+ $ questionbankurl = new moodle_url ('/question/edit.php ' , $ qparams );
242
+ $ questionbanklink = html_writer::link ($ questionbankurl , $ nameandcount ->name , ['target ' => '_blank ' ]);
236
243
if ($ outcome === self ::PASS ) {
237
244
$ numpasses += 1 ;
238
245
} else if ($ outcome === self ::MISSINGANSWER ) {
239
- $ missinganswers [] = $ questionnamelink ;
246
+ $ missinganswers [] = " $ coursename / $ questionbanklink / $ questionnamelink" ;
240
247
} else {
241
- $ failingtests [] = "$ questionnamelink: $ message " ;
248
+ $ failingtests [] = "$ coursename / $ questionbanklink / $ questionnamelink: $ message " ;
242
249
}
243
250
}
244
251
echo "</ul> \n" ;
0 commit comments