Code Duplication    Length = 10-11 lines in 2 locations

main/exercise/question.class.php 1 location

@@ 556-565 (lines=10) @@
553
     * delete any category entry for question id
554
     * delete the category for question
555
     */
556
    public function deleteCategory()
557
    {
558
        $table = Database::get_course_table(TABLE_QUIZ_QUESTION_REL_CATEGORY);
559
        $question_id = intval($this->id);
560
        $sql = "DELETE FROM $table
561
                WHERE
562
                    question_id = $question_id AND
563
                    c_id = ".api_get_course_int_id();
564
        Database::query($sql);
565
    }
566
567
    /**
568
     * changes the question position

main/forum/forumfunction.inc.php 1 location

@@ 3813-3823 (lines=11) @@
3810
 * @author Patrick Cool <[email protected]>, Ghent University
3811
 * @version february 2006, dokeos 1.8
3812
 */
3813
function increase_thread_view($thread_id)
3814
{
3815
    $table_threads = Database::get_course_table(TABLE_FORUM_THREAD);
3816
    $course_id = api_get_course_int_id();
3817
3818
    $sql = "UPDATE $table_threads 
3819
            SET thread_views = thread_views + 1
3820
            WHERE 
3821
                c_id = $course_id AND  
3822
                thread_id = '".intval($thread_id)."'";
3823
    Database::query($sql);
3824
}
3825
3826
/**