| @@ 533-542 (lines=10) @@ | ||
| 530 | * delete any category entry for question id |
|
| 531 | * delete the category for question |
|
| 532 | */ |
|
| 533 | public function deleteCategory() |
|
| 534 | { |
|
| 535 | $table = Database::get_course_table(TABLE_QUIZ_QUESTION_REL_CATEGORY); |
|
| 536 | $question_id = intval($this->id); |
|
| 537 | $sql = "DELETE FROM $table |
|
| 538 | WHERE |
|
| 539 | question_id = $question_id AND |
|
| 540 | c_id = ".api_get_course_int_id(); |
|
| 541 | Database::query($sql); |
|
| 542 | } |
|
| 543 | ||
| 544 | /** |
|
| 545 | * changes the question position |
|
| @@ 3805-3815 (lines=11) @@ | ||
| 3802 | * @author Patrick Cool <[email protected]>, Ghent University |
|
| 3803 | * @version february 2006, dokeos 1.8 |
|
| 3804 | */ |
|
| 3805 | function increase_thread_view($thread_id) |
|
| 3806 | { |
|
| 3807 | $table_threads = Database::get_course_table(TABLE_FORUM_THREAD); |
|
| 3808 | $course_id = api_get_course_int_id(); |
|
| 3809 | ||
| 3810 | $sql = "UPDATE $table_threads SET thread_views=thread_views+1 |
|
| 3811 | WHERE |
|
| 3812 | c_id = $course_id AND |
|
| 3813 | thread_id = '".intval($thread_id)."'"; |
|
| 3814 | Database::query($sql); |
|
| 3815 | } |
|
| 3816 | ||
| 3817 | /** |
|
| 3818 | * The relies counter gets increased every time somebody replies to the thread |
|