By Maverick on Saturday, 11 February 2017
Posted in Technical Issues
Likes 0
Views 319
Votes 0
Hi,

I am the author of Community Quiz extension which has integration with EasySocial points.

The issue we are facing is: irrespective of how many points set in the rules, the user is awarded only one point. I am not sure if there is any change in API as the documentation is restricted now. Here is what I am doing.


$api = JPATH_ADMINISTRATOR.'/components/com_easysocial/includes/foundry.php';
if( file_exists($api) ) {
require_once $api;
Foundry::points()->assign( $params['function'] , $params['component'] , $userid );
}

The rule has 100 points set but only 1 point is being awarded.

Can you please help?

Thanks.
Hey Haki,

I am sorry for the delay of this reply is because we rushing Easyblog and Easysocial release new version at yesterday and today.

Thanks for getting back to us and guide us the correct step in order to get the 1 point, I will test it again.

However, can you consult with your developer again which php file added this following code?


$api = JPATH_ADMINISTRATOR.'/components/com_easysocial/includes/foundry.php';
if( file_exists($api) ) {
require_once $api;
Foundry:oints()->assign( $params['function'] , $params['component'] , $userid );
}


And can you update your correct FTP login credentials so I can able to connect and check on this?
·
Friday, 17 February 2017 23:58
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey there,

I am really sorry for the delay of this reply as it is a weekend for us here.

May i know which documentation page you trying to access?

Can I see your point rules file?
·
Saturday, 11 February 2017 10:51
·
0 Likes
·
0 Votes
·
0 Comments
·
Here is the rules file:

[
{
"title" : "New Quiz",
"alias" : "new-quiz",
"description" : "Points awarded for submitting a quiz.",
"command" : "com_communityquiz.new_quiz",
"extension" : "com_communityquiz",
"state" : true,
"points" : 1
},
{
"title" : "Quiz Passed",
"alias" : "quiz-passed",
"description" : "Points used for passing out a quiz.",
"command" : "com_communityquiz.passed_quiz",
"extension" : "com_communityquiz",
"state" : true,
"points" : 1
},
{
"title" : "Quiz Failed",
"alias" : "quiz-failed",
"description" : "Points for failing a quiz.",
"command" : "com_communityquiz.failed_quiz",
"extension" : "com_communityquiz",
"state" : true,
"points" : 1
},
{
"title" : "New Response",
"alias" : "new-response",
"description" : "Points awarded for responding to a quiz.",
"command" : "com_communityquiz.new_response",
"extension" : "com_communityquiz",
"state" : true,
"points" : 1
}
]

The documentation page is accessible now.
·
Sunday, 12 February 2017 16:59
·
0 Likes
·
0 Votes
·
0 Comments
·
When the points are discovered from the back end, they are stored in the database. Regardless if you changed or modified the number of points in the json file, the number of points is already stored in the db.

You would just need to edit the rule from the back end and set the number of points that you desire. After making the changes from the back end, try to lookup for the record with the command that you are trying to search for in the table #__social_points to see if it is storing your points correctly.

Also, you want to check what does the string $params['function'] is.
·
Sunday, 12 February 2017 21:58
·
0 Likes
·
0 Votes
·
0 Comments
·
Can ES help me here? The developer who started this post is referring to my situation w/ ES. Here is his response to me (after your response to him):

"There is no issue with integration as the rule is properly triggering. As per their post, you should check in the database table they mentioned.

See if the points are properly saved or not whichever you configured in the rule. If not, it is a bug in easysocial.
If the points are correct in database table and still you get wrong points, its another bug in easysocial."

Where do I go from here?
·
Tuesday, 14 February 2017 01:30
·
0 Likes
·
0 Votes
·
0 Comments
·
I've checked from your backend > Easysocial > user point > Quiz Passed > you set to 100 point .

But I run this following SQL query into your database, it seems like no buddy getting this point yet.

Quiz Passed point id is 106


SELECT * FROM wj1rg_social_points_history where points_id = 106;


Can you try get the Quiz Passed point again from your frontend and see how it goes?
·
Tuesday, 14 February 2017 13:05
·
0 Likes
·
0 Votes
·
0 Comments
·
I completed the quiz again (with 100% correct answers) and no points were awarded still.

Feel free to log in and take the quizzes yourself..

Answers:
Hiiking Quiz
1) 2650

Martial Arts Quiz
1) aikido
2) select the last image
3) cardio
·
Wednesday, 15 February 2017 02:02
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey Haki,

The rule has 100 points set but only 1 point is being awarded. - from your developer

If you check your developer first response on this thread, it should get awarded 1 point at least, but base on yours and me testing on this, we can't even get awarded 1 point after completed the quiz (with 100% correct answers), but what we receive is "lost 0 points - New Response", you can refer on my attached screenshot below.

Perhaps you can try check with your developer again why we can't get awarded 1 point? If the user can get awarded 1 point instead of 100 point, then we only can able to investigate on this.

By the way, keep us updated regarding this.
·
Wednesday, 15 February 2017 11:02
·
0 Likes
·
0 Votes
·
0 Comments
·
So here's the deal, a user can only "pass" the quiz once. When they pass the quiz they are awarded 1 point (should be 100)
After that, that user cannot receive any more points even if they pass the quiz again (by design from developer)

Here is their last response to me:
"So whatever the testing performed by ES team is wrong. When you already have the points awarded, you will no longer get points for same quiz, no matter how many times you will pass it.

So please ask them to do proper testing with new user or new quiz. Please share your test result as why only 1 point is awarded when the rule has 100 points.

From the CQ point of view - there is nothing I could do as the rule is getting triggered. How many points are awarded is completely internal to ES. I can only check any issue if the rule is not getting triggered."

Now what??
·
Thursday, 16 February 2017 10:07
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Alex,

The topic is solved by removing custom points assignment statement (as easysocial do not support assigning custom points) and reinstalling the rules file.

Best Regards,
Maverick
·
Tuesday, 21 February 2017 15:18
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks for getting back to us Maverick, since you already mark as resolved, I will continue on your another thread here https://stackideas.com/forums/3rd-party-apps-es-point-allocation
·
Tuesday, 21 February 2017 22:40
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post