Shika: Available API triggers

Shika Plugin Triggers

Shika provides a variety of plugin triggers which developers can use to Intercept & modify data in order to extend Invitex or Integrate it with their own Extensions. Here we provide a short documentation on how you can utilise these triggers.

onAfterCourseCreation

/**
* Function used as a trigger after each course creation.
*
* @param INT $courseId course ID
* @param INT $courseCreator course creator user ID
* @param STRING $courseTitle course tilte
*
* @return boolean true or false
*
* @since 1.0.0
*/
public function onAfterCourseCreation($courseId, $courseCreator, $courseTitle)
{
/* YOUR CODE GOES HERE*/
}

 

OnAfterModuleCreation

/**
* Function used as a trigger after each module creation.
*
* @param INT $courseId course ID
* @param INT $moduleId Module ID
* @param STRING $moduleTitle Module tilte
*
* @return boolean true or false
*
* @since 1.0.0
*/
public function OnAfterModuleCreation($courseId, $moduleId, $moduleTitle)
{
/* YOUR CODE GOES HERE*/
}

 

OnAfterLessonCreation

/**
* Function used as a trigger after each lesson creation.
*
* @param INT $courseId course ID
* @param INT $lessonId lesson ID
* @param STRING $lesson Lesson object
*
* @return boolean true or false
*
* @since 1.0.0
*/
public function OnAfterLessonCreation($courseId, $lessonId, $lesson)
{
/* YOUR CODE GOES HERE*/
}

 

OnAfterLessonDelete

/**
* Function used as a trigger after lesson deleted
*
* @param INT $courseId Course ID
* @param INT $lessonId Lesson ID
* @param INT $mediaIds Media ID
*
* @return boolean true or false
*
* @since 1.0.0
*/
public function onAfterLessonDelete($courseId, $lessonId, $mediaIds)
{
/* YOUR CODE GOES HERE*/

}

 

OnAfterCourseDelete

/**
* Function used as a trigger after course deleted
*
* @param ARRAY $courseIds Course IDs
*
* @return void
*
* @since 1.0.0
*/
public function onAfterCourseDelete($courseIds)
{
/* YOUR CODE GOES HERE*/
}

 


onAfterCourseEnrol

/**
* Function used as a trigger after user successfully enrolled for a course.
*
* @param INT $actorId user has been enrolled
* @param INT $state Enrollment state
* @param INT $courseId course ID
* @param INT $enrolledBy user who enrolled the actor
*
* @return boolean true or false
*
* @since 1.0.0
*/
public function onAfterCourseEnrol($actorId, $state, $courseId, $enrolledBy)
{
/* YOUR CODE GOES HERE*/
}

 

onAfterApproveCourseEnrolement

/**
* Function used as a trigger after admin approves the enrollment for the course
*
* @param INT $enroledTableId enrolled user table ID
* @param INT $state Enrollment status
* @param INT $approvedBy User who approved the enrollment
* @param INT $enrolledBy user who enrolled the actor
*
* @return boolean true or false
*
* @since 1.0.0
*/
public function onAfterApprovecourseEnrolement($enroledTableId, $state, $approvedBy)
{
/* YOUR CODE GOES HERE*/
}

 

onAfterLessonAttemptstarted

/**
* Function used as a trigger after user start a lesson.
*
* @param INT $lessonId Lesson ID
* @param INT $attempt attempt number of the user
* @param INT $actorId User who is attempting the lesson
*
* @return boolean true or false
*
* @since 1.0.0
*/
public function onAfterLessonAttemptstarted($lessonId, $attempt, $actorId)
{
/* YOUR CODE GOES HERE*/
}

 

onAfterLessonAttemptEnd

/**
* Function used as a trigger after user finish a attempt for a lesson.
*
* @param INT $lessonId Lesson ID
* @param INT $attempt attempt number of the user
* @param INT $actorId User who is attempting the lesson
* @param INT $lessonFormat Format of the lesson
*
* @return boolean true or false
*
* @since 1.0.0
*/
public function onAfterLessonAttemptEnd($lessonId, $attempt, $actorId, $lessonFormat)
{
/* YOUR CODE GOES HERE*/
}

 

onAfterLessonCompletion

/**
* Function used as a trigger after user completes a lesson. While considering attempt grading
*
* @param INT $lessonId Lesson ID
* @param INT $attempt attempt number of the user
* @param INT $actorId User who is attempting the lesson
*
* @return boolean true or false
*
* @since 1.0.0
*/
public function onAfterLessonCompletion($lessonId, $attempt, $actorId)
{
/* YOUR CODE GOES HERE*/
}

 

onAfterCourseCompletion

/**
* Function used as a trigger after user completes a course.
*
* @param INT $actorId User to completed the course
* @param INT $courseId Course ID
*
* @return boolean true or false
*
* @since 1.0.0
*/
public function onAfterCourseCompletion($actorId, $courseId)
{
/* YOUR CODE GOES HERE*/
}

 

onAfterRecommend

/**
* Function used as a trigger after user send a recommendation for course successfully.
*
* @param INT $todoId Todo table Id
* @param INT $to User to whom recommended
* @param INT $from User who recommend
* @param INT $params Course which is recommended
*
* @return boolean true or false
*
* @since 1.0.0
*/
public function onAfterRecommend($todoId, $to, $from, $params)
{
/* YOUR CODE GOES HERE*/
}

 

onAfterAssignment

/**
* Function is triggered after a user(Course Creator) assigns a course to other user
*
* @param INT $todoId Todo table Id
* @param INT $to User to whom recommended
* @param INT $from User who recommend
* @param INT $params Contains Course which is recommended
*
* @return boolean true or false
*
* @since 1.0.0
*/
public function onAfterAssignment($todoId, $to, $from, $params)
{
/* YOUR CODE GOES HERE*/
}

 

onAfterSubscriptionExpired

/**
* Function used as a trigger after subscribtion expired
*
* @param INT $userId User ID
* @param INT $courseId Course ID
*
* @return boolean true or false
*
* @since 1.0.0
*/
public function onAfterSubscriptionExpired($userId, $courseId)
{
/* YOUR CODE GOES HERE*/
}