@@ 780-787 (lines=8) @@ | ||
777 | $user_grades = get_transient( $transient_key ); |
|
778 | ||
779 | // get the data if nothing was stored in the transient |
|
780 | if( empty( $user_grades ) || false != $user_grades ){ |
|
781 | ||
782 | $user_grades = Sensei_Utils::get_user_data( 'quiz_grades', $lesson_id, $user_id ); |
|
783 | ||
784 | //set the transient with the new valid data for faster retrieval in future |
|
785 | set_transient( $transient_key, $user_grades, 10 * DAY_IN_SECONDS ); |
|
786 | ||
787 | } // end if transient check |
|
788 | ||
789 | // if there is no data for this user |
|
790 | if( ! is_array( $user_grades ) ){ |
|
@@ 944-951 (lines=8) @@ | ||
941 | $encoded_feedback = get_transient( $transient_key ); |
|
942 | ||
943 | // get the data if nothing was stored in the transient |
|
944 | if( empty( $encoded_feedback ) || !$encoded_feedback ){ |
|
945 | ||
946 | $encoded_feedback = Sensei_Utils::get_user_data( 'quiz_answers_feedback', $lesson_id, $user_id ); |
|
947 | ||
948 | //set the transient with the new valid data for faster retrieval in future |
|
949 | set_transient( $transient_key, $encoded_feedback, 10 * DAY_IN_SECONDS); |
|
950 | ||
951 | } // end if transient check |
|
952 | ||
953 | // if there is no data for this user |
|
954 | if( ! is_array( $encoded_feedback ) ){ |