@@ 737-743 (lines=7) @@ | ||
734 | $comment_meta_id = Sensei_Utils::add_user_data( 'quiz_grades', $lesson_id, $quiz_grades, $user_id ); |
|
735 | ||
736 | // were the grades save successfully ? |
|
737 | if( intval( $comment_meta_id ) > 0 ) { |
|
738 | ||
739 | $success = true; |
|
740 | // save transient |
|
741 | $transient_key = 'quiz_grades_'. $user_id . '_' . $lesson_id; |
|
742 | set_transient( $transient_key, $quiz_grades, 10 * DAY_IN_SECONDS ); |
|
743 | } |
|
744 | ||
745 | return $success; |
|
746 | ||
@@ 896-902 (lines=7) @@ | ||
893 | $feedback_saved = Sensei_Utils::add_user_data( 'quiz_answers_feedback', $lesson_id , $encoded_answers_feedback, $user_id ) ; |
|
894 | ||
895 | //Were the the question feedback save correctly? |
|
896 | if( intval( $feedback_saved ) > 0){ |
|
897 | ||
898 | // save transient to make retrieval faster in future |
|
899 | $transient_key = 'sensei_answers_feedback_'.$user_id.'_'.$lesson_id; |
|
900 | set_transient( $transient_key, $encoded_answers_feedback, 10 * DAY_IN_SECONDS ); |
|
901 | ||
902 | } |
|
903 | ||
904 | return $feedback_saved; |
|
905 |