public/wordpress/wp-content/plugins/wp-courseware/includes/legacy/classes/unitfrontend.php
/**
		 * Update the progress for this quiz to allow a retake to happen.
		 */
Update the progress for this quiz to allow a retake to happen.
Update the progress for this quiz to allow a retake to happen .
public function update_quizzes_requestQuizRetake() {
			if ( $this->check_quizzes_canUserRequestRetake() ) {
				global $wpdb, $wpcwdb;
				$wpdb->show_errors();
				$this->update_quizzes_setNextStepData( 'retake_waiting', false );
				$wpdb->query( $wpdb->prepare( "
				DELETE FROM $wpcwdb->question_rand_lock 
				WHERE question_user_id = %d
				  AND parent_unit_id = %d
			", $this->currentUserID, $this->unitPost->ID ) );
				$this->unitQuizDetails = WPCW_quizzes_getAssociatedQuizForUnit( $this->unitPost->ID, true, $this->currentUserID );
				$this->unitQuizProgress->quiz_next_step_type = 'retake_waiting';
				$this->unitQuizProgress->quiz_paging_next_q  = 0;
			}
		}
public function update_quizzes_requestQuizRetake ( ) { if ( $ this -> check_quizzes_canUserRequestRetake ( ) ) { global $ wpdb , $ wpcwdb ; $ wpdb -> show_errors ( ) ; $ this -> update_quizzes_setNextStepData ( 'retake_waiting' , false ) ; $ wpdb -> query ( $ wpdb -> prepare ( " 
				DELETE FROM  $ wpcwdb -> question_rand_lock  
				WHERE question_user_id = %d
				  AND parent_unit_id = %d
			 " , $ this -> currentUserID , $ this -> unitPost -> ID ) ) ; $ this -> unitQuizDetails = WPCW_quizzes_getAssociatedQuizForUnit ( $ this -> unitPost -> ID , true , $ this -> currentUserID ) ; $ this -> unitQuizProgress -> quiz_next_step_type = 'retake_waiting' ; $ this -> unitQuizProgress -> quiz_paging_next_q = 0 ; } }
Update the progress for this quiz to allow a retake to happen.
Update the progress for this quiz to allow a retake to happen .
// Update the quiz progress so that the next step is showing the quiz so that the user can complete it. // Remove any locks for this unit for this user, if there are any random questions. // Reload any questions, as we've just deleted random locks. // Change the status of the user progress without reloading all of the data again.