File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -2440,8 +2440,8 @@ public function manage_answer(
24402440 while ($ row = Database::fetch_array ($ result )) {
24412441 $ ind = $ row ['answer ' ];
24422442 $ values = explode (': ' , $ ind );
2443- $ my_answer_id = $ values [0 ];
2444- $ option = $ values [1 ];
2443+ $ my_answer_id = isset ( $ values [0 ]) ? $ values [ 0 ] : '' ;
2444+ $ option = isset ( $ values [1 ]) ? $ values [ 1 ] : '' ;
24452445 $ choice [$ my_answer_id ] = $ option ;
24462446 }
24472447 }
@@ -2530,12 +2530,12 @@ public function manage_answer(
25302530 $ ind = $ row ['answer ' ];
25312531 $ result = explode (': ' ,$ ind );
25322532 if (isset ($ result [0 ])) {
2533- $ my_answer_id = $ result [0 ];
2534- $ option = $ result [1 ];
2533+ $ my_answer_id = isset ( $ result [0 ]) ? $ result [ 0 ] : '' ;
2534+ $ option = isset ( $ result [1 ]) ? $ result [ 1 ] : '' ;
25352535 $ choice [$ my_answer_id ] = $ option ;
25362536 }
25372537 }
2538- $ studentChoice = $ choice [$ answerAutoId ];
2538+ $ studentChoice = isset ( $ choice [$ answerAutoId ]) ? $ choice [ $ answerAutoId ] : '' ;
25392539
25402540 if ($ answerCorrect == $ studentChoice ) {
25412541 //$answerCorrect = 1;
Original file line number Diff line number Diff line change @@ -3579,6 +3579,12 @@ public static function display_question_list_by_attempt(
35793579 $ category_was_added_for_this_test = false ;
35803580
35813581 if (isset ($ objQuestionTmp ->category ) && !empty ($ objQuestionTmp ->category )) {
3582+ if (!isset ($ category_list [$ objQuestionTmp ->category ]['score ' ])) {
3583+ $ category_list [$ objQuestionTmp ->category ]['score ' ] = 0 ;
3584+ }
3585+ if (!isset ($ category_list [$ objQuestionTmp ->category ]['total ' ])) {
3586+ $ category_list [$ objQuestionTmp ->category ]['total ' ] = 0 ;
3587+ }
35823588 $ category_list [$ objQuestionTmp ->category ]['score ' ] += $ my_total_score ;
35833589 $ category_list [$ objQuestionTmp ->category ]['total ' ] += $ my_total_weight ;
35843590 $ category_was_added_for_this_test = true ;
You can’t perform that action at this time.
0 commit comments