public/wordpress/wp-content/plugins/wp-courseware/includes/legacy/pages/page-quiz-modify.php
/**
 * Function called before a quiz is being saved.
 *
 * @since 1.0.0
 *
 * @param array $originalFormValues The raw form values.
 * @param RecordsForm $thisObject The reference to the form object doing the saving.
 */
Function called before a quiz is being saved.

@param array $originalFormValues The raw form values.
@param RecordsForm $thisObject The reference to the form object doing the saving.
Function called before a quiz is being saved . @param array $originalFormValues The raw form values . @param RecordsForm $thisObject The reference to the form object doing the saving .
function WPCW_actions_quizzes_beforeQuizSaved( $originalFormValues, $thisObject ) {
	if ( 'survey' == $originalFormValues['quiz_type'] ) {
		$originalFormValues['quiz_show_answers'] = 'no_answers';
	}
	if ( 'survey' == $originalFormValues['quiz_type'] ) {
		$originalFormValues['quiz_timer_mode'] = 'no_timer';
	}
	if ( 'no_timer' == $originalFormValues['quiz_timer_mode'] && intval( $originalFormValues['quiz_timer_mode_limit'] ) <= 0 ) {
		$originalFormValues['quiz_timer_mode_limit'] = '15';
	}
	return $originalFormValues;
}
function WPCW_actions_quizzes_beforeQuizSaved ( $ originalFormValues , $ thisObject ) { if ( 'survey' == $ originalFormValues [ 'quiz_type' ] ) { $ originalFormValues [ 'quiz_show_answers' ] = 'no_answers' ; } if ( 'survey' == $ originalFormValues [ 'quiz_type' ] ) { $ originalFormValues [ 'quiz_timer_mode' ] = 'no_timer' ; } if ( 'no_timer' == $ originalFormValues [ 'quiz_timer_mode' ] && intval ( $ originalFormValues [ 'quiz_timer_mode_limit' ] ) <= 0 ) { $ originalFormValues [ 'quiz_timer_mode_limit' ] = '15' ; } return $ originalFormValues ; }
Function called before a quiz is being saved.
Function called before a quiz is being saved .
// Ensure if survey is selected, that no answers are set up. // Ensure that if we're not in quiz mode, that we can't use the timer. // Ensure if no timer is selected, that the time is set to a useful time other than 0.