query regarding $save

9 views
Skip to first unread message

Sheharyar Ahmed

unread,
Dec 29, 2023, 4:27:41 PM12/29/23
to classEx - Help and Discussion Forum
Hello to the Team classEx.
I am working to design a customized experiment.
I have calculated profit as
$profit=$benefit-$cost;
it is calculated perfectly. Now I want the aggregate profit to be displayed to the group for which i proceeded in the following manner.
first i saved the variable using $save("profit",$profit,$round);
then i use 
$sum_profit=$findGroupSum('profit',$round,$includingOwn=true); to calculate the sum of profits by all members of the group.
The problem is that it adds the value of profit player by player and does not display the aggregate value (same value for all).
i hope my query is clear.
Any lead in this regard will be appreciated

Best Regards
Sheharyar Ahmed

Marcus Giamattei (classEx Team)

unread,
Jan 5, 2024, 10:25:01 AM1/5/24
to classEx - Help and Discussion Forum
Dear Ahmed,

did you make sure that the save function and findGroupSum are on different stages. Otherwise it may lead to conflicts as functions may be executed simultaneously.

Best, Marcus
Reply all
Reply to author
Forward
0 new messages