Welcome, Guest
Username: Password: Remember me

TOPIC: Two managers evaluate one employee in one form

Two managers evaluate one employee in one form 3 years 2 weeks ago #59169

  • apple
  • apple's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 2
  • Karma: 0
Hi,:)

I have to create a evaluation form for performance employees evaluation. Each employee will be evaluated by two managers. The first manager will evaluate the employee. Then the second manager will evaluate the employee that he wants to see the result of the first manager too. The question is how to show the result of the first manager while the second manager is doing the evaluation?

the example of my form will be found in attached file

example-evaluation.jpg
The administrator has disabled public write access.

Re: Two managers evaluate one employee in one form 3 years 2 weeks ago #59251

  • apple
  • apple's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 2
  • Karma: 0
As my research, I think I can custom {INSERTANS:xxxxxx} in order to show previous answers from first evaluation of manager1. I don't know anyone else wants to do the same as mine or not. but hopefully, there are some.
The administrator has disabled public write access.

Re: Two managers evaluate one employee in one form 3 years 2 weeks ago #59269

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 3837
  • Thank you received: 688
  • Karma: 330
{INSERTANS:xxxxxx} can only be used within a single survey submission.

I think to allow 2 managers (respondents) to access the same survey submission the first manager will need to need to save the survey after completing their part. The second manager can then open the saved survey and continue.
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

Re: Two managers evaluate one employee in one form 2 years 9 months ago #63776

  • applz
  • applz's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 2
  • Karma: 0
I got the answer to solve this problem by my own. And I think it would be good to share.

my situation, every employees will be evaluated by 2 managers. the first manager evaluates the employee at the first time that he/she starts to work at the company. after 3 months, the second manager will evaluate that employee again. my request is to show the evaluation result from the first manager while the second manager is evaluating the employee.

my solution is to retrieve the last record of the employee in index.php then create hidden fields to store that record. After that, adding javascript in template.js to inject img tag that is indicator image at the answer. just like the image below;

LimeSurvey_Answer.jpg



Thanks for LimeSurvey team
The administrator has disabled public write access.

Re: Two managers evaluate one employee in one form 2 years 9 months ago #63779

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 5869
  • Thank you received: 719
  • Karma: 223
Hello,

It's seems to be a beautiful solution, can you explain more what did you do on index.php ?
applz wrote:
my solution is to retrieve the last record of the employee in index.php then create hidden fields to store that record.

Thanks
The administrator has disabled public write access.

Re: Two managers evaluate one employee in one form 2 years 8 months ago #63871

  • applz
  • applz's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 2
  • Karma: 0
Hi Shnoulle,


what i did in index.php is retrieve my data from database by using tokenReplace and db_execute_assoc functions from common.php. I use MSSQL server.

I use tokenReplace function because i save some fields in token table. my code in index.php look like;
if($surveyid=="31337")
{		
	$evaluateeId = tokenReplace('{TOKEN:ATTRIBUTE_3}');  // tokenReplace function is in common.php
	if(tokenReplace('{TOKEN:ATTRIBUTE_2}') == 'MG2')
		$previousTrainedModule = 'MG1';
	else	
		$previousTrainedModule = '';
 
	if(strlen(trim($evaluateeId)) > 0 &&  strlen(trim($previousTrainedModule)) > 0)
	{
		$query = " SELECT TOP 1 *
				FROM 	cce_survey_31337
				WHERE	[31337X10x52] = '$evaluateeId'
				AND		[31337X10X54] = '$previousTrainedModule'
				ORDER BY [31337X10x146] DESC ";
 
		$result = db_execute_assoc($query) or safe_die ("Error loading results<br />$query<br />".$connect->ErrorMsg());   //Checked
		if ($result->RecordCount() < 1)
		{
			$errormsg .= $clang->gT("There is no saved result from the first trainer for 31337")."<br />\n";
			echo "<br>error quary data<br>";
		}
		else
		{
 
			$row=$result->FetchRow();
			foreach ($row as $column => $value)
			{
				// input answer format: id = 'answer31337X1X1A1' value='A1' name='31337X1X1'
				echo "<input id='$column$value' type='hidden' value='$value' name='$column'>";	// use hidden fields to keep record from DB
 
			} // foreach
		}		
	}
}
 


hope it makes you clear. I am not expert PHP programmer. I am new. :)


applz
Last Edit: 2 years 8 months ago by applz.
The administrator has disabled public write access.

Re: Two managers evaluate one employee in one form 2 years 8 months ago #63872

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 5869
  • Thank you received: 719
  • Karma: 223
Great ,


Thanks
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.170 seconds
Donation Image