|
|
|
@ -370,7 +370,7 @@ function lp_upload_quiz_action_handling() |
|
|
|
if (is_array($myAnswerList) && !empty($myAnswerList) && !empty($question_id)) { |
|
|
|
if (is_array($myAnswerList) && !empty($myAnswerList) && !empty($question_id)) { |
|
|
|
$id = 1; |
|
|
|
$id = 1; |
|
|
|
$objAnswer = new Answer($question_id, $courseId); |
|
|
|
$objAnswer = new Answer($question_id, $courseId); |
|
|
|
$globalScore = $scoreList[$i]; |
|
|
|
$globalScore = isset($scoreList[$i]) ? $scoreList[$i] : null; |
|
|
|
|
|
|
|
|
|
|
|
// Calculate the number of correct answers to divide the |
|
|
|
// Calculate the number of correct answers to divide the |
|
|
|
// score between them when importing from CSV |
|
|
|
// score between them when importing from CSV |
|
|
|
@ -387,7 +387,7 @@ function lp_upload_quiz_action_handling() |
|
|
|
$score = 0; |
|
|
|
$score = 0; |
|
|
|
if (strtolower($answer_data['extra']) == 'x') { |
|
|
|
if (strtolower($answer_data['extra']) == 'x') { |
|
|
|
$correct = 1; |
|
|
|
$correct = 1; |
|
|
|
$score = $scoreList[$i]; |
|
|
|
$score = isset($scoreList[$i]) ? $scoreList[$i] : null; |
|
|
|
$comment = isset($feedbackTrueList[$i]) ? $feedbackTrueList[$i] : ''; |
|
|
|
$comment = isset($feedbackTrueList[$i]) ? $feedbackTrueList[$i] : ''; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
$comment = isset($feedbackFalseList[$i]) ? $feedbackFalseList[$i] : ''; |
|
|
|
$comment = isset($feedbackFalseList[$i]) ? $feedbackFalseList[$i] : ''; |
|
|
|
@ -463,7 +463,7 @@ function lp_upload_quiz_action_handling() |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
break; |
|
|
|
case FREE_ANSWER: |
|
|
|
case FREE_ANSWER: |
|
|
|
$globalScore = $scoreList[$i]; |
|
|
|
$globalScore = isset($scoreList[$i]) ? $scoreList[$i] : null; |
|
|
|
$questionObj = Question::read($question_id, $courseId); |
|
|
|
$questionObj = Question::read($question_id, $courseId); |
|
|
|
if ($questionObj) { |
|
|
|
if ($questionObj) { |
|
|
|
$questionObj->updateWeighting($globalScore); |
|
|
|
$questionObj->updateWeighting($globalScore); |
|
|
|
@ -504,7 +504,7 @@ function lp_upload_quiz_action_handling() |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
break; |
|
|
|
case MATCHING: |
|
|
|
case MATCHING: |
|
|
|
$globalScore = $scoreList[$i]; |
|
|
|
$globalScore = isset($scoreList[$i]) ? $scoreList[$i] : null; |
|
|
|
$position = 1; |
|
|
|
$position = 1; |
|
|
|
|
|
|
|
|
|
|
|
$objAnswer = new Answer($question_id, $courseId); |
|
|
|
$objAnswer = new Answer($question_id, $courseId); |
|
|
|
|