Code Duplication    Length = 10-11 lines in 2 locations

main/exercise/question.class.php 1 location

@@ 541-550 (lines=10) @@
538
     * delete any category entry for question id
539
     * delete the category for question
540
     */
541
    public function deleteCategory()
542
    {
543
        $table = Database::get_course_table(TABLE_QUIZ_QUESTION_REL_CATEGORY);
544
        $question_id = intval($this->id);
545
        $sql = "DELETE FROM $table
546
                WHERE
547
                    question_id = $question_id AND
548
                    c_id = ".api_get_course_int_id();
549
        Database::query($sql);
550
    }
551
552
    /**
553
     * changes the question position

main/forum/forumfunction.inc.php 1 location

@@ 3785-3795 (lines=11) @@
3782
 * @author Patrick Cool <[email protected]>, Ghent University
3783
 * @version february 2006, dokeos 1.8
3784
 */
3785
function increase_thread_view($thread_id)
3786
{
3787
    $table_threads = Database::get_course_table(TABLE_FORUM_THREAD);
3788
    $course_id = api_get_course_int_id();
3789
3790
    $sql = "UPDATE $table_threads 
3791
            SET thread_views = thread_views + 1
3792
            WHERE 
3793
                c_id = $course_id AND  
3794
                thread_id = '".intval($thread_id)."'";
3795
    Database::query($sql);
3796
}
3797
3798
/**