Fix weird scorm status update BT#8897

Restoring file from previous change
1.10.x
Julio Montoya 11 years ago
parent dd2df8ae88
commit 8095571983
  1. 12
      main/newscorm/learnpathItem.class.php

@ -3817,7 +3817,6 @@ class learnpathItem
if ($this->type == 'quiz' && $this->get_prevent_reinit() == 0 &&
$this->get_status() == 'completed'
) {
if (!api_is_invitee()) {
// We force the item to be restarted.
$this->restart();
$params = array(
@ -3843,7 +3842,6 @@ class learnpathItem
$this->db_item_view_id = Database::insert($item_view_table, $params);
$inserted = true;
}
}
$item_view_table = Database::get_course_table(TABLE_LP_ITEM_VIEW);
$check = "SELECT * FROM $item_view_table
@ -3862,7 +3860,6 @@ class learnpathItem
// Depending on what we want (really), we'll update or insert a new row
// now save into DB.
if (!$inserted && Database::num_rows($check_res) < 1) {
if (!api_is_invitee()) {
$params = array(
"c_id" => $course_id,
"total_time" => $this->get_total_time(),
@ -3886,10 +3883,8 @@ class learnpathItem
}
$this->db_item_view_id = Database::insert($item_view_table, $params);
}
} else {
if ($this->type == 'hotpotatoes') {
if (!api_is_invitee()) {
$params = array(
'total_time' => $this->get_total_time(),
'start_time' => $this->get_current_start_time(),
@ -3904,7 +3899,6 @@ class learnpathItem
array($course_id, $this->db_id, $this->view_id, $this->get_attempt_id())
);
Database::update($item_view_table, $params, $where);
}
} else {
// For all other content types...
if ($this->type == 'quiz') {
@ -4028,7 +4022,6 @@ class learnpathItem
}
if ($this->type == 'sco') {
if (!api_is_invitee()) {
//IF scorm scorm_update_time has already updated total_time in db
//" . //start_time = ".$this->get_current_start_time().", " . //scorm_init_time does it
////" max_time_allowed = '".$this->get_max_time_allowed()."'," .
@ -4043,10 +4036,8 @@ class learnpathItem
lp_item_id = " . $this->db_id . " AND
lp_view_id = " . $this->view_id . " AND
view_count = " . $this->get_attempt_id();
}
} else {
if (!api_is_invitee()) {
//" max_time_allowed = '".$this->get_max_time_allowed()."'," .
$sql = "UPDATE $item_view_table SET
$total_time
@ -4062,7 +4053,6 @@ class learnpathItem
lp_view_id = " . $this->view_id . " AND
view_count = " . $this->get_attempt_id();
}
}
$this->current_start_time = time();
}
if (self::debug > 2) {
@ -4071,10 +4061,8 @@ class learnpathItem
0
);
}
if (!empty($sql)) {
Database::query($sql);
}
}
if (is_array($this->interactions) && count($this->interactions) > 0) {
// Save interactions.

Loading…
Cancel
Save