@@ -3848,6 +3848,7 @@ public function response_analysis($rid, $resps, $compare, $isgroupmember, $allre
3848
3848
$ oppositeallscore = ' | ' .$ allscore [1 ].'% ' ;
3849
3849
}
3850
3850
if ($ this ->survey ->feedbackscores ) {
3851
+ $ table = $ table ?? new html_table ();
3851
3852
if ($ compare ) {
3852
3853
$ table ->data [] = array ($ sectionlabel , $ score [0 ].'% ' .$ oppositescore , $ allscore [0 ].'% ' .$ oppositeallscore );
3853
3854
} else {
@@ -3976,24 +3977,28 @@ public function response_analysis($rid, $resps, $compare, $isgroupmember, $allre
3976
3977
default :
3977
3978
}
3978
3979
3979
- foreach ($ allscore as $ key => $ sc ) {
3980
- if (isset ($ chartlabels [$ key ])) {
3981
- $ lb = explode ("| " , $ chartlabels [$ key ]);
3982
- $ oppositescore = '' ;
3983
- $ oppositeallscore = '' ;
3984
- if (count ($ lb ) > 1 ) {
3985
- $ sectionlabel = $ lb [0 ] . ' | ' . $ lb [1 ];
3986
- $ oppositescore = ' | ' . $ oppositescorepercent [$ key ] . '% ' ;
3987
- $ oppositeallscore = ' | ' . $ alloppositescorepercent [$ key ] . '% ' ;
3988
- } else {
3989
- $ sectionlabel = $ chartlabels [$ key ];
3990
- }
3991
- // If all questions of $section are unseen then don't show feedbackscores for this section.
3992
- if ($ compare && !is_nan ($ scorepercent [$ key ])) {
3993
- $ table ->data [] = array ($ sectionlabel , $ scorepercent [$ key ] . '% ' . $ oppositescore ,
3994
- $ allscorepercent [$ key ] . '% ' . $ oppositeallscore );
3995
- } else if (isset ($ allscorepercent [$ key ]) && !is_nan ($ allscorepercent [$ key ])) {
3996
- $ table ->data [] = array ($ sectionlabel , $ allscorepercent [$ key ] . '% ' . $ oppositeallscore );
3980
+ if ($ this ->survey ->feedbackscores ) {
3981
+ foreach ($ allscore as $ key => $ sc ) {
3982
+ if (isset ($ chartlabels [$ key ])) {
3983
+ $ lb = explode ("| " , $ chartlabels [$ key ]);
3984
+ $ oppositescore = '' ;
3985
+ $ oppositeallscore = '' ;
3986
+ if (count ($ lb ) > 1 ) {
3987
+ $ sectionlabel = $ lb [0 ] . ' | ' . $ lb [1 ];
3988
+ $ oppositescore = ' | ' . $ oppositescorepercent [$ key ] . '% ' ;
3989
+ $ oppositeallscore = ' | ' . $ alloppositescorepercent [$ key ] . '% ' ;
3990
+ } else {
3991
+ $ sectionlabel = $ chartlabels [$ key ];
3992
+ }
3993
+ // If all questions of $section are unseen then don't show feedbackscores for this section.
3994
+ if ($ compare && !is_nan ($ scorepercent [$ key ])) {
3995
+ $ table = $ table ?? new html_table ();
3996
+ $ table ->data [] = array ($ sectionlabel , $ scorepercent [$ key ] . '% ' . $ oppositescore ,
3997
+ $ allscorepercent [$ key ] . '% ' . $ oppositeallscore );
3998
+ } else if (isset ($ allscorepercent [$ key ]) && !is_nan ($ allscorepercent [$ key ])) {
3999
+ $ table = $ table ?? new html_table ();
4000
+ $ table ->data [] = array ($ sectionlabel , $ allscorepercent [$ key ] . '% ' . $ oppositeallscore );
4001
+ }
3997
4002
}
3998
4003
}
3999
4004
}
0 commit comments