@@ -313,7 +313,7 @@ public function run_all_tests_for_context($questionidstoinclude = []) {
313
313
} else {
314
314
$ qparams ['courseid ' ] = SITEID ;
315
315
}
316
- $ questiontestsurl = new moodle_url ('/question/type/coderunner/questiontestrun.php ' );
316
+ $ questiontestsurl = new moodle_url ('/question/type/coderunner/questiontestrun.php ' );
317
317
$ questiontestsurl ->params ($ qparams );
318
318
319
319
$ this ->numpasses = 0 ;
@@ -404,7 +404,7 @@ public function run_all_tests_for_context($questionidstoinclude = []) {
404
404
}
405
405
echo "</ul> \n" ;
406
406
}
407
- return ;
407
+ return [ $ this -> numpasses , $ this -> failedtestdetails , $ this -> missinganswerdetails ] ;
408
408
}
409
409
410
410
@@ -497,8 +497,6 @@ public function print_overall_result() {
497
497
}
498
498
echo html_writer::end_tag ('ul ' );
499
499
}
500
-
501
-
502
500
if (count ($ this ->failedtestdetails ) > 0 ) {
503
501
echo $ OUTPUT ->heading (get_string ('coderunner_install_testsuite_failures ' , 'qtype_coderunner ' ), 5 );
504
502
echo html_writer::start_tag ('ul ' );
@@ -532,6 +530,36 @@ public function print_overall_result() {
532
530
echo html_writer::tag ('p ' , $ link );
533
531
}
534
532
533
+ /**
534
+ * Print an overall summary of the failed tests.
535
+ */
536
+ public static function print_summary_after_bulktestall ($ numpasses , $ allfailingtests , $ allmissinganswers ) {
537
+ global $ OUTPUT ;
538
+ echo $ OUTPUT ->heading (get_string ('bulktestoverallresults ' , 'qtype_coderunner ' ), 5 );
539
+ $ spacer = ' | ' ;
540
+ $ passstr = $ numpasses . ' ' . get_string ('passes ' , 'qtype_coderunner ' ) . $ spacer ;
541
+ $ failstr = count ($ allfailingtests ) . ' ' . get_string ('fails ' , 'qtype_coderunner ' ) . $ spacer ;
542
+ $ missingstr = count ($ allmissinganswers ) . ' ' . get_string ('missinganswers ' , 'qtype_coderunner ' );
543
+ echo html_writer::tag ('p ' , $ passstr . $ failstr . $ missingstr );
544
+
545
+ if (count ($ allmissinganswers ) > 0 ) {
546
+ echo $ OUTPUT ->heading (get_string ('coderunner_install_testsuite_noanswer ' , 'qtype_coderunner ' ), 5 );
547
+ echo html_writer::start_tag ('ul ' );
548
+ foreach ($ allmissinganswers as $ message ) {
549
+ echo html_writer::tag ('li ' , $ message );
550
+ }
551
+ echo html_writer::end_tag ('ul ' );
552
+ }
553
+ if (count ($ allfailingtests ) > 0 ) {
554
+ echo $ OUTPUT ->heading (get_string ('coderunner_install_testsuite_failures ' , 'qtype_coderunner ' ), 5 );
555
+ echo html_writer::start_tag ('ul ' );
556
+ foreach ($ allfailingtests as $ message ) {
557
+ echo html_writer::tag ('li ' , $ message );
558
+ }
559
+ echo html_writer::end_tag ('ul ' );
560
+ }
561
+ }
562
+
535
563
536
564
/**
537
565
* Display the results of scanning all the CodeRunner questions to
0 commit comments