LLMS_Notification_View_Quiz_Graded::set_merge_data( string $code )
Replace merge codes with actual values
Parameters Parameters
- $code
-
(string) (Required) The merge code to get merged data for.
Return Return
(string)
Source Source
File: includes/notifications/views/class.llms.notification.view.quiz.graded.php
protected function set_merge_data( $code ) { $attempt = new LLMS_Quiz_Attempt( $this->notification->get( 'post_id' ) ); if ( ! $attempt->exists() ) { return ''; } $lesson = llms_get_post( $attempt->get( 'lesson_id' ) ); if ( ! $lesson ) { return ''; } switch ( $code ) { case '{{COURSE_TITLE}}': $course = $lesson->get_course(); if ( $course ) { $code = $course->get( 'title' ); } else { $code = ''; } break; case '{{GRADE}}': $code = llms()->grades()->round( $attempt->get( 'grade' ) ) . '%'; break; case '{{LESSON_TITLE}}': $code = $lesson->get( 'title' ); break; case '{{QUIZ_TITLE}}': $code = get_the_title( $attempt->get( 'quiz_id' ) ); break; case '{{REVIEW_URL}}': $code = $attempt->get_permalink(); break; case '{{STATUS}}': $code = $attempt->l10n( 'status' ); break; case '{{STUDENT_NAME}}': $code = $this->user->get_name(); break; }// End switch(). return $code; }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.24.0 | Introduced. |