|
|
|
@ -2203,7 +2203,7 @@ function get_terms() |
|
|
|
//check the row exists |
|
|
|
//check the row exists |
|
|
|
$inserted = false; |
|
|
|
$inserted = false; |
|
|
|
|
|
|
|
|
|
|
|
// this a special case for multiple attepmts and Dokeos exercises |
|
|
|
// this a special case for multiple attempts and Dokeos exercises |
|
|
|
if ($this->type == 'quiz' && $this->get_prevent_reinit()==0 && $this->get_status()=='completed') { |
|
|
|
if ($this->type == 'quiz' && $this->get_prevent_reinit()==0 && $this->get_status()=='completed') { |
|
|
|
// we force the item to be restarted |
|
|
|
// we force the item to be restarted |
|
|
|
$this->restart(); |
|
|
|
$this->restart(); |
|
|
|
@ -2283,8 +2283,8 @@ function get_terms() |
|
|
|
$this->db_item_view_id = Database::get_last_insert_id(); |
|
|
|
$this->db_item_view_id = Database::get_last_insert_id(); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
$sql = ''; |
|
|
|
$sql = ''; |
|
|
|
if($this->type=='hotpotatoes') |
|
|
|
if($this->type=='hotpotatoes') { |
|
|
|
{ //make an exception for HotPotatoes, don't update the score |
|
|
|
//make an exception for HotPotatoes, don't update the score |
|
|
|
//because it has been saved outside of this tool |
|
|
|
//because it has been saved outside of this tool |
|
|
|
$sql = "UPDATE $item_view_table " . |
|
|
|
$sql = "UPDATE $item_view_table " . |
|
|
|
"SET total_time = ".$this->get_total_time().", " . |
|
|
|
"SET total_time = ".$this->get_total_time().", " . |
|
|
|
@ -2297,9 +2297,8 @@ function get_terms() |
|
|
|
"WHERE lp_item_id = ".$this->db_id." " . |
|
|
|
"WHERE lp_item_id = ".$this->db_id." " . |
|
|
|
"AND lp_view_id = ".$this->view_id." " . |
|
|
|
"AND lp_view_id = ".$this->view_id." " . |
|
|
|
"AND view_count = ".$this->attempt_id; |
|
|
|
"AND view_count = ".$this->attempt_id; |
|
|
|
} |
|
|
|
} else { |
|
|
|
else |
|
|
|
//for all other content types... |
|
|
|
{ //for all other content types... |
|
|
|
|
|
|
|
if ($this->type=='quiz') { |
|
|
|
if ($this->type=='quiz') { |
|
|
|
$my_status = ' '; |
|
|
|
$my_status = ' '; |
|
|
|
$total_time = ' '; |
|
|
|
$total_time = ' '; |
|
|
|
@ -2316,8 +2315,6 @@ function get_terms() |
|
|
|
$mytime = ((int)$time_exe_date-(int)$time_start_date); |
|
|
|
$mytime = ((int)$time_exe_date-(int)$time_start_date); |
|
|
|
$total_time =" total_time = ".$mytime.", "; |
|
|
|
$total_time =" total_time = ".$mytime.", "; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
$my_type_lp=learnpath::get_type_static($this->lp_id); |
|
|
|
$my_type_lp=learnpath::get_type_static($this->lp_id); |
|
|
|
// this is a array containing values finished |
|
|
|
// this is a array containing values finished |
|
|
|
@ -2331,9 +2328,8 @@ function get_terms() |
|
|
|
$rs_verified=api_sql_query($sql_verified,__FILE__,__LINE__); |
|
|
|
$rs_verified=api_sql_query($sql_verified,__FILE__,__LINE__); |
|
|
|
$row_verified=Database::fetch_array($rs_verified); |
|
|
|
$row_verified=Database::fetch_array($rs_verified); |
|
|
|
|
|
|
|
|
|
|
|
//get type lp i.e 2=scorm and 1=lp dokeos |
|
|
|
//get type lp: 1=lp dokeos and 2=scorm |
|
|
|
// if not is completed or passed or browsed and learnig path is scorm |
|
|
|
// if not is completed or passed or browsed and learning path is scorm |
|
|
|
|
|
|
|
|
|
|
|
if(!in_array($this->get_status(false),$case_completed) && $my_type_lp==2 ) {//&& $this->type!='dir' |
|
|
|
if(!in_array($this->get_status(false),$case_completed) && $my_type_lp==2 ) {//&& $this->type!='dir' |
|
|
|
$total_time =" total_time = total_time +".$this->get_total_time().", "; |
|
|
|
$total_time =" total_time = total_time +".$this->get_total_time().", "; |
|
|
|
$my_status = " status = '".$this->get_status(false)."' ,"; |
|
|
|
$my_status = " status = '".$this->get_status(false)."' ,"; |
|
|
|
@ -2347,30 +2343,27 @@ function get_terms() |
|
|
|
$my_status = " status = '".$this->get_status(false)."' ,"; |
|
|
|
$my_status = " status = '".$this->get_status(false)."' ,"; |
|
|
|
}else { |
|
|
|
}else { |
|
|
|
//&& !in_array($row_verified['status'],$case_completed) |
|
|
|
//&& !in_array($row_verified['status'],$case_completed) |
|
|
|
|
|
|
|
|
|
|
|
//is lp dokeos |
|
|
|
//is lp dokeos |
|
|
|
if ($my_type_lp==1 && $this->type!='chapter') { |
|
|
|
if ($my_type_lp==1 && $this->type!='chapter') { |
|
|
|
$total_time =" total_time = total_time + ".$this->get_total_time().", "; |
|
|
|
$total_time =" total_time = total_time + ".$this->get_total_time().", "; |
|
|
|
$my_status = " status = '".$this->get_status(false)."' ,"; |
|
|
|
$my_status = " status = '".$this->get_status(false)."' ,"; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
// is multipe attempts |
|
|
|
// is multiple attempts |
|
|
|
if (in_array($this->get_status(false),$case_completed) && $my_type_lp==2) { |
|
|
|
if (in_array($this->get_status(false),$case_completed) && $my_type_lp==2) { |
|
|
|
//reset zero new attempt ? |
|
|
|
//reset zero new attempt ? |
|
|
|
|
|
|
|
$my_status = " status = '".$this->get_status(false)."' ,"; |
|
|
|
} elseif (!in_array($this->get_status(false),$case_completed) && $my_type_lp==2){ |
|
|
|
} elseif (!in_array($this->get_status(false),$case_completed) && $my_type_lp==2){ |
|
|
|
$total_time =" total_time = ".$this->get_total_time().", "; |
|
|
|
$total_time =" total_time = ".$this->get_total_time().", "; |
|
|
|
$my_status = " status = '".$this->get_status(false)."' ,"; |
|
|
|
$my_status = " status = '".$this->get_status(false)."' ,"; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
//is lp dokeos |
|
|
|
//is dokeos LP |
|
|
|
$total_time =" total_time = total_time +".$this->get_total_time().", "; |
|
|
|
$total_time =" total_time = total_time +".$this->get_total_time().", "; |
|
|
|
$my_status = " status = '".$this->get_status(false)."' ,"; |
|
|
|
$my_status = " status = '".$this->get_status(false)."' ,"; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/*if ($my_type_lp==1 && !in_array($row_verified['status'],$case_completed)) { |
|
|
|
/*if ($my_type_lp==1 && !in_array($row_verified['status'],$case_completed)) { |
|
|
|
$total_time =" total_time = total_time + ".$this->get_total_time().", "; |
|
|
|
$total_time =" total_time = total_time + ".$this->get_total_time().", "; |
|
|
|
}*/ |
|
|
|
}*/ |
|
|
|
|