Beispiel #1
0
/**
 * Function called when any filtering occurs within the thickbox window
 * for the Question Pool.
 */
function WPCW_AJAX_handleThickboxAction_QuestionPool()
{
    $args = wp_parse_args($_POST, array('pagenum' => 1));
    // Create URL from parameters to use for building the question pool table
    echo WPCW_questionPool_showPoolTable(20, $args, 'ajax');
    die;
}
/**
 * Shows the main Question Pool table.
 */
function WPCW_showPage_QuestionPool_load()
{
    global $wpcwdb, $wpdb;
    $wpdb->show_errors();
    // Get the requested page number
    $paging_pageWanted = WPCW_arrays_getValue($_GET, 'pagenum') + 0;
    if ($paging_pageWanted == 0) {
        $paging_pageWanted = 1;
    }
    // Title for page with page number
    $titlePage = false;
    if ($paging_pageWanted > 1) {
        $titlePage = sprintf(' - %s %s', __('Page', 'wp_courseware'), $paging_pageWanted);
    }
    $page = new PageBuilder(false);
    $page->showPageHeader(__('Question Pool', 'wp_courseware') . $titlePage, '75%', WPCW_icon_getPageIconURL());
    // Handle the question deletion before showing remaining questions
    WPCW_quizzes_handleQuestionDeletion($page);
    // Show the main pool table
    echo WPCW_questionPool_showPoolTable(50, $_GET, 'std', $page);
    $page->showPageFooter();
}
/**
 * Render the placeholder for the AJAX-loading Thickbox that allows the user to add questions
 * to a quiz directly from a thickbox.
 */
function WPCW_showPage_thickbox_questionPool()
{
    printf('<div id="wpcw_tb_question_pool" style="display: none">');
    printf('<div id="wpcw_tb_question_pool_inner">');
    echo WPCW_questionPool_showPoolTable(20, $_GET, 'ajax');
    printf('</div>');
    // #wpcw_tb_question_pool_inner
    printf('</div>');
    // #wpcw_tb_question_pool
}