|
|
|
@ -5030,6 +5030,11 @@ EOT; |
|
|
|
$total_weight |
|
|
|
$total_weight |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$percentage = 0; |
|
|
|
|
|
|
|
if (!empty($total_weight)) { |
|
|
|
|
|
|
|
$percentage = ($total_score / $total_weight) * 100; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return [ |
|
|
|
return [ |
|
|
|
'category_list' => $category_list, |
|
|
|
'category_list' => $category_list, |
|
|
|
'attempts_result_list' => $attemptResult, // array of results |
|
|
|
'attempts_result_list' => $attemptResult, // array of results |
|
|
|
@ -5040,6 +5045,7 @@ EOT; |
|
|
|
'all_answers_html' => $all, |
|
|
|
'all_answers_html' => $all, |
|
|
|
'total_score' => $total_score, |
|
|
|
'total_score' => $total_score, |
|
|
|
'total_weight' => $total_weight, |
|
|
|
'total_weight' => $total_weight, |
|
|
|
|
|
|
|
'total_percentage' => $percentage, |
|
|
|
'count_pending_questions' => $countPendingQuestions, |
|
|
|
'count_pending_questions' => $countPendingQuestions, |
|
|
|
]; |
|
|
|
]; |
|
|
|
} |
|
|
|
} |
|
|
|
@ -5957,16 +5963,26 @@ EOT; |
|
|
|
MessageManager::send_message($currentUserId, $subject, $content); |
|
|
|
MessageManager::send_message($currentUserId, $subject, $content); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Notifications. |
|
|
|
$extraFieldData = $exerciseExtraFieldValue->get_values_by_handler_and_field_variable( |
|
|
|
$extraFieldData = $exerciseExtraFieldValue->get_values_by_handler_and_field_variable( |
|
|
|
$objExercise->iId, |
|
|
|
$objExercise->iId, |
|
|
|
'notifications' |
|
|
|
'notifications' |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
$exerciseNotification = ''; |
|
|
|
$exerciseNotification = ''; |
|
|
|
if ($extraFieldData && isset($extraFieldData['value'])) { |
|
|
|
if ($extraFieldData && isset($extraFieldData['value'])) { |
|
|
|
$exerciseNotification = $extraFieldData['value']; |
|
|
|
$exerciseNotification = $extraFieldData['value']; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Blocking exercise. |
|
|
|
|
|
|
|
$extraFieldData = $exerciseExtraFieldValue->get_values_by_handler_and_field_variable( |
|
|
|
|
|
|
|
$objExercise->iId, |
|
|
|
|
|
|
|
'blocking_percentage' |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
$blockPercentage = false; |
|
|
|
|
|
|
|
if ($extraFieldData && isset($extraFieldData['value']) && $extraFieldData['value']) { |
|
|
|
|
|
|
|
$blockPercentage = $extraFieldData['value']; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$extraFieldValueUser = new ExtraFieldValue('user'); |
|
|
|
$extraFieldValueUser = new ExtraFieldValue('user'); |
|
|
|
|
|
|
|
|
|
|
|
if (!empty($exerciseNotification) && !empty($notifications)) { |
|
|
|
if (!empty($exerciseNotification) && !empty($notifications)) { |
|
|
|
@ -6012,6 +6028,19 @@ EOT; |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($blockPercentage && isset($attempt['is_block_by_percentage'])) { |
|
|
|
|
|
|
|
$passBlock = $stats['total_percentage'] > $blockPercentage; |
|
|
|
|
|
|
|
if ($attempt['is_block_by_percentage']) { |
|
|
|
|
|
|
|
if ($passBlock) { |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
if (false === $passBlock) { |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
switch ($attempt['status']) { |
|
|
|
switch ($attempt['status']) { |
|
|
|
case 'passed': |
|
|
|
case 'passed': |
|
|
|
if ($exercisePassed) { |
|
|
|
if ($exercisePassed) { |
|
|
|
|