public/wordpress/wp-content/plugins/wp-courseware/includes/legacy/classes/unitfrontend.php
/**
		 * Works out if we're showing any custom feedback messages to the user.
		 *
		 * @return $resultsList The list of messages to show (or an empty array).
		 */
Works out if we're showing any custom feedback messages to the user.
@return $resultsList The list of messages to show (or an empty array).
Works out if we ' re showing any custom feedback messages to the user . @return $resultsList The list of messages to show ( or an empty array ) .
public function fetch_customFeedbackMessage_calculateMessages() {
			$resultsList = array();
			if ( $this->check_quizzes_validQuizDetails() &&
			     $this->unitQuizProgress &&
			     'survey' != $this->unitQuizDetails->quiz_type &&
			     ( $this->unitQuizProgress->quiz_needs_marking == 0 ) ) {
				$tagBucketList = $this->fetch_quizzes_questionResultsByTag();
				if ( empty( $tagBucketList ) ) {
					return $resultsList;
				}
				$tagIDList    = array_keys( $tagBucketList );
				$feedbackList = WPCW_quizzes_feedback_getFeedbackMessagesForQuiz( $this->unitQuizDetails->quiz_id, $tagIDList );
				if ( ! empty( $feedbackList ) ) {
					foreach ( $feedbackList as $feedbackItem ) {
						$fb = new WPCW_quiz_CustomFeedback( $this->unitQuizDetails->quiz_id, $feedbackItem );
						if ( $fb->doesMessageMatchCriteria( $tagBucketList ) ) {
							$resultsList[] = $fb->getMessage();
						}
					}
				} 
			} 
			return $resultsList;
		}
public function fetch_customFeedbackMessage_calculateMessages ( ) { $ resultsList = array ( ) ; if ( $ this -> check_quizzes_validQuizDetails ( ) && $ this -> unitQuizProgress && 'survey' != $ this -> unitQuizDetails -> quiz_type && ( $ this -> unitQuizProgress -> quiz_needs_marking == 0 ) ) { $ tagBucketList = $ this -> fetch_quizzes_questionResultsByTag ( ) ; if ( empty ( $ tagBucketList ) ) { return $ resultsList ; } $ tagIDList = array_keys ( $ tagBucketList ) ; $ feedbackList = WPCW_quizzes_feedback_getFeedbackMessagesForQuiz ( $ this -> unitQuizDetails -> quiz_id , $ tagIDList ) ; if ( ! empty ( $ feedbackList ) ) { foreach ( $ feedbackList as $ feedbackItem ) { $ fb = new WPCW_quiz_CustomFeedback ( $ this -> unitQuizDetails -> quiz_id , $ feedbackItem ) ; if ( $ fb -> doesMessageMatchCriteria ( $ tagBucketList ) ) { $ resultsList [ ] = $ fb -> getMessage ( ) ; } } } } return $ resultsList ; }
Works out if we're showing any custom feedback messages to the user.
Works out if we ' re showing any custom feedback messages to the user .
// #### 1) - Check we have graded questions for a quiz // #### 2) - See if we have any tag grades for this quiz // No tags to check data against // #### 3) - See if we have any feedback messages for this quiz using // a combination of the tags from above, and the quiz ID. This saves // how much data we load from the database. // #### 4) - Now we process each feedback message to see if it matches the criteria. // See if the message matches the feedback we've got. //echo $fb->generate_editForm(); // end if $feedbackList. // end if quiz check