public/wordpress/wp-content/plugins/wp-courseware/includes/legacy/classes/unitfrontend.php
/**
		 * Main rendering function for the details for this unit.
		 *
		 * @param String  $content The content currently being shown on the page.
		 * @param Boolean $justGetCompletionAndQuizData If true, then just render the completion box and quiz details.
		 *
		 * @return String The content to render for the unit.
		 */
Main rendering function for the details for this unit.
@param String  $content The content currently being shown on the page.
@param Boolean $justGetCompletionAndQuizData If true, then just render the completion box and quiz details.

@return String The content to render for the unit.
Main rendering function for the details for this unit . @param String $content The content currently being shown on the page . @param Boolean $justGetCompletionAndQuizData If true then just render the completion box and quiz details . @return String The content to render for the unit .
public function render_detailsForUnit( $content, $justGetCompletionAndQuizData = false ) {
			$completionBox    = false;
			$extraMessages    = false;
			$quizProgressData = false;
			if ( $this->check_timers_doWeHaveTimerDataForThisQuiz() ) {
				if ( $this->check_timers_doWeHaveAnActiveTimer_thatHasExpired() ) {
					$this->update_quizzes_endQuizTimeExpired();
				}
			}
			if ( $this->check_unit_isCompleted() ) {
				$completionBox .= $this->render_completionBox_complete();
			} else {
				if ( $this->check_is_admin_or_teacher() || $this->check_is_unit_teaser() ) {
					$completionBox .= $this->render_completionBox_pending();
				} else {
					$lockDetails = $this->render_completionBox_contentLockedDueToDripfeed();
					if ( $lockDetails['content_locked'] ) {
						$lockedMsg = self::message_createMessage_error( sprintf( __( '%s', 'wp-couresware' ), $this->parentData->course_message_unit_not_yet_dripfeed ) );
						$completionBox .= str_ireplace( '{UNIT_UNLOCKED_TIME}', WPCW_date_getHumanTimeDiff( $lockDetails['unlock_date'] ), $lockedMsg );
						WPCW_queue_dripfeed::addQueueItem( $this->unitPost->ID, $this->currentUserID, $lockDetails['unlock_date'] );
						$content = false;
					} else {
						$completionBox .= $this->render_completionBox_pending();
					}
				}
			}
			if ( $this->check_quizzes_hasUserCompletedQuiz() &&
			     $this->check_quizzes_doWeShowResults() &&
			     ! $this->check_quizzes_areWeWaitingForUserToRetakeQuiz() ) {
				if ( $this->unitQuizProgress ) {
					$quizProgressData = $this->render_quizzes_showAllCorrectAnswers();
				}
			}
						$extraMessages = implode( "\n", $this->extraMessagesToShow_preQuizResults );
			if ( $justGetCompletionAndQuizData ) {
				return $completionBox . $extraMessages . $quizProgressData;
			} else {
				$navigationBox = $this->render_navigation_getNavigationBox();
				$content = apply_filters( 'wpcw_front_unit_content_normal', $content, $this->parentData, $this->unitPost );
				$completionBox = apply_filters( 'wpcw_front_completion_box', $completionBox );
				return $content . '<div id="wpcw_fe_outer_wrap">' . $completionBox . $extraMessages . $quizProgressData . '</div>' . $navigationBox;
			}
		}
public function render_detailsForUnit ( $ content , $ justGetCompletionAndQuizData = false ) { $ completionBox = false ; $ extraMessages = false ; $ quizProgressData = false ; if ( $ this -> check_timers_doWeHaveTimerDataForThisQuiz ( ) ) { if ( $ this -> check_timers_doWeHaveAnActiveTimer_thatHasExpired ( ) ) { $ this -> update_quizzes_endQuizTimeExpired ( ) ; } } if ( $ this -> check_unit_isCompleted ( ) ) { $ completionBox .= $ this -> render_completionBox_complete ( ) ; } else { if ( $ this -> check_is_admin_or_teacher ( ) || $ this -> check_is_unit_teaser ( ) ) { $ completionBox .= $ this -> render_completionBox_pending ( ) ; } else { $ lockDetails = $ this -> render_completionBox_contentLockedDueToDripfeed ( ) ; if ( $ lockDetails [ 'content_locked' ] ) { $ lockedMsg = self :: message_createMessage_error ( sprintf ( __ ( '%s' , 'wp-couresware' ) , $ this -> parentData -> course_message_unit_not_yet_dripfeed ) ) ; $ completionBox .= str_ireplace ( '{UNIT_UNLOCKED_TIME}' , WPCW_date_getHumanTimeDiff ( $ lockDetails [ 'unlock_date' ] ) , $ lockedMsg ) ; WPCW_queue_dripfeed :: addQueueItem ( $ this -> unitPost -> ID , $ this -> currentUserID , $ lockDetails [ 'unlock_date' ] ) ; $ content = false ; } else { $ completionBox .= $ this -> render_completionBox_pending ( ) ; } } } if ( $ this -> check_quizzes_hasUserCompletedQuiz ( ) && $ this -> check_quizzes_doWeShowResults ( ) && ! $ this -> check_quizzes_areWeWaitingForUserToRetakeQuiz ( ) ) { if ( $ this -> unitQuizProgress ) { $ quizProgressData = $ this -> render_quizzes_showAllCorrectAnswers ( ) ; } } $ extraMessages = implode ( " \n " , $ this -> extraMessagesToShow_preQuizResults ) ; if ( $ justGetCompletionAndQuizData ) { return $ completionBox . $ extraMessages . $ quizProgressData ; } else { $ navigationBox = $ this -> render_navigation_getNavigationBox ( ) ; $ content = apply_filters ( 'wpcw_front_unit_content_normal' , $ content , $ this -> parentData , $ this -> unitPost ) ; $ completionBox = apply_filters ( 'wpcw_front_completion_box' , $ completionBox ) ; return $ content . '<div id="wpcw_fe_outer_wrap">' . $ completionBox . $ extraMessages . $ quizProgressData . '</div>' . $ navigationBox ; } }
Main rendering function for the details for this unit.
Main rendering function for the details for this unit .
// ####ÊTimers - Check if the timer has timed out for the quiz. // #### Completion Box - Determine if this unit has been completed or not by rendering the status // 						 box that appears in the footer of the unit. // #### Dripfeed - Determine if the user can access this course yet (or not). // Get locked message, and insert the current time delay until it's available to the user. // Replace variable with the actual time delay before the unit is unlocked. // Add item to the queue to notify the user that this unit has been unlocked. // Hide the content for this post. We don't want to show it because it's locked. // If we want to show answers for this quiz/survey, then we show them. // Got the user progress, determine if it's pending marking or not. // User has completed this quiz... show the results. // Any extra messages we're showing?
 // Just want the completion box and quiz, don't need the body content or navigation. // #### Show the navigation box // Modify the main content if needed // Modify the completion box. // Create a wrapper around all dynamic content for jQuery/AJAX control