public/wordpress/wp-content/plugins/wp-courseware/includes/legacy/ajax.php
/**
 * Function called when adding a question to a quiz from the thickbox.
 *
 * @since 1.0.0
 */
Function called when adding a question to a quiz from the thickbox.
Function called when adding a question to a quiz from the thickbox .
function WPCW_AJAX_handleThickboxAction_QuestionPool_addQuestion() {
	$questionID      = WPCW_arrays_getValue( $_POST, 'questionnum' );
	$questionDetails = WPCW_questions_getQuestionDetails( $questionID );
	if ( $questionDetails ) {
		switch ( $questionDetails->question_type ) {
			case 'multi':
				$quizObj = new WPCW_quiz_MultipleChoice( $questionDetails );
				break;
			case 'truefalse':
				$quizObj = new WPCW_quiz_TrueFalse( $questionDetails );
				break;
			case 'open':
				$quizObj = new WPCW_quiz_OpenEntry( $questionDetails );
				break;
			case 'upload':
				$quizObj = new WPCW_quiz_FileUpload( $questionDetails );
				break;
			case 'random_selection':
				$quizObj = new WPCW_quiz_RandomSelection( $questionDetails );
				break;
			default:
				die( __( 'Unknown quiz type: ', 'wp-courseware' ) . $questionDetails->question_type );
				break;
		}
		$quizObj->showErrors         = true;
		$quizObj->needCorrectAnswers = true;
		echo $quizObj->editForm_toString();
	}
	die();
}
function WPCW_AJAX_handleThickboxAction_QuestionPool_addQuestion ( ) { $ questionID = WPCW_arrays_getValue ( $ _POST , 'questionnum' ) ; $ questionDetails = WPCW_questions_getQuestionDetails ( $ questionID ) ; if ( $ questionDetails ) { switch ( $ questionDetails -> question_type ) { case 'multi' : $ quizObj = new WPCW_quiz_MultipleChoice ( $ questionDetails ) ; break ; case 'truefalse' : $ quizObj = new WPCW_quiz_TrueFalse ( $ questionDetails ) ; break ; case 'open' : $ quizObj = new WPCW_quiz_OpenEntry ( $ questionDetails ) ; break ; case 'upload' : $ quizObj = new WPCW_quiz_FileUpload ( $ questionDetails ) ; break ; case 'random_selection' : $ quizObj = new WPCW_quiz_RandomSelection ( $ questionDetails ) ; break ; default : die ( __ ( 'Unknown quiz type: ' , 'wp-courseware' ) . $ questionDetails -> question_type ) ; break ; } $ quizObj -> showErrors = true ; $ quizObj -> needCorrectAnswers = true ; echo $ quizObj -> editForm_toString ( ) ; } die ( ) ; }
Function called when adding a question to a quiz from the thickbox.
Function called when adding a question to a quiz from the thickbox .