41 $this->preserve_manual_scores =
false;
43 $this->recalculatedPasses = array();
80 $participants = $this->
test->getCompleteEvaluationData(
false)->getParticipants();
81 if (is_array($participants)) {
82 require_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
83 foreach ($participants as $active_id => $userdata) {
84 if (is_object($userdata) && is_array($userdata->getPasses())) {
98 $passes = $userdata->getPasses();
99 foreach ($passes as
$pass => $passdata) {
100 if (is_object($passdata)) {
114 $questions = $passdata->getAnsweredQuestions();
115 if (is_array($questions)) {
116 foreach ($questions as $questiondata) {
121 $question_gui = $this->
test->createQuestionGUI(
"", $questiondata[
'id']);
122 $this->recalculateQuestionScore($question_gui, $active_id,
$pass, $questiondata);
133 public function recalculateQuestionScore($question_gui, $active_id,
$pass, $questiondata)
136 if (is_object($question_gui)) {
137 $reached = $question_gui->object->calculateReachedPoints($active_id,
$pass);
138 $actual_reached = $question_gui->object->adjustReachedPointsByScoringOptions($reached, $active_id,
$pass);
140 if ($this->preserve_manual_scores ==
true && $questiondata[
'manual'] ==
'1') {
149 $question_gui->object->getMaximumPoints(),
163 public function calculateBestSolutionForTest()
166 foreach ($this->
test->getAllQuestions() as $question) {
168 $question_gui = $this->
test->createQuestionGUI(
"", $question[
'question_id']);
169 $solution .= $question_gui->getSolutionOutput(0, null,
true,
true,
false,
false,
true,
false);
177 $this->recalculatedPasses = array();
187 if (!is_array($this->recalculatedPasses[$activeId])) {
188 $this->recalculatedPasses[$activeId] = array();
191 $this->recalculatedPasses[$activeId][] =
$pass;
198 $query =
"DELETE FROM tst_test_result WHERE question_fi = %s";
206 foreach ($activeIds as $activeId) {
210 foreach ($passSelector->getExistingPasses() as
$pass) {
211 assQuestion::_updateTestPassResults($activeId,
$pass, $this->
test->areObligationsEnabled());
226 SELECT COUNT(*) num_manual_scorings 227 FROM tst_test_result tres 229 INNER JOIN tst_active tact 230 ON tact.active_id = tres.active_fi 231 AND tact.test_fi = %s 233 WHERE tres.manual = 1 236 $types = array(
'integer');
241 AND tres.question_fi = %s 244 $types[] =
'integer';
250 while (
$row = $DIC->database()->fetchAssoc(
$res)) {
251 return (
int)
$row[
'num_manual_scorings'];
static _updateTestResultCache($active_id, ilAssQuestionProcessLocker $processLocker=null)
Move this to a proper place.
recalculatePass($passdata, $active_id, $pass)
getRecalculatedPassesByActives()
foreach($_POST as $key=> $value) $res
static setForcePassResultUpdateEnabled($forcePassResultsUpdateEnabled)
addRecalculatedPassByActive($activeId, $pass)
__construct(ilObjTest $test)
setPreserveManualScores($preserve_manual_scores)
updatePassAndTestResults($activeIds)
resetRecalculatedPassesByActives()
removeAllQuestionResults($questionId)
getPreserveManualScores()
static _setReachedPoints($active_id, $question_id, $points, $maxpoints, $pass, $manualscoring, $obligationsEnabled)
Sets the points, a learner has reached answering the question Additionally objective results are upda...
recalculatePasses($userdata, $active_id)
setQuestionId(int $questionId)