|
|
@ -3070,7 +3070,7 @@ function newThread(CForumForum $forum, $form_values = '', $showPreview = true) |
|
|
|
* @param int $qualify_time |
|
|
|
* @param int $qualify_time |
|
|
|
* @param int $session_id |
|
|
|
* @param int $session_id |
|
|
|
* |
|
|
|
* |
|
|
|
* @return array optional |
|
|
|
* @return string |
|
|
|
* |
|
|
|
* |
|
|
|
* @author Isaac Flores <isaac.flores@dokeos.com>, U.N.A.S University |
|
|
|
* @author Isaac Flores <isaac.flores@dokeos.com>, U.N.A.S University |
|
|
|
* |
|
|
|
* |
|
|
@ -3080,20 +3080,20 @@ function saveThreadScore( |
|
|
|
CForumThread $threadEntity, |
|
|
|
CForumThread $threadEntity, |
|
|
|
$user_id, |
|
|
|
$user_id, |
|
|
|
$thread_id, |
|
|
|
$thread_id, |
|
|
|
$thread_qualify = 0, |
|
|
|
$thread_qualify, |
|
|
|
$qualify_time, |
|
|
|
$qualify_time, |
|
|
|
$session_id = 0 |
|
|
|
$session_id |
|
|
|
) { |
|
|
|
) { |
|
|
|
$table_threads_qualify = Database::get_course_table(TABLE_FORUM_THREAD_QUALIFY); |
|
|
|
$table_threads_qualify = Database::get_course_table(TABLE_FORUM_THREAD_QUALIFY); |
|
|
|
|
|
|
|
|
|
|
|
$course_id = api_get_course_int_id(); |
|
|
|
$course_id = api_get_course_int_id(); |
|
|
|
$session_id = (int) $session_id; |
|
|
|
$session_id = (int) $session_id; |
|
|
|
|
|
|
|
$thread_id = (int) $thread_id; |
|
|
|
|
|
|
|
$user_id = (int) $user_id; |
|
|
|
|
|
|
|
$thread_qualify = (float) $thread_qualify; |
|
|
|
$currentUserId = api_get_user_id(); |
|
|
|
$currentUserId = api_get_user_id(); |
|
|
|
|
|
|
|
$qualify_time = Database::escape_string($qualify_time); |
|
|
|
|
|
|
|
|
|
|
|
if ($user_id == (string) ((int) $user_id) && |
|
|
|
|
|
|
|
$thread_id == (string) ((int) $thread_id) && |
|
|
|
|
|
|
|
$thread_qualify == (string) ((float) $thread_qualify) |
|
|
|
|
|
|
|
) { |
|
|
|
|
|
|
|
$max = $threadEntity->getThreadQualifyMax(); |
|
|
|
$max = $threadEntity->getThreadQualifyMax(); |
|
|
|
if ($thread_qualify <= $max) { |
|
|
|
if ($thread_qualify <= $max) { |
|
|
|
if ($threadEntity->isThreadPeerQualify()) { |
|
|
|
if ($threadEntity->isThreadPeerQualify()) { |
|
|
@ -3143,10 +3143,9 @@ function saveThreadScore( |
|
|
|
|
|
|
|
|
|
|
|
return 'update'; |
|
|
|
return 'update'; |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
|
|
|
|
return null; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return ''; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -3277,7 +3276,9 @@ function saveThreadScoreHistory( |
|
|
|
$table_threads_qualify = Database::get_course_table(TABLE_FORUM_THREAD_QUALIFY); |
|
|
|
$table_threads_qualify = Database::get_course_table(TABLE_FORUM_THREAD_QUALIFY); |
|
|
|
$table_threads_qualify_log = Database::get_course_table(TABLE_FORUM_THREAD_QUALIFY_LOG); |
|
|
|
$table_threads_qualify_log = Database::get_course_table(TABLE_FORUM_THREAD_QUALIFY_LOG); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$thread_id = (int) $thread_id; |
|
|
|
$course_id = (int) $course_id; |
|
|
|
$course_id = (int) $course_id; |
|
|
|
|
|
|
|
$user_id = (int) $user_id; |
|
|
|
$qualify_user_id = api_get_user_id(); |
|
|
|
$qualify_user_id = api_get_user_id(); |
|
|
|
|
|
|
|
|
|
|
|
if ($user_id == (string) ((int) $user_id) && |
|
|
|
if ($user_id == (string) ((int) $user_id) && |
|
|
|