![Educare](https://github.com/FixBD/Educare/blob/FixBD/assets/img/Educare.svg)
# Educare - Powerful Results Management System

> ## Educare is a powerful online School/College students & results management system dev by FixBD. This plugin allows you to manage and publish students results. This is a School/College students & results management plugin that was created to make WordPress a more powerful CMS.

Educare help you to easily control over your institute students at online. You can easily Add/Edit/Delete Students, Results, Class, Exam, Year, Extra field, Custom Result Rules, Auto calculations and much more... Also you can import & export unlimited students and results just one click!

### Current Features

#### Result Rules (Grading Systems):
<p>In the preview version of Educare, admins can add results with only one (default) grading system. Now by adding (v1.2.0+) this feature admin can add his country result system/rules. So, <strong>Using this feature you (admin) can add, modify, manage or automatically calculate any type of result based on your country or demand</strong>. Eg: India, Bangladesh or US result GPA (CGPA) and calculation methods/rules are different. So, maintaining a defined result using one rule is a bit tricky. The result rule feature solves this problem. If you manage results for Indian students, you can add Indian grading system or rules. Also, you can add Bangladesh or US grading system in the same way. We know, it's a bit difficult. Please share your experience while using these features to improve Educare.</p>

1. Users/Students can find result by Name, Registration number, Roll Number, Exam, Passing Year
1. Auto/Manual results calculations
1. Auto GPA (CGPA) - based on your (admin) rules
1. Automatically show letter grade
1. Results table with students details
1. Subject marks and grade
1. Users/Students Photos
1. Optional subject detection
1. Field validation
1. Error notice
1. Custom Themes
1. Print results

#### Admin Can -

1. Public Results
1. Control Settings
1. Add Custom Result Rules
1. Modify Grading Systems
1. Add/Update/Delete Students
1. Add/Update/Delete Results
1. Add/Update/Delete Subject
1. Add/Update/Delete Class
1. Add/Update/Delete Exam
1. Add/Update/Delete Year
1. Add/Update/Delete Extra field
1. View Results by Class, Exam, Year With Asc/Desc Mode
1. Change Default Students Photos
1. Import/Export Results

Just install and manage  your School, College, Coaching Center & personal website with existing Features of Educare. Remember, all Features of Educare is completely free of charge!

Finally, we are going to add all the features in this plugin which you will not get in any premium plugins. And we will give you all these premium features for free. Because, we believe in freedom and understand the value of your work or dreams! 

If you have face any problems and need our support (Totally Free!), Please contact us with this email:

[fixbd.org@gmail.com](mailto:fixbd.org@gmail.com)

Also, You can send your feedback here:

[https://wordpress.org/plugins/educare/#reviews](https://wordpress.org/plugins/educare/#reviews)

# How to Install
> ### From the WordPress Plugin Directory
> #### The Official WordPress Plugin can be found here: https://wordpress.org/plugins/educare/
> ### From this repository
> #### Go to the [releases](https://github.com/fixbd/educare/releases).  section of the repository and download the most recent release.

1. Then, from your WordPress administration panel, go to Plugins > Add New and click the Upload Plugin button at the top of the page. (For manualy installation, Upload `Educare` to the `/wp-content/plugins/` directory.)

1. Activate the plugin (Educare) through the 'Plugins' menu in WordPress.

1. Now, you can see Educare icon appears into menu bar.

1. Go to "Educare > Settings" for configure the plugin. or 

1. Go to "Educare > Grading Systems" for configure Result Rules.
 
1. **Add shortcodes for show results in frond-end**

> There are a shortcodes `[educare_results]` that you can use in your post editor or any shortcode-ready area for display front end results system. More info given at shortcode sections.

# Documentation

>###  From your WordPress administration panel go to Plugins > Installed Plugins and scroll down until you find Educare. You will need to activate it first (Skip this, if u'r already activated). After activated the plugin, you can see Educare icon appears into menu bar. Go to Educare > Settings to configure it.

### How to use the plugin

This plugin is set up everything clearly and simply. So, you can easily manage this plugin features. Currently, there are six main Features available for Admin:

1. View Results
1. Add Results
1. Import Results
1. Update Results
1. Grading Systems
1. Settings Results

Also, there are Two (2) Features available for Users/Students:

1. Front end Search forms (user can find her results)
1. Front end results table (user can view her results)

### Admin features

## 1. View Results

> **Admin menu > Educare > View Results**

There are lots of options to find students results. You can view results by Class, Exam, Year. And short results by Asc or Decs. For this, you need to change that options. Also, You can view all the results at a same times. For view all results, keep entire options by default and click View Results button. That's it!

## 2. Add Results

> **Admin menu > Educare > Add Results**

Notes: Please carefully fill out all the details of the form. If you miss one, you may have problems to see the result. So, verify the student's admission form well and then give all details here. All (Class, Exam, Roll No, Regi No, Year) fields are required.

## 3. Import Results

> **Admin menu > Educare > Import Results**

Please carefully fill out all the details of your import (.csv) files. If you miss one, you may have problems to import the results. So, verify the student's admission form well and then give all the details in your import files. Required field are: Name, Roll No, Regi No, Exam, Class and Year. So, don't miss all of this required field!

If you don't know, how to create import files. Please [download](https://github.com/fixbd/Educare/assets/files/import_demo.csv) demo files for better understanding.

This is an auto generate  .csv file for import demo, based on users current settings (Subject, Exam, Extra field...).
If problem to download the flies, you can manually get this file in plugins dir: Educare/assets/files/import_demo.csv

Notes: Files must be an .csv extension for import the results.

## 4. Update Results

> **Admin menu > Educare > Update Results**

Here admin can update/edit/delete the students results that was previously added.

## 5. Grading Systems

> **Admin menu > Educare > Grading Systems**

Here you can change your custom results system. Also, you can change or add your country's result rules by code, Educare provides some powerful functions to manage or add custom result rules based on your demand. If you don't khow, How to add custom results rules? Visit the [Educare support](https://wordpress.org/support/plugin/educare)  forum to add your custom rules.

In the preview version of Educare, admins can add results with only one (default) grading system. Now by adding (v1.2.0+) this feature admin can add his country result system/rules. So, <strong>Using this feature you (admin) can add, modify, manage or automatically calculate any type of result based your country or demand<strong>. Eg: India, Bangladesh or US result GPA (CGPA) and calculation methods/rules are different. So, maintaining a defined result using one rule is a bit tricky. The result rule feature solves this problem. If you manage results for Indian students, you can add Indian grading system or rules. Also, you can add Bangladesh or US grading system in the same way. We know, it's a bit difficult. Please share your experience while using these features to improve Educare.

## 6. Educare Settings

> **Admin menu > Educare > Settings**

Here you can see two sections. One is for Add Content and another one is Settings.

**Add Content:**

> 1. Add/Update/Delete Class
> 1. Add/Update/Delete Subject
> 1. Add/Update/Delete Exam
> 1. Add/Update/Delete Year
> 1. Add/Update/Delete Extra field

**Settings**

> Here you can change or disable Educare default settings.

* **Page Setup:** 
Inter your front end results page slug (Where you use `[educare_results]` shortcode in your editor, template or any shortcode-ready area for front end results system). Don't need to insert with domain - http://xxxxx.com/results. Only slug will be accepted, for exp: results or index.php/results.

* **Customize:** 
Here you can change or disable Front End Typography of - Name, Roll, Reg Number, Class, Exam and Year

* **Delete confirmation:**
Anable and disable delete/remove confirmation

* **Guidelines:** 
Anable and disable guide/help messages
*Recommend: You can keep anabled **Guidelines** to get help pop-up messages. It's help you to know - How to use the the plugins (Educare).*

* **Students Photos:** 
Show or Hide students photos

* **Auto Results:** 
Automatically calculate students results status Passed/Failed and GPA

* **Advance Settings:** 
Anable and disable Advance/Developers menu. Note: it's only for developers or advance users

* **Automatically Delete Subject:** 
Automatically Delete Subject from Results Table When You Delete Subject From Subject List?

* **Delete and Clear field data:** 
Tips: If you set No that's mean only field will be delete. And, if you set Yes - clear field data when you delete any (current) field. Delete and Clear field data?

## 7. User/Students Features
1. User can find results 
1. User can front end results table
1. User can print results

# Shortcodes

> Currently there are only one shortcodes available. You need to add `[educare_results]` shortcode in editor, template or any shortcode-ready area for front end results system. This shortcode display search form and results table. So, users/students can easily find and view there results.

**`[educare_results]`**

For use this shortcode in your code or any PHP files:

**`echo do_shortcode( '[educare_results]' );`**

### For example in a template files (page-results.php):

	<?php
		/**
		* Template Name: Educare Results
		* Allow users to view their results from Frontend.
		* After added this code in your themes functions.php files, you can see Educare Results in template setcion in WP post/page editor. Seletct it and save. Or create a page same as your templaete files name (results). Make sure to slug name and (page-results.php) files name are same.
		*/
		
		// Show site header
		get_header();

		echo do_shortcode( '[educare_results]' );
		
		// Show site footers
		get_footer();
	?>

# Developers only

If you're a theme author, plugin author, or just a code hobbyist, you can follow this development introductions given below -

## Customize Educare

> ### Educare **v1.2.2+** has two functions to customize the result card and search form

**For customize results card:**
`educare_custom_results($results)`

**For customize search form:**
`educare_custom_search_form($not_found, $errmsg)`

1. Copy and paste this function in your themes `functions.php` files
1. allow/enable ‘Custom Design Permission’ in plugin settings (because we care of your security)
1. Throw your logic [code] under 'educare_custom_results' function for customize results card and 'educare_custom_search_form' for customize search forms

**Please follow this files for more details:**

For customize results card:
https://github.com/FixBD/Educare/blob/1.2.2/includes/support/educare_custom_results.php

For customize search form:
https://github.com/FixBD/Educare/blob/1.2.2/includes/support/educare_custom_search_form.php

If you have face any problems and need our support (Totally Free!), Please contact us by email provided in plugin details.

### To Change Results Table Style/Colors

##### In function.php files (php)
	
	add_action('wp_enqueue_scripts', 'custom_results_style');
	function custom_results_style() {
	    wp_enqueue_style('custom_results_style', get_template_directory_uri().'/assets/css/results.css');
	}
	
* *Notes*: Make sure to change (assets/css/results.css) to your own URL
	
##### In results.css files (css)
	
	/* Button style */
	.educare_results button {
		color: white;
		background-color: blue;
	}

	/* Students photos */
	.result_body .student_photos {
	text-align: center;
	}
	.result_body .student_photos img {
		width: 40%;
		height: 40%;
		max-width: 150px;
		max-height: 150px;
		padding: 8px;
		border-radius: 8px;
	}

	/* Headers style */
	.result_body h2,
	.result_body h3 {
		color: white;
		background: rgb(250, 0, 196);
		padding: 22px;
	}
	.result_body .grade_sheet th {
		background: rgba(250, 0, 196, 0.300);
	}
	
	/* Table style */
	.result_body table {
		background: rgba(250, 0, 196, 0.075);
		border-collapse: collapse;
	}
	.result_body .result_details td,
	.result_body .grade_sheet td,
	.result_body .grade_sheet th {
		border: 1px solid rgba(20,20,20,0.10);
	}

	/* Status style */
	.result_body .failed,
	.result_body .error,
	.errnotice b {
		color: red;
	}
	.result_body .success {
		color: green;
	}

### Let's Know Educare Functionality

* String to object
* Educare using this method to configure settings
* Main function: json_encode() and json_decode()

* @return object

Code exp: =>

	$settings = ["delete_subject"=>"checked", "clear_field"=>"unchecked"];
	$data = json_encode($settings);
	$status = json_decode($data);
	
	// Preview return
	print_r($status);
	echo $status->clear_field;


************************************( Next )***********************************


* Search and remove array content
* Educare using this method to Remove the content
* Main function:
	* 1. array_search() for search array content
	* 2. unset() for remove content
	* 3. array_values() for reindex array content/key

* @return array

Code exp: =>

	$data = array('English', 'Mathematics', 'Chemistry', 'Biology', 'ICT');
	$target = 'Mathematics';
	if (($target = array_search($target, $data)) != false) {
	    unset($data[$target]);
		// currently $data index/key is => 0, 2, 3, 4
		// reindex $data
	    $data = array_values($data);
		// Now $data index/key is => 0, 1, 2, 3
	}
	
	// Preview return
	print_r($data);


************************************( Next )***********************************


* discover function cleanData() for cleaning array data for specific characters
* Educare using this method to configure Extra fields content or Optional Subject
* Main function: preg_match()

* @return array

Code exp: =>

	$data = Array (
		0 => "text 1",
		1 => "x text 2",
		2 => "text 3",
		3 => "x text 4",
		4 => "text 5",
	);
	
	// create function for clean data
	function cleanData($data){ 
	    $clean = array();
	    foreach($data as $val){ 
	    	// for global match: /[x 2]/
	        preg_match ('/x /', $val, $matches); 
	        if(count($matches) == 0) $clean[] = $val;
	    }
	    return $clean;
	}
	
	// Preview return
	print_r(cleanData($data));
	// output: Array ( [0] => text 1 [1] => text 3 [2] => text 5 )
	

************************************( Next )***********************************


* Similar to above

Code exp: =>

	$data = array(1,3,4,1,3,1,5,8,9,10);
	$clean = array();
	
	foreach($data as $value) {
		if($value=='3') {
	        continue;
	    } else {
	        $clean[]=$value;
	    }     
	}
	
	print_r($clean);


************************************( Next )***********************************


* Getting first and last word
* Educare using this method to detect (forms) field type
* @return string

Code exp: =>

	$target = "text Fathers Name";
		# 1. type	2. name
	// $target = "number Mobile Number";
	
	// sclice/remove first world
	// for replace all white space
	// $name = str_replace(' ', '_', $name);
	$name = substr(strstr($target, ' '), 1);
	
	// getting first world
	$type = strtok($target, ' ');
	
	echo "
		input name: $name<br>
		input type: $type<br>
	";
	
	// more example:
	echo "<input type='".$type."' name='".$name."' placeholder='Type students ".$name."'>";

* Notes: Change $target (1) value number to text, email, file, date...

## Like this plugin?

### Need Your Helps!
The Educare plugin is a massive project with lot's of code to maintain. A major update can take weeks or months of work. We don't make any money from this plugin users, We glad to say that, All (PREMIUM) Features of Educare is completely free of charge!. So, no money will be required to install or update this plugin. Please consider helping just -

* [Rating the plugin](https://wordpress.org/support/plugin/educare/reviews/?filter=5#new-post).
Yours Ratings Inspired us to discover more and more features!

## Professional Support

If you need professional plugin support from me, the plugin author, you can [visit our support page](https://wordpress.org/support/plugin/educare). 

## Copyright and License

This project is licensed under the [GNU GPL](http://www.gnu.org/licenses/old-licenses/gpl-2.0.html), version 2 or later.

