You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
768 B
28 lines
768 B
<?php
|
|
/* For licensing terms, see /license.txt */
|
|
/**
|
|
* Responses to AJAX calls
|
|
*/
|
|
require_once '../global.inc.php';
|
|
if (api_is_anonymous()) {
|
|
exit;
|
|
}
|
|
|
|
$action = $_REQUEST['a'];
|
|
|
|
switch ($action) {
|
|
case 'update_question_order':
|
|
$new_question_list = $_POST['question_id_list'];
|
|
$TBL_QUESTIONS = Database::get_course_table(TABLE_QUIZ_TEST_QUESTION);
|
|
$counter = 1;
|
|
foreach ($new_question_list as $new_order_id) {
|
|
Database::update($TBL_QUESTIONS, array('question_order'=>$counter), array('question_id = ? '=>intval($new_order_id)));
|
|
$counter++;
|
|
}
|
|
Display::display_confirmation_message(get_lang('Saved'));
|
|
break;
|
|
default:
|
|
echo '';
|
|
|
|
}
|
|
exit; |