' . __('Options updated', 'watu') . '
';
}
// save no_ajax
if(!empty($_POST['save_ajax_settings']) and check_admin_referer('watu_ajax_options')) {
$ids = empty($_POST['no_ajax']) ? array(0) : watu_int_array($_POST['no_ajax']);
// make sure IDs contains only exam IDs
$id_sql = implode(',', $ids);
if(!preg_match("/^[0-9,]+$/", $id_sql)) $id_sql = "0";
$wpdb->query("UPDATE ".WATU_EXAMS." SET no_ajax=1 WHERE ID IN (".$id_sql.")");
$wpdb->query("UPDATE ".WATU_EXAMS." SET no_ajax=0 WHERE ID NOT IN (".$id_sql.")");
}
$answer_display = get_option('watu_show_answers');
$delete_db = get_option('watu_delete_db');
$text_captcha = get_option('watu_text_captcha');
// load 3 default questions in case nothing is loaded
if(empty($text_captcha)) {
$text_captcha = __('What is the color of the snow? = white', 'watu').PHP_EOL.__('Is fire hot or cold? = hot', 'watu')
.PHP_EOL. __('In which continent is Norway? = Europe', 'watu');
}
// select all quizzes for No Ajax option
$quizzes = $wpdb->get_results("SELECT ID, name, no_ajax FROM ".WATU_EXAMS." ORDER BY name");
$roles = $wp_roles->roles;
$delim = get_option('watu_csv_delim');
if(@file_exists(get_stylesheet_directory().'/watu/options.html.php')) include get_stylesheet_directory().'/watu/options.html.php';
else include(WATU_PATH . '/views/options.html.php');