Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
smeyer-ilias committed Aug 21, 2015
1 parent f36bf27 commit 5c23b7f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ public function updateQuestionResult(ilTestSession $session, assQuestion $qst)
$ur->saveObjectiveResult(
$run->getObjectiveId(),
$this->getAssignments()->getTypeByTest($session->getRefId()),
ilLOUtils::isCompleted(
$comp = ilLOUtils::isCompleted(
$this->container_id,
$session->getRefId(),
$run->getObjectiveId(),
Expand All @@ -394,6 +394,7 @@ public function updateQuestionResult(ilTestSession $session, assQuestion $qst)
$old_result['is_final']
);
$GLOBALS['ilLog']->write(__METHOD__.': '.print_r($run->getResult(),true));
$GLOBALS['ilLog']->write(__METHOD__.'!!!!!!!!!!!!!!!!!!!!: '.print_r($comp,TRUE));

include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
ilLPStatusWrapper::_updateStatus($this->container_id,$this->user_id);
Expand Down
8 changes: 5 additions & 3 deletions Modules/Course/classes/Objectives/class.ilLOUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class ilLOUtils
/**
* Check if objective is completed
*/
public static function isCompleted($a_cont_oid, $a_test_rid, $a_objective_id, $max_points, $reached,$limit_perc)
public static function isCompleted($a_cont_oid, $a_test_rid, $a_objective_id, $max_points, $reached, $limit_perc)
{
include_once './Modules/Course/classes/Objectives/class.ilLOSettings.php';
$settings = ilLOSettings::getInstanceByObjId($a_cont_oid);
Expand All @@ -31,13 +31,15 @@ public static function isCompleted($a_cont_oid, $a_test_rid, $a_objective_id, $m
}
else
{
$required_perc = self::lookupObjectiveRequiredPercentage($a_cont_oid, $a_objective_id, $a_test_rid, $max_points);

if(!$max_points)
{
return TRUE;
}
else
{
return ($reached / $max_points * 100) >= $limit_perc;
return ($reached / $max_points * 100) >= $required_perc;
}
}
}
Expand Down Expand Up @@ -219,4 +221,4 @@ public static function hasActiveRun($a_container_id, $a_test_ref_id, $a_objectiv
}

}
?>
?>
2 changes: 1 addition & 1 deletion Modules/Course/classes/class.ilCourseObjectiveResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ function reset($a_course_id)
"AND user_id = ".$ilDB->quote($this->getUserId())."";
$res = $ilDB->manipulate($query);

$query = "DELETE FROM ilLOUserResults ".
$query = "DELETE FROM loc_user_results ".
"WHERE ".$ilDB->in('objective_id',$objectives,false,'integer').' '.
"AND user_id = ".$ilDB->quote($this->getUserId())."";
}
Expand Down
12 changes: 8 additions & 4 deletions Services/Container/classes/class.ilContainerObjectiveGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -1036,10 +1036,14 @@ public static function buildObjectiveProgressBar($a_has_initial_test, $a_objecti

$next_step = $progress_txt = $bar_color = $test_url = $initial_sub = null;


include_once './Modules/Course/classes/Objectives/class.ilLOSettings.php';
// qualifying test
if($a_lo_result["type"] == ilLOUserResults::TYPE_QUALIFIED ||
($a_lo_result['type'] == ilLOUserResults::TYPE_INITIAL &&
ilLOSettings::getInstanceByObjId($a_lo_result['course_id'])->isInitialTestQualifying()))
if(
$a_lo_result["type"] == ilLOUserResults::TYPE_QUALIFIED or
($a_lo_result['type'] == ilLOUserResults::TYPE_INITIAL and
ilLOSettings::getInstanceByObjId($a_lo_result['course_id'])->isInitialTestQualifying())
)
{
$progress_txt = $lng->txt("crs_loc_progress_result_qtest");
$tt_txt = $lng->txt("crs_loc_tab_qtest").": ".$tt_txt;
Expand Down Expand Up @@ -1226,4 +1230,4 @@ protected function showButton($a_cmd,$a_text,$a_target = '', $a_id = "")
$a_target, "", '', $a_id);
}
}
?>
?>

0 comments on commit 5c23b7f

Please sign in to comment.