Weekly Report 9 Gsoc @ Moodle

week 9 (01 august- 07 august)

Before writing about this weeks task & outcomes. I want to thanks my mentors for their positive feedback and evaluation towards my project. This week I corrected  somes issues including some bugs too.

Task 1 :- Performing plugin checks:-      We need to perform to checks for plugin & behave according to the outcome.

A. Whether the plugin is able to communicate with solr :-  We ping solr if return true solr is reachable if not than we throw the error code.

try {
if (!$this->solr->ping()) {
$this->errorcode = -1;
$this->errormessage = “Ping failed !”;
return false;
} catch (Exception $e)  {

$e->getMessage();

}

B. Whether Admin tool is installed :-    Just retrieve the installed plugin list if the plugin “Course search” exist we can proceed else throw the errorcode.

if(!array_key_exists(‘coursesearch’,get_plugin_list(‘tool’)))
{
$errorcode = 1;
}

 

Task 2 Listen to events and mark courses for re-indexing :- We need to re-index or delete a particular course from index if-

— a course is deleted.

— a course is updated

— a course is created

moodle event API  makes this  easy . Although moodle developers are going to rebuild the Event API for moodle 2.6

We just need to create events.php class inside db directory. While the plugin upgrade the the function & corresponding files or trigger are called.

I will be writing some more specification about this task 🙂

Code snippets :-

$handlers = array (
‘course_created’ => array (
‘handlerfile’ => ‘/admin/tool/coursesearch/locallib.php’,
‘handlerfunction’ => ‘deleteById’,
‘schedule’ => ‘instant’,
‘internal’ => 1,
)

 

Thanks 🙂

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s