From d5cee32dc21f68f304ab00476939a49ba78b12a5 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 14 Oct 2021 16:29:31 -0400 Subject: [PATCH 001/154] integrated memory task with waiting room/session setup --- app/Events/LeaderAnswered.php | 2 +- app/GroupTask.php | 71 ++++++--- app/Http/Controllers/AjaxController.php | 5 +- app/Http/Controllers/GroupTaskController.php | 2 +- app/Http/Controllers/LoginController.php | 10 ++ app/Http/Controllers/TaskRoomController.php | 18 ++- .../Controllers/WaitingRoomController.php | 4 +- app/Jobs/AssignGroups.php | 119 ++++++++++----- app/Jobs/SendIntroComplete.php | 7 +- app/Tasks/Intro.php | 22 +++ app/Tasks/Memory.php | 134 +++++++++-------- public/js/memory.js | 22 ++- .../participant-study-consent.blade.php | 42 ++++++ .../layouts/participants/task-room.blade.php | 8 + .../tasks/memory-group-intro.blade.php | 46 +++++- .../participants/tasks/memory-group.blade.php | 137 +++++++++++++----- 16 files changed, 472 insertions(+), 177 deletions(-) diff --git a/app/Events/LeaderAnswered.php b/app/Events/LeaderAnswered.php index 0221bf9a..35962e1f 100644 --- a/app/Events/LeaderAnswered.php +++ b/app/Events/LeaderAnswered.php @@ -37,7 +37,7 @@ public function __construct(User $user) */ public function broadcastOn() { - return ['memory-channel']; + return ['task-channel']; } public function broadcastAs() diff --git a/app/GroupTask.php b/app/GroupTask.php index 70a69493..17ee9665 100644 --- a/app/GroupTask.php +++ b/app/GroupTask.php @@ -110,6 +110,40 @@ public static function initializeCombinedPilotTasks($group_id, $randomize) { return Self::initializeTasks($group_id, $taskArray, $randomize); } + #TASK LIST FOR PHASE 1+2 MEMORY PILOT + public static function initializeCombinedMemoryTasks($group_id, $randomize) { + $taskArray = '[ + {"taskName":"Consent","taskParams":{"url_endpoint":"end-individual-task","hasIndividuals":"true","hasGroup":"false","subjectPool":"memory_pilot"}}, + {"taskName":"Intro","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"chat_notification"}}, + {"taskName":"Intro","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"adblock"}}, + {"taskName":"Intro","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"no_notes"}}, + {"taskName":"DeviceCheck","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"eligibility"}}, + {"taskName":"Memory","taskParams":{"hasIndividuals":"true","hasGroup":"false","test":"intro"}}, + {"taskName":"Memory","taskParams":{"hasIndividuals":"true","hasGroup":"false","test":"words_instructions"}}, + {"taskName":"Memory","taskParams":{"hasIndividuals":"true","hasGroup":"false","test":"words_1"}}, + {"taskName":"Memory","taskParams":{"hasIndividuals":"true","hasGroup":"false","test":"images_instructions"}}, + {"taskName":"Memory","taskParams":{"hasIndividuals":"true","hasGroup":"false","test":"faces_1"}}, + {"taskName":"Memory","taskParams":{"hasIndividuals":"true","hasGroup":"false","test":"story_instructions"}}, + {"taskName":"Memory","taskParams":{"hasIndividuals":"true","hasGroup":"false","test":"story_1"}}, + {"taskName":"Memory","taskParams":{"hasIndividuals":"true","hasGroup":"false","test":"results"}}, + {"taskName":"Intro","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"selection_page"}}, + {"taskName":"WaitingRoom","taskParams":{"hasIndividuals":"true","hasGroup":"false","task":"2"}} + ]'; + + + return Self::initializeTasks($group_id, $taskArray, $randomize); + } + + #TASK LIST FOR MEMORY WAITING ROOM SHORTCUT + public static function initializeMemoryWaitingRoomTasks($group_id, $randomize) { + $taskArray = '[ + {"taskName":"WaitingRoom","taskParams":{"hasIndividuals":"true","hasGroup":"false","task":"2"}} + ]'; + + + return Self::initializeTasks($group_id, $taskArray, $randomize); + } + #TASK LIST FOR PHASE 2 PILOT public static function initializePhaseTwoTasks($group_id, $randomize) { $taskArray = '[ @@ -169,6 +203,25 @@ public static function initializeCryptoTasks($group_id, $randomize,$final) { return Self::initializeTasks($group_id, $taskArray, $randomize); } + public static function initializeMemoryTasks($group_id, $randomize,$final) { + if($final){ + $taskArray = '[ + {"taskName":"Memory","taskParams":{"hasIndividuals":"false","hasGroup":"true","test":"group_1_instructions","type":"intro"}}, + {"taskName":"Memory","taskParams":{"hasIndividuals":"false","hasGroup":"true","test":"group_1","type":"task"}}, + {"taskName":"Conclusion","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"mturk","hasCode":"false","displayScoreGroup":"false", "digitalReceipt":"false", "sonaId": "547", "payment": "30", "feedback":"true", "feedbackLinkType":"qualtrics"}} + ]'; + } + else{ + $taskArray = '[ + {"taskName":"Memory","taskParams":{"hasIndividuals":"false","hasGroup":"true","test":"group_1_instructions","type":"intro"}}, + {"taskName":"Memory","taskParams":{"hasIndividuals":"false","hasGroup":"true","test":"group_1","type":"task"}}, + {"taskName":"WaitingRoom","taskParams":{"hasIndividuals":"false","hasGroup":"true","task":"2"}} + ]'; + } + + return Self::initializeTasks($group_id, $taskArray, $randomize); + } + #TASK LIST FOR CRYPTO MTURK TEST public static function initializeCryptoMturkTasks($group_id, $randomize) { $taskArray = '[ @@ -306,25 +359,9 @@ public static function initializeWaitingRoomTasks($group_id, $randomize) { return Self::initializeTasks($group_id, $taskArray, $randomize); } - - - public static function initializeMemoryWaitingRoomTasks($group_id, $randomize) { - $taskArray = '[ - {"taskName":"WaitingRoom","taskParams":{"hasIndividuals":"false","hasGroup":"true","task":"2"}} - ]'; - return Self::initializeTasks($group_id, $taskArray, $randomize); - } - - public static function initializeMemoryTasks($group_id, $randomize) { - $taskArray = '[ - {"taskName":"Memory","taskParams":{"hasIndividuals":"false","hasGroup":"true","test":"group_1_instructions"}}, - {"taskName":"Memory","taskParams":{"hasIndividuals":"false","hasGroup":"true","test":"group_1"}}, - {"taskName":"Conclusion","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"group_1","hasCode":"false","displayScoreGroup":"false", "digitalReceipt":"false", "sonaId": "547", "payment": "30", "feedback":"false", "feedbackLinkType":"group1Pilot"}} - ]'; - return Self::initializeTasks($group_id, $taskArray, $randomize); - } + diff --git a/app/Http/Controllers/AjaxController.php b/app/Http/Controllers/AjaxController.php index 2fb0620b..fcd47774 100644 --- a/app/Http/Controllers/AjaxController.php +++ b/app/Http/Controllers/AjaxController.php @@ -95,7 +95,7 @@ public function markIndividualReadyForGroup(Request $request) { $step = (int) $request->step; $teammates = \Teamwork\User::where('group_id', $request->group_id) ->get(); - foreach($teammates as $key => $teammate){ + /*foreach($teammates as $key => $teammate){ for($i = 1; $i < $step; $i++){ $has_turn_for_step = \DB::table('waiting') ->where('user_id', $teammate->id) @@ -112,7 +112,7 @@ public function markIndividualReadyForGroup(Request $request) { 'updated_at' => date("Y-m-d H:i:s")]); } } - } + }*/ if(!$exists){ \DB::table('waiting')->insert(['user_id' => $request->user_id, 'group_id' => $request->group_id, @@ -121,6 +121,7 @@ public function markIndividualReadyForGroup(Request $request) { 'created_at' => date("Y-m-d H:i:s"), 'updated_at' => date("Y-m-d H:i:s")]); } + return '200'; } public function checkGroupReady(Request $request) { diff --git a/app/Http/Controllers/GroupTaskController.php b/app/Http/Controllers/GroupTaskController.php index 8178fe76..6326e48f 100644 --- a/app/Http/Controllers/GroupTaskController.php +++ b/app/Http/Controllers/GroupTaskController.php @@ -282,7 +282,7 @@ public function memory(Request $request) { $group_users = \Teamwork\User::where('group_id',\Auth::user()->group_id)->get(); foreach($group_users as $key => $group_user){ $scores = $this->getIndividualMemoryTaskResults($group_user); - $group_users_array[$group_user->participant_id] = $scores; + $group_users_array[$group_user->group_role] = $scores; } // Determine is this user is the reporter for the group diff --git a/app/Http/Controllers/LoginController.php b/app/Http/Controllers/LoginController.php index f678a0e1..3bb30039 100644 --- a/app/Http/Controllers/LoginController.php +++ b/app/Http/Controllers/LoginController.php @@ -201,6 +201,16 @@ public function postParticipantLogin(Request $request) { \Teamwork\GroupTask::initializeCombinedPilotTasks(\Auth::user()->group_id, $randomize = false); return redirect('/get-individual-task'); } + //ASSIGN COMBINED MEMORY PILOT TASKS + elseif($request->task_package == 'combined-memory-pilot'){ + \Teamwork\GroupTask::initializeCombinedMemoryPilotTasks(\Auth::user()->group_id, $randomize = false); + return redirect('/get-individual-task'); + } + //ASSIGN MEMORY WAITING ROOM TASKS + elseif($request->task_package == 'memory-waiting-room'){ + \Teamwork\GroupTask::initializeMemoryWaitingRoomTasks(\Auth::user()->group_id, $randomize = false); + return redirect('/get-individual-task'); + } //ASSIGN MTURK TEST TASKS elseif($request->task_package == 'mturk-test'){ \Teamwork\GroupTask::initializeCryptoMturkTasks(\Auth::user()->group_id, $randomize = false); diff --git a/app/Http/Controllers/TaskRoomController.php b/app/Http/Controllers/TaskRoomController.php index 218c794f..3f9da50f 100644 --- a/app/Http/Controllers/TaskRoomController.php +++ b/app/Http/Controllers/TaskRoomController.php @@ -17,6 +17,7 @@ class TaskRoomController extends Controller public function taskRoom(Request $request){ $admin = User::where('id',1)->first(); + $task = $admin->waiting; $time_remaining = null; @@ -32,10 +33,19 @@ public function taskRoom(Request $request){ $survey_length = env('SURVEY_LENGTH',120); $buffer_length = env('BUFFER_LENGTH',30); - - $session_length = $task_length + $survey_length + $buffer_length; - $time_remaining = ($session_length * $admin->current_session) - $time_elapsed - ($survey_length + $buffer_length); + if($task == 1){ + $session_length = $task_length + $survey_length + $buffer_length; + + $time_remaining = ($session_length * $admin->current_session) - $time_elapsed - ($survey_length + $buffer_length); + } + else{ + $session_length = $task_length + $buffer_length; + + $time_remaining = ($session_length * $admin->current_session) - $time_elapsed - $buffer_length; + } + + } else @@ -61,7 +71,7 @@ public function taskRoom(Request $request){ $parameters = unserialize($currentTask->parameters); - if($currentTask->name == "Cryptography" && $parameters->type == "intro"){ + if(($currentTask->name == "Cryptography" || $currentTask->name == "Memory") && $parameters->type == "intro"){ $time_remaining -= (env('TASK_LENGTH',600) - env('INTRO_LENGTH',180)); $time_label = "Time Until Task Begins"; $time_color = "red"; diff --git a/app/Http/Controllers/WaitingRoomController.php b/app/Http/Controllers/WaitingRoomController.php index f53f8e03..853f3690 100644 --- a/app/Http/Controllers/WaitingRoomController.php +++ b/app/Http/Controllers/WaitingRoomController.php @@ -85,7 +85,7 @@ public function getWaitingRoom(Request $request){ //WE USE SIGNATURE_DATE AS A WAY OF INDICATING WHO ENTERED THE WAITING ROOM AT ALL, FOR CREDIT GRANTING PURPOSES IN THE PILOT STAGE $this_user->signature_date = \Carbon\Carbon::now(); //EITHER 0 FOR NOT-IN-WAITING-ROOM, 1 FOR CRYPTO, OR 2 FOR MEMORY - $this_user->in_room = $task; + $this_user->in_room = 1; //STATUS IS USED FOR DISPLAYING SESSION DATA ON ADMIN-PAGE $this_user->status = 'Active'; @@ -319,7 +319,7 @@ public function beginSession(Request $request){ $session_length = $task_length + $survey_length + $buffer_length; for($i=0; $i<$request->num_sessions; $i++){ - (new AssignGroups(''))->dispatch('')->delay(\Carbon\Carbon::now()->addSeconds($session_length * $i)); + (new AssignGroups('',$admin->waiting))->dispatch('',$admin->waiting)->delay(\Carbon\Carbon::now()->addSeconds($session_length * $i)); } return '200'; diff --git a/app/Jobs/AssignGroups.php b/app/Jobs/AssignGroups.php index e3ac1cb5..ddd5191d 100644 --- a/app/Jobs/AssignGroups.php +++ b/app/Jobs/AssignGroups.php @@ -31,8 +31,9 @@ class AssignGroups implements ShouldQueue * * @return void */ - public function __construct(String $id){ + public function __construct(String $id,int $task ){ $this->id = $id; + $this->task = $task; } /** @@ -53,12 +54,14 @@ public function handle() //LOOP UNTIL < 3 USERS IN WAITING ROOM ARE UNASSIGNED //ONLY CRYPTO FOR NOW - $task = 1; + $task = $this->task; + Log::debug('Task is '.$task); //GET ACTIVE WAITING ROOM MEMBERS $in_room = User::where('in_room',1)->where('id','!=',1)->where('status','Active')->get()->shuffle(); if(count($in_room) >= 3){ + Log::debug('first condition met'); $leaders = User::where('in_room',1)->where('id','!=',1)->where('status','Active')->where('group_role','leader')->orderBy('waitnum','desc')->get(); $members = User::where('in_room',1)->where('id','!=',1)->where('status','Active')->where('group_role','!=','leader')->orderBy('waitnum','desc')->get(); @@ -90,6 +93,7 @@ public function handle() $members = User::where('in_room',1)->where('id','!=',1)->where('status','Active')->where('group_role','!=','leader')->whereNotIn('id',$memberWaiters)->get()->shuffle(); while(count($leaders) > 0 && count($members) > 1){ + Log::debug('while loop begun'); //RANDOMLY ASSIGN ROLES FOR NOW $leader = $leaders->pop(); @@ -145,7 +149,7 @@ public function handle() $task_name = "Cryptography"; } elseif($task == 2){ - \Teamwork\GroupTask::initializeMemoryTasks($group->id,$randomize=false); + \Teamwork\GroupTask::initializeMemoryTasks($group->id,$randomize=false,$final=$admin->current_session == $admin->max_sessions); $task_name = "Memory"; } else{ @@ -325,51 +329,96 @@ public function handle() } - //SETTING TIME VARIABLES FOR COUNTDOWNS - $session_start = \Teamwork\Time::where('type','session')->orderBy('created_at','desc')->first(); + if($task == 1){ + //SETTING TIME VARIABLES FOR COUNTDOWNS + $session_start = \Teamwork\Time::where('type','session')->orderBy('created_at','desc')->first(); - $time_elapsed = $session_start->created_at->diffInSeconds(\Carbon\Carbon::now()); + $time_elapsed = $session_start->created_at->diffInSeconds(\Carbon\Carbon::now()); - $task_length = env('TASK_LENGTH',300); + $task_length = env('TASK_LENGTH',300); - $survey_length = env('SURVEY_LENGTH',120); + $survey_length = env('SURVEY_LENGTH',120); - $buffer_length = env('BUFFER_LENGTH',30); + $buffer_length = env('BUFFER_LENGTH',30); - $intro_length = env('INTRO_LENGTH',30); - - $session_length = $task_length + $survey_length + $buffer_length; + $intro_length = env('INTRO_LENGTH',30); + + $session_length = $task_length + $survey_length + $buffer_length; - //IMMEDIATELY FIRES EVENTS TO SEND USERS FROM WAITING ROOM TO THEIR NEWLY ASSIGNED TASK - event(new SendToTask($leader)); - event(new SendToTask($follower1)); - event(new SendToTask($follower2)); + //IMMEDIATELY FIRES EVENTS TO SEND USERS FROM WAITING ROOM TO THEIR NEWLY ASSIGNED TASK + event(new SendToTask($leader)); + event(new SendToTask($follower1)); + event(new SendToTask($follower2)); - //DISPATCHES DELAYED JOBS WHICH WILL FIRE EVENTS THAT SEND USERS FROM THE TASK TO THE WAITING ROOM/CONCLUSION - //AT THE END OF A SUBSESSION - (new SendIntroComplete($leader->id,2))->dispatch($leader->id,2)->delay(\Carbon\Carbon::now()->addSeconds($intro_length)); - (new SendIntroComplete($follower1->id,2))->dispatch($follower1->id,2)->delay(\Carbon\Carbon::now()->addSeconds($intro_length + 1)); - (new SendIntroComplete($follower2->id,2))->dispatch($follower2->id,2)->delay(\Carbon\Carbon::now()->addSeconds($intro_length + 2)); + //DISPATCHES DELAYED JOBS WHICH WILL FIRE EVENTS THAT SEND USERS FROM THE TASK TO THE WAITING ROOM/CONCLUSION + //AT THE END OF A SUBSESSION + (new SendIntroComplete($leader->id,2))->dispatch($leader->id,2)->delay(\Carbon\Carbon::now()->addSeconds($intro_length)); + (new SendIntroComplete($follower1->id,2))->dispatch($follower1->id,2)->delay(\Carbon\Carbon::now()->addSeconds($intro_length + 1)); + (new SendIntroComplete($follower2->id,2))->dispatch($follower2->id,2)->delay(\Carbon\Carbon::now()->addSeconds($intro_length + 2)); - (new SendTaskComplete($leader->id,2))->dispatch($leader->id,2)->delay(\Carbon\Carbon::now()->addSeconds($session_length-($survey_length + $buffer_length))); - (new SendTaskComplete($follower1->id,2))->dispatch($follower1->id,2)->delay(\Carbon\Carbon::now()->addSeconds($session_length-($survey_length + $buffer_length + 1))); - (new SendTaskComplete($follower2->id,2))->dispatch($follower2->id,2)->delay(\Carbon\Carbon::now()->addSeconds($session_length-($survey_length + $buffer_length + 2))); + (new SendTaskComplete($leader->id,2))->dispatch($leader->id,2)->delay(\Carbon\Carbon::now()->addSeconds($session_length-($survey_length + $buffer_length))); + (new SendTaskComplete($follower1->id,2))->dispatch($follower1->id,2)->delay(\Carbon\Carbon::now()->addSeconds($session_length-($survey_length + $buffer_length + 1))); + (new SendTaskComplete($follower2->id,2))->dispatch($follower2->id,2)->delay(\Carbon\Carbon::now()->addSeconds($session_length-($survey_length + $buffer_length + 2))); - (new SendTaskComplete($leader->id,3))->dispatch($leader->id,3)->delay(\Carbon\Carbon::now()->addSeconds($session_length-$buffer_length)); - (new SendTaskComplete($follower1->id,3))->dispatch($follower1->id,3)->delay(\Carbon\Carbon::now()->addSeconds($session_length-$buffer_length + 1)); - (new SendTaskComplete($follower2->id,3))->dispatch($follower2->id,3)->delay(\Carbon\Carbon::now()->addSeconds($session_length-$buffer_length + 2)); + (new SendTaskComplete($leader->id,3))->dispatch($leader->id,3)->delay(\Carbon\Carbon::now()->addSeconds($session_length-$buffer_length)); + (new SendTaskComplete($follower1->id,3))->dispatch($follower1->id,3)->delay(\Carbon\Carbon::now()->addSeconds($session_length-$buffer_length + 1)); + (new SendTaskComplete($follower2->id,3))->dispatch($follower2->id,3)->delay(\Carbon\Carbon::now()->addSeconds($session_length-$buffer_length + 2)); - //(new SendTaskEvent($leader->id))->dispatch($leader->id)->delay(\Carbon\Carbon::now()->addSeconds($session_length-$buffer_length)); - //(new SendTaskEvent($follower1->id))->dispatch($follower1->id)->delay(\Carbon\Carbon::now()->addSeconds($session_length-$buffer_length -1)); - //(new SendTaskEvent($follower2->id))->dispatch($follower2->id)->delay(\Carbon\Carbon::now()->addSeconds($session_length-$buffer_length - 2)); + //(new SendTaskEvent($leader->id))->dispatch($leader->id)->delay(\Carbon\Carbon::now()->addSeconds($session_length-$buffer_length)); + //(new SendTaskEvent($follower1->id))->dispatch($follower1->id)->delay(\Carbon\Carbon::now()->addSeconds($session_length-$buffer_length -1)); + //(new SendTaskEvent($follower2->id))->dispatch($follower2->id)->delay(\Carbon\Carbon::now()->addSeconds($session_length-$buffer_length - 2)); - //IF THIS IS THE LAST SUBSESSION, DISPATCH A DELAYED JOB TO FIRE "END OF SESSION" EVENTS - if($admin->current_session == $admin->max_sessions){ - (new SendSessionComplete($follower2->id))->dispatch($follower2->id)->delay(\Carbon\Carbon::now()->addSeconds($session_length)); - if(count($leaderWaiters) > 0 || count($memberWaiters) > 0){ - (new HandleStragglers($admin->id))->dispatch($admin->id); + //IF THIS IS THE LAST SUBSESSION, DISPATCH A DELAYED JOB TO FIRE "END OF SESSION" EVENTS + if($admin->current_session == $admin->max_sessions){ + (new SendSessionComplete($follower2->id))->dispatch($follower2->id)->delay(\Carbon\Carbon::now()->addSeconds($session_length)); + if(count($leaderWaiters) > 0 || count($memberWaiters) > 0){ + (new HandleStragglers($admin->id))->dispatch($admin->id); + } } } + else{ + //SETTING TIME VARIABLES FOR COUNTDOWNS + $session_start = \Teamwork\Time::where('type','session')->orderBy('created_at','desc')->first(); + + $time_elapsed = $session_start->created_at->diffInSeconds(\Carbon\Carbon::now()); + + $task_length = env('TASK_LENGTH',300); + + $buffer_length = env('BUFFER_LENGTH',30); + + $intro_length = env('INTRO_LENGTH',30); + + $session_length = $task_length + $buffer_length; + + //IMMEDIATELY FIRES EVENTS TO SEND USERS FROM WAITING ROOM TO THEIR NEWLY ASSIGNED TASK + event(new SendToTask($leader)); + event(new SendToTask($follower1)); + event(new SendToTask($follower2)); + + //DISPATCHES DELAYED JOBS WHICH WILL FIRE EVENTS THAT SEND USERS FROM THE TASK TO THE WAITING ROOM/CONCLUSION + //AT THE END OF A SUBSESSION + (new SendIntroComplete($leader->id,1))->dispatch($leader->id,1)->delay(\Carbon\Carbon::now()->addSeconds($intro_length)); + (new SendIntroComplete($follower1->id,1))->dispatch($follower1->id,1)->delay(\Carbon\Carbon::now()->addSeconds($intro_length + 1)); + (new SendIntroComplete($follower2->id,1))->dispatch($follower2->id,1)->delay(\Carbon\Carbon::now()->addSeconds($intro_length + 2)); + + (new SendTaskComplete($leader->id,2))->dispatch($leader->id,2)->delay(\Carbon\Carbon::now()->addSeconds($session_length-$buffer_length)); + (new SendTaskComplete($follower1->id,2))->dispatch($follower1->id,2)->delay(\Carbon\Carbon::now()->addSeconds($session_length-$buffer_length + 1)); + (new SendTaskComplete($follower2->id,2))->dispatch($follower2->id,2)->delay(\Carbon\Carbon::now()->addSeconds($session_length-$buffer_length + 2)); + + //(new SendTaskEvent($leader->id))->dispatch($leader->id)->delay(\Carbon\Carbon::now()->addSeconds($session_length-$buffer_length)); + //(new SendTaskEvent($follower1->id))->dispatch($follower1->id)->delay(\Carbon\Carbon::now()->addSeconds($session_length-$buffer_length -1)); + //(new SendTaskEvent($follower2->id))->dispatch($follower2->id)->delay(\Carbon\Carbon::now()->addSeconds($session_length-$buffer_length - 2)); + + //IF THIS IS THE LAST SUBSESSION, DISPATCH A DELAYED JOB TO FIRE "END OF SESSION" EVENTS + if($admin->current_session == $admin->max_sessions){ + (new SendSessionComplete($follower2->id))->dispatch($follower2->id)->delay(\Carbon\Carbon::now()->addSeconds($session_length)); + if(count($leaderWaiters) > 0 || count($memberWaiters) > 0){ + (new HandleStragglers($admin->id))->dispatch($admin->id); + } + } + } + + } diff --git a/app/Jobs/SendIntroComplete.php b/app/Jobs/SendIntroComplete.php index 71330c6f..4eaf01dd 100644 --- a/app/Jobs/SendIntroComplete.php +++ b/app/Jobs/SendIntroComplete.php @@ -40,7 +40,12 @@ public function __construct(String $id){ public function handle() { $this_user = User::find($this->id); - $group_task = GroupTask::where('group_id',$this_user->group_id)->where('name','Cryptography')->first(); + $admin = User::find(1); + if($admin->waiting == 1) + $name = "Cryptography"; + if($admin->waiting == 2) + $name = "Memory"; + $group_task = GroupTask::where('group_id',$this_user->group_id)->where('name',$name)->where('order',1)->first(); $group_task->completed = 1; $group_task->save(); event(new IntroEnding($this_user)); diff --git a/app/Tasks/Intro.php b/app/Tasks/Intro.php index 523afd2b..67258b47 100644 --- a/app/Tasks/Intro.php +++ b/app/Tasks/Intro.php @@ -131,6 +131,28 @@ class Intro {
' ] ], + 'no_notes' => [[ + 'type' => 'header', + 'content' => 'Reminder' + ], + [ + 'type' => 'paragraph', + 'content' => 'This session is trying to understand MEMORY.' + ], + [ + 'type' => 'paragraph', + 'content' => 'It is very important that you don\'t write anything down (or take any screenshots) during this experiment.' + ],[ + 'type' => 'paragraph', + 'content' => 'If anyone violates this rule, that person will not receive credit for participating in the study.' + ], + [ + 'type' => 'paragraph', + 'content' => '
+ Next +
' + ] + ], "part1_instructions" => [[ 'type' => 'header', diff --git a/app/Tasks/Memory.php b/app/Tasks/Memory.php index 5ab9e379..b1dc2ad5 100644 --- a/app/Tasks/Memory.php +++ b/app/Tasks/Memory.php @@ -1066,11 +1066,10 @@ class Memory { 'directory' => '/img/memory-task/bodies/', 'blocks' => [ ['type'=>'text', - 'header'=> 'Welcome to the final set of group tasks!', + 'header'=> 'Welcome to the Group Memory task!', 'wait_for_all'=>'true', 'text'=>[ - 'You will be working together for 10-12 minutes, trying to solve the COLLECTIVE MEMORY task.', - 'Please take a moment to introduce yourselves.' + 'You will be working together for 10-12 minutes.' ] ], ['type'=>'text', @@ -1081,13 +1080,21 @@ class Memory { 'Now, you will be working on the task as a group' ] ], + ['type'=>'text', + 'header'=> 'Reminder', + 'wait_for_all'=>'true', + 'text'=>[ + 'It is very important that you don\'t write anything down during this task (or take any screenshots).', + 'If anyone violates this rule during the group session, that person - and their teammates - will not receive credit for participating in the study.' + ] + ], ['type'=>'text', 'header'=> '', 'wait_for_all'=>'true', 'text'=>[ - "The collective Memory task examines three types of memory: images, words, and stories", + "The collective Memory task examines three types of memory: images, words, and stories", 'Your group must memorize all three types of stimuli at the same time', - "Please do NOT write anything down during this task", + "Please do NOT write anything down during this task, or take screenshots.", "We'll start with a practice round" ] ], @@ -1099,7 +1106,7 @@ class Memory { 3 images, 6 words, and 2 very short stories.', 'During the memorization period, each person can look at whatever stimulus they like', - 'Reminder: You are NOT allowed to write anything down.' + 'Reminder: You are NOT allowed to write anything down, or take any screenshots.' ]], ['type' => 'review_choice', 'header' => 'Practice Round', @@ -1110,14 +1117,12 @@ class Memory { Then, if you have time, you can click on a different button and try to memorize the Words and/or the Images.', - 'Take a minute to discuss with your group how you\'ll - approach this task.', 'Recall: in this practice round there are 6 words; 3 images; and 2 very short stories.', 'Your 20 seconds will begin when everyone in the group has clicked on a button below.'], 'choices' => [['color' => 'success', 'type' => 'images'], - ['color' => 'warning', 'type' => 'words'], + ['color' => '#fbbc05', 'type' => 'words'], ['color' => 'danger', 'type' => 'stories']], 'review_time' => 20], @@ -1147,7 +1152,7 @@ class Memory { ] ], 'choices' => [['color' => 'success', 'type' => 'images'], - ['color' => 'warning', 'type' => 'words'], + ['color' => '#fbbc05', 'type' => 'words'], ['color' => 'danger', 'type' => 'stories']], 'review_time' => 20], @@ -1157,7 +1162,7 @@ class Memory { 'wait_for_all' => 'true', 'role' =>True, 'leader' => ['Now we will ask you some questions about the stimuli.', - 'You are the leader and are responsible for answering on behalf of the group.', + 'As the leader, you are the only person who can answer the questions. *This will be your responsibility*', 'The practice questions will begin when you all click next' ], 'follower1' => ['Now we will ask you some questions about the stimuli.', @@ -1471,55 +1476,62 @@ class Memory { ['type'=>'text', 'header'=>'Final Instructions', 'wait_for_all'=>'true', - 'text' =>[ - 'Your group will have 40 seconds to memorize the words, images, and stories as a group', - "It may be helpful to reference your teammates' scores on the individual memory test to determine who should focus on each category", - " - - - - - - - - - - - - - - - - - - - - - - - - -
Participant ID - Images - - Words - - Stories -
- - - -
- - - -
- - - -
", - 'Click "Next" for some more information' - ]], + 'role' =>True, + 'leader' => ['As the LEADER you receive some extra information about scores on the individual memory test. Your teammates will not see this information.', + "Recall that you are responsible for answering questions in the task.", + " + + + + + + + + + + + + + + + + + + + + + + + + +
Role + Images + + Words + + Stories +
+ + + +
+ + + +
+ + + +
", + 'Click "Next" for some more information' + ], + 'follower1' => ['The leader is now viewing info that only they can see.', + 'The practice questions will begin when you all click next' + ], + 'follower2' => ['The leader is now viewing info that only they can see.', + 'The practice questions will begin when you all click next' + ] + ], ['type' => 'review_choice', 'header' => 'Memory Task', 'text' => ['This is the page where you can choose what to memorize.', @@ -1568,7 +1580,7 @@ class Memory { 'wait_for_all' => 'true', 'role' => True, 'leader' => ['Now we will ask you some questions about the stimuli.', - 'You are the leader and are responsible for answering on behalf of the group.', + 'Remember: as the LEADER, only you can answer the questions (with the help of your team).', 'The questions will begin when you all click next' ], 'follower1' => ['Now we will ask you some questions about the stimuli.', diff --git a/public/js/memory.js b/public/js/memory.js index 51f71544..9f65e40b 100644 --- a/public/js/memory.js +++ b/public/js/memory.js @@ -285,32 +285,32 @@ var Memory = class Memory { markMemoryChoice(userId, groupId, groupTasksId, token, modal) { $.post( "/mark-individual-ready", { user_id: userId, group_id: groupId, group_tasks_id: groupTasksId, step: this.step, _token: token } ); + console.log('showing popup'); + $(modal).modal('show'); this.waitForGroup(userId, groupId, groupTasksId, modal); + } waitForGroup(userId, groupId, groupTasksId, modal) { console.log(this.step); self = this; - $.get( "/check-group-ready", { user_id: userId, group_id: groupId, group_tasks_id: groupTasksId, step: this.step,} ) + $.get( "/check-group-ready", { user_id: userId, group_id: groupId, group_tasks_id: groupTasksId, step: this.step} ) .done(function( response ) { if(response == '1') { + console.log('ready freddie'); + console.log(self.step); // Increment the step counter - try{ - $(modal).modal('hide'); - } - catch(e){ - location.reload(); - } - self.step++; + + localStorage.setItem('step',self.step); + console.log('hiding modal'); $(modal).modal('hide'); self.advance(); } else { - $(modal).modal('show'); + console.log('setting timeout'); setTimeout(function(){ - $(modal).modal('show'); console.log('waiting...'); self.waitForGroup(userId, groupId, groupTasksId, modal); }, 1000); @@ -330,9 +330,7 @@ var Memory = class Memory { self.advance(); } else { - $(modal).modal('show'); setTimeout(function(){ - $(modal).modal('show'); console.log('waiting...'); self.waitForGroup(userId, groupId, groupTasksId, modal); }, 1000); diff --git a/resources/views/layouts/participants/participant-study-consent.blade.php b/resources/views/layouts/participants/participant-study-consent.blade.php index 9ff74e1e..2df1211e 100644 --- a/resources/views/layouts/participants/participant-study-consent.blade.php +++ b/resources/views/layouts/participants/participant-study-consent.blade.php @@ -202,6 +202,48 @@
+ @elseif($subjectPool == 'memory_pilot') +

+ PURPOSE OF RESEARCH STUDY: To pilot an experiment examining teamwork skills. +

+

+ WHAT YOU’LL DO: You will be asked to solve memory puzzles individually and in a group. You will also be asked to provide feedback about the experiment. +

+

+ RISKS: There are no risks + for participating in this study beyond those associated with normal + computer use, including fatigue and mild stress. +

+

+ COMPENSATION: Average payment is $18 (minimum is $12). +

+

+ VOLUNTARY PARTICIPATION AND RIGHT TO + WITHDRAW: Participation in this study is voluntary, and + you can stop at any time without any penalty. To stop, simply + close your browser window. Partial data will not be analyzed. +

+

+ CONFIDENTIALITY: All data collected as part of this study will be destroyed at the end of the pilot and only used for academic purposes. +

+

+ CONTACT INFORMATION: If you have any + questions about this research, you may contact: skillslab@hks.harvard.edu +

+

+ CLICKING ACCEPT: By signing and clicking on the + "I Consent" button, you indicate that you are 18 years of age or older, + that you voluntarily agree to participate in this study and that you + understand the information in this consent form. +

+

+ SIGNATURE: +

+
+
+ +
+
diff --git a/resources/views/layouts/participants/task-room.blade.php b/resources/views/layouts/participants/task-room.blade.php index e9804bea..2ecf2cd1 100644 --- a/resources/views/layouts/participants/task-room.blade.php +++ b/resources/views/layouts/participants/task-room.blade.php @@ -174,9 +174,17 @@
Your role: @if($user->group_role == 'follower1') + @if($task->Name == "Cryptography") Equations + @else + Team Member 1 + @endif @elseif($user->group_role == 'follower2') + @if($task->Name == "Cryptography") Hypotheses + @else + Team Member 2 + @endif @else Leader @endif diff --git a/resources/views/layouts/participants/tasks/memory-group-intro.blade.php b/resources/views/layouts/participants/tasks/memory-group-intro.blade.php index 657c465a..dd128ae8 100644 --- a/resources/views/layouts/participants/tasks/memory-group-intro.blade.php +++ b/resources/views/layouts/participants/tasks/memory-group-intro.blade.php @@ -1,4 +1,4 @@ -@extends('layouts.master') +@extends('layouts.bare') @section('js') @@ -11,6 +11,37 @@ var group_id = {{ $user->group_id }}; $( document ).ready(function() { + //SET IDLE STATUS IF NOT PRESSING NEXT + tmt = setTimeout(function(){ + status = 'Idle'; + $.post('/status-change',{ + _token: '{{ csrf_token() }}', + id: user_id, + status: 'Idle' + }); + },10000); + + //CLEAR TIMER IF THEY PRESS NEXT + $('#next').on('click',function(event){ + clearTimeout(tmt); + if(status == 'Idle'){ + status = 'Active' + $.post('/status-change',{ + _token: '{{ csrf_token() }}', + id: user_id, + status: 'Active' + }); + } + }); + + //PING SERVER TO PROVE STILL ON PAGE + var itv = setInterval(function() { + console.log('GOING OFF'); + $.get('/still-present', { + _token: "{{ csrf_token() }}" + }); + },7000); + Pusher.logToConsole = true; var pusher = new Pusher('{{ config("app.PUSHER_APP_KEY") }}', { @@ -19,6 +50,19 @@ var channel = pusher.subscribe('task-channel'); + //IF SUBSESSION ENDS, END TASK + channel.bind('end-subsession', function(data){ + if(data['user']['id'] == user_id && data['order'] == 1){ + window.location.href='/end-intro'; + } + }); + + channel.bind('intro-ending',function(data){ + if(data['user']['id'].toString() == user_id){ + window.location.reload(); + } + }); + channel.bind('clear-storage', function(data){ console.log('freedom!'); localStorage.clear(); diff --git a/resources/views/layouts/participants/tasks/memory-group.blade.php b/resources/views/layouts/participants/tasks/memory-group.blade.php index be3cc323..c4f39608 100644 --- a/resources/views/layouts/participants/tasks/memory-group.blade.php +++ b/resources/views/layouts/participants/tasks/memory-group.blade.php @@ -1,7 +1,7 @@ -@extends('layouts.master') +@extends('layouts.bare') @section('js') - + @stop @@ -13,6 +13,7 @@ - + @stop diff --git a/resources/views/layouts/participants/tasks/group-survey.blade.php b/resources/views/layouts/participants/tasks/group-survey.blade.php index 46b7a04a..ef5acd84 100644 --- a/resources/views/layouts/participants/tasks/group-survey.blade.php +++ b/resources/views/layouts/participants/tasks/group-survey.blade.php @@ -114,8 +114,13 @@ @if($user->group_role != 'leader') We would like to ask some questions about your group's LEADER (who entered the groups guesses for all the letter values) + @else - We would like to ask some questions about the person who Made Hypotheses (e.g. guessed things like A=7) + @if($task_name == "Cryptography") + We would like to ask some questions about the person who Made Hypotheses (e.g. guessed things like A=7) + @else + We would like to ask some questions about Team Member 2 + @endif @endif

@@ -168,7 +173,11 @@

@if($user->group_role == 'leader') - We would like to ask some questions about the person who Entered the Equations (e.g. C+D+F=?) + @if($task_name == "Cryptography") + We would like to ask some questions about the person who Entered the Equations (e.g. C+D+F=?) + @else + We would like to ask some questions about Team Member 1 + @endif @else Thinking about the group I just participated in, I would say that: @endif diff --git a/resources/views/layouts/participants/tasks/memory-group.blade.php b/resources/views/layouts/participants/tasks/memory-group.blade.php index dc615a1a..60eb6da1 100644 --- a/resources/views/layouts/participants/tasks/memory-group.blade.php +++ b/resources/views/layouts/participants/tasks/memory-group.blade.php @@ -273,7 +273,7 @@ function clear_timer(){ $("#popup-continue").on('click', function(event) { $("#popup").modal('toggle'); //memory.advance(); - }) + }); }); @@ -440,6 +440,7 @@ function clear_timer(){ @if($block['type'] == 'practice_test_stories')
+
{{ $b_key }} / {{ count($test['blocks']) }}

{{ $block['prompt'] }}

@if($user->group_role == 'leader')

As the leader, you can type the number '1', '2', or '3' on your keyboard to enter the group's answer

@@ -461,6 +462,7 @@ function clear_timer(){ @if($block['type'] == 'test_stories')
+
{{ $b_key }} / {{ count($test['blocks']) }}

{{ $block['prompt'] }}

@if($user->group_role == 'leader')

As the leader, you can type the number '1', '2', or '3' on your keyboard to enter the group's answer

@@ -482,6 +484,7 @@ function clear_timer(){ @if($block['type'] == 'practice_test_words' || $block['type'] == 'test_words')
+
{{ $b_key }} / {{ count($test['blocks']) }}

{{ $block['prompt'] }}

@if($user->group_role == 'leader')

As the leader, select all that apply, then click "Next"

@@ -519,6 +522,7 @@ function clear_timer(){ @if($block['type'] == 'practice_test_images')
+
{{ $b_key }} / {{ count($test['blocks']) }}

{{ $block['prompt'] }}

@if($user->group_role == 'leader')

As the leader, you can type the number '1', '2', or '3' on your keyboard to enter the group's answer

@@ -539,6 +543,7 @@ function clear_timer(){ @if($block['type'] == 'test_images')
+
{{ $b_key }} / {{ count($test['blocks']) }}

{{ $block['prompt'] }}

@if($user->group_role == 'leader')

As the leader, you can type the number '1', '2', or '3' on your keyboard to enter the group's answer

From 052695e295922cefc544b85600d239b97939bb21 Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 18 Oct 2021 14:49:56 -0400 Subject: [PATCH 005/154] edits requested by Ben for group memory --- .../Controllers/WaitingRoomController.php | 6 +-- app/Tasks/Memory.php | 20 ++++---- .../participants/tasks/memory-group.blade.php | 50 ++++++++++++++++--- 3 files changed, 57 insertions(+), 19 deletions(-) diff --git a/app/Http/Controllers/WaitingRoomController.php b/app/Http/Controllers/WaitingRoomController.php index f25fc214..0e60f6c0 100644 --- a/app/Http/Controllers/WaitingRoomController.php +++ b/app/Http/Controllers/WaitingRoomController.php @@ -363,11 +363,11 @@ public function sendGroupToWaitingRoom(Request $request,$participant_id){ #GET PARTICIPANT'S ROLE public function getRole(Request $request){ - $currentTask = $request->session()->get('currentGroupTask'); - $currentTask = Group::find($currentTask); + $user = User::where('id',$request->id)->first(); - $user->which_task = $currentTask->name; + $currentTask = GroupTask::where('group_id',$user->group_id)->where('completed',0)->orderBy('order','asc')->first(); + $user->task_name = $currentTask->name; return $user; } diff --git a/app/Tasks/Memory.php b/app/Tasks/Memory.php index 8b288fa7..afaa9aa1 100644 --- a/app/Tasks/Memory.php +++ b/app/Tasks/Memory.php @@ -1711,25 +1711,25 @@ class Memory { 'type' => 'intro', 'directory' => '/img/memory-task/cars/', 'blocks' => [ - ['type'=>'text', 'header'=>'', 'wait_for_all'=>'true', 'text' =>[ - 'Now for the actual task', - 'This will determine your score', - 'Your group will have 40 seconds to memorize 6 images, 12 words and 2 short stories. This is like the practice, but you have twice as long to remember twice as much', - 'Click "Next" for some more information' + 'When you click next, the group task will begin.', + 'Your group has 10 minutes to work through the task.', + 'This time has already begun.', + 'Note: only the group Leader has information about the time remaining. There is a timer at the top of Leader\'s screen.', + 'Click Next to begin.' ]], + ['type'=>'text', 'header'=>'', 'wait_for_all'=>'true', 'text' =>[ - 'When you click next, the group task will begin.', - 'Your group has 10 minutes to work through the task.', - 'This time has already begun.', - 'Note: only the group Leader has information about the time remaining. There is a timer at the top of Leader\'s screen.' - 'Click Next to begin.' + 'Now for the actual task', + 'This will determine your score', + 'Your group will have 40 seconds to memorize 6 images, 12 words and 2 short stories. This is like the practice, but you have twice as long to remember twice as much', + 'Click "Next" for some more information' ]], ['type'=>'text', 'header'=>'Final Instructions', diff --git a/resources/views/layouts/participants/tasks/memory-group.blade.php b/resources/views/layouts/participants/tasks/memory-group.blade.php index 60eb6da1..a7d023df 100644 --- a/resources/views/layouts/participants/tasks/memory-group.blade.php +++ b/resources/views/layouts/participants/tasks/memory-group.blade.php @@ -440,7 +440,7 @@ function clear_timer(){ @if($block['type'] == 'practice_test_stories')
-
{{ $b_key }} / {{ count($test['blocks']) }}
+
{{ $b_key - 8}} / {{ count($test['blocks']) - 8}}

{{ $block['prompt'] }}

@if($user->group_role == 'leader')

As the leader, you can type the number '1', '2', or '3' on your keyboard to enter the group's answer

@@ -462,7 +462,7 @@ function clear_timer(){ @if($block['type'] == 'test_stories')
-
{{ $b_key }} / {{ count($test['blocks']) }}
+
{{ $b_key - 5}} / {{ count($test['blocks']) - 5}}

{{ $block['prompt'] }}

@if($user->group_role == 'leader')

As the leader, you can type the number '1', '2', or '3' on your keyboard to enter the group's answer

@@ -482,9 +482,47 @@ function clear_timer(){
@endif {{-- End if blocktype = test_stories --}} - @if($block['type'] == 'practice_test_words' || $block['type'] == 'test_words') + @if($block['type'] == 'practice_test_words')
-
{{ $b_key }} / {{ count($test['blocks']) }}
+
{{ $b_key - 8}} / {{ count($test['blocks']) - 8}}
+

{{ $block['prompt'] }}

+ @if($user->group_role == 'leader') +

As the leader, select all that apply, then click "Next"

+ @endif +
+ @foreach($block['choices'] as $c_key => $choice) +
+

+
+ + @if($user->group_role == 'leader') + + @endif +

+
+ @endforeach +
+
+ + @if($user->group_role == 'leader') + + @endif + +
+
+ @endif {{-- End if blocktype = practice_text_words --}} + + @if( $block['type'] == 'test_words') +
+
{{ $b_key - 5}} / {{ count($test['blocks']) - 5}}

{{ $block['prompt'] }}

@if($user->group_role == 'leader')

As the leader, select all that apply, then click "Next"

@@ -522,7 +560,7 @@ function clear_timer(){ @if($block['type'] == 'practice_test_images')
-
{{ $b_key }} / {{ count($test['blocks']) }}
+
{{ $b_key - 8}} / {{ count($test['blocks']) - 8}}

{{ $block['prompt'] }}

@if($user->group_role == 'leader')

As the leader, you can type the number '1', '2', or '3' on your keyboard to enter the group's answer

@@ -543,7 +581,7 @@ function clear_timer(){ @if($block['type'] == 'test_images')
-
{{ $b_key }} / {{ count($test['blocks']) }}
+
{{ $b_key - 5}} / {{ count($test['blocks']) - 5}}

{{ $block['prompt'] }}

@if($user->group_role == 'leader')

As the leader, you can type the number '1', '2', or '3' on your keyboard to enter the group's answer

From b36c24380059f384774a321a5a90423138c8e917 Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 18 Oct 2021 15:21:37 -0400 Subject: [PATCH 006/154] edits requested by Ben for group memory --- .../Controllers/IndividualTaskController.php | 1 + .../tasks/memory-individual-intro.blade.php | 21 ++----------------- 2 files changed, 3 insertions(+), 19 deletions(-) diff --git a/app/Http/Controllers/IndividualTaskController.php b/app/Http/Controllers/IndividualTaskController.php index 1ba03149..854b3a84 100644 --- a/app/Http/Controllers/IndividualTaskController.php +++ b/app/Http/Controllers/IndividualTaskController.php @@ -273,6 +273,7 @@ public function groupSurvey(Request $request){ ->with('surveyType',$parameters->type) ->with('time_remaining',$time_remaining) ->with('questions',$statements[$this_user->group_role == 'leader' ? 'leader' : 'member']) + ->with('task_name',$task_name) ->with('user',$this_user); } diff --git a/resources/views/layouts/participants/tasks/memory-individual-intro.blade.php b/resources/views/layouts/participants/tasks/memory-individual-intro.blade.php index f1cfbd90..365b312d 100644 --- a/resources/views/layouts/participants/tasks/memory-individual-intro.blade.php +++ b/resources/views/layouts/participants/tasks/memory-individual-intro.blade.php @@ -19,29 +19,12 @@

Memory Task

-

- Task {{ \Session::get('completedTasks') + 1 }} of {{ \Session::get('totalTasks') }} -

This task measures your short-term memory. - There are three short parts, in which we ask you to remember: + There are three short parts, in which we ask you to remember: Words, Images, and Stories.

-
-
-

-
    -
  • Image memory
  • -
  • Word memory
  • -
  • Story memory
  • -
-

-
-

- Please do NOT write anything down during these tasks. -

-

- There are no performance payments for this section. + Please do NOT write anything down during these tasks (or take screenshots).

From 0e250ff91279a6bf83638f4754cbc804bf36ab72 Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 18 Oct 2021 16:04:53 -0400 Subject: [PATCH 007/154] edits requested by Ben for group memory --- .../layouts/participants/tasks/memory-group.blade.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/resources/views/layouts/participants/tasks/memory-group.blade.php b/resources/views/layouts/participants/tasks/memory-group.blade.php index a7d023df..a10dcd8f 100644 --- a/resources/views/layouts/participants/tasks/memory-group.blade.php +++ b/resources/views/layouts/participants/tasks/memory-group.blade.php @@ -68,7 +68,14 @@ function clear_timer(){ count = 1; jQuery.each(scores, function(key, val) { - $('#pid_'+count.toString()).text(key); + + if(key == 'follower1') + role = 'Team Member 1'; + if(key=='follower2') + role = 'Team member 2'; + if(key=='leader') + role= 'Leader'; + $('#pid_'+count.toString()).text(role); $('#faces_'+count.toString()).text(val['faces']); $('#words_'+count.toString()).text(val['words']); $('#stories_'+count.toString()).text(val['story']); From fe58766b671ac8f072cab7928d4f8eb7c1ba23e0 Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 18 Oct 2021 16:30:05 -0400 Subject: [PATCH 008/154] edits requested by Ben for group memory --- app/Jobs/AssignGroups.php | 6 +++--- app/Tasks/Memory.php | 21 ++++++++++--------- .../participants/tasks/memory-group.blade.php | 12 +++++------ 3 files changed, 20 insertions(+), 19 deletions(-) diff --git a/app/Jobs/AssignGroups.php b/app/Jobs/AssignGroups.php index dd0a79fc..c228d0bc 100644 --- a/app/Jobs/AssignGroups.php +++ b/app/Jobs/AssignGroups.php @@ -407,9 +407,9 @@ public function handle() (new SendTaskComplete($follower1->id,2))->dispatch($follower1->id,2)->delay(\Carbon\Carbon::now()->addSeconds($session_length - ($survey_length + $buffer_length) + 1)); (new SendTaskComplete($follower2->id,2))->dispatch($follower2->id,2)->delay(\Carbon\Carbon::now()->addSeconds($session_length- ($survey_length + $buffer_length) + 2)); - (new SendTaskEvent($leader->id))->dispatch($leader->id)->delay(\Carbon\Carbon::now()->addSeconds($session_length-$buffer_length)); - (new SendTaskEvent($follower1->id))->dispatch($follower1->id)->delay(\Carbon\Carbon::now()->addSeconds($session_length-$buffer_length +1)); - (new SendTaskEvent($follower2->id))->dispatch($follower2->id)->delay(\Carbon\Carbon::now()->addSeconds($session_length-$buffer_length + 2)); + (new SendTaskEvent($leader->id,3))->dispatch($leader->id,3)->delay(\Carbon\Carbon::now()->addSeconds($session_length-$buffer_length)); + (new SendTaskEvent($follower1->id,3))->dispatch($follower1->id,3)->delay(\Carbon\Carbon::now()->addSeconds($session_length-$buffer_length +1)); + (new SendTaskEvent($follower2->id,3))->dispatch($follower2->id,3)->delay(\Carbon\Carbon::now()->addSeconds($session_length-$buffer_length + 2)); //IF THIS IS THE LAST SUBSESSION, DISPATCH A DELAYED JOB TO FIRE "END OF SESSION" EVENTS if($admin->current_session == $admin->max_sessions){ diff --git a/app/Tasks/Memory.php b/app/Tasks/Memory.php index afaa9aa1..2efc8ddf 100644 --- a/app/Tasks/Memory.php +++ b/app/Tasks/Memory.php @@ -1066,30 +1066,31 @@ class Memory { 'directory' => '/img/memory-task/bodies/', 'blocks' => [ ['type'=>'text', - 'header'=> 'Welcome to the Group Memory task!', + 'header'=> '', 'wait_for_all'=>'true', 'text'=>[ - 'You will be working together for 10-12 minutes.' + 'Note that your group has 5 minutes to work through these instructions (including a practice question).', + 'This time has already begun.', + 'Only the group Leader has information about the time remaining: there is a timer at the top of the Leader\'s screen.', + 'Click next to continue.' ] ], - ['type'=>'text', - 'header'=> '', + ['type'=>'text', + 'header'=> 'Welcome to the Group Memory task!', 'wait_for_all'=>'true', 'text'=>[ - 'This task is similar to the memory tasks you completed as an individual.', - 'Now, you will be working on the task as a group' + 'You will be working together for 10-12 minutes.' ] ], ['type'=>'text', 'header'=> '', 'wait_for_all'=>'true', 'text'=>[ - 'Note that your group has 5 minutes to work through these instructions (including a practice question).', - 'This time has already begun.', - 'Only the group Leader has information about the time remaining: there is a timer at the top of the Leader\'s screen.', - 'Click next to continue.' + 'This task is similar to the memory tasks you completed as an individual.', + 'Now, you will be working on the task as a group' ] ], + ['type'=>'text', 'header'=> 'Reminder', 'wait_for_all'=>'true', diff --git a/resources/views/layouts/participants/tasks/memory-group.blade.php b/resources/views/layouts/participants/tasks/memory-group.blade.php index a10dcd8f..e6109987 100644 --- a/resources/views/layouts/participants/tasks/memory-group.blade.php +++ b/resources/views/layouts/participants/tasks/memory-group.blade.php @@ -447,7 +447,7 @@ function clear_timer(){ @if($block['type'] == 'practice_test_stories')
-
{{ $b_key - 8}} / {{ count($test['blocks']) - 8}}
+
{{ $b_key - 8}} / {{ count($test['blocks']) - 9}}

{{ $block['prompt'] }}

@if($user->group_role == 'leader')

As the leader, you can type the number '1', '2', or '3' on your keyboard to enter the group's answer

@@ -469,7 +469,7 @@ function clear_timer(){ @if($block['type'] == 'test_stories')
-
{{ $b_key - 5}} / {{ count($test['blocks']) - 5}}
+
{{ $b_key - 5}} / {{ count($test['blocks']) - 6}}

{{ $block['prompt'] }}

@if($user->group_role == 'leader')

As the leader, you can type the number '1', '2', or '3' on your keyboard to enter the group's answer

@@ -491,7 +491,7 @@ function clear_timer(){ @if($block['type'] == 'practice_test_words')
-
{{ $b_key - 8}} / {{ count($test['blocks']) - 8}}
+
{{ $b_key - 8}} / {{ count($test['blocks']) - 9}}

{{ $block['prompt'] }}

@if($user->group_role == 'leader')

As the leader, select all that apply, then click "Next"

@@ -529,7 +529,7 @@ function clear_timer(){ @if( $block['type'] == 'test_words')
-
{{ $b_key - 5}} / {{ count($test['blocks']) - 5}}
+
{{ $b_key - 5}} / {{ count($test['blocks']) - 6}}

{{ $block['prompt'] }}

@if($user->group_role == 'leader')

As the leader, select all that apply, then click "Next"

@@ -567,7 +567,7 @@ function clear_timer(){ @if($block['type'] == 'practice_test_images')
-
{{ $b_key - 8}} / {{ count($test['blocks']) - 8}}
+
{{ $b_key - 8}} / {{ count($test['blocks']) - 9}}

{{ $block['prompt'] }}

@if($user->group_role == 'leader')

As the leader, you can type the number '1', '2', or '3' on your keyboard to enter the group's answer

@@ -588,7 +588,7 @@ function clear_timer(){ @if($block['type'] == 'test_images')
-
{{ $b_key - 5}} / {{ count($test['blocks']) - 5}}
+
{{ $b_key - 5}} / {{ count($test['blocks']) - 6}}

{{ $block['prompt'] }}

@if($user->group_role == 'leader')

As the leader, you can type the number '1', '2', or '3' on your keyboard to enter the group's answer

From 105111679ad817f47799157177213faa6412e71b Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 18 Oct 2021 16:55:27 -0400 Subject: [PATCH 009/154] edits requested by Ben for group memory --- app/Tasks/Memory.php | 9 ++++++ .../participants/tasks/memory-group.blade.php | 28 +++++++++++++------ 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/app/Tasks/Memory.php b/app/Tasks/Memory.php index 2efc8ddf..1620b2c9 100644 --- a/app/Tasks/Memory.php +++ b/app/Tasks/Memory.php @@ -1207,6 +1207,15 @@ class Memory { 'prompt' => 'Which of the following images is a "target" image?', 'img' => 'p0_test_1.jpeg', 'correct' => [1]], + ['type'=>'text', + 'header'=> 'Wait for task to begin', + 'wait_for_all'=>'true', + 'no_proceed'=>'true', + 'text'=>[ + 'You and your group will proceed to the task when the leader\'s 5 minute timer runs out', + 'Until then, please chat with your teammates.' + ] + ] ]// end blocks ], // end group_1_instructions diff --git a/resources/views/layouts/participants/tasks/memory-group.blade.php b/resources/views/layouts/participants/tasks/memory-group.blade.php index e6109987..60be0f01 100644 --- a/resources/views/layouts/participants/tasks/memory-group.blade.php +++ b/resources/views/layouts/participants/tasks/memory-group.blade.php @@ -321,6 +321,7 @@ function clear_timer(){ @endif {{-- End if blocktype = text_intro --}} @if($block['type'] == 'text') + @if(isset($block['role']))
@if(isset($block['header'])) @@ -330,12 +331,21 @@ function clear_timer(){

{!! $text !!}

@endforeach -
- -
+ @if($block['no_proceed']) +
+ +
+ @else +
+ +
+ @endif
@else
@@ -447,7 +457,7 @@ function clear_timer(){ @if($block['type'] == 'practice_test_stories')
-
{{ $b_key - 8}} / {{ count($test['blocks']) - 9}}
+
{{ $b_key - 8}} / {{ count($test['blocks']) - 10}}

{{ $block['prompt'] }}

@if($user->group_role == 'leader')

As the leader, you can type the number '1', '2', or '3' on your keyboard to enter the group's answer

@@ -491,7 +501,7 @@ function clear_timer(){ @if($block['type'] == 'practice_test_words')
-
{{ $b_key - 8}} / {{ count($test['blocks']) - 9}}
+
{{ $b_key - 8}} / {{ count($test['blocks']) - 10}}

{{ $block['prompt'] }}

@if($user->group_role == 'leader')

As the leader, select all that apply, then click "Next"

@@ -567,7 +577,7 @@ function clear_timer(){ @if($block['type'] == 'practice_test_images')
-
{{ $b_key - 8}} / {{ count($test['blocks']) - 9}}
+
{{ $b_key - 8}} / {{ count($test['blocks']) - 10}}

{{ $block['prompt'] }}

@if($user->group_role == 'leader')

As the leader, you can type the number '1', '2', or '3' on your keyboard to enter the group's answer

From b37c4abf4712742afefcd814ecbe77558612cc44 Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 20 Oct 2021 10:32:35 -0400 Subject: [PATCH 010/154] major timing adjustments on account of design changes (in memory, timing for each subsession is not uniform --- app/GroupTask.php | 8 + app/Http/Controllers/GroupTaskController.php | 11 +- .../Controllers/IndividualTaskController.php | 53 +- app/Http/Controllers/TaskRoomController.php | 42 +- .../Controllers/WaitingRoomController.php | 210 +++++-- app/Jobs/AssignGroups.php | 54 +- app/Tasks/Memory.php | 526 +++++++++++++----- .../layouts/participants/admin-page.blade.php | 60 +- .../layouts/participants/task-room.blade.php | 2 +- .../participants/tasks/memory-group.blade.php | 38 +- .../tasks/memory-individual.blade.php | 1 + routes/web.php | 6 + 12 files changed, 777 insertions(+), 234 deletions(-) diff --git a/app/GroupTask.php b/app/GroupTask.php index b06ba4e2..fedc8354 100644 --- a/app/GroupTask.php +++ b/app/GroupTask.php @@ -212,6 +212,14 @@ public static function initializeMemoryTasks($group_id, $randomize,$final,$test) {"taskName":"Conclusion","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"mturk","hasCode":"false","displayScoreGroup":"false", "digitalReceipt":"false", "sonaId": "547", "payment": "30", "feedback":"true", "feedbackLinkType":"qualtrics"}} ]'; } + elseif($test == 1){ + $taskArray = '[ + {"taskName":"Memory","taskParams":{"hasIndividuals":"false","hasGroup":"true","test":"group_'.$test.'_instructions","type":"intro"}}, + {"taskName":"Memory","taskParams":{"hasIndividuals":"false","hasGroup":"true","test":"group_'.$test.'","type":"task"}}, + {"taskName":"GroupSurvey","taskParams":{"hasIndividuals":"false","hasGroup":"true","type":"1","statementOrder":"ordered","task_name":"Memory"}}, + {"taskName":"WaitingRoom","taskParams":{"hasIndividuals":"false","hasGroup":"true","task":"2"}} + ]'; + } else{ $taskArray = '[ {"taskName":"Memory","taskParams":{"hasIndividuals":"false","hasGroup":"true","test":"group_'.$test.'_instructions","type":"intro"}}, diff --git a/app/Http/Controllers/GroupTaskController.php b/app/Http/Controllers/GroupTaskController.php index 6326e48f..4232d696 100644 --- a/app/Http/Controllers/GroupTaskController.php +++ b/app/Http/Controllers/GroupTaskController.php @@ -248,6 +248,9 @@ public function memoryGroupIntro(Request $request) { $user_id = \Auth::user()->id; $this_user = User::where('id',$user_id)->first(); + $this_user->status = 'Active'; + $this_user->save(); + event(new StatusChanged($this_user)); return view('layouts.participants.tasks.memory-group-intro') ->with('introType', $intro['test_name']) @@ -261,6 +264,7 @@ public function memory(Request $request) { $currentTask->started = 1; $currentTask->save(); + $parameters = unserialize($currentTask->parameters); $memory = new \Teamwork\Tasks\Memory; $test = $memory->getTest($parameters->test); @@ -290,7 +294,10 @@ public function memory(Request $request) { $user_id = \Auth::user()->id; $this_user = User::where('id',$user_id)->first(); - + $this_user->status = 'Active'; + $this_user->in_room = 0; + $this_user->save(); + event(new StatusChanged($this_user)); // GABE: // Originally, there was an array of multiple tests. We've separated the // different memory tasks into individual tasks but to avoid rewriting a @@ -729,6 +736,8 @@ public function cryptographyIntro(Request $request) { public function cryptography(Request $request) { $user = User::find(\Auth::user()->id); + $user->in_room = 0; + $user->save(); $isReporter = $this->isReporter(\Auth::user()->id, \Auth::user()->group_id); $currentTask = GroupTask::with('Response')->find($request->session()->get('currentGroupTask')); diff --git a/app/Http/Controllers/IndividualTaskController.php b/app/Http/Controllers/IndividualTaskController.php index 854b3a84..be19990c 100644 --- a/app/Http/Controllers/IndividualTaskController.php +++ b/app/Http/Controllers/IndividualTaskController.php @@ -187,6 +187,8 @@ public function groupSurvey(Request $request){ $admin = User::find(1); $currentTask = \Teamwork\GroupTask::find($request->session()->get('currentGroupTask')); + $currentTask->started = 1; + $currentTask->save(); $groupSurveyTask = \Teamwork\GroupTask::where('name','GroupSurvey') ->where('group_id',$this_user->group_id) @@ -215,15 +217,35 @@ public function groupSurvey(Request $request){ $time_elapsed = $session_start->created_at->diffInSeconds(\Carbon\Carbon::now()); - $task_length = env('TASK_LENGTH',300); + if($admin->waiting == 1) + $task_length = env('CRYPTO_TASK_LENGTH',300); + else + $task_length = env('MEMORY_TASK_LENGTH',300); $survey_length = env('SURVEY_LENGTH',120); $buffer_length = env('BUFFER_LENGTH',30); - $session_length = $task_length + $survey_length + $buffer_length; + $intro_length = env('MEMORY_INTRO_LENGTH',300); + + $alt_intro_length = env('MEMORY_ALT_INTRO_LENGTH',30); + + if($admin->waiting == 2){ + $alt_task_length = $task_length - $intro_length + $alt_intro_length; + + $session_length = $task_length + $survey_length + $buffer_length; + + $alt_session_length = $alt_task_length + $survey_length + $buffer_length; + + + $time_remaining = $alt_session_length * ($admin->current_session - 1) + $session_length - $time_elapsed - $buffer_length; + } + else{ + $session_length = $task_length + $survey_length + $buffer_length; + + $time_remaining = $session_length * ($admin->current_session) - $time_elapsed - $buffer_length; + } - $time_remaining = $session_length * $admin->current_session - $time_elapsed - $buffer_length; } else @@ -255,15 +277,34 @@ public function groupSurvey(Request $request){ $time_elapsed = $session_start->created_at->diffInSeconds(\Carbon\Carbon::now()); - $task_length = env('TASK_LENGTH',300); + if($admin->waiting == 1) + $task_length = env('CRYPTO_TASK_LENGTH',300); + else + $task_length = env('MEMORY_TASK_LENGTH',300); $survey_length = env('SURVEY_LENGTH',120); $buffer_length = env('BUFFER_LENGTH',30); - $session_length = $task_length + $survey_length + $buffer_length; + $intro_length = env('MEMORY_INTRO_LENGTH',300); - $time_remaining = $session_length * $admin->current_session - $time_elapsed - $buffer_length; + $alt_intro_length = env('MEMORY_ALT_INTRO_LENGTH',30); + + if($admin->waiting == 2){ + $alt_task_length = $task_length - $intro_length + $alt_intro_length; + + $session_length = $task_length + $survey_length + $buffer_length; + + $alt_session_length = $alt_task_length + $survey_length + $buffer_length; + + + $time_remaining = $alt_session_length * ($admin->current_session - 1) + $session_length - $time_elapsed - $buffer_length; + } + else{ + $session_length = $task_length + $survey_length + $buffer_length; + + $time_remaining = $session_length * ($admin->current_session) - $time_elapsed - $buffer_length; + } } else diff --git a/app/Http/Controllers/TaskRoomController.php b/app/Http/Controllers/TaskRoomController.php index 01045282..5c548f74 100644 --- a/app/Http/Controllers/TaskRoomController.php +++ b/app/Http/Controllers/TaskRoomController.php @@ -28,21 +28,39 @@ public function taskRoom(Request $request){ $time_elapsed = $session_start->created_at->diffInSeconds(\Carbon\Carbon::now()); - $task_length = env('TASK_LENGTH',300); + + + if($task == 1){ + $task_length = env('CRYPTO_TASK_LENGTH',300); - $survey_length = env('SURVEY_LENGTH',120); + $survey_length = env('SURVEY_LENGTH',120); - $buffer_length = env('BUFFER_LENGTH',30); + $buffer_length = env('BUFFER_LENGTH',30); + + $intro_length = env('CRYPTO_INTRO_LENGTH',180); - if($task == 1){ $session_length = $task_length + $survey_length + $buffer_length; $time_remaining = ($session_length * $admin->current_session) - $time_elapsed - ($survey_length + $buffer_length); } else{ + $task_length = env('MEMORY_TASK_LENGTH',300); + + $survey_length = env('SURVEY_LENGTH',120); + + $buffer_length = env('BUFFER_LENGTH',30); + + $intro_length = env('MEMORY_INTRO_LENGTH',180); + + $alt_intro_length = env('MEMORY_ALT_INTRO_LENGTH',180); + + $alt_task_length = $task_length - $intro_length + $alt_intro_length; + $session_length = $task_length + $survey_length + $buffer_length; - $time_remaining = ($session_length * $admin->current_session) - $time_elapsed - ($survey_length + $buffer_length); + $alt_session_length = $alt_task_length + $survey_length + $buffer_length; + + $time_remaining = ($alt_session_length * ($admin->current_session-1)) + $session_length - $time_elapsed - ($survey_length + $buffer_length); } @@ -72,8 +90,18 @@ public function taskRoom(Request $request){ $parameters = unserialize($currentTask->parameters); if(($currentTask->name == "Cryptography" || $currentTask->name == "Memory") && $parameters->type == "intro"){ - $time_remaining -= (env('TASK_LENGTH',600) - env('INTRO_LENGTH',180)); - $time_label = "Time Until Task Begins"; + if($currentTask->name == "Cryptography"){ + $time_remaining -= (env('CRYPTO_TASK_LENGTH',600) - env('CRYPTO_INTRO_LENGTH',180)); + $time_label = "Time Until Task Begins"; + } + else{ + if($admin->current_session == 1) + $time_remaining -= $task_length - $intro_length; + else + $time_remaining -= $alt_task_length - $alt_intro_length; + + $time_label = "Time remaining for Instructions and Practice Exercise"; + } $time_color = "red"; } else{ diff --git a/app/Http/Controllers/WaitingRoomController.php b/app/Http/Controllers/WaitingRoomController.php index 0e60f6c0..e6649dec 100644 --- a/app/Http/Controllers/WaitingRoomController.php +++ b/app/Http/Controllers/WaitingRoomController.php @@ -93,27 +93,75 @@ public function getWaitingRoom(Request $request){ //SEND EVENT TO LET ADMIN PAGE KNOW THAT USER IS ACTIVE AND IN WAITING ROOM event(new StatusChanged($this_user)); - - //ADMIN USER CONTAINS INFO ABOUT CURRENT SESSION - $admin = User::where('id',1)->first(); + $admin = User::find(1); //IF SESSION IS ACTIVE, DISPLAY TIMER INDICATING COUNTDOWN TO NEXT SUBSESSION - if($admin->current_session){ - $session_start = \Teamwork\Time::where('type','session')->orderBy('created_at','desc')->first(); + if($task == 2){ + if($admin->current_session){ + if($admin->current_session != 1){ + $session_start = \Teamwork\Time::where('type','session')->orderBy('created_at','desc')->first(); - $time_elapsed = $session_start->created_at->diffInSeconds(\Carbon\Carbon::now()); - - $task_length = env('TASK_LENGTH',300); + $time_elapsed = $session_start->created_at->diffInSeconds(\Carbon\Carbon::now()); + + $task_length = env('MEMORY_TASK_LENGTH',300); - $survey_length = env('SURVEY_LENGTH',120); + $survey_length = env('SURVEY_LENGTH',120); - $buffer_length = env('BUFFER_LENGTH',30); + $buffer_length = env('BUFFER_LENGTH',30); - $session_length = $task_length + $survey_length + $buffer_length; + $intro_length = env('MEMORY_INTRO_LENGTH',300); + + $alt_intro_length = env('MEMORY_ALT_INTRO_LENGTH',30); + + $alt_task_length = $task_length - $intro_length + $alt_intro_length; + + $session_length = $alt_task_length + $survey_length + $buffer_length; + + $first_session_length = $task_length + $survey_length + $buffer_length; + + $time_remaining = $first_session_length + ($session_length * ($admin->current_session-1)) - $time_elapsed; + } + else{ + $session_start = \Teamwork\Time::where('type','session')->orderBy('created_at','desc')->first(); + + $time_elapsed = $session_start->created_at->diffInSeconds(\Carbon\Carbon::now()); + + $task_length = env('MEMORY_TASK_LENGTH',300); + + $survey_length = env('SURVEY_LENGTH',120); - $time_remaining = ($session_length * $admin->current_session) - $time_elapsed; + $buffer_length = env('BUFFER_LENGTH',30); + + $session_length = $task_length + $survey_length + $buffer_length; + + $time_remaining = ($session_length * $admin->current_session) - $time_elapsed; + } + + } + else{ + $time_remaining = NULL; + } } - else - $time_remaining = NULL; + else{ + if($admin->current_session){ + $session_start = \Teamwork\Time::where('type','session')->orderBy('created_at','desc')->first(); + + $time_elapsed = $session_start->created_at->diffInSeconds(\Carbon\Carbon::now()); + + $task_length = env('CRYPTO_TASK_LENGTH',300); + + $survey_length = env('SURVEY_LENGTH',120); + + $buffer_length = env('BUFFER_LENGTH',30); + + $session_length = $task_length + $survey_length + $buffer_length; + + $time_remaining = ($session_length * $admin->current_session) - $time_elapsed; + } + else{ + $time_remaining = NULL; + } + } + $room_users = User::where('in_room',$task)->where('id','!=',1)->orderBy('updated_at','ASC')->get(); @@ -183,39 +231,82 @@ public function adminPage(Request $request){ $waitingRoomMembers = User::where('in_room',1)->where('id','!=',1)->get(); - $activeGroupTasks = GroupTask::where('started',1)->where('name',"Cryptography")->where('order',1)->where('created_at','>',\Carbon\Carbon::now()->startOfDay())->get(); + $activeGroupTasks = GroupTask::where('started',1)->where('name','!=','WaitingRoom')->where('completed',0)->where('created_at','>',\Carbon\Carbon::now()->startOfDay())->get(); $groups = []; foreach($activeGroupTasks as $key => $ac_task){ - #GRABS THE CRYPTO TASK RATHER THAN THE CRYPTO INTRO TASK - $real_task = GroupTask::where('group_id',$ac_task->group_id)->whereIn('name',array('Cryptography',"GroupSurvey"))->whereIn('order',array(2,3))->first(); - - if(!$real_task->completed) - $groups[] = $real_task->group_id; + $groups[] = $ac_task->group_id; } $groupMembers = User::whereIn('group_id',$groups)->get()->groupBy('group_id'); $time_remaining = null; + $session_length = null; - if($admin->current_session){ - $session_start = \Teamwork\Time::where('type','session')->orderBy('created_at','desc')->first(); + //IF SESSION IS ACTIVE, DISPLAY TIMER INDICATING COUNTDOWN TO NEXT SUBSESSION + if($admin->waiting == 2){ + if($admin->current_session){ + if($admin->current_session != 1){ + $session_start = \Teamwork\Time::where('type','session')->orderBy('created_at','desc')->first(); - $time_elapsed = $session_start->created_at->diffInSeconds(\Carbon\Carbon::now()); - - $task_length = env('TASK_LENGTH',300); + $time_elapsed = $session_start->created_at->diffInSeconds(\Carbon\Carbon::now()); + + $task_length = env('MEMORY_TASK_LENGTH',300); - $survey_length = env('SURVEY_LENGTH',120); + $survey_length = env('SURVEY_LENGTH',120); - $buffer_length = env('BUFFER_LENGTH',30); + $buffer_length = env('BUFFER_LENGTH',30); - $session_length = $task_length + $survey_length + $buffer_length; + $intro_length = env('MEMORY_INTRO_LENGTH',300); + + $intro_length = env('MEMORY_INTRO_LENGTH',300); + + $alt_intro_length = env('MEMORY_ALT_INTRO_LENGTH',30); + + $alt_task_length = $task_length - $intro_length + $alt_intro_length; + + $session_length = $alt_task_length + $survey_length + $buffer_length; + + $first_session_length = $task_length + $survey_length + $buffer_length; + + $time_remaining = $first_session_length + ($session_length * ($admin->current_session-1)) - $time_elapsed; + } + else{ + $session_start = \Teamwork\Time::where('type','session')->orderBy('created_at','desc')->first(); + + $time_elapsed = $session_start->created_at->diffInSeconds(\Carbon\Carbon::now()); + + $task_length = env('MEMORY_TASK_LENGTH',300); + + $survey_length = env('SURVEY_LENGTH',120); + + $buffer_length = env('BUFFER_LENGTH',30); + + $session_length = $task_length + $survey_length + $buffer_length; + + $time_remaining = ($session_length * $admin->current_session) - $time_elapsed; + } + + } + } + else{ + if($admin->current_session){ + $session_start = \Teamwork\Time::where('type','session')->orderBy('created_at','desc')->first(); - $time_remaining = ($session_length * $admin->current_session) - $time_elapsed; + $time_elapsed = $session_start->created_at->diffInSeconds(\Carbon\Carbon::now()); + + $task_length = env('CRYPTO_TASK_LENGTH',300); - $total_time = $session_length * $admin->max_sessions; + $survey_length = env('SURVEY_LENGTH',120); + + $buffer_length = env('BUFFER_LENGTH',30); + + $session_length = $task_length + $survey_length + $buffer_length; + + $time_remaining = ($session_length * $admin->current_session) - $time_elapsed; + } } return view('layouts.participants.admin-page') @@ -223,6 +314,8 @@ public function adminPage(Request $request){ ->with('in_session',$in_session) ->with('waitingRoomMembers',$waitingRoomMembers) ->with('groupMembers',$groupMembers) + ->with('admin',$admin) + ->with('subsession_length',$session_length) ->with('time_remaining',$time_remaining); } @@ -243,7 +336,6 @@ public function toggleSession(Request $request){ #FORCE PARTICIPANT PAGE TO REFRESH public function forceRefreshUser($id, Request $request){ - $this_user = User::where('participant_id',$id)->first(); @@ -310,16 +402,51 @@ public function beginSession(Request $request){ $time = \Teamwork\Time::create(['user_id' => \Auth::user()->id, 'type' => 'session']); $time->recordStartTime(); - $task_length = env('TASK_LENGTH',300); + //IF SESSION IS ACTIVE, DISPLAY TIMER INDICATING COUNTDOWN TO NEXT SUBSESSION + if($admin->waiting == 2){ + + $task_length = env('MEMORY_TASK_LENGTH',300); + + $survey_length = env('SURVEY_LENGTH',120); + + $buffer_length = env('BUFFER_LENGTH',30); + + $intro_length = env('MEMORY_INTRO_LENGTH',300); - $survey_length = env('SURVEY_LENGTH',120); + $alt_intro_length = env('MEMORY_ALT_INTRO_LENGTH',300); - $buffer_length = env('BUFFER_LENGTH',30); + $alt_task_length = $task_length - $intro_length + $alt_intro_length; - $session_length = $task_length + $survey_length + $buffer_length; + //$task_length -= $intro_length; - for($i=0; $i<$request->num_sessions; $i++){ - (new AssignGroups('',$admin->waiting))->dispatch('',$admin->waiting)->delay(\Carbon\Carbon::now()->addSeconds($session_length * $i)); + $session_length = $task_length + $survey_length + $buffer_length; + + $alt_session_length = $alt_task_length+ $survey_length + $buffer_length; + + for($i=0; $i<$request->num_sessions; $i++){ + if($i == 0) + (new AssignGroups('',$admin->waiting))->dispatch('',$admin->waiting)->delay(\Carbon\Carbon::now()->addSeconds(0)); + elseif($i == 1) + (new AssignGroups('',$admin->waiting))->dispatch('',$admin->waiting)->delay(\Carbon\Carbon::now()->addSeconds($session_length)); + else + (new AssignGroups('',$admin->waiting))->dispatch('',$admin->waiting)->delay(\Carbon\Carbon::now()->addSeconds($alt_session_length * ($i-1) + $session_length)); + + + } + } + else{ + + $task_length = env('CRYPTO_TASK_LENGTH',300); + + $survey_length = env('SURVEY_LENGTH',120); + + $buffer_length = env('BUFFER_LENGTH',30); + + $session_length = $task_length + $survey_length + $buffer_length; + + for($i=0; $i<$request->num_sessions; $i++){ + (new AssignGroups('',$admin->waiting))->dispatch('',$admin->waiting)->delay(\Carbon\Carbon::now()->addSeconds($session_length * $i)); + } } return '200'; @@ -438,6 +565,15 @@ public function saveNotes(Request $request){ return '200'; } + #TOGGLE SESSION TASK TYPE + public function setTaskType(Request $request){ + $admin = User::find(1); + $admin->waiting = (int) $request->type; + $admin->save(); + + return '200'; + } + #DISPLAY MAIN ADMIN MENU public function adminMenu(Request $request){ return view('layouts.participants.admin-menu'); diff --git a/app/Jobs/AssignGroups.php b/app/Jobs/AssignGroups.php index c228d0bc..b446a9e8 100644 --- a/app/Jobs/AssignGroups.php +++ b/app/Jobs/AssignGroups.php @@ -335,13 +335,13 @@ public function handle() $time_elapsed = $session_start->created_at->diffInSeconds(\Carbon\Carbon::now()); - $task_length = env('TASK_LENGTH',300); + $task_length = env('CRYPTO_TASK_LENGTH',300); $survey_length = env('SURVEY_LENGTH',120); $buffer_length = env('BUFFER_LENGTH',30); - $intro_length = env('INTRO_LENGTH',30); + $intro_length = env('CRYPTO_INTRO_LENGTH',30); $session_length = $task_length + $survey_length + $buffer_length; @@ -382,13 +382,19 @@ public function handle() $time_elapsed = $session_start->created_at->diffInSeconds(\Carbon\Carbon::now()); - $task_length = env('TASK_LENGTH',300); + $task_length = env('MEMORY_TASK_LENGTH',300); $survey_length = env('SURVEY_LENGTH',120); $buffer_length = env('BUFFER_LENGTH',30); - $intro_length = env('INTRO_LENGTH',30); + $intro_length = env('MEMORY_INTRO_LENGTH',30); + + $alt_intro_length = env('MEMORY_ALT_INTRO_LENGTH'); + + if($admin->current_session != 1){ + $task_length = $task_length - $intro_length + $alt_intro_length; + } $session_length = $task_length + $survey_length + $buffer_length; @@ -397,19 +403,37 @@ public function handle() event(new SendToTask($follower1)); event(new SendToTask($follower2)); - //DISPATCHES DELAYED JOBS WHICH WILL FIRE EVENTS THAT SEND USERS FROM THE TASK TO THE WAITING ROOM/CONCLUSION - //AT THE END OF A SUBSESSION - (new SendIntroComplete($leader->id,1))->dispatch($leader->id,1)->delay(\Carbon\Carbon::now()->addSeconds($intro_length)); - (new SendIntroComplete($follower1->id,1))->dispatch($follower1->id,1)->delay(\Carbon\Carbon::now()->addSeconds($intro_length + 1)); - (new SendIntroComplete($follower2->id,1))->dispatch($follower2->id,1)->delay(\Carbon\Carbon::now()->addSeconds($intro_length + 2)); + if($admin->current_session == 1){ + //DISPATCHES DELAYED JOBS WHICH WILL FIRE EVENTS THAT SEND USERS FROM THE TASK TO THE WAITING ROOM/CONCLUSION + //AT THE END OF A SUBSESSION + (new SendIntroComplete($leader->id,1))->dispatch($leader->id,1)->delay(\Carbon\Carbon::now()->addSeconds($intro_length)); + (new SendIntroComplete($follower1->id,1))->dispatch($follower1->id,1)->delay(\Carbon\Carbon::now()->addSeconds($intro_length + 1)); + (new SendIntroComplete($follower2->id,1))->dispatch($follower2->id,1)->delay(\Carbon\Carbon::now()->addSeconds($intro_length + 2)); - (new SendTaskComplete($leader->id,2))->dispatch($leader->id,2)->delay(\Carbon\Carbon::now()->addSeconds($session_length- ($survey_length + $buffer_length))); - (new SendTaskComplete($follower1->id,2))->dispatch($follower1->id,2)->delay(\Carbon\Carbon::now()->addSeconds($session_length - ($survey_length + $buffer_length) + 1)); - (new SendTaskComplete($follower2->id,2))->dispatch($follower2->id,2)->delay(\Carbon\Carbon::now()->addSeconds($session_length- ($survey_length + $buffer_length) + 2)); + (new SendTaskComplete($leader->id,2))->dispatch($leader->id,2)->delay(\Carbon\Carbon::now()->addSeconds($session_length- ($survey_length + $buffer_length))); + (new SendTaskComplete($follower1->id,2))->dispatch($follower1->id,2)->delay(\Carbon\Carbon::now()->addSeconds($session_length - ($survey_length + $buffer_length) + 1)); + (new SendTaskComplete($follower2->id,2))->dispatch($follower2->id,2)->delay(\Carbon\Carbon::now()->addSeconds($session_length- ($survey_length + $buffer_length) + 2)); - (new SendTaskEvent($leader->id,3))->dispatch($leader->id,3)->delay(\Carbon\Carbon::now()->addSeconds($session_length-$buffer_length)); - (new SendTaskEvent($follower1->id,3))->dispatch($follower1->id,3)->delay(\Carbon\Carbon::now()->addSeconds($session_length-$buffer_length +1)); - (new SendTaskEvent($follower2->id,3))->dispatch($follower2->id,3)->delay(\Carbon\Carbon::now()->addSeconds($session_length-$buffer_length + 2)); + (new SendTaskComplete($leader->id,3))->dispatch($leader->id,3)->delay(\Carbon\Carbon::now()->addSeconds($session_length-$buffer_length)); + (new SendTaskComplete($follower1->id,3))->dispatch($follower1->id,3)->delay(\Carbon\Carbon::now()->addSeconds($session_length-$buffer_length + 1)); + (new SendTaskComplete($follower2->id,3))->dispatch($follower2->id,3)->delay(\Carbon\Carbon::now()->addSeconds($session_length-$buffer_length + 2)); + } + else{ + (new SendIntroComplete($leader->id,1))->dispatch($leader->id,1)->delay(\Carbon\Carbon::now()->addSeconds($alt_intro_length)); + (new SendIntroComplete($follower1->id,1))->dispatch($follower1->id,1)->delay(\Carbon\Carbon::now()->addSeconds($alt_intro_length + 1)); + (new SendIntroComplete($follower2->id,1))->dispatch($follower2->id,1)->delay(\Carbon\Carbon::now()->addSeconds($alt_intro_length + 2)); + + (new SendTaskComplete($leader->id,2))->dispatch($leader->id,2)->delay(\Carbon\Carbon::now()->addSeconds($session_length- ($survey_length + $buffer_length))); + (new SendTaskComplete($follower1->id,2))->dispatch($follower1->id,2)->delay(\Carbon\Carbon::now()->addSeconds($session_length - ($survey_length + $buffer_length) + 1)); + (new SendTaskComplete($follower2->id,2))->dispatch($follower2->id,2)->delay(\Carbon\Carbon::now()->addSeconds($session_length- ($survey_length + $buffer_length) + 2)); + + (new SendTaskComplete($leader->id,3))->dispatch($leader->id,3)->delay(\Carbon\Carbon::now()->addSeconds($session_length-$buffer_length)); + (new SendTaskComplete($follower1->id,3))->dispatch($follower1->id,3)->delay(\Carbon\Carbon::now()->addSeconds($session_length-$buffer_length + 1)); + (new SendTaskComplete($follower2->id,3))->dispatch($follower2->id,3)->delay(\Carbon\Carbon::now()->addSeconds($session_length-$buffer_length + 2)); + } + + + //IF THIS IS THE LAST SUBSESSION, DISPATCH A DELAYED JOB TO FIRE "END OF SESSION" EVENTS if($admin->current_session == $admin->max_sessions){ diff --git a/app/Tasks/Memory.php b/app/Tasks/Memory.php index 1620b2c9..bd91daac 100644 --- a/app/Tasks/Memory.php +++ b/app/Tasks/Memory.php @@ -1193,20 +1193,23 @@ class Memory { 'choices' => ['100', '150', '125'], - 'correct' => [3]], + 'correct' => [3], + 'num' => 1], [ 'type' => 'practice_test_words', 'selection_type' => 'select_all', 'prompt' => 'Which of the following are target words?', 'choices' => ['bread', 'fish', 'pie'], - 'correct' => [1]], + 'correct' => [1], + 'num' => 2], [ 'type' => 'practice_test_images', 'selection_type' => 'select_one', 'show_numbers' => 'false', 'prompt' => 'Which of the following images is a "target" image?', 'img' => 'p0_test_1.jpeg', - 'correct' => [1]], + 'correct' => [1], + 'num' => 3], ['type'=>'text', 'header'=> 'Wait for task to begin', 'wait_for_all'=>'true', @@ -1227,12 +1230,16 @@ class Memory { 'directory' => '/img/memory-task/faces/', 'wait_for_all'=>'true', 'blocks' => [ - ['type' => 'text_intro', + ['type' => 'text', 'header' => 'Memory Task', 'wait_for_all' => 'true', - 'text' => ['Next is a test of your group’s collective memory. This - will be the same as the group memory task you completed previously.' + 'no_proceed' => 'true', + 'text' => ['You have seen this group memory task before, so we will NOT do a + practice this time. You will be memorizing new sets of items.', + 'Remember, you will all complete the memorization phase as individuals, but only the Leader can input the answers for the questions that follow.', + 'You will continue to the task when the Leader\'s timer reaches 0. Please introduce yourselves and chat until then.' ]], + /* WE ARE SKIPPING THE PRACTICE FOR THIS GROUP FOR NOW ['type' => 'text', 'header' => 'Memory: practice round', @@ -1339,17 +1346,20 @@ class Memory { ], // end group_2_instructions 'group_3_instructions' => [ - 'test_name' => 'group_2_instructions', + 'test_name' => 'group_3_instructions', 'task_type' => 'mixed', 'type' => 'intro', 'directory' => '/img/memory-task/faces/', 'wait_for_all'=>'true', 'blocks' => [ - ['type' => 'text_intro', + ['type' => 'text', 'header' => 'Memory Task', 'wait_for_all' => 'true', - 'text' => ['Next is a test of your group’s collective memory. This - will be the same as the group memory task you completed previously.' + 'no_proceed' => 'true', + 'text' => ['You have seen this group memory task before, so we will NOT do a + practice this time. You will be memorizing new sets of items.', + 'Remember, you will all complete the memorization phase as individuals, but only the Leader can input the answers for the questions that follow.', + 'You will continue to the task when the Leader\'s timer reaches 0. Please introduce yourselves and chat until then.' ]], /* WE ARE SKIPPING THE PRACTICE FOR THIS GROUP FOR NOW ['type' => 'text', @@ -1726,7 +1736,7 @@ class Memory { 'wait_for_all'=>'true', 'text' =>[ 'When you click next, the group task will begin.', - 'Your group has 10 minutes to work through the task.', + 'Your group has 8 minutes to work through the task.', 'This time has already begun.', 'Note: only the group Leader has information about the time remaining. There is a timer at the top of Leader\'s screen.', 'Click Next to begin.' @@ -1739,6 +1749,7 @@ class Memory { 'Now for the actual task', 'This will determine your score', 'Your group will have 40 seconds to memorize 6 images, 12 words and 2 short stories. This is like the practice, but you have twice as long to remember twice as much', + "Keep in mind: on average, groups require 5 minutes to complete the memorization phase and answer the questions. You have 8 minutes total.", 'Click "Next" for some more information' ]], ['type'=>'text', @@ -1870,6 +1881,7 @@ class Memory { 'prompt' => 'Which of the following images is a "target" image?', 'img' => '1_test_1.jpg', 'correct' => [3], + 'num' => 1 ], ['type' => 'test_stories', @@ -1879,26 +1891,30 @@ class Memory { 'choices' => ['Collisions with other shoppers', 'Running into stacks of groceries', 'Having accidents with their carts'], - 'correct' => [3]], + 'correct' => [3], + 'num' => 2], [ 'type' => 'test_words', 'selection_type' => 'select_all', 'prompt' => 'Which of the following are target words?', 'choices' => ['fork', 'pan', 'knife'], - 'correct' => [1, 2]], + 'correct' => [1, 2], + 'num' => 3], [ 'type' => 'test_images', 'selection_type' => 'select_one', 'show_numbers' => 'false', 'prompt' => 'Which of the following images is a "target" image?', 'img' => '1_test_2.jpg', - 'correct' => [1]], + 'correct' => [1], + 'num' => 4], [ 'type' => 'test_words', 'selection_type' => 'select_all', 'prompt' => 'Which of the following are target words?', 'choices' => ['spatula', 'beer', 'bomb'], - 'correct' => [1, 3]], + 'correct' => [1, 3], + 'num' => 5], ['type' => 'test_stories', 'selection_type' => 'select_one', @@ -1906,20 +1922,23 @@ class Memory { 'choices' => ['Recently', 'Last month', 'A week ago'], - 'correct' => [1]], + 'correct' => [1], + 'num' => 6], [ 'type' => 'test_images', 'selection_type' => 'select_one', 'show_numbers' => 'false', 'prompt' => 'Which of the following images is a "target" image?', 'img' => '1_test_3.jpg', - 'correct' => [1]], + 'correct' => [1], + 'num' => 7], [ 'type' => 'test_words', 'selection_type' => 'select_all', 'prompt' => 'Which of the following are target words?', 'choices' => ['whiskey', 'lemon', 'gun'], - 'correct' => []], + 'correct' => [], + 'num' => 8], ['type' => 'test_stories', 'selection_type' => 'select_one', @@ -1927,20 +1946,23 @@ class Memory { 'choices' => ['None', 'One', 'It\'s unclear based on the story'], - 'correct' => [3]], + 'correct' => [3], + 'num' => 9], [ 'type' => 'test_words', 'selection_type' => 'select_all', 'prompt' => 'Which of the following are target words?', 'choices' => ['gun', 'pistol', 'trout'], - 'correct' => [2]], + 'correct' => [2], + 'num' => 10], [ 'type' => 'test_images', 'selection_type' => 'select_one', 'show_numbers' => 'false', 'prompt' => 'Which of the following images is a "target" image?', 'img' => '1_test_4.jpg', - 'correct' => [2]], + 'correct' => [2], + 'num' => 11], ['type' => 'test_stories', 'selection_type' => 'select_one', @@ -1948,7 +1970,8 @@ class Memory { 'choices' => ['They make an annoying noise', 'They have faulty wheels', 'They can be difficult to move'], - 'correct' => [2]], + 'correct' => [2], + 'num' => 12], ['type' => 'test_stories', 'selection_type' => 'select_one', @@ -1956,33 +1979,38 @@ class Memory { 'choices' => ['Grangers', 'Graysons', 'Greysons'], - 'correct' => [1]], + 'correct' => [1], + 'num' => 13], [ 'type' => 'test_images', 'selection_type' => 'select_one', 'show_numbers' => 'false', 'prompt' => 'Which of the following images is a "target" image?', 'img' => '1_test_5.jpg', - 'correct' => [3]], + 'correct' => [3], + 'num' => 14], [ 'type' => 'test_words', 'selection_type' => 'select_all', 'prompt' => 'Which of the following are target words?', 'choices' => ['wine', 'fork', 'sword'], - 'correct' => [1, 2, 3]], + 'correct' => [1, 2, 3], + 'num' => 15], [ 'type' => 'test_images', 'selection_type' => 'select_one', 'show_numbers' => 'false', 'prompt' => 'Which of the following images is a "target" image?', 'img' => '1_test_6.jpg', - 'correct' => [2]], + 'correct' => [2], + 'num' => 16], [ 'type' => 'test_words', 'selection_type' => 'select_all', 'prompt' => 'Which of the following are target words?', 'choices' => ['rum', 'pencil', 'pot'], - 'correct' => [1, 3]], + 'correct' => [1, 3], + 'num' => 17], ['type' => 'test_stories', 'selection_type' => 'select_one', @@ -1990,14 +2018,16 @@ class Memory { 'choices' => ['Saying they will fix their shopping carts', 'Claiming the problem is with the customers', 'Promising they’ll look into the issue'], - 'correct' => [2]], + 'correct' => [2], + 'num' => 18], [ 'type' => 'test_images', 'selection_type' => 'select_one', 'show_numbers' => 'false', 'prompt' => 'Which of the following images is a "target" image?', 'img' => '1_test_7.jpg', - 'correct' => [2]], + 'correct' => [2], + 'num' => 19], ['type' => 'test_stories', 'selection_type' => 'select_one', @@ -2005,20 +2035,23 @@ class Memory { 'choices' => ['More than half', 'Almost all', '8 out of 10'], - 'correct' => [3]], + 'correct' => [3], + 'num' => 20], [ 'type' => 'test_images', 'selection_type' => 'select_one', 'show_numbers' => 'false', 'prompt' => 'Which of the following images is a "target" image?', 'img' => '1_test_8.jpg', - 'correct' => [3]], + 'correct' => [3], + 'num' => 21], [ 'type' => 'test_words', 'selection_type' => 'select_all', 'prompt' => 'Which of the following are target words?', 'choices' => ['can', 'vodka', 'spoon'], - 'correct' => [1, 3]], + 'correct' => [1, 3], + 'num' => 22], ['type' => 'test_stories', 'selection_type' => 'select_one', @@ -2026,40 +2059,109 @@ class Memory { 'choices' => ['Black', 'Expensive', 'New'], - 'correct' => [2]], + 'correct' => [2], + 'num' => 23], [ 'type' => 'test_words', 'selection_type' => 'select_all', 'prompt' => 'Which of the following are target words?', 'choices' => ['rifle', 'gold', 'strainer'], - 'correct' => [1]], + 'correct' => [1], + 'num' => 24] ]// end blocks ], // end group_1 - 'group_2' => [ + 'group_2' => [ 'test_name' => 'group_2', 'task_type' => 'mixed', 'type' => 'intro', 'directory' => '/img/memory-task/faces/', 'blocks' => [ + ['type'=>'text', + 'header'=>'', + 'wait_for_all'=>'true', + 'text' =>[ + 'The group task has now begun', + 'Your group has 8 minutes to work through the task.', + 'This time has already begun.', + 'Note: only the group Leader has information about the time remaining. There is a timer at the top of Leader\'s screen.', + 'Click Next to continue.' + ]], ['type' => 'text', 'header' => 'Memory Task', 'wait_for_all' => 'true', 'text' => ['You have seen this group memory task before, so we will NOT do a practice this time.', - 'Remember, each person will memorize the stimuli on their own computer. - But, you will answer as a group. Questions will only appear on - the Reporter\'s laptop.', + 'Remember, you will all complete the memorization phase as individuals, but only the Leader can input the answers for the questions that follow.', + "Keep in mind: on average, groups require 5 minutes to complete the memorization phase and answer the questions. You have 8 minutes total.", 'The task will continue when everyone has clicked "Next".' ]], - ['type' => 'review_choice', - 'text' => ['You will have 40 seconds to memorize everything as a group. There - is a timer in the top right of the screen.', - 'Remember, during the 40 seconds, you can always change the stimuli - you are memorizing by clicking on a different button.', - 'You’re NOT allowed to write anything down.', - 'The time starts when everyone has clicked on one of the buttons.'], + ['type'=>'text', + 'header'=>'Final Instructions', + 'wait_for_all'=>'true', + 'role' =>True, + 'leader' => ['As the LEADER you receive some extra information about scores on the individual memory test. Your teammates will not see this information.', + "Recall that you are responsible for answering questions in the task.", + " + + + + + + + + + + + + + + + + + + + + + + + + +
Role + Images + + Words + + Stories +
+ + + +
+ + + +
+ + + +
", + 'Click "Next" for some more information' + ], + 'follower1' => ['The leader is now viewing info that only they can see.', + 'The practice questions will begin when you all click next' + ], + 'follower2' => ['The leader is now viewing info that only they can see.', + 'The practice questions will begin when you all click next' + ] + ], + ['type' => 'review_choice', + 'header' => 'Memory Task', + 'text' => ['This is the page where you can choose what to memorize.', + 'If you want, you can try to memorize several types of stimuli.', + 'Your 40 seconds starts when everyone in the group has made a choice.', + 'You’re NOT allowed to write anything down (or take a screenshot).'], 'choices' => [['color' => 'success', 'type' => 'images'], ['color' => 'warning', 'type' => 'words'], ['color' => 'danger', 'type' => 'stories']], @@ -2095,27 +2197,34 @@ class Memory { ['color' => 'warning', 'type' => 'words'], ['color' => 'danger', 'type' => 'stories']], 'review_time' => 40], - - ['type' => 'text', - 'header' => '', - 'end_individual_section' => 'true', - 'text' => ['We will now ask you questions.', - 'Everyone should be able to see the screen of the Reporter\'s laptop. You will - answer as a group, on The Reporter\'s laptop.', - 'The questions will begin when The Reporter clicks "Next"' + ['type' => 'text', + 'header' => '', + 'wait_for_all' => 'true', + 'role' => True, + 'leader' => ['Now we will ask you some questions about the stimuli.', + 'Remember: as the LEADER, only you can answer the questions (with the help of your team).', + 'The questions will begin when you all click next' + ], + 'follower1' => ['Now we will ask you some questions about the stimuli.', + 'You will see the questions on your computer.', + "Your group leader will answer on the group's behalf", + 'The questions will begin when you all click next' + ], + 'follower2' => ['Now we will ask you some questions about the stimuli.', + 'You will see the questions on your computer.', + "Your group leader will answer on the group's behalf", + 'The questions will begin when you all click next' ]], - ['type' => 'text', - 'text' => ['Make sure all your group members - can see this screen. We are about to ask questions about - the words, stories and images you memorized.
- Click "Next" to continue.' - ]], - [ 'type' => 'test_images', + + + + [ 'type' => 'test_images', 'selection_type' => 'select_one', 'show_numbers' => 'true', 'prompt' => 'Which of the following images is a "target" face?', 'img' => '2_test_1.jpg', - 'correct' => [3]], + 'correct' => [3], + 'num' => 1], [ 'type' => 'test_stories', 'selection_type' => 'select_one', @@ -2123,26 +2232,30 @@ class Memory { 'choices' => ['Europe and Mexico', 'Europe and China', 'China and Mexico'], - 'correct' => [2]], + 'correct' => [2], + 'num' => 2], ['type' => 'test_words', 'selection_type' => 'select_all', 'prompt' => 'Which of the following are target words', 'choices' => ['oil', 'kerosine', 'priest'], - 'correct' => [2]], + 'correct' => [2], + 'num' => 3], ['type' => 'test_words', 'selection_type' => 'select_all', 'prompt' => 'Which of the following are target words', 'choices' => ['salt', 'basement', 'piano'], - 'correct' => []], + 'correct' => [], + 'num' => 4], ['type' => 'test_images', 'selection_type' => 'select_one', 'show_numbers' => 'true', 'prompt' => 'Which of the following images is a "target" image?', 'img' => '2_test_2.jpg', - 'correct' => [1]], + 'correct' => [1], + 'num' => 5], [ 'type' => 'test_stories', 'selection_type' => 'select_one', @@ -2150,20 +2263,23 @@ class Memory { 'choices' => ['Stubborn', 'Cheap', 'Rude'], - 'correct' => [1]], + 'correct' => [1], + 'num' => 6], ['type' => 'test_images', 'selection_type' => 'select_one', 'show_numbers' => 'true', 'prompt' => 'Which of the following images is a "target" image?', 'img' => '2_test_3.jpg', - 'correct' => [2]], + 'correct' => [2], + 'num' => 7], ['type' => 'test_words', 'selection_type' => 'select_all', 'prompt' => 'Which of the following are target words', 'choices' => ['wood', 'harmonica', 'trumpet'], - 'correct' => [1, 3]], + 'correct' => [1, 3], + 'num' => 8], [ 'type' => 'test_stories', 'selection_type' => 'select_one', @@ -2171,14 +2287,16 @@ class Memory { 'choices' => ['18 months ago', '6 months ago', '12 months ago'], - 'correct' => [1]], + 'correct' => [1], + 'num' => 9], ['type' => 'test_images', 'selection_type' => 'select_one', 'show_numbers' => 'true', 'prompt' => 'Which of the following images is a "target" image?', 'img' => '2_test_4.jpg', - 'correct' => [3]], + 'correct' => [3], + 'num' => 10], ['type' => 'test_images', @@ -2186,7 +2304,8 @@ class Memory { 'show_numbers' => 'true', 'prompt' => 'Which of the following images is a "target" image?', 'img' => '2_test_5.jpg', - 'correct' => [1]], + 'correct' => [1], + 'num' => 11], [ 'type' => 'test_stories', 'selection_type' => 'select_one', @@ -2194,7 +2313,8 @@ class Memory { 'choices' => ['Simpson', 'Sanderson', 'Sandford'], - 'correct' => [1]], + 'correct' => [1], + 'num' => 12], [ 'type' => 'test_stories', 'selection_type' => 'select_one', @@ -2202,26 +2322,30 @@ class Memory { 'choices' => ['1933', '1932', '1923'], - 'correct' => [1]], + 'correct' => [1], + 'num' => 13], ['type' => 'test_words', 'selection_type' => 'select_all', 'prompt' => 'Which of the following are target words', 'choices' => ['garlic', 'violin', 'vanilla'], - 'correct' => [1, 2, 3]], + 'correct' => [1, 2, 3], + 'num' => 14], ['type' => 'test_images', 'selection_type' => 'select_one', 'show_numbers' => 'true', 'prompt' => 'Which of the following images is a "target" image?', 'img' => '2_test_6.jpg', - 'correct' => [3]], + 'correct' => [3], + 'num' => 15], ['type' => 'test_words', 'selection_type' => 'select_all', 'prompt' => 'Which of the following are target words', 'choices' => ['chair', 'pepper', 'horn'], - 'correct' => []], + 'correct' => [], + 'num' => 16], [ 'type' => 'test_stories', 'selection_type' => 'select_one', @@ -2229,20 +2353,23 @@ class Memory { 'choices' => ['Ten thousand dollars', 'Eleven thousand dollars', 'Twelve thousand dollars'], - 'correct' => [1]], + 'correct' => [1], + 'num' => 17], ['type' => 'test_words', 'selection_type' => 'select_all', 'prompt' => 'Which of the following are target words', 'choices' => ['sand', 'sugar', 'drum'], - 'correct' => [2]], + 'correct' => [2], + 'num' => 18], ['type' => 'test_images', 'selection_type' => 'select_one', 'show_numbers' => 'true', 'prompt' => 'Which of the following images is a "target" image?', 'img' => '2_test_7.jpg', - 'correct' => [2]], + 'correct' => [2], + 'num' => 19], [ 'type' => 'test_stories', 'selection_type' => 'select_one', @@ -2250,14 +2377,16 @@ class Memory { 'choices' => ['Slimmer waists and larger arms', 'Larger waists and slimmer legs', 'Slimmer waists and larger chests'], - 'correct' => [3]], + 'correct' => [3], + 'num' => 20], ['type' => 'test_images', 'selection_type' => 'select_one', 'show_numbers' => 'true', 'prompt' => 'Which of the following images is a "target" image?', 'img' => '2_test_8.jpg', - 'correct' => [2]], + 'correct' => [2], + 'num' => 11], [ 'type' => 'test_stories', 'selection_type' => 'select_one', @@ -2265,19 +2394,22 @@ class Memory { 'choices' => ['Relieved', 'Pleased', 'Grateful'], - 'correct' => [2]], + 'correct' => [2], + 'num' => 22], ['type' => 'test_words', 'selection_type' => 'select_all', 'prompt' => 'Which of the following are target words', 'choices' => ['flute', 'clarinet', 'piano'], - 'correct' => [2]], + 'correct' => [2], + 'num' => 23], ['type' => 'test_words', 'selection_type' => 'select_all', 'prompt' => 'Which of the following are target words', 'choices' => ['coal', 'electricity', 'lemon'], - 'correct' => [1]], + 'correct' => [1], + 'num' => 24], ]// end blocks ], // end group_2 @@ -2288,26 +2420,90 @@ class Memory { 'type' => 'intro', 'directory' => '/img/memory-task/bikes/', 'blocks' => [ + ['type'=>'text', + 'header'=>'', + 'wait_for_all'=>'true', + 'text' =>[ + 'When you click next, the group task will begin.', + 'Your group has 8 minutes to work through the task.', + 'This time has already begun.', + 'Note: only the group Leader has information about the time remaining. There is a timer at the top of Leader\'s screen.', + 'Click Next to begin.' + ]], ['type' => 'text', 'header' => 'Memory Task', 'wait_for_all' => 'true', - 'text' => ['Your group will have 40 seconds to memorize 6 images, 12 words and 2 short - stories.', - 'Everyone should be in front of their own laptop. During the memorization - period, you have the option of looking at multiple types of stimuli - (e.g. stories AND - images). Or, - you can divide the responsibilities of memorizing different things.', - 'Take some time to discuss how you will approach this task.', - 'You will receive some final instructions when each group member has clicked "Next".' + 'text' => ['You have seen this group memory task before, so we will NOT do a + practice this time.', + 'Remember, you will all complete the memorization phase as individuals, but only the Leader can input the answers for the questions that follow.', + "Keep in mind: on average, groups require 5 minutes to complete the memorization phase and answer the questions. You have 8 minutes total.", + 'The task will continue when everyone has clicked "Next".' ]], - ['type' => 'review_choice', - 'text' => ['Remember: you have 40 seconds, and there is a timer in - the top right of the screen.', - 'You’re NOT allowed to write anything down.', - 'If you want, you can always change the stimuli - you are memorizing by clicking on a different button..', - 'The timer starts when everyone has clicked on one of the buttons.'], + ['type'=>'text', + 'header'=>'Final Instructions', + 'wait_for_all'=>'true', + 'role' =>True, + 'leader' => ['As the LEADER you receive some extra information about scores on the individual memory test. Your teammates will not see this information.', + "Recall that you are responsible for answering questions in the task.", + " + + + + + + + + + + + + + + + + + + + + + + + + +
Role + Images + + Words + + Stories +
+ + + +
+ + + +
+ + + +
", + 'Click "Next" for some more information' + ], + 'follower1' => ['The leader is now viewing info that only they can see.', + 'The practice questions will begin when you all click next' + ], + 'follower2' => ['The leader is now viewing info that only they can see.', + 'The practice questions will begin when you all click next' + ] + ], + ['type' => 'review_choice', + 'header' => 'Memory Task', + 'text' => ['This is the page where you can choose what to memorize.', + 'If you want, you can try to memorize several types of stimuli.', + 'Your 40 seconds starts when everyone in the group has made a choice.', + 'You’re NOT allowed to write anything down (or take a screenshot).'], 'choices' => [['color' => 'success', 'type' => 'images'], ['color' => 'warning', 'type' => 'words'], ['color' => 'danger', 'type' => 'stories']], @@ -2318,48 +2514,59 @@ class Memory { 'types' => [ ['type' => 'images', 'directory' => '/img/memory-task/bikes/', 'prompt' => 'Remember these target images', - 'targets' => ['1_target_1.jpeg', '1_target_2.jpeg', '1_target_3.jpeg'] + 'targets' => ['3_targets_1.jpg', '3_targets_2.jpg', '3_targets_3.jpg'] ], ['type' => 'words', 'prompt' => 'Remember these target words', - 'targets' => ['bluebird', 'chisel', 'eagle', 'screwdriver', 'crow', - 'wrench', 'pants', 'nails', 'shoes', - 'canary', 'skirt', 'blouse'], + 'targets' => ['garlic', 'wood', 'sugar', 'coal', 'clarinet', + 'trumpet', 'cinnamon', 'flute', 'kerosine', + 'vanilla', 'gasoline', 'violin'] ], ['type' => 'stories', 'prompt' => 'Remember these target stories', - 'targets' => ['At 7:35pm on Monday, Joe Garcia of San Francisco was watching television as he - dressed to go out. A weather bulletin interrupted the program to warn of a - thunderstorm. The announcer said the storm could bring hail and up to four - inches of rain. Joe decided to stay home. He took off his coat and sat down - to watch old movies.', - 'A Tokyo barmaid is suing a customer for two hundred and twenty thousand - dollars. The complaint arose after the man attempted a goodnight kiss, - causing the couple to fall down a flight of stairs. The forty six year - old woman suffered facial injuries in the fall but avoided the attempted - kiss.'], + 'targets' => ['Clothing makers in Europe and China have a problem. The shape of the + American male has changed. American men now have slimmer waists and larger chests + than they did in 1933 when the last measurements were taken. Manufacturers will + alter their designs and have promised to update their statistics more frequently.', + 'Michael Simpson earned a reputation for being stubborn after refusing to + accept pay cheques. Instead of cheques, he wanted his wages to be paid in + cash. He eventually collected ten thousand dollars in back pay. His wife + was pleased because she had been forced to cook on a camping stove, after + services to their home were cut off eighteen months ago.'], ] ], 'choices' => [['color' => 'success', 'type' => 'images'], ['color' => 'warning', 'type' => 'words'], ['color' => 'danger', 'type' => 'stories']], 'review_time' => 40], - - ['type' => 'text', - 'header' => '', - 'end_individual_section' => 'true', - 'text' => ['We will now ask you questions.', - 'Everyone should be able to see the screen of the Reporter\'s laptop. You will - answer as a group, on The Reporter\'s laptop.', - 'The questions will begin when The Reporter clicks "Next"' + ['type' => 'text', + 'header' => '', + 'wait_for_all' => 'true', + 'role' => True, + 'leader' => ['Now we will ask you some questions about the stimuli.', + 'Remember: as the LEADER, only you can answer the questions (with the help of your team).', + 'The questions will begin when you all click next' + ], + 'follower1' => ['Now we will ask you some questions about the stimuli.', + 'You will see the questions on your computer.', + "Your group leader will answer on the group's behalf", + 'The questions will begin when you all click next' + ], + 'follower2' => ['Now we will ask you some questions about the stimuli.', + 'You will see the questions on your computer.', + "Your group leader will answer on the group's behalf", + 'The questions will begin when you all click next' ]], + - [ 'type' => 'test_images', + + [ 'type' => 'test_images', 'selection_type' => 'select_one', 'show_numbers' => 'true', 'prompt' => 'Which of the following images is a "target" image?', 'img' => '1_test_1.jpeg', - 'correct' => [1]], + 'correct' => [1], + 'num' => 1], [ 'type' => 'test_stories', 'selection_type' => 'select_one', @@ -2367,20 +2574,23 @@ class Memory { 'choices' => ['San Jose', 'San Diego', 'San Francisco'], - 'correct' => [3]], + 'correct' => [3], + 'num' => 2], ['type' => 'test_images', 'selection_type' => 'select_one', 'show_numbers' => 'true', 'prompt' => 'Which of the following images is a "target" image?', 'img' => '1_test_2.jpeg', - 'correct' => [2]], + 'correct' => [2], + 'num' => 3], ['type' => 'test_words', 'selection_type' => 'select_all', 'prompt' => 'Which of the following are target words', 'choices' => ['child', 'bluebird', 'chapel'], - 'correct' => [2]], + 'correct' => [2], + 'num' => 4], [ 'type' => 'test_stories', 'selection_type' => 'select_one', @@ -2388,32 +2598,37 @@ class Memory { 'choices' => ['Monday', 'Sunday', 'Tuesday'], - 'correct' => [1]], + 'correct' => [1], + 'num' => 5], ['type' => 'test_images', 'selection_type' => 'select_one', 'show_numbers' => 'true', 'prompt' => 'Which of the following images is a "target" image?', 'img' => '1_test_3.jpeg', - 'correct' => [1]], + 'correct' => [1], + 'num' => 6], ['type' => 'test_words', 'selection_type' => 'select_all', 'prompt' => 'Which of the following are target words', 'choices' => ['canary', 'socks', 'robin'], - 'correct' => [1]], + 'correct' => [1], + 'num' => 7], ['type' => 'test_words', 'selection_type' => 'select_all', 'prompt' => 'Which of the following are target words', 'choices' => ['hammer', 'skirt', 'apple'], - 'correct' => [2]], + 'correct' => [2], + 'num' => 8], ['type' => 'test_images', 'selection_type' => 'select_one', 'show_numbers' => 'true', 'prompt' => 'Which of the following images is a "target" image?', 'img' => '1_test_4.jpeg', - 'correct' => [2]], + 'correct' => [2], + 'num' => 9], [ 'type' => 'test_stories', 'selection_type' => 'select_one', @@ -2421,13 +2636,15 @@ class Memory { 'choices' => ['$220,000', '$200,000', '$20,000'], - 'correct' => [1]], + 'correct' => [1], + 'num' => 10], ['type' => 'test_words', 'selection_type' => 'select_all', 'prompt' => 'Which of the following are target words', 'choices' => ['shirt', 'saw', 'wren'], - 'correct' => []], + 'correct' => [], + 'num' => 11], [ 'type' => 'test_stories', 'selection_type' => 'select_one', @@ -2435,20 +2652,23 @@ class Memory { 'choices' => ['At least 4 inches', 'Up to 4 inches', 'More than 4 inches'], - 'correct' => [2]], + 'correct' => [2], + 'num' => 12], ['type' => 'test_words', 'selection_type' => 'select_all', 'prompt' => 'Which of the following are target words', 'choices' => ['chisel', 'screwdriver', 'sparrow'], - 'correct' => [1, 2]], + 'correct' => [1, 2], + 'num' => 13], ['type' => 'test_images', 'selection_type' => 'select_one', 'show_numbers' => 'true', 'prompt' => 'Which of the following images is a "target" image?', 'img' => '1_test_5.jpeg', - 'correct' => [3]], + 'correct' => [3], + 'num' => 14], [ 'type' => 'test_stories', 'selection_type' => 'select_one', @@ -2456,20 +2676,23 @@ class Memory { 'choices' => ['36', '46', '26'], - 'correct' => [2]], + 'correct' => [2], + 'num' => 15], ['type' => 'test_images', 'selection_type' => 'select_one', 'show_numbers' => 'true', 'prompt' => 'Which of the following images is a "target" image?', 'img' => '1_test_6.jpeg', - 'correct' => [3]], + 'correct' => [3], + 'num' => 16], ['type' => 'test_words', 'selection_type' => 'select_all', 'prompt' => 'Which of the following are target words', 'choices' => ['silver', 'nails', 'eagle'], - 'correct' => [2, 3]], + 'correct' => [2, 3], + 'num' => 17], [ 'type' => 'test_stories', 'selection_type' => 'select_one', @@ -2477,20 +2700,23 @@ class Memory { 'choices' => ['Her manager', 'Her employer', 'Her customer'], - 'correct' => [3]], + 'correct' => [3], + 'num' => 18], ['type' => 'test_images', 'selection_type' => 'select_one', 'show_numbers' => 'true', 'prompt' => 'Which of the following images is a "target" image?', 'img' => '1_test_7.jpeg', - 'correct' => [2]], + 'correct' => [2], + 'num' => 19], ['type' => 'test_words', 'selection_type' => 'select_all', 'prompt' => 'Which of the following are target words', 'choices' => ['crow', 'rock', 'rook'], - 'correct' => [1]], + 'correct' => [1], + 'num' => 20], [ 'type' => 'test_stories', 'selection_type' => 'select_one', @@ -2498,14 +2724,16 @@ class Memory { 'choices' => ['Call in sick', 'Watch old movies', 'Go back to watching TV programs'], - 'correct' => [2]], + 'correct' => [2], + 'num' => 21], ['type' => 'test_images', 'selection_type' => 'select_one', 'show_numbers' => 'true', 'prompt' => 'Which of the following images is a "target" image?', 'img' => '1_test_8.jpeg', - 'correct' => [3]], + 'correct' => [3], + 'num' => 22], [ 'type' => 'test_stories', 'selection_type' => 'select_one', @@ -2513,15 +2741,17 @@ class Memory { 'choices' => ['He was watching a news program', 'A weather report interrupted the program he was watching', 'He saw a weather bulletin between shows'], - 'correct' => [2]], + 'correct' => [2], + 'num' => 23], ['type' => 'test_words', 'selection_type' => 'select_all', 'prompt' => 'Which of the following are target words', 'choices' => ['blouse', 'pants', 'wrench'], - 'correct' => [1, 2, 3]], + 'correct' => [1, 2, 3], + 'num' => 24] ]// end blocks - ], // end group_3 + ], // end group_2 'group_4' => [ 'test_name' => 'group_4', diff --git a/resources/views/layouts/participants/admin-page.blade.php b/resources/views/layouts/participants/admin-page.blade.php index 8ef4f4ce..45a09fb6 100644 --- a/resources/views/layouts/participants/admin-page.blade.php +++ b/resources/views/layouts/participants/admin-page.blade.php @@ -21,12 +21,24 @@ function convertTZ(date) { var session_count = null; var happened = false; var session_begun = false; -var subsession_length = parseInt('{{ env("TASK_LENGTH",300) }}') + parseInt('{{ env("SURVEY_LENGTH",120) }}') + parseInt('{{ env("BUFFER_LENGTH",30) }}'); +var task = '{{ $admin->waiting }}'; +var current_session = '{{ $admin->current_session }}'; + +//var subsession_length = parseInt('{{ env("TASK_LENGTH",300) }}') + parseInt('{{ env("SURVEY_LENGTH",120) }}') + parseInt('{{ env("BUFFER_LENGTH",30) }}'); +var subsession_length = '';//parseInt('{{ $subsession_length }}'); +var alt_subsession_length = ''; var current_session = parseInt('{{ $user->current_session }}'); var max_sessions = parseInt('{{ $user->max_sessions }}'); var itv; $( document ).ready(function() { + if(task == '1'){ + subsession_length = parseInt('{{ env("CRYPTO_TASK_LENGTH",300) }}') + parseInt('{{ env("SURVEY_LENGTH",300) }}') + parseInt('{{ env("BUFFER_LENGTH",300) }}'); + } + else{ + subsession_length = parseInt('{{ env("MEMORY_TASK_LENGTH",300) }}') + parseInt('{{ env("SURVEY_LENGTH",300) }}') + parseInt('{{ env("BUFFER_LENGTH",300) }}'); + alt_subsession_length = parseInt('{{ env("MEMORY_TASK_LENGTH",300) }}') + parseInt('{{ env("SURVEY_LENGTH",300) }}') + parseInt('{{ env("BUFFER_LENGTH",300) }}') - parseInt('{{ env("MEMORY_INTRO_LENGTH",300) }}') + parseInt('{{ env("MEMORY_ALT_INTRO_LENGTH",300) }}'); + } //ESTABLISHES THE DEFINITION OF A ROW IN OUR LIST.JS TABLE //ITEM IS A FUNCTION THAT TAKES CELL VALUES AND OUTPUTS THE HTML FOR THE ROW options = { @@ -108,7 +120,10 @@ function convertTZ(date) { $('#session_count').text(session_count); - time_remaining = subsession_length; + if(task == '1') + time_remaining = subsession_length; + else + time_remaining = alt_subsession_length; } } @@ -192,7 +207,10 @@ function convertTZ(date) { else{ session_count += 1; $('#session_count').text(session_count); - time_remaining = subsession_length; + if(task == '1') + time_remaining = subsession_length; + else + time_remaining = alt_subsession_length; } } //TIMER CAN'T BE LESS THAN 0 @@ -221,6 +239,17 @@ function convertTZ(date) { }); }); + $('#task_type').on('change',function(event){ + $.ajax({ + type: "POST", + url: '/set-task-type', + data:{type:$('#task_type').val(),_token: "{{ csrf_token() }}",}, + success: function(data){ + window.location.reload(); + } + }); + }); + //SCROLL TO TOP WHEN TABLE IS SORTED $('th').on('click',function(event){ $('#tablediv').scrollTop(0); @@ -304,7 +333,10 @@ function convertTZ(date) { session_count += 1; $('#session_count').text(session_count); - time_remaining = subsession_length; + if(task == '1') + time_remaining = subsession_length; + else + time_remaining = alt_subsession_length; } } @@ -445,17 +477,33 @@ function convertTZ(date) {

+

Set task type:

+

# of sub-sessions
@if($user->current_session) - @else - @endif + @if($admin->waiting == 1) + @else + + + + @endif @if($user->current_session)

Current session: {{ $user->current_session }}/{{ $user->max_sessions }}

diff --git a/resources/views/layouts/participants/task-room.blade.php b/resources/views/layouts/participants/task-room.blade.php index 825b67e7..dbb5e332 100644 --- a/resources/views/layouts/participants/task-room.blade.php +++ b/resources/views/layouts/participants/task-room.blade.php @@ -162,7 +162,7 @@
@if($user->group_role == 'leader')
-
{{ $time_label }}: {{ gmdate('i:s',$time_remaining) }}
+

{{ $time_label }}: {{ gmdate('i:s',$time_remaining) }}

@endif
diff --git a/resources/views/layouts/participants/tasks/memory-group.blade.php b/resources/views/layouts/participants/tasks/memory-group.blade.php index 60be0f01..0b9ad9b4 100644 --- a/resources/views/layouts/participants/tasks/memory-group.blade.php +++ b/resources/views/layouts/participants/tasks/memory-group.blade.php @@ -53,6 +53,7 @@ function clear_timer(){ //CLEAR TIMER IF THEY PRESS NEXT $('#next').on('click',function(event){ + $(document).scrollTop(0); clearTimeout(tmt); if(status == 'Idle'){ status = 'Active' @@ -250,6 +251,7 @@ function clear_timer(){ $(document).keydown(function(event) { + var key = event.key; if(((key == 1 || key == 2 || key == 3) && ($(".memory-img").is(":visible") || $(".story-choices").is(":visible"))) && "{{ $user->group_role }}" === "leader" ) { memory.advanceImageTest(key); @@ -257,6 +259,7 @@ function clear_timer(){ _token : "{{ csrf_token() }}", key : key }); + $(document).scrollTop(0); } @@ -331,7 +334,7 @@ function clear_timer(){

{!! $text !!}

@endforeach - @if($block['no_proceed']) + @if(array_key_exists('no_proceed',$block))
{!! $text !!}

@endforeach -
- -
+ @if(array_key_exists('no_proceed',$block)) +
+ +
+ @else +
+ +
+ @endif
@endif @endif {{-- End if blocktype = text --}} @@ -457,7 +469,7 @@ function clear_timer(){ @if($block['type'] == 'practice_test_stories')
-
{{ $b_key - 8}} / {{ count($test['blocks']) - 10}}
+
{{ $block['num'] }}/3

{{ $block['prompt'] }}

@if($user->group_role == 'leader')

As the leader, you can type the number '1', '2', or '3' on your keyboard to enter the group's answer

@@ -479,7 +491,7 @@ function clear_timer(){ @if($block['type'] == 'test_stories')
-
{{ $b_key - 5}} / {{ count($test['blocks']) - 6}}
+
{{ $block['num'] }}/24

{{ $block['prompt'] }}

@if($user->group_role == 'leader')

As the leader, you can type the number '1', '2', or '3' on your keyboard to enter the group's answer

@@ -501,7 +513,7 @@ function clear_timer(){ @if($block['type'] == 'practice_test_words')
-
{{ $b_key - 8}} / {{ count($test['blocks']) - 10}}
+
{{ $block['num'] }}/3

{{ $block['prompt'] }}

@if($user->group_role == 'leader')

As the leader, select all that apply, then click "Next"

@@ -539,7 +551,7 @@ function clear_timer(){ @if( $block['type'] == 'test_words')
-
{{ $b_key - 5}} / {{ count($test['blocks']) - 6}}
+
{{ $block['num'] }}/24

{{ $block['prompt'] }}

@if($user->group_role == 'leader')

As the leader, select all that apply, then click "Next"

@@ -577,7 +589,7 @@ function clear_timer(){ @if($block['type'] == 'practice_test_images')
-
{{ $b_key - 8}} / {{ count($test['blocks']) - 10}}
+
{{ $block['num'] }}/3

{{ $block['prompt'] }}

@if($user->group_role == 'leader')

As the leader, you can type the number '1', '2', or '3' on your keyboard to enter the group's answer

@@ -598,7 +610,7 @@ function clear_timer(){ @if($block['type'] == 'test_images')
-
{{ $b_key - 5}} / {{ count($test['blocks']) - 6}}
+
{{ $block['num'] }}/24

{{ $block['prompt'] }}

@if($user->group_role == 'leader')

As the leader, you can type the number '1', '2', or '3' on your keyboard to enter the group's answer

diff --git a/resources/views/layouts/participants/tasks/memory-individual.blade.php b/resources/views/layouts/participants/tasks/memory-individual.blade.php index eefb7983..d6c69e69 100644 --- a/resources/views/layouts/participants/tasks/memory-individual.blade.php +++ b/resources/views/layouts/participants/tasks/memory-individual.blade.php @@ -132,6 +132,7 @@ @if($block['type'] == 'practice_test')
+
{{ $b_key }} / {{ count($test['blocks']) - 1 }}

{{ $block['prompt'] }}

Type [1], [2], or [3]

Note: You need to type the number on your keyboard

diff --git a/routes/web.php b/routes/web.php index e2e4153c..56e4df38 100644 --- a/routes/web.php +++ b/routes/web.php @@ -157,6 +157,12 @@ 'roles' => ['Researcher'] // Only a logged in user can view this page ]); +Route::post('/set-task-type', [ + 'middleware' => ['auth', 'roles'], // A 'roles' middleware must be specified + 'uses' => 'WaitingRoomController@setTaskType', + 'roles' => ['Researcher'] // Only a logged in user can view this page +]); + Route::get('/pick-leader', [ 'middleware' => ['auth', 'roles'], // A 'roles' middleware must be specified From 91b6da2f916471ada1fcde69a979f16885cc74de Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 22 Oct 2021 12:28:22 -0400 Subject: [PATCH 011/154] final cosmetic adjustments for phase 1 + 2 of memory --- app/Http/Controllers/TaskRoomController.php | 8 +- .../Controllers/WaitingRoomController.php | 8 +- app/Tasks/Memory.php | 194 ++++++++++-------- public/css/tasks.css | 11 +- .../participants/tasks/memory-group.blade.php | 45 ++-- .../tasks/memory-individual.blade.php | 39 +++- .../participants/waiting-room.blade.php | 6 +- 7 files changed, 201 insertions(+), 110 deletions(-) diff --git a/app/Http/Controllers/TaskRoomController.php b/app/Http/Controllers/TaskRoomController.php index 5c548f74..c32cfb77 100644 --- a/app/Http/Controllers/TaskRoomController.php +++ b/app/Http/Controllers/TaskRoomController.php @@ -95,10 +95,14 @@ public function taskRoom(Request $request){ $time_label = "Time Until Task Begins"; } else{ - if($admin->current_session == 1) + if($admin->current_session == 1){ $time_remaining -= $task_length - $intro_length; - else + $time_label = "Time remaining for Instructions and Practice Exercise"; + } + else{ $time_remaining -= $alt_task_length - $alt_intro_length; + $time_label = "Time until Main Task begins"; + } $time_label = "Time remaining for Instructions and Practice Exercise"; } diff --git a/app/Http/Controllers/WaitingRoomController.php b/app/Http/Controllers/WaitingRoomController.php index e6649dec..f43ce6b2 100644 --- a/app/Http/Controllers/WaitingRoomController.php +++ b/app/Http/Controllers/WaitingRoomController.php @@ -233,13 +233,19 @@ public function adminPage(Request $request){ $activeGroupTasks = GroupTask::where('started',1)->where('name','!=','WaitingRoom')->where('completed',0)->where('created_at','>',\Carbon\Carbon::now()->startOfDay())->get(); + $groupSurveyTasks = GroupTask::where('started',1)->where('name','GroupSurvey')->where('completed',1)->where('created_at','>',\Carbon\Carbon::now()->startOfDay())->get(); + $groups = []; foreach($activeGroupTasks as $key => $ac_task){ $groups[] = $ac_task->group_id; } - $groupMembers = User::whereIn('group_id',$groups)->get()->groupBy('group_id'); + foreach($groupSurveyTasks as $key => $ac_task){ + $groups[] = $ac_task->group_id; + } + + $groupMembers = User::whereIn('group_id',$groups)->where('in_room',0)->get()->groupBy('group_id'); $time_remaining = null; $session_length = null; diff --git a/app/Tasks/Memory.php b/app/Tasks/Memory.php index bd91daac..f3517156 100644 --- a/app/Tasks/Memory.php +++ b/app/Tasks/Memory.php @@ -52,29 +52,33 @@ class Memory { 'header' => 'Image Memory', 'text' => 'In this task, you\'ll be presented with a set of images (for example, 6 faces). There will be 6 images to memorize. We\'ll - call these "target images". We\'ll start with a practice.',], + call these "target images". We\'ll start with a practice.'], ['type' => 'practice_review', 'text' => 'Look at these 6 faces for a few seconds. We\'ll call these "target faces".', + 'subtext' => 'Don\'t leave this page!', 'targets' => ['p0_targets_1.png'], 'review_time' => null], [ 'type' => 'practice_test', 'selection_type' => 'select_one', 'prompt' => 'Which of the following faces is a "target" face?', 'img' => 'p0_test_1.png', - 'correct' => [1]], + 'correct' => [1], + 'num' => 1], [ 'type' => 'practice_test', 'selection_type' => 'select_one', 'prompt' => 'Which of the following faces is a "target" face?', 'img' => 'p0_test_2.png', - 'correct' => [3]], + 'correct' => [3], + 'num' => 2], ['type' => 'text', 'text' => 'Now for the actual task. When you click "Continue" a screen will appear with 6 target images. You can view the images front-on or in profile. Click the "change perspective" button to see them from a different angle. You will have 20 seconds to memorize - these target images.'], + these target images.', + 'Do NOT take any screenshots, or write anything down.'], ]// end blocks ], // end images_instructions @@ -111,7 +115,6 @@ class Memory { you have read and understood the instructions, so please answer all questions carefully.',], ['type' => 'review', - 'text' => '', 'targets' => ['blue', 'yellow', 'red'], 'review_time_each' => 2, 'review_time' => null], @@ -119,14 +122,17 @@ class Memory { 'selection_type' => 'select_all', 'prompt' => 'Which of the following are target words?', 'choices' => ['red', 'rust', 'blue'], - 'correct' => [1, 3]], + 'correct' => [1, 3], + 'num' => 1 + ], [ 'type' => 'practice_test', 'selection_type' => 'select_all', 'prompt' => 'Which of the following are target words?', 'choices' => ['green', 'baseball', 'egg'], 'correct' => [], 'popup_text' => 'Sometimes, none of the words will be a target word.
In that case, just click "next"!', - 'popup_display_time' => 5], + 'popup_display_time' => 5, + 'num' => 1], ['type' => 'text', 'text' => 'Now for the actual task. You will be presented with 12 target words. Try to remember all of them. Each word will @@ -161,10 +167,11 @@ class Memory { 'header' => 'Story Memory', 'text' => 'This memory task asks you to remember two very short stories. Once again, we’ll start with a - practice. In the practice round each "story" will only have one sentence.'], + practice. In the practice round each "story" will only have one sentence. + As always, you\'re not allowed to write anything down or take screenshots.'], ['type' => 'review', - 'text' => 'Practice:', - 'subtext' => 'Read these two \'stories\' quickly but carefully. When you\'re finished click continue.', + 'text' => 'You have 30 seconds to memorize the two "stories" presented below (there is a timer in the top left).', + 'subtext' => 'Don\'t leave this page!', 'targets' => ['Peter was hungry, so he went to the store on the corner of his street and bought a hamburger.', 'Yesterday, a local woman found a 10-foot crocodile @@ -177,14 +184,16 @@ class Memory { 'choices' => ['Because he was hungry', 'To get coffee', 'To buy food for his dog'], - 'correct' => [1]], + 'correct' => [1], + 'num' => 1], [ 'type' => 'practice_test', 'selection_type' => 'select_one', 'prompt' => 'Where was a crocodile found yesterday?', 'choices' => ['In a kitchen', 'On a roof in Manhattan', 'On the moon'], - 'correct' => [1]], + 'correct' => [1], + 'num' => 2], ['type' => 'text', 'text' => 'Now for the actual task. You will be presented with two longer stories. You will have 30 seconds to read them. Try to take in as much information as possible. @@ -223,55 +232,64 @@ class Memory { 'show_numbers' => 'true', 'prompt' => 'Which of the following images is a "target" face?', 'img' => '1_test_1.jpg', - 'correct' => [3]], + 'correct' => [3], + 'num' => 1], ['type' => 'test', 'selection_type' => 'select_one', 'show_numbers' => 'true', 'prompt' => 'Which of the following images is a "target" face?', 'img' => '1_test_2.jpg', - 'correct' => [3]], + 'correct' => [3], + 'num' => 2], ['type' => 'test', 'selection_type' => 'select_one', 'show_numbers' => 'true', 'prompt' => 'Which of the following images is a "target" face?', 'img' => '1_test_3.jpg', - 'correct' => [1]], + 'correct' => [1], + 'num' => 3], ['type' => 'test', 'selection_type' => 'select_one', 'show_numbers' => 'true', 'prompt' => 'Which of the following images is a "target" face?', 'img' => '1_test_4.jpg', - 'correct' => [1]], + 'correct' => [1], + 'num' => 4], ['type' => 'test', 'selection_type' => 'select_one', 'show_numbers' => 'true', 'prompt' => 'Which of the following images is a "target" face?', 'img' => '1_test_5.jpg', - 'correct' => [3]], + 'correct' => [3], + 'num' => 5], ['type' => 'test', 'selection_type' => 'select_one', 'show_numbers' => 'true', 'prompt' => 'Which of the following images is a "target" face?', 'img' => '1_test_6.jpg', - 'correct' => [2]], + 'correct' => [2], + 'num' => 6], ['type' => 'test', 'selection_type' => 'select_one', 'show_numbers' => 'true', 'prompt' => 'Which of the following images is a "target" face?', 'img' => '1_test_7.jpg', - 'correct' => [3]], + 'correct' => [3], + 'num' => 7], ['type' => 'test', 'selection_type' => 'select_one', 'show_numbers' => 'true', 'prompt' => 'Which of the following images is a "target" face?', 'img' => '1_test_8.jpg', - 'correct' => [3]], + 'correct' => [3], + 'num' => 8], ['type' => 'test', 'selection_type' => 'select_one', 'show_numbers' => 'true', 'prompt' => 'Which of the following images is a "target" face?', 'img' => '1_test_9.jpg', - 'correct' => [1]], + 'correct' => [1], + 'num' => 9], ['type' => 'review', 'text' => 'Here’s a reminder of the faces. @@ -291,37 +309,43 @@ class Memory { 'show_numbers' => 'true', 'prompt' => 'Which of the following images is a "target" face?', 'img' => '1_test_10.jpg', - 'correct' => [1]], + 'correct' => [1], + 'num' => 10], ['type' => 'test', 'selection_type' => 'select_one', 'show_numbers' => 'true', 'prompt' => 'Which of the following images is a "target" face?', 'img' => '1_test_11.jpg', - 'correct' => [3]], + 'correct' => [3], + 'num' => 11], ['type' => 'test', 'selection_type' => 'select_one', 'show_numbers' => 'true', 'prompt' => 'Which of the following faces is a "target" face?', 'img' => '1_test_12.jpg', - 'correct' => [3]], + 'correct' => [3], + 'num' => 12], ['type' => 'test', 'selection_type' => 'select_one', 'show_numbers' => 'true', 'prompt' => 'Which of the following images is a "target" face?', 'img' => '1_test_13.jpg', - 'correct' => [2]], + 'correct' => [2], + 'num' => 13], ['type' => 'test', 'selection_type' => 'select_one', 'show_numbers' => 'true', 'prompt' => 'Which of the following images is a "target" face?', 'img' => '1_test_14.jpg', - 'correct' => [1]], + 'correct' => [1], + 'num' => 14], ['type' => 'test', 'selection_type' => 'select_one', 'show_numbers' => 'true', 'prompt' => 'Which of the following images is a "target" face?', 'img' => '1_test_15.jpg', - 'correct' => [2]], + 'correct' => [2], + 'num' => 15], ], // End blocks @@ -527,42 +551,50 @@ class Memory { 'selection_type' => 'select_all', 'prompt' => 'Which of the following are target words', 'choices' => ['house', 'tiger', 'hut'], - 'correct' => [2, 3]], + 'correct' => [2, 3], + 'num' => 1], ['type' => 'test', 'selection_type' => 'select_all', 'prompt' => 'Which of the following are target words', 'choices' => ['hotel', 'coffee', 'mountain'], - 'correct' => [1]], + 'correct' => [1], + 'num' => 2], ['type' => 'test', 'selection_type' => 'select_all', 'prompt' => 'Which of the following are target words', 'choices' => ['cow', 'dog', 'emerald'], - 'correct' => [1, 3]], + 'correct' => [1, 3], + 'num' => 3], ['type' => 'test', 'selection_type' => 'select_all', 'prompt' => 'Which of the following are target words', 'choices' => ['ruby', 'pig', 'balloon'], - 'correct' => []], + 'correct' => [], + 'num' => 4], ['type' => 'test', 'selection_type' => 'select_all', 'prompt' => 'Which of the following are target words', 'choices' => ['apartment', 'tiger', 'diamond'], - 'correct' => [2]], + 'correct' => [2], + 'num' => 5], ['type' => 'test', 'selection_type' => 'select_all', 'prompt' => 'Which of the following are target words', 'choices' => ['pearl', 'scarf', 'hotel'], - 'correct' => [1, 3]], + 'correct' => [1, 3], + 'num' => 6], ['type' => 'test', 'selection_type' => 'select_all', 'prompt' => 'Which of the following are target words', 'choices' => ['boat', 'penny', 'cat'], - 'correct' => []], + 'correct' => [], + 'num' => 7], ['type' => 'test', 'selection_type' => 'select_all', 'prompt' => 'Which of the following are target words', 'choices' => ['lion', 'sapphire', 'cave'], - 'correct' => [1, 2, 3]], + 'correct' => [1, 2, 3], + 'num' => 8], ] // End blocks @@ -767,56 +799,64 @@ class Memory { 'choices' => ['State Street', 'Main Street', 'Sixth Street'], - 'correct' => [1]], + 'correct' => [1], + 'num' => 1], [ 'type' => 'test', 'selection_type' => 'select_one', 'prompt' => 'In which town was an attack stopped by an umbrella?', 'choices' => ['Greensville', 'Gainessville', 'Greensboro'], - 'correct' => [1]], + 'correct' => [1], + 'num' => 2], [ 'type' => 'test', 'selection_type' => 'select_one', 'prompt' => 'How old was the woman who defended herself with an umbrella?', 'choices' => ['56', '57', '67'], - 'correct' => [2]], + 'correct' => [2], + 'num' => 3], [ 'type' => 'test', 'selection_type' => 'select_one', 'prompt' => 'What was Anna Thompson\'s job?', 'choices' => ['Cook', 'She didn\'t have a job', 'Janitor'], - 'correct' => [1]], + 'correct' => [1], + 'num' => 4], [ 'type' => 'test', 'selection_type' => 'select_one', 'prompt' => 'When did Anna report being robbed?', 'choices' => ['One night after the robbery', 'Two nights after the robbery', 'A week after the robbery'], - 'correct' => [2]], + 'correct' => [2], + 'num' => 5], [ 'type' => 'test', 'selection_type' => 'select_one', 'prompt' => 'How long had it been since Anna\'s family had eaten?', 'choices' => ['2 days', '1 day', 'They missed 2 meals'], - 'correct' => [1]], + 'correct' => [1], + 'num' => 6], [ 'type' => 'test', 'selection_type' => 'select_one', 'prompt' => 'What color was the pickup truck used by the attackers in Florida?', 'choices' => ['Yellow', 'Black', 'It wasn\'t mentioned'], - 'correct' => [1]], + 'correct' => [1], + 'num' => 7], [ 'type' => 'test', 'selection_type' => 'select_one', 'prompt' => 'What did the police do to help Anna Thompson?', 'choices' => ['Make arrests', 'Collect money for her', 'Give her food'], - 'correct' => [2]], + 'correct' => [2], + 'num' => 8], ] // End blocks ], // End story_1 @@ -1066,22 +1106,15 @@ class Memory { 'directory' => '/img/memory-task/bodies/', 'blocks' => [ ['type'=>'text', - 'header'=> '', + 'header'=> 'Welcome to the Group Memory task', 'wait_for_all'=>'true', 'text'=>[ 'Note that your group has 5 minutes to work through these instructions (including a practice question).', - 'This time has already begun.', - 'Only the group Leader has information about the time remaining: there is a timer at the top of the Leader\'s screen.', + 'Your time has already begun!', + 'Only the group Leader has information about the time remaining.', 'Click next to continue.' ] ], - ['type'=>'text', - 'header'=> 'Welcome to the Group Memory task!', - 'wait_for_all'=>'true', - 'text'=>[ - 'You will be working together for 10-12 minutes.' - ] - ], ['type'=>'text', 'header'=> '', 'wait_for_all'=>'true', @@ -1105,7 +1138,6 @@ class Memory { 'text'=>[ "The collective Memory task examines three types of memory: images, words, and stories", 'Your group must memorize all three types of stimuli at the same time', - "Please do NOT write anything down during this task, or take screenshots.", "We'll start with a practice round" ] ], @@ -1121,7 +1153,7 @@ class Memory { ]], ['type' => 'review_choice', 'header' => 'Practice Round', - 'text' => ['This is the page where you can choose what to memorize..', + 'text' => ['This is the page where you can choose what to memorize.', 'If you want, you can try to memorize several types of stimuli. For example, you might start with "Stories" (by clicking on the Stories button). @@ -1172,16 +1204,16 @@ class Memory { 'end_individual_section' => 'true', 'wait_for_all' => 'true', 'role' =>True, - 'leader' => ['Now we will ask you some questions about the stimuli.', + 'leader' => ['Next, we will ask you 3 questions about the stimuli.', 'As the leader, you are the only person who can answer the questions. *This will be your responsibility*', 'The practice questions will begin when you all click next' ], - 'follower1' => ['Now we will ask you some questions about the stimuli.', + 'follower1' => ['Next, we will ask you 3 questions about the stimuli.', 'You will see the questions on your computer.', "Your group leader will answer on the group's behalf", 'The practice questions will begin when you all click next' ], - 'follower2' => ['Now we will ask you some questions about the stimuli.', + 'follower2' => ['Next, we will ask you 3 questions about the stimuli.', 'You will see the questions on your computer.', "Your group leader will answer on the group's behalf", 'The practice questions will begin when you all click next' @@ -1215,8 +1247,8 @@ class Memory { 'wait_for_all'=>'true', 'no_proceed'=>'true', 'text'=>[ - 'You and your group will proceed to the task when the leader\'s 5 minute timer runs out', - 'Until then, please chat with your teammates.' + 'The task will begin shortly (when the timer on the Leader\'s screen reaches 0:00).', + 'Until then, please stay on this page and chat with your teammates!.' ] ] @@ -1234,10 +1266,11 @@ class Memory { 'header' => 'Memory Task', 'wait_for_all' => 'true', 'no_proceed' => 'true', - 'text' => ['You have seen this group memory task before, so we will NOT do a - practice this time. You will be memorizing new sets of items.', - 'Remember, you will all complete the memorization phase as individuals, but only the Leader can input the answers for the questions that follow.', - 'You will continue to the task when the Leader\'s timer reaches 0. Please introduce yourselves and chat until then.' + 'text' => ['Welcome to your new group. In this task, you will work together to memorize a set of images, words and stories -- and then answer questions about these stimuli.', + "Many of you will have seen a very similar task before in a previous group.", + 'There is a timer on your Leader\'s screen.', + 'The task will begin shortly (when the timer on the Leader\'s screen reaches 0:00).', + 'Until then, please stay on this page and chat with your teammates!' ]], /* WE ARE SKIPPING THE PRACTICE FOR THIS GROUP FOR NOW @@ -1356,10 +1389,11 @@ class Memory { 'header' => 'Memory Task', 'wait_for_all' => 'true', 'no_proceed' => 'true', - 'text' => ['You have seen this group memory task before, so we will NOT do a - practice this time. You will be memorizing new sets of items.', - 'Remember, you will all complete the memorization phase as individuals, but only the Leader can input the answers for the questions that follow.', - 'You will continue to the task when the Leader\'s timer reaches 0. Please introduce yourselves and chat until then.' + 'text' => ['Welcome to your new group. In this task, you will work together to memorize a set of images, words and stories -- and then answer questions about these stimuli.', + "Many of you will have seen a very similar task before in a previous group.", + 'There is a timer on your Leader\'s screen.', + 'The task will begin shortly (when the timer on the Leader\'s screen reaches 0:00).', + 'Until then, please stay on this page and chat with your teammates!' ]], /* WE ARE SKIPPING THE PRACTICE FOR THIS GROUP FOR NOW ['type' => 'text', @@ -1737,8 +1771,8 @@ class Memory { 'text' =>[ 'When you click next, the group task will begin.', 'Your group has 8 minutes to work through the task.', - 'This time has already begun.', - 'Note: only the group Leader has information about the time remaining. There is a timer at the top of Leader\'s screen.', + 'Your time has already begun!', + 'Note: only the group Leader has information about the time remaining.', 'Click Next to begin.' ]], @@ -1749,8 +1783,8 @@ class Memory { 'Now for the actual task', 'This will determine your score', 'Your group will have 40 seconds to memorize 6 images, 12 words and 2 short stories. This is like the practice, but you have twice as long to remember twice as much', - "Keep in mind: on average, groups require 5 minutes to complete the memorization phase and answer the questions. You have 8 minutes total.", - 'Click "Next" for some more information' + "Note: on average, groups require 5 minutes to complete the memorization phase and answer the questions.", + 'Click Next for some more information' ]], ['type'=>'text', 'header'=>'Final Instructions', @@ -2079,7 +2113,7 @@ class Memory { 'directory' => '/img/memory-task/faces/', 'blocks' => [ ['type'=>'text', - 'header'=>'', + 'header'=>'Memory Task', 'wait_for_all'=>'true', 'text' =>[ 'The group task has now begun', @@ -2089,11 +2123,10 @@ class Memory { 'Click Next to continue.' ]], ['type' => 'text', - 'header' => 'Memory Task', + 'header' => '', 'wait_for_all' => 'true', 'text' => ['You have seen this group memory task before, so we will NOT do a practice this time.', - 'Remember, you will all complete the memorization phase as individuals, but only the Leader can input the answers for the questions that follow.', "Keep in mind: on average, groups require 5 minutes to complete the memorization phase and answer the questions. You have 8 minutes total.", 'The task will continue when everyone has clicked "Next".' ]], @@ -2386,7 +2419,7 @@ class Memory { 'prompt' => 'Which of the following images is a "target" image?', 'img' => '2_test_8.jpg', 'correct' => [2], - 'num' => 11], + 'num' => 21], [ 'type' => 'test_stories', 'selection_type' => 'select_one', @@ -2421,21 +2454,20 @@ class Memory { 'directory' => '/img/memory-task/bikes/', 'blocks' => [ ['type'=>'text', - 'header'=>'', + 'header'=>'Memory Task', 'wait_for_all'=>'true', 'text' =>[ - 'When you click next, the group task will begin.', + 'The group task has now begun', 'Your group has 8 minutes to work through the task.', 'This time has already begun.', 'Note: only the group Leader has information about the time remaining. There is a timer at the top of Leader\'s screen.', - 'Click Next to begin.' + 'Click Next to continue.' ]], ['type' => 'text', - 'header' => 'Memory Task', + 'header' => '', 'wait_for_all' => 'true', 'text' => ['You have seen this group memory task before, so we will NOT do a practice this time.', - 'Remember, you will all complete the memorization phase as individuals, but only the Leader can input the answers for the questions that follow.', "Keep in mind: on average, groups require 5 minutes to complete the memorization phase and answer the questions. You have 8 minutes total.", 'The task will continue when everyone has clicked "Next".' ]], diff --git a/public/css/tasks.css b/public/css/tasks.css index de16aa97..5d1e91a8 100644 --- a/public/css/tasks.css +++ b/public/css/tasks.css @@ -193,6 +193,11 @@ form#big-five-form th.rotate > div { height: auto; } +.target-img-group { + width: 100%; + height: auto; +} + .target-img-group_4 { width: 700px; } @@ -205,6 +210,10 @@ form#big-five-form th.rotate > div { width: 646px; height: auto; } +.memory-img-group { + width: 100%; + height: auto; +} .mixed-mem-targets { min-height: 380px; @@ -220,7 +229,7 @@ form#big-five-form th.rotate > div { } .word-choices, .story-choices { - margin-top: 64px; + margin-top: 10px; } .word-choices label { diff --git a/resources/views/layouts/participants/tasks/memory-group.blade.php b/resources/views/layouts/participants/tasks/memory-group.blade.php index 0b9ad9b4..3e4b63b4 100644 --- a/resources/views/layouts/participants/tasks/memory-group.blade.php +++ b/resources/views/layouts/participants/tasks/memory-group.blade.php @@ -6,7 +6,7 @@ @stop @section('css') - + @stop @section('content') @@ -253,7 +253,7 @@ function clear_timer(){ var key = event.key; - if(((key == 1 || key == 2 || key == 3) && ($(".memory-img").is(":visible") || $(".story-choices").is(":visible"))) && "{{ $user->group_role }}" === "leader" ) { + if(((key == 1 || key == 2 || key == 3) && ($(".memory-img-group").is(":visible") || $(".story-choices").is(":visible"))) && "{{ $user->group_role }}" === "leader" ) { memory.advanceImageTest(key); $.post('leader-answered', { _token : "{{ csrf_token() }}", @@ -434,7 +434,7 @@ function clear_timer(){ @if($memType['type'] == 'images') @foreach($memType['targets'] as $img_key => $img) - + @endforeach
@@ -471,9 +471,6 @@ function clear_timer(){
{{ $block['num'] }}/3

{{ $block['prompt'] }}

- @if($user->group_role == 'leader') -

As the leader, you can type the number '1', '2', or '3' on your keyboard to enter the group's answer

- @endif
@foreach($block['choices'] as $c_key => $choice) @@ -485,6 +482,9 @@ function clear_timer(){ name="response_{{ $key }}_{{ $b_key }}" id="response_{{ $key }}_{{ $b_key }}">
+ @if($user->group_role == 'leader') +

As the leader, you can type the number '1', '2', or '3' on your keyboard to enter the group's answer

+ @endif
@endif {{-- End if blocktype = practice_test_stories --}} @@ -493,9 +493,6 @@ function clear_timer(){
{{ $block['num'] }}/24

{{ $block['prompt'] }}

- @if($user->group_role == 'leader') -

As the leader, you can type the number '1', '2', or '3' on your keyboard to enter the group's answer

- @endif
@foreach($block['choices'] as $c_key => $choice) @@ -507,6 +504,10 @@ function clear_timer(){ name="response_{{ $key }}_{{ $b_key }}" id="response_{{ $key }}_{{ $b_key }}">
+
+ @if($user->group_role == 'leader') +

As the leader, you can type the number '1', '2', or '3' on your keyboard to enter the group's answer

+ @endif
@endif {{-- End if blocktype = test_stories --}} @@ -516,11 +517,11 @@ function clear_timer(){
{{ $block['num'] }}/3

{{ $block['prompt'] }}

@if($user->group_role == 'leader') -

As the leader, select all that apply, then click "Next"

+

As the leader, select all that apply, then click "Next"

@endif
@foreach($block['choices'] as $c_key => $choice) -
+


-

+ + + +
+
+

@if($user->group_role != 'leader') We would like to ask some questions about your group's LEADER (who entered the groups guesses for all the letter values) @@ -139,11 +144,7 @@ We would like to ask some questions about Team Member 2 @endif @endif -

- - -
-
+

@for($i = 0; $i < count($questions['1']); $i++)

{{ $questions['1'][$i]['question'] }}

From d7c5f5d67d09fbb863dd248235714912d66f717c Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 28 Oct 2021 12:56:03 -0400 Subject: [PATCH 028/154] fixes to status changes on group memory, fixed lock-unlock functionality (no longer interferes with active study to lock login page) --- app/Http/Controllers/LoginController.php | 7 +- .../layouts/participants/task-room.blade.php | 7 +- .../participants/tasks/group-survey.blade.php | 3 +- .../participants/tasks/memory-group.blade.php | 78 ++++++++++++------- .../tasks/memory-individual.blade.php | 3 + .../participants/waiting-room.blade.php | 7 -- 6 files changed, 60 insertions(+), 45 deletions(-) diff --git a/app/Http/Controllers/LoginController.php b/app/Http/Controllers/LoginController.php index 5397e603..09a6196a 100644 --- a/app/Http/Controllers/LoginController.php +++ b/app/Http/Controllers/LoginController.php @@ -72,12 +72,7 @@ public function participantPackageLogin($package) { $wave = 1; if(\Auth::check() && User::find(\Auth::user()->id)->updated_at >= \Carbon\Carbon::now()->startOfDay()){ - return view('layouts.participants.participant-login') - ->with('in_session',$in_session) - ->with('package', $package) - ->with('wave',7) - ->with('participant_id',User::find(\Auth::user()->id)->participant_id) - ->with('date',$date); + return redirect('get-group-task'); } return view('layouts.participants.participant-login') diff --git a/resources/views/layouts/participants/task-room.blade.php b/resources/views/layouts/participants/task-room.blade.php index 7a900f5a..513c23b9 100644 --- a/resources/views/layouts/participants/task-room.blade.php +++ b/resources/views/layouts/participants/task-room.blade.php @@ -170,9 +170,7 @@
-

Your Team:

-
-
Your role: +

Your role: @if($user->group_role == 'follower1') @if($task->Name == "Cryptography") Equations @@ -188,7 +186,8 @@ @else Leader @endif -

+ +
diff --git a/resources/views/layouts/participants/tasks/group-survey.blade.php b/resources/views/layouts/participants/tasks/group-survey.blade.php index 74483343..26504cb7 100644 --- a/resources/views/layouts/participants/tasks/group-survey.blade.php +++ b/resources/views/layouts/participants/tasks/group-survey.blade.php @@ -130,7 +130,7 @@ -
+

@@ -145,6 +145,7 @@ @endif @endif

+
@for($i = 0; $i < count($questions['1']); $i++)

{{ $questions['1'][$i]['question'] }}

diff --git a/resources/views/layouts/participants/tasks/memory-group.blade.php b/resources/views/layouts/participants/tasks/memory-group.blade.php index 0eadaeea..7918613d 100644 --- a/resources/views/layouts/participants/tasks/memory-group.blade.php +++ b/resources/views/layouts/participants/tasks/memory-group.blade.php @@ -22,13 +22,14 @@ function leaderAnswered(){ } //COUNTDOWN FOR IDLE STATUS - function start_timer(){ - tm = setTimeout(function(){ - $.post('/set-idle', { - _token: "{{ csrf_token() }}", - user_id:'{{ $user->id }}' - }); - },10000); + function change_status(id,status){ + console.log(id); + console.log(status); + $.post('/status-change',{ + _token: '{{ csrf_token() }}', + id: id, + status: status + }); } @@ -41,28 +42,22 @@ function clear_timer(){ var tests = ; $( document ).ready(function() { + var memory = new Memory(tests, false, callback); + memory.begin(); + //SET IDLE STATUS IF NOT PRESSING NEXT - tmt = setTimeout(function(){ - status = 'Idle'; - $.post('/status-change',{ - _token: '{{ csrf_token() }}', - id: user_id, - status: 'Idle' - }); - },10000); + + if(memory.hasWait()){ + tmt = setTimeout(function(){ + change_status(user_id,'Idle'); + }, 10000); + } //CLEAR TIMER IF THEY PRESS NEXT - $('#next').on('click',function(event){ + $('#next, .memory-nav, .choose-mem-review-type').on('click',function(event){ $(document).scrollTop(0); - clearTimeout(tmt); - if(status == 'Idle'){ - status = 'Active' - $.post('/status-change',{ - _token: '{{ csrf_token() }}', - id: user_id, - status: 'Active' - }); - } + + }); //console.log("{{ $scores }}"); scores = JSON.parse("{{ $scores }}".replace(/"/g,'"')); @@ -179,6 +174,13 @@ function clear_timer(){ channel.bind('leader-answered', function(data){ if(data['user']['group_id'].toString() === "{{ $user->group_id }}" && "{{ $user->group_role }}" != "leader") memory.advance(); + clearTimeout(tmt); + change_status(user_id,'Active'); + if(memory.hasWait()){ + tmt = setTimeout(function(){ + change_status(user_id,'Idle'); + }, 10000); + } }); $('.not-reporter').on('click', function(event) { @@ -193,6 +195,13 @@ function clear_timer(){ }); $('.memory-nav').on('click', function(event) { + clearTimeout(tmt); + change_status(user_id,'Active'); + if(memory.hasWait()){ + tmt = setTimeout(function(){ + change_status(user_id,'Idle'); + }, 10000); + } if(memory.hasPopup()) { event.stopImmediatePropagation(); return; @@ -210,6 +219,7 @@ function clear_timer(){ memory.advance(); + event.preventDefault(); }); @@ -218,6 +228,13 @@ function clear_timer(){ $('.mem-btn-' + $(this).data('type')).addClass('btn-lg'); $.post( "/record-mem-review-selection", { user_id: userId, group_tasks_id: taskId, type: $(this).data('type'), _token: "{{ csrf_token() }}" } ); memory.markMemoryChoice(userId, groupId, taskId, "{{ csrf_token() }}", "#waiting"); + clearTimeout(tmt); + change_status(user_id,'Active'); + if(memory.hasWait()){ + tmt = setTimeout(function(){ + change_status(user_id,'Idle'); + }, 10000); + } event.preventDefault(); }); @@ -259,6 +276,13 @@ function clear_timer(){ _token : "{{ csrf_token() }}", key : key }); + clearTimeout(tmt); + change_status(user_id,'Active'); + if(memory.hasWait()){ + tmt = setTimeout(function(){ + change_status(user_id,'Idle'); + }, 10000); + } $(document).scrollTop(0); } @@ -521,7 +545,7 @@ function clear_timer(){ @endif
@foreach($block['choices'] as $c_key => $choice) -
+

diff --git a/resources/views/layouts/participants/tasks/memory-group.blade.php b/resources/views/layouts/participants/tasks/memory-group.blade.php index a1a51eb8..a0b5d7fb 100644 --- a/resources/views/layouts/participants/tasks/memory-group.blade.php +++ b/resources/views/layouts/participants/tasks/memory-group.blade.php @@ -425,7 +425,7 @@ function change_status(id,status){ @if($block['type'] == 'mixed_review')
-

Time remaining:


+
Time Remaining:

@if(isset($block['header']))

{{ $block['header'] }}

@endif diff --git a/resources/views/layouts/participants/tasks/memory-individual.blade.php b/resources/views/layouts/participants/tasks/memory-individual.blade.php index 46818423..6db03c3b 100644 --- a/resources/views/layouts/participants/tasks/memory-individual.blade.php +++ b/resources/views/layouts/participants/tasks/memory-individual.blade.php @@ -103,7 +103,7 @@ @foreach($test['blocks'] as $b_key => $block) - @if($block['type'] == 'review' || $block['type'] == 'practice_review') + @if($block['type'] == 'practice_review')

{{ $block['text'] }}

@@ -130,6 +130,34 @@
@endif {{-- End if blocktype = review --}} + @if($block['type'] == 'review') +
+ +

Time Remaining:


+

{{ $block['text'] }}

+ @if(count($block['targets']) == 1) + + @if($block['type'] == 'practice_review') +

Press continue when you’re ready!

+ @endif +
+ +
+ @else + @foreach($block['targets'] as $img_key => $img) + + @endforeach + +
+ +
+ @endif {{-- End multiple images --}} +
+ @endif {{-- End if blocktype = review --}} + @if($block['type'] == 'practice_test')
{{ $block['num'] }} / 2
@@ -283,10 +311,11 @@ @foreach($test['blocks'] as $b_key => $block) @if($block['type'] == 'review') +
-

+

Time Remaining:


@if(isset($block['header'])) -

{{ $block['header'] }}

+

{{ $block['header'] }}

@endif

{{ $block['text'] }}

@if(array_key_exists('subtext', $block)) diff --git a/resources/views/layouts/participants/tasks/psi-iri-intro.blade.php b/resources/views/layouts/participants/tasks/psi-iri-intro.blade.php index 34c5f21a..6171e384 100644 --- a/resources/views/layouts/participants/tasks/psi-iri-intro.blade.php +++ b/resources/views/layouts/participants/tasks/psi-iri-intro.blade.php @@ -22,7 +22,7 @@ Task {{ \Session::get('completedTasks') + 1 }} of {{ \Session::get('totalTasks') }}

- Next, we’ll ask you some questions about your personality. This will take about 5 minutes. Remember, your answers will be kept in absolute confidence, and deleted at the conclusion of the study. + Next, we’ll ask you some more questions about your personality. This will take about 5 minutes. Remember, your answers will be kept in absolute confidence, and deleted at the conclusion of the study.

Please be honest. Select the option that best describes yourself. diff --git a/resources/views/layouts/participants/tasks/shapes-individual.blade.php b/resources/views/layouts/participants/tasks/shapes-individual.blade.php index 7abc0d12..d84fed53 100644 --- a/resources/views/layouts/participants/tasks/shapes-individual.blade.php +++ b/resources/views/layouts/participants/tasks/shapes-individual.blade.php @@ -81,7 +81,7 @@
-

+

diff --git a/resources/views/layouts/participants/waiting-room.blade.php b/resources/views/layouts/participants/waiting-room.blade.php index 22056c9a..262997e2 100644 --- a/resources/views/layouts/participants/waiting-room.blade.php +++ b/resources/views/layouts/participants/waiting-room.blade.php @@ -81,7 +81,7 @@ function shuffle(a) { $.get('/still-here', { _token: "{{ csrf_token() }}" }); - },3000); + },2000); }); From 6047feedc1cd49cadc8c579264e3175932d37943 Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 5 Nov 2021 09:13:56 -0400 Subject: [PATCH 042/154] individual cosmetic adjustments and minor bug fixes --- app/GroupTask.php | 5 +- .../Controllers/IndividualTaskController.php | 4 +- app/Tasks/Conclusion.php | 3 +- app/Tasks/Consent.php | 4 +- app/Tasks/Intro.php | 2 +- public/js/timer.js | 4 +- .../participant-study-consent.blade.php | 46 +++++++++++++++++++ ...ryptography-individual-alt-intro.blade.php | 12 +++++ .../tasks/leadership-intro.blade.php | 2 +- 9 files changed, 70 insertions(+), 12 deletions(-) diff --git a/app/GroupTask.php b/app/GroupTask.php index 13c9700e..880c9f34 100644 --- a/app/GroupTask.php +++ b/app/GroupTask.php @@ -287,7 +287,7 @@ public static function initializeCryptoPilotNoConsentTasks($group_id, $randomize #TASK LIST FOR INDIVIDUAL PILOT (INDIVIDUAL TASK LISTS ARE ALSO DEFINED HERE, NOT JUST GROUP) public static function initializeLabIndividualPilotTasks($group_id, $randomize) { $taskArray = '[ - {"taskName":"Consent","taskParams":{"url_endpoint":"end-individual-task","hasIndividuals":"true","hasGroup":"false","subjectPool":"mturk"}}, + {"taskName":"Consent","taskParams":{"url_endpoint":"end-individual-task","hasIndividuals":"true","hasGroup":"false","subjectPool":"individual_pilot"}}, {"taskName":"Intro","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"mturk"}}, {"taskName":"Eyes","taskParams":{"hasIndividuals":"true","hasGroup":"false"}}, {"taskName":"BigFive","taskParams":{"hasIndividuals":"true","hasGroup":"false","statementOrder":"random"}}, @@ -305,8 +305,7 @@ public static function initializeLabIndividualPilotTasks($group_id, $randomize) {"taskName":"Cryptography","taskParams":{"intro":"intro","hasIndividuals":"true","hasGroup":"false","mapping":"random","maxResponses":"10"}}, {"taskName":"Cryptography","taskParams":{"intro":"individual_alt","hasIndividuals":"true","hasGroup":"false","mapping":"random","maxResponses":"10"}}, {"taskName":"Intro","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"selection_page"}}, - {"taskName":"Feedback","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"mturk","hasCode":"true"}}, - {"taskName":"Conclusion","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"hdsl_individual","hasCode":"false","displayScoreGroup":"false","digitalReceipt":"false","feedback":"false", "feedbackLinkType":"pilot"}} + {"taskName":"Conclusion","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"mturk","hasCode":"false","displayScoreGroup":"false","digitalReceipt":"false","feedback":"false", "feedbackLinkType":"pilot"}} ]'; return Self::initializeTasks($group_id, $taskArray, $randomize); } diff --git a/app/Http/Controllers/IndividualTaskController.php b/app/Http/Controllers/IndividualTaskController.php index 74045238..1eff055f 100644 --- a/app/Http/Controllers/IndividualTaskController.php +++ b/app/Http/Controllers/IndividualTaskController.php @@ -1261,7 +1261,7 @@ public function cryptographyIntro(Request $request) { - + $parameters = unserialize($currentTask->parameters); $time = Time::where('user_id',\Auth::user()->id) ->where('group_tasks_id',$currentTask->id) @@ -1284,7 +1284,7 @@ public function cryptographyIntro(Request $request) { //$currentTask = \Teamwork\GroupTask::find($request->session()->get('currentGroupTask')); - $parameters = unserialize($currentTask->parameters); + if($currentTask->name != 'Cryptography'){ if($parameters->hasGroup == 'true'){ diff --git a/app/Tasks/Conclusion.php b/app/Tasks/Conclusion.php index 9d3b2579..96884786 100644 --- a/app/Tasks/Conclusion.php +++ b/app/Tasks/Conclusion.php @@ -102,7 +102,8 @@ class Conclusion { 'group5Pilot' => 'https://docs.google.com/forms/d/1KNfcSCGmdNy4vqKtx2R8paFvSeklTfQyvtWBPaINRwk/viewform?usp=sharing_eip&ts=5d405d8c&edit_requested=true', 'groupTwo' => 'https://urldefense.proofpoint.com/v2/url?u=https-3A__docs.google.com_forms_d_e_1FAIpQLSfL8x7CTs9I6vPreeXAdw5-2DURJMj5G17SqKZuMyCNC-5F1EQw1w_viewform-3Fusp-3Dsf-5Flink&d=DwMFaQ&c=WO-RGvefibhHBZq3fL85hQ&r=tAX8kL7P9f6gcapc67VgDbxuAn6xB0Zl7vfMQBORGpQ&m=23Mvsql-PxIiPW6hhQRvCrbd4sGrl4FDLjm7r5XrFVM&s=Xa0buQFFydQM--IKsMwZf0uuKzfcX4YiwTD54YkoiHE&e=', 'qualtrics' => 'https://harvard.az1.qualtrics.com/jfe/form/SV_2tLibq6KB8AlxnE',#https://harvard.az1.qualtrics.com/jfe/form/SV_b7cZXgNyfCeTUB8' - 'memory' => 'https://harvard.az1.qualtrics.com/jfe/form/SV_82l3wcljCQ3QBH8' + 'memory' => 'https://harvard.az1.qualtrics.com/jfe/form/SV_82l3wcljCQ3QBH8', + 'individual_pilot' => 'https://harvard.az1.qualtrics.com/jfe/form/SV_0quKZbKL2deX2aW' ]; private static $avaialbleParams = ['hasIndividuals' => ['true', 'false'], 'hasGroup' => ['false'], 'type' => ['mturk', 'hdsl_individual'], 'hasCode' => ['true', 'false'], 'feedback' => ['true', 'false']]; diff --git a/app/Tasks/Consent.php b/app/Tasks/Consent.php index 900d5dcc..e9d14abe 100644 --- a/app/Tasks/Consent.php +++ b/app/Tasks/Consent.php @@ -7,9 +7,9 @@ class Consent { - private $subjectPool = ['mturk', 'hdsl','memory_pilot']; + private $subjectPool = ['mturk', 'hdsl','memory_pilot','individual_pilot']; - private static $avaialbleParams = ['subjectPool' => ['mturk', 'hdsl', 'hdsl_individual_pilot','memory_pilot'], 'hasIndividuals' => ['true'], 'hasGroup' => ['false']]; + private static $avaialbleParams = ['subjectPool' => ['mturk', 'hdsl', 'hdsl_individual_pilot','memory_pilot','individual_pilot'], 'hasIndividuals' => ['true'], 'hasGroup' => ['false']]; public function getSubjectPool() { return $this->prompts; diff --git a/app/Tasks/Intro.php b/app/Tasks/Intro.php index cce0d2b1..c6b454f5 100644 --- a/app/Tasks/Intro.php +++ b/app/Tasks/Intro.php @@ -357,7 +357,7 @@ class Intro { ], [ 'type' => 'paragraph', - 'content' => 'Team members are essential for group success.
+ 'content' => 'Team members are essential for group success.
- Team Members receive the same payment regardless of group performance.
' ], [ diff --git a/public/js/timer.js b/public/js/timer.js index 127f5523..7b5915be 100644 --- a/public/js/timer.js +++ b/public/js/timer.js @@ -45,7 +45,7 @@ function timer(callback){ else { clearInterval(t); if(clock){ - clock.innerHTML = '00:00'; + clock.innerHTML = 'Time Remaining: 00:00'; } if (typeof callback === "function") { @@ -65,7 +65,7 @@ function displayTime(timer){ var minutesDisplay = pad(theTime.getMinutes(), 2); var secondsDisplay = pad(theTime.getSeconds(), 2); - return minutesDisplay+':'+secondsDisplay; + return 'Time Remaining: '+minutesDisplay+':'+secondsDisplay; } diff --git a/resources/views/layouts/participants/participant-study-consent.blade.php b/resources/views/layouts/participants/participant-study-consent.blade.php index e57c8f79..4cb08e17 100644 --- a/resources/views/layouts/participants/participant-study-consent.blade.php +++ b/resources/views/layouts/participants/participant-study-consent.blade.php @@ -116,6 +116,52 @@
+ @elseif($subjectPool == "individual_pilot") +

+ PURPOSE OF RESEARCH STUDY: To understand + the relationship between measures of social skill and fluid intelligence. +

+

+ WHAT YOU’LL DO: You will be asked to solve puzzles, perform memory tasks, and identify people’s emotions based on photographs. +

+

+ RISKS: There are no risks + for participating in this study beyond those associated with normal + computer use, including fatigue and mild stress. +

+

+ COMPENSATION: Payment will be $15. +

+

+ PLEASE NOTE: This study contains a number of checks to make sure participants are finishing the tasks honestly and completely. +

+

+ VOLUNTARY PARTICIPATION AND RIGHT TO + WITHDRAW: Participation in this study is voluntary, and + you can stop at any time without any penalty. To stop, simply + close your browser window. Partial data will not be analyzed. +

+

+ CONFIDENTIALITY: All data collected as part of this study will be anonymized and used only for academic research purposes. +

+

+ CONTACT INFORMATION: If you have any + questions about this research, you may contact: skillslab@hks.harvard.edu +

+

+ CLICKING ACCEPT: By signing and clicking on the + "I Consent" button, you indicate that you are 18 years of age or older, + that you voluntarily agree to participate in this study and that you + understand the information in this consent form. +

+

+ SIGNATURE: +

+
+
+ +
+
@elseif($subjectPool == 'hdsl_individual')

PURPOSE OF RESEARCH STUDY: To understand diff --git a/resources/views/layouts/participants/tasks/cryptography-individual-alt-intro.blade.php b/resources/views/layouts/participants/tasks/cryptography-individual-alt-intro.blade.php index fbd3ecbc..a10c2f56 100644 --- a/resources/views/layouts/participants/tasks/cryptography-individual-alt-intro.blade.php +++ b/resources/views/layouts/participants/tasks/cryptography-individual-alt-intro.blade.php @@ -19,6 +19,18 @@ timeout = setTimeout(function() { window.location = '/cryptography-individual'; },1000 * 180); + + $("#next").on('click', function(event) { + page_count += 1; + $(window).scrollTop(0); + if(page_count == 2){ + $('#next').attr('disabled',true); + } + }); + $('#back').on('click',function(event){ + page_count -= 1; + $('#next').attr('disabled',false); + }) instructionPaginator(function(){clearTimeout(timeout); window.location = '/cryptography-individual';}); setInterval(function(){ if(time_remaining <= 0){ diff --git a/resources/views/layouts/participants/tasks/leadership-intro.blade.php b/resources/views/layouts/participants/tasks/leadership-intro.blade.php index 6b0cfd56..713c99f9 100644 --- a/resources/views/layouts/participants/tasks/leadership-intro.blade.php +++ b/resources/views/layouts/participants/tasks/leadership-intro.blade.php @@ -22,7 +22,7 @@ Task {{ \Session::get('completedTasks') + 1 }} of {{ \Session::get('totalTasks') }}

- Next, we’ll ask you some questions about your personality. This will take about 4 minutes. Remember, your answers will be kept in absolute confidence, and deleted at the conclusion of the study. + Next, we’ll ask you some more questions about your personality. This will take about 4 minutes. Remember, your answers will be kept in absolute confidence, and deleted at the conclusion of the study.

Please be honest. Select the option that best describes yourself. From 95ab8ccd68b6ebbc058b1062d8a7af9641f68ae0 Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 5 Nov 2021 09:22:18 -0400 Subject: [PATCH 043/154] individual cosmetic adjustments and minor bug fixes --- .../layouts/participants/tasks/shapes-individual.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/layouts/participants/tasks/shapes-individual.blade.php b/resources/views/layouts/participants/tasks/shapes-individual.blade.php index d84fed53..acee80a4 100644 --- a/resources/views/layouts/participants/tasks/shapes-individual.blade.php +++ b/resources/views/layouts/participants/tasks/shapes-individual.blade.php @@ -2,7 +2,7 @@ @section('js') - + @stop @section('css') From b09fb6c6c28370e093bfe2e744cd0a60f32a2a9c Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 5 Nov 2021 09:26:17 -0400 Subject: [PATCH 044/154] individual cosmetic adjustments and minor bug fixes --- app/GroupTask.php | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/app/GroupTask.php b/app/GroupTask.php index 880c9f34..c9aaccf4 100644 --- a/app/GroupTask.php +++ b/app/GroupTask.php @@ -305,7 +305,7 @@ public static function initializeLabIndividualPilotTasks($group_id, $randomize) {"taskName":"Cryptography","taskParams":{"intro":"intro","hasIndividuals":"true","hasGroup":"false","mapping":"random","maxResponses":"10"}}, {"taskName":"Cryptography","taskParams":{"intro":"individual_alt","hasIndividuals":"true","hasGroup":"false","mapping":"random","maxResponses":"10"}}, {"taskName":"Intro","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"selection_page"}}, - {"taskName":"Conclusion","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"mturk","hasCode":"false","displayScoreGroup":"false","digitalReceipt":"false","feedback":"false", "feedbackLinkType":"pilot"}} + {"taskName":"Conclusion","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"mturk","hasCode":"false","displayScoreGroup":"false","digitalReceipt":"false","feedback":"true", "feedbackLinkType":"pilot"}} ]'; return Self::initializeTasks($group_id, $taskArray, $randomize); } @@ -364,10 +364,9 @@ public static function initializeEQTasks($group_id, $randomize) { public static function initializeTestingTasks($group_id, $randomize) { $taskArray = '[ - {"taskName":"Consent","taskParams":{"hasIndividuals":"true","hasGroup":"false","subjectPool":"hdsl_individual"}}, - {"taskName":"Shapes","taskParams":{"hasIndividuals":"true","hasGroup":"false","subtest":"subtest5"}}, - {"taskName":"Survey","taskParams":{"hasIndividuals":"true","hasGroup":"false","survey":"hdsl"}}, - {"taskName":"Conclusion","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"hdsl_individual","hasCode":"false","displayScoreGroup":"false","digitalReceipt":"false","feedback":"false", "feedbackLinkType":"pilot"}} + {"taskName":"Cryptography","taskParams":{"intro":"intro","hasIndividuals":"true","hasGroup":"false","mapping":"random","maxResponses":"10"}}, + {"taskName":"Cryptography","taskParams":{"intro":"individual_alt","hasIndividuals":"true","hasGroup":"false","mapping":"random","maxResponses":"10"}}, + {"taskName":"Conclusion","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"mturk","hasCode":"false","displayScoreGroup":"false","digitalReceipt":"false","feedback":"true", "feedbackLinkType":"pilot"}} ]'; return Self::initializeTasks($group_id, $taskArray, $randomize); } @@ -375,12 +374,9 @@ public static function initializeTestingTasks($group_id, $randomize) { public static function initializeGroupTestTasks($group_id, $randomize) { $taskArray = '[ - {"taskName":"Intro","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"group_2"}}, - {"taskName":"ChooseReporter","taskParams":{"hasIndividuals":"true","hasGroup":"true"}}, - {"taskName":"Shapes","taskParams":{"hasIndividuals":"false","hasGroup":"true","subtest":"subtest5"}}, - {"taskName":"Optimization","taskParams":{"hasIndividuals":"true","hasGroup":"false","function":"1","intro":"individual","maxResponses":"10"}}, - {"taskName":"Cryptography","taskParams":{"hasIndividuals":"false","intro":"group_5","hasGroup":"true","mapping":"random","maxResponses":"10"}}, - {"taskName":"Conclusion","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"group_4","hasCode":"false","displayScoreGroup":"false", "digitalReceipt":"true", "sonaId": "547", "payment": "30", "feedback":"false", "feedbackLinkType":"group5Pilot"}} + {"taskName":"Cryptography","taskParams":{"intro":"intro","hasIndividuals":"true","hasGroup":"false","mapping":"random","maxResponses":"10"}}, + {"taskName":"Cryptography","taskParams":{"intro":"individual_alt","hasIndividuals":"true","hasGroup":"false","mapping":"random","maxResponses":"10"}}, + {"taskName":"Conclusion","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"mturk","hasCode":"false","displayScoreGroup":"false","digitalReceipt":"false","feedback":"true", "feedbackLinkType":"pilot"}} ]'; return Self::initializeTasks($group_id, $taskArray, $randomize); } From f1ca11c9664503fecb9960b59aebe72e8141f973 Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 5 Nov 2021 09:28:49 -0400 Subject: [PATCH 045/154] individual cosmetic adjustments and minor bug fixes --- app/Http/Controllers/LoginController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/LoginController.php b/app/Http/Controllers/LoginController.php index bfebfcf9..36f5cfed 100644 --- a/app/Http/Controllers/LoginController.php +++ b/app/Http/Controllers/LoginController.php @@ -182,7 +182,7 @@ public function postParticipantLogin(Request $request) { return redirect('/task-room'); } elseif($request->task_package == 'test'){ - \Teamwork\GroupTask::initializeTestTasks(\Auth::user()->group_id, $randomize = false); + \Teamwork\GroupTask::initializeTestingTasks(\Auth::user()->group_id, $randomize = false); } elseif($request->task_package == 'group-1'){ \Teamwork\GroupTask::initializeGroupOneTasks(\Auth::user()->group_id, $randomize = false); From 998d223bcfbd2dec8a77b0320d30e38df01669cf Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 5 Nov 2021 09:30:35 -0400 Subject: [PATCH 046/154] individual cosmetic adjustments and minor bug fixes --- .../tasks/cryptography-individual-alt-intro.blade.php | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/views/layouts/participants/tasks/cryptography-individual-alt-intro.blade.php b/resources/views/layouts/participants/tasks/cryptography-individual-alt-intro.blade.php index a10c2f56..af9885c4 100644 --- a/resources/views/layouts/participants/tasks/cryptography-individual-alt-intro.blade.php +++ b/resources/views/layouts/participants/tasks/cryptography-individual-alt-intro.blade.php @@ -15,6 +15,7 @@ - - + + + @stop @section('css') diff --git a/resources/views/layouts/participants/tasks/cryptography-individual.blade.php b/resources/views/layouts/participants/tasks/cryptography-individual.blade.php index 77c02081..37b2beff 100644 --- a/resources/views/layouts/participants/tasks/cryptography-individual.blade.php +++ b/resources/views/layouts/participants/tasks/cryptography-individual.blade.php @@ -3,8 +3,8 @@ @section('title','Individual Cryptography') @section('js') - - + + @stop @section('css') From a834ca57798bbd33255bdf9d1da42fc5296569a5 Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 8 Nov 2021 10:11:18 -0500 Subject: [PATCH 050/154] minor fixes to crypto individual --- .../tasks/cryptography-individual-alt-intro.blade.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/resources/views/layouts/participants/tasks/cryptography-individual-alt-intro.blade.php b/resources/views/layouts/participants/tasks/cryptography-individual-alt-intro.blade.php index af9885c4..a3d579e8 100644 --- a/resources/views/layouts/participants/tasks/cryptography-individual-alt-intro.blade.php +++ b/resources/views/layouts/participants/tasks/cryptography-individual-alt-intro.blade.php @@ -46,10 +46,11 @@
-
-
+
Instructions end in: {{ gmdate('i:s',$time_remaining) }}
+
+

Cryptography Task - Second Attempt

From c089a37b11d79a30264fde26324df0c2bc153f64 Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 9 Nov 2021 13:30:47 -0500 Subject: [PATCH 051/154] leadership edits --- .../tasks/cryptography-individual-alt-intro.blade.php | 2 +- .../views/layouts/participants/tasks/leadership-intro.blade.php | 2 +- resources/views/layouts/participants/tasks/leadership.blade.php | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/resources/views/layouts/participants/tasks/cryptography-individual-alt-intro.blade.php b/resources/views/layouts/participants/tasks/cryptography-individual-alt-intro.blade.php index a3d579e8..bc5b14f8 100644 --- a/resources/views/layouts/participants/tasks/cryptography-individual-alt-intro.blade.php +++ b/resources/views/layouts/participants/tasks/cryptography-individual-alt-intro.blade.php @@ -101,7 +101,7 @@ You will have a maximum of {{ $maxResponses }} trials and 10 minutes to solve the cryptography task.
No calculators are allowed.
- When you press "Next" your 10 minutes will begin! + The puzzle will begin when your TIMER (above) reaches 0:00.

diff --git a/resources/views/layouts/participants/tasks/leadership-intro.blade.php b/resources/views/layouts/participants/tasks/leadership-intro.blade.php index 713c99f9..467acbc1 100644 --- a/resources/views/layouts/participants/tasks/leadership-intro.blade.php +++ b/resources/views/layouts/participants/tasks/leadership-intro.blade.php @@ -22,7 +22,7 @@ Task {{ \Session::get('completedTasks') + 1 }} of {{ \Session::get('totalTasks') }}

- Next, we’ll ask you some more questions about your personality. This will take about 4 minutes. Remember, your answers will be kept in absolute confidence, and deleted at the conclusion of the study. + Next, we'll ask you some questions about your leadership style. Judge how well each statement fits you. The statements talk about how you relate to "others": this may refer to work colleagues, staff, or clients.

Please be honest. Select the option that best describes yourself. diff --git a/resources/views/layouts/participants/tasks/leadership.blade.php b/resources/views/layouts/participants/tasks/leadership.blade.php index abd5312f..0c79963f 100644 --- a/resources/views/layouts/participants/tasks/leadership.blade.php +++ b/resources/views/layouts/participants/tasks/leadership.blade.php @@ -48,6 +48,7 @@

+
In thinking about your leadership style, how does each statement fit you?
{{ csrf_field() }} From 446044b0903f6e14de0b7906bbb7da29e718519f Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 18 Nov 2021 10:50:32 -0500 Subject: [PATCH 052/154] design changes --- app/GroupTask.php | 35 ++++++++++++++++++- app/Tasks/Intro.php | 32 ++++++++++++----- public/js/ads.js | 1 + public/js/wp-banners.js | 1 + .../participant-study-intro.blade.php | 25 +++++++++++++ 5 files changed, 85 insertions(+), 9 deletions(-) create mode 100644 public/js/ads.js create mode 100644 public/js/wp-banners.js diff --git a/app/GroupTask.php b/app/GroupTask.php index c90ce2b6..83f8e15d 100644 --- a/app/GroupTask.php +++ b/app/GroupTask.php @@ -286,8 +286,13 @@ public static function initializeCryptoPilotNoConsentTasks($group_id, $randomize #TASK LIST FOR INDIVIDUAL PILOT (INDIVIDUAL TASK LISTS ARE ALSO DEFINED HERE, NOT JUST GROUP) public static function initializeLabIndividualPilotTasks($group_id, $randomize) { - $taskArray = '[ + $coinflip = random_int(0,1); + if($coinflip == 1){ + $taskArray = '[ {"taskName":"Consent","taskParams":{"url_endpoint":"end-individual-task","hasIndividuals":"true","hasGroup":"false","subjectPool":"individual_pilot"}}, + {"taskName":"Intro","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"incognito"}}, + {"taskName":"Intro","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"adblock"}}, + {"taskName":"DeviceCheck","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"eligibility"}}, {"taskName":"Intro","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"mturk"}}, {"taskName":"Eyes","taskParams":{"hasIndividuals":"true","hasGroup":"false"}}, {"taskName":"BigFive","taskParams":{"hasIndividuals":"true","hasGroup":"false","statementOrder":"random"}}, @@ -305,8 +310,36 @@ public static function initializeLabIndividualPilotTasks($group_id, $randomize) {"taskName":"Cryptography","taskParams":{"intro":"intro","hasIndividuals":"true","hasGroup":"false","mapping":"random","maxResponses":"10"}}, {"taskName":"Cryptography","taskParams":{"intro":"individual_alt","hasIndividuals":"true","hasGroup":"false","mapping":"random","maxResponses":"10"}}, {"taskName":"Intro","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"selection_page"}}, + {"taskName":"Intro","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"selection_followup"}}, + {"taskName":"Conclusion","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"mturk","hasCode":"false","displayScoreGroup":"false","digitalReceipt":"false","feedback":"true", "feedbackLinkType":"individual_pilot"}} + ]'; + } + else{ + $taskArray = '[ + {"taskName":"Consent","taskParams":{"url_endpoint":"end-individual-task","hasIndividuals":"true","hasGroup":"false","subjectPool":"individual_pilot"}}, + {"taskName":"Intro","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"incognito"}}, + {"taskName":"Intro","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"adblock"}}, + {"taskName":"DeviceCheck","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"eligibility"}}, + {"taskName":"Intro","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"mturk"}}, + {"taskName":"Eyes","taskParams":{"hasIndividuals":"true","hasGroup":"false"}}, + {"taskName":"BigFive","taskParams":{"hasIndividuals":"true","hasGroup":"false","statementOrder":"random"}}, + {"taskName":"Memory","taskParams":{"hasIndividuals":"true","hasGroup":"false","test":"intro"}}, + {"taskName":"Memory","taskParams":{"hasIndividuals":"true","hasGroup":"false","test":"words_instructions"}}, + {"taskName":"Memory","taskParams":{"hasIndividuals":"true","hasGroup":"false","test":"words_1"}}, + {"taskName":"Memory","taskParams":{"hasIndividuals":"true","hasGroup":"false","test":"images_instructions"}}, + {"taskName":"Memory","taskParams":{"hasIndividuals":"true","hasGroup":"false","test":"faces_1"}}, + {"taskName":"Memory","taskParams":{"hasIndividuals":"true","hasGroup":"false","test":"story_instructions"}}, + {"taskName":"Memory","taskParams":{"hasIndividuals":"true","hasGroup":"false","test":"story_1"}}, + {"taskName":"Memory","taskParams":{"hasIndividuals":"true","hasGroup":"false","test":"results"}}, + {"taskName":"PsiIri","taskParams":{"hasIndividuals":"true","hasGroup":"false","statementOrder":"random"}}, + {"taskName":"Shapes","taskParams":{"hasIndividuals":"true","hasGroup":"false","subtest":"subtest5"}}, + {"taskName":"Leadership","taskParams":{"hasIndividuals":"true","hasGroup":"false","statementOrder":"random"}}, + {"taskName":"Cryptography","taskParams":{"intro":"intro","hasIndividuals":"true","hasGroup":"false","mapping":"random","maxResponses":"10"}}, + {"taskName":"Cryptography","taskParams":{"intro":"individual_alt","hasIndividuals":"true","hasGroup":"false","mapping":"random","maxResponses":"10"}}, {"taskName":"Conclusion","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"mturk","hasCode":"false","displayScoreGroup":"false","digitalReceipt":"false","feedback":"true", "feedbackLinkType":"individual_pilot"}} ]'; + } + return Self::initializeTasks($group_id, $taskArray, $randomize); } diff --git a/app/Tasks/Intro.php b/app/Tasks/Intro.php index c6b454f5..26877045 100644 --- a/app/Tasks/Intro.php +++ b/app/Tasks/Intro.php @@ -14,7 +14,7 @@ class Intro { ], [ 'type' => 'paragraph', - 'content' => 'Over the next 60-70 minutes you will complete a + 'content' => 'Over the next ~55 minutes you will complete a range of different tasks. Our goal is to understand how well you solve problems, your ability to perceive emotions in others, and your short-term memory. This is a research study @@ -279,7 +279,7 @@ class Intro { ], ], - 'adblock' => [[ + 'incognito' => [[ 'type' => 'header', 'content' => 'Important Note' ], @@ -295,18 +295,18 @@ class Intro { ] ], - 'incognito' => [[ + 'adblock' => [[ 'type' => 'header', 'content' => 'Important Note' ], [ 'type' => 'paragraph', - 'content' => 'This study is not compatible with the Adblock chrome extension, or other extensions like it. If you are using an ad blocker, make sure it is always disabled for this website. Otherwise, the study may not function correctly.' + 'content' => 'This study is not compatible with the Adblock chrome extension, or other extensions like it. If you are using an ad blocker, make sure it is always disabled for this website (not just this page), and refresh the page once you\'ve made the change. Otherwise, you will not be able to proceed with the study.' ], [ 'type' => 'paragraph', 'content' => '
- Next +
' ] ], @@ -338,7 +338,7 @@ class Intro { ], 'selection_page' => [[ 'type' => 'header', - 'content' => 'What Role would you choose?' + 'content' => 'What Role would you prefer?' ], [ 'type' => 'paragraph', @@ -346,8 +346,8 @@ class Intro { ], [ 'type' => 'paragraph', - 'content' => 'We are running another study, involving group tasks.
- There are two roles: "Leader" or "Team member".' + 'content' => 'The rest of the study involves group tasks.
+ There are two roles in each group: "Leader" or "Team member".' ], [ @@ -376,6 +376,22 @@ class Intro {
' ] + ], + 'selection_followup' => [[ + 'type' => 'paragraph', + 'content' => 'Thanks! Your preference has been noted.' + ], + [ + 'type' => 'paragraph', + 'content' => 'Please be aware that you will NOT always get your preferred role.' + ], + [ + 'type' => 'paragraph', + 'content' => '
+ Next +
' + ] + ], 'individual_crypto_end' => [ [ diff --git a/public/js/ads.js b/public/js/ads.js new file mode 100644 index 00000000..e2652785 --- /dev/null +++ b/public/js/ads.js @@ -0,0 +1 @@ +var e = 1; \ No newline at end of file diff --git a/public/js/wp-banners.js b/public/js/wp-banners.js new file mode 100644 index 00000000..e2652785 --- /dev/null +++ b/public/js/wp-banners.js @@ -0,0 +1 @@ +var e = 1; \ No newline at end of file diff --git a/resources/views/layouts/participants/participant-study-intro.blade.php b/resources/views/layouts/participants/participant-study-intro.blade.php index 13659c48..9ddbb0c5 100644 --- a/resources/views/layouts/participants/participant-study-intro.blade.php +++ b/resources/views/layouts/participants/participant-study-intro.blade.php @@ -16,10 +16,17 @@ @section('css') + @stop @section('js') + @stop @@ -46,6 +65,12 @@ @section('content')
+ @if($type == 'adblock') +
+
+
+
+ @endif
@foreach($introContent as $content) From 70e6874327baf17afae4267947aada130df60a0f Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 18 Nov 2021 13:36:57 -0500 Subject: [PATCH 053/154] remove device check --- app/GroupTask.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/GroupTask.php b/app/GroupTask.php index 83f8e15d..08f29a8d 100644 --- a/app/GroupTask.php +++ b/app/GroupTask.php @@ -292,7 +292,6 @@ public static function initializeLabIndividualPilotTasks($group_id, $randomize) {"taskName":"Consent","taskParams":{"url_endpoint":"end-individual-task","hasIndividuals":"true","hasGroup":"false","subjectPool":"individual_pilot"}}, {"taskName":"Intro","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"incognito"}}, {"taskName":"Intro","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"adblock"}}, - {"taskName":"DeviceCheck","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"eligibility"}}, {"taskName":"Intro","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"mturk"}}, {"taskName":"Eyes","taskParams":{"hasIndividuals":"true","hasGroup":"false"}}, {"taskName":"BigFive","taskParams":{"hasIndividuals":"true","hasGroup":"false","statementOrder":"random"}}, @@ -319,7 +318,6 @@ public static function initializeLabIndividualPilotTasks($group_id, $randomize) {"taskName":"Consent","taskParams":{"url_endpoint":"end-individual-task","hasIndividuals":"true","hasGroup":"false","subjectPool":"individual_pilot"}}, {"taskName":"Intro","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"incognito"}}, {"taskName":"Intro","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"adblock"}}, - {"taskName":"DeviceCheck","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"eligibility"}}, {"taskName":"Intro","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"mturk"}}, {"taskName":"Eyes","taskParams":{"hasIndividuals":"true","hasGroup":"false"}}, {"taskName":"BigFive","taskParams":{"hasIndividuals":"true","hasGroup":"false","statementOrder":"random"}}, From e50c64997c105ebe2d97d603a43fc560ad4a40b1 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 18 Nov 2021 13:44:50 -0500 Subject: [PATCH 054/154] remove device check --- .../layouts/participants/participant-study-consent.blade.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/views/layouts/participants/participant-study-consent.blade.php b/resources/views/layouts/participants/participant-study-consent.blade.php index 4cb08e17..3ecb0179 100644 --- a/resources/views/layouts/participants/participant-study-consent.blade.php +++ b/resources/views/layouts/participants/participant-study-consent.blade.php @@ -122,7 +122,7 @@ the relationship between measures of social skill and fluid intelligence.

- WHAT YOU’LL DO: You will be asked to solve puzzles, perform memory tasks, and identify people’s emotions based on photographs. + WHAT YOU’LL DO: Today, you will solve some puzzles by yourself, and answer some questions about your personality. In later parts of the study, you’ll interact in small groups (using video chat) to solve problems. The total time of the study is 4 hours. It takes place between now and Dec 13th.

RISKS: There are no risks @@ -130,7 +130,7 @@ computer use, including fatigue and mild stress.

- COMPENSATION: Payment will be $15. + COMPENSATION: Payment depends on participation in the group sessions. After the first group session, the average participant will receive a payment of $35 (min=$20). Total payment for the 4-hour study will average $90 (min=$60, max=$120). You will not receive your payment today, only after first group session.

PLEASE NOTE: This study contains a number of checks to make sure participants are finishing the tasks honestly and completely. From cf6308f6d76132021bf2be3cb0917911e39f0dd9 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 18 Nov 2021 14:01:59 -0500 Subject: [PATCH 055/154] remove device check --- app/GroupTask.php | 37 +++++++++++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/app/GroupTask.php b/app/GroupTask.php index 08f29a8d..27d8eb3e 100644 --- a/app/GroupTask.php +++ b/app/GroupTask.php @@ -343,8 +343,12 @@ public static function initializeLabIndividualPilotTasks($group_id, $randomize) #TASK LIST FOR INDIVIDUAL PILOT (INDIVIDUAL TASK LISTS ARE ALSO DEFINED HERE, NOT JUST GROUP) public static function initializeLabIndividualOfficialTasks($group_id, $randomize) { - $taskArray = '[ - {"taskName":"Consent","taskParams":{"url_endpoint":"end-individual-task","hasIndividuals":"true","hasGroup":"false","subjectPool":"mturk"}}, + $coinflip = random_int(0,1); + if($coinflip == 1){ + $taskArray = '[ + {"taskName":"Consent","taskParams":{"url_endpoint":"end-individual-task","hasIndividuals":"true","hasGroup":"false","subjectPool":"individual_pilot"}}, + {"taskName":"Intro","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"incognito"}}, + {"taskName":"Intro","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"adblock"}}, {"taskName":"Intro","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"mturk"}}, {"taskName":"Eyes","taskParams":{"hasIndividuals":"true","hasGroup":"false"}}, {"taskName":"BigFive","taskParams":{"hasIndividuals":"true","hasGroup":"false","statementOrder":"random"}}, @@ -362,9 +366,34 @@ public static function initializeLabIndividualOfficialTasks($group_id, $randomiz {"taskName":"Cryptography","taskParams":{"intro":"intro","hasIndividuals":"true","hasGroup":"false","mapping":"random","maxResponses":"10"}}, {"taskName":"Cryptography","taskParams":{"intro":"individual_alt","hasIndividuals":"true","hasGroup":"false","mapping":"random","maxResponses":"10"}}, {"taskName":"Intro","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"selection_page"}}, - {"taskName":"Feedback","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"mturk","hasCode":"true"}}, - {"taskName":"Conclusion","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"hdsl_individual","hasCode":"false","displayScoreGroup":"false","digitalReceipt":"false","feedback":"false", "feedbackLinkType":"pilot"}} + {"taskName":"Intro","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"selection_followup"}}, + {"taskName":"Conclusion","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"mturk","hasCode":"false","displayScoreGroup":"false","digitalReceipt":"false","feedback":"true", "feedbackLinkType":"individual_pilot"}} + ]'; + } + else{ + $taskArray = '[ + {"taskName":"Consent","taskParams":{"url_endpoint":"end-individual-task","hasIndividuals":"true","hasGroup":"false","subjectPool":"individual_pilot"}}, + {"taskName":"Intro","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"incognito"}}, + {"taskName":"Intro","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"adblock"}}, + {"taskName":"Intro","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"mturk"}}, + {"taskName":"Eyes","taskParams":{"hasIndividuals":"true","hasGroup":"false"}}, + {"taskName":"BigFive","taskParams":{"hasIndividuals":"true","hasGroup":"false","statementOrder":"random"}}, + {"taskName":"Memory","taskParams":{"hasIndividuals":"true","hasGroup":"false","test":"intro"}}, + {"taskName":"Memory","taskParams":{"hasIndividuals":"true","hasGroup":"false","test":"words_instructions"}}, + {"taskName":"Memory","taskParams":{"hasIndividuals":"true","hasGroup":"false","test":"words_1"}}, + {"taskName":"Memory","taskParams":{"hasIndividuals":"true","hasGroup":"false","test":"images_instructions"}}, + {"taskName":"Memory","taskParams":{"hasIndividuals":"true","hasGroup":"false","test":"faces_1"}}, + {"taskName":"Memory","taskParams":{"hasIndividuals":"true","hasGroup":"false","test":"story_instructions"}}, + {"taskName":"Memory","taskParams":{"hasIndividuals":"true","hasGroup":"false","test":"story_1"}}, + {"taskName":"Memory","taskParams":{"hasIndividuals":"true","hasGroup":"false","test":"results"}}, + {"taskName":"PsiIri","taskParams":{"hasIndividuals":"true","hasGroup":"false","statementOrder":"random"}}, + {"taskName":"Shapes","taskParams":{"hasIndividuals":"true","hasGroup":"false","subtest":"subtest5"}}, + {"taskName":"Leadership","taskParams":{"hasIndividuals":"true","hasGroup":"false","statementOrder":"random"}}, + {"taskName":"Cryptography","taskParams":{"intro":"intro","hasIndividuals":"true","hasGroup":"false","mapping":"random","maxResponses":"10"}}, + {"taskName":"Cryptography","taskParams":{"intro":"individual_alt","hasIndividuals":"true","hasGroup":"false","mapping":"random","maxResponses":"10"}}, + {"taskName":"Conclusion","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"mturk","hasCode":"false","displayScoreGroup":"false","digitalReceipt":"false","feedback":"true", "feedbackLinkType":"individual_pilot"}} ]'; + } return Self::initializeTasks($group_id, $taskArray, $randomize); } From c47caaaffb12259eecc9505d7dd485567b647c89 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 18 Nov 2021 14:03:53 -0500 Subject: [PATCH 056/154] remove device check --- app/GroupTask.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/GroupTask.php b/app/GroupTask.php index 27d8eb3e..b6a7db49 100644 --- a/app/GroupTask.php +++ b/app/GroupTask.php @@ -370,7 +370,7 @@ public static function initializeLabIndividualOfficialTasks($group_id, $randomiz {"taskName":"Conclusion","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"mturk","hasCode":"false","displayScoreGroup":"false","digitalReceipt":"false","feedback":"true", "feedbackLinkType":"individual_pilot"}} ]'; } - else{ + else{s $taskArray = '[ {"taskName":"Consent","taskParams":{"url_endpoint":"end-individual-task","hasIndividuals":"true","hasGroup":"false","subjectPool":"individual_pilot"}}, {"taskName":"Intro","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"incognito"}}, From 948d568ee36dd71935e1dfd581e1a2943fe8fa1c Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 18 Nov 2021 14:16:28 -0500 Subject: [PATCH 057/154] remove device check --- app/GroupTask.php | 2 +- .../layouts/participants/participant-study-consent.blade.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/GroupTask.php b/app/GroupTask.php index b6a7db49..27d8eb3e 100644 --- a/app/GroupTask.php +++ b/app/GroupTask.php @@ -370,7 +370,7 @@ public static function initializeLabIndividualOfficialTasks($group_id, $randomiz {"taskName":"Conclusion","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"mturk","hasCode":"false","displayScoreGroup":"false","digitalReceipt":"false","feedback":"true", "feedbackLinkType":"individual_pilot"}} ]'; } - else{s + else{ $taskArray = '[ {"taskName":"Consent","taskParams":{"url_endpoint":"end-individual-task","hasIndividuals":"true","hasGroup":"false","subjectPool":"individual_pilot"}}, {"taskName":"Intro","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"incognito"}}, diff --git a/resources/views/layouts/participants/participant-study-consent.blade.php b/resources/views/layouts/participants/participant-study-consent.blade.php index 3ecb0179..db7d4293 100644 --- a/resources/views/layouts/participants/participant-study-consent.blade.php +++ b/resources/views/layouts/participants/participant-study-consent.blade.php @@ -130,7 +130,7 @@ computer use, including fatigue and mild stress.

- COMPENSATION: Payment depends on participation in the group sessions. After the first group session, the average participant will receive a payment of $35 (min=$20). Total payment for the 4-hour study will average $90 (min=$60, max=$120). You will not receive your payment today, only after first group session. + COMPENSATION: Payment depends on participation in the group sessions. After the first group session, the average participant will receive a payment of $35 (min=$25). Total payment for the 4-hour study will average $90 (min=$60, max=$120). You will not receive your payment today, only after first group session.

PLEASE NOTE: This study contains a number of checks to make sure participants are finishing the tasks honestly and completely. From 5280d14806562b502828ad382157775e53ac8c94 Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 19 Nov 2021 09:14:03 -0500 Subject: [PATCH 058/154] remove device check --- app/Http/Controllers/IndividualTaskController.php | 1 + app/Tasks/Conclusion.php | 11 ++++++++++- app/Tasks/Intro.php | 6 +++++- .../participant-study-conclusion.blade.php | 8 +++++++- 4 files changed, 23 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/IndividualTaskController.php b/app/Http/Controllers/IndividualTaskController.php index 1eff055f..a45d3ad3 100644 --- a/app/Http/Controllers/IndividualTaskController.php +++ b/app/Http/Controllers/IndividualTaskController.php @@ -878,6 +878,7 @@ public function studyConclusion(Request $request) { ->with('conclusionContent', $conclusionContent) ->with('code', $user->survey_code) ->with('score', false) + ->with('type',$parameters->type) ->with('checkEligibility', $parameters->displayScoreGroup == 'true') ->with('eligible', $eligibility) ->with('feedbackLink', $feedbackLink) diff --git a/app/Tasks/Conclusion.php b/app/Tasks/Conclusion.php index 96884786..40ebeafa 100644 --- a/app/Tasks/Conclusion.php +++ b/app/Tasks/Conclusion.php @@ -23,6 +23,15 @@ class Conclusion { 'content' => 'Thank you for participating!' ] ], + 'individual_pilot' => [[ + 'type' => 'sub-header', + 'content' => 'You\'ve completed yhr individual tasks! Congratulations.' + ], + [ + 'type' => 'sub-header', + 'content' => 'The final step for today is to get a completion code in Qualtrics. Please click on the button below!' + ] + ], 'hdsl_individual' => [[ 'type' => 'header', 'content' => "Congratulations! You've finished the pilot." @@ -103,7 +112,7 @@ class Conclusion { 'groupTwo' => 'https://urldefense.proofpoint.com/v2/url?u=https-3A__docs.google.com_forms_d_e_1FAIpQLSfL8x7CTs9I6vPreeXAdw5-2DURJMj5G17SqKZuMyCNC-5F1EQw1w_viewform-3Fusp-3Dsf-5Flink&d=DwMFaQ&c=WO-RGvefibhHBZq3fL85hQ&r=tAX8kL7P9f6gcapc67VgDbxuAn6xB0Zl7vfMQBORGpQ&m=23Mvsql-PxIiPW6hhQRvCrbd4sGrl4FDLjm7r5XrFVM&s=Xa0buQFFydQM--IKsMwZf0uuKzfcX4YiwTD54YkoiHE&e=', 'qualtrics' => 'https://harvard.az1.qualtrics.com/jfe/form/SV_2tLibq6KB8AlxnE',#https://harvard.az1.qualtrics.com/jfe/form/SV_b7cZXgNyfCeTUB8' 'memory' => 'https://harvard.az1.qualtrics.com/jfe/form/SV_82l3wcljCQ3QBH8', - 'individual_pilot' => 'https://harvard.az1.qualtrics.com/jfe/form/SV_0quKZbKL2deX2aW' + 'individual_pilot' => 'https://harvard.az1.qualtrics.com/jfe/form/SV_5mrgmDl8AmQaYF8' ]; private static $avaialbleParams = ['hasIndividuals' => ['true', 'false'], 'hasGroup' => ['false'], 'type' => ['mturk', 'hdsl_individual'], 'hasCode' => ['true', 'false'], 'feedback' => ['true', 'false']]; diff --git a/app/Tasks/Intro.php b/app/Tasks/Intro.php index 26877045..edc0a449 100644 --- a/app/Tasks/Intro.php +++ b/app/Tasks/Intro.php @@ -285,7 +285,11 @@ class Intro { ], [ 'type' => 'paragraph', - 'content' => 'Warning: our study does NOT work with "incognito" or "private" browsers. If your current browser is in incognito/private mode, please close the window and re-open the study link from prolific. Otherwise, click next.' + 'content' => 'Warning: our study does NOT work with "incognito" or "private" browsers. If your current browser is in incognito/private mode, please copy the link below and reopen the study in a browser that is NOT incognito/private. If your browser is not incognito/private, just click next Otherwise, click next.' + ], + [ + 'type' => 'paragraph', + 'content' => 'https://harvardskillslab.org/participant-login/individual-pilot' ], [ 'type' => 'paragraph', diff --git a/resources/views/layouts/participants/participant-study-conclusion.blade.php b/resources/views/layouts/participants/participant-study-conclusion.blade.php index a07b8893..b10aa62f 100644 --- a/resources/views/layouts/participants/participant-study-conclusion.blade.php +++ b/resources/views/layouts/participants/participant-study-conclusion.blade.php @@ -111,7 +111,13 @@

To finish the study, please complete this feedback survey

- Feedback + + @if($type == 'individual_pilot') + Go to Qualtrics + @else + Feedback + @endif + @endif From 26f5096d6e1c2c51eee4cac2602e5ba51756e3a6 Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 19 Nov 2021 09:15:30 -0500 Subject: [PATCH 059/154] remove device check --- .../layouts/participants/participant-study-consent.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/layouts/participants/participant-study-consent.blade.php b/resources/views/layouts/participants/participant-study-consent.blade.php index db7d4293..7e36421b 100644 --- a/resources/views/layouts/participants/participant-study-consent.blade.php +++ b/resources/views/layouts/participants/participant-study-consent.blade.php @@ -130,7 +130,7 @@ computer use, including fatigue and mild stress.

- COMPENSATION: Payment depends on participation in the group sessions. After the first group session, the average participant will receive a payment of $35 (min=$25). Total payment for the 4-hour study will average $90 (min=$60, max=$120). You will not receive your payment today, only after first group session. + COMPENSATION: Payment depends on participation in the group sessions. After the first group session, the average participant will receive a payment of $35 (min=$25). Total payment for the 4-hour study will average $90 (min=$60, max=$120). You will not receive your payment today, only after the first group session.

PLEASE NOTE: This study contains a number of checks to make sure participants are finishing the tasks honestly and completely. From 04154ad0f4a3ebb79213ffd24a50c379886021aa Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 19 Nov 2021 09:16:49 -0500 Subject: [PATCH 060/154] remove device check --- app/Tasks/Intro.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Tasks/Intro.php b/app/Tasks/Intro.php index edc0a449..a346c5e2 100644 --- a/app/Tasks/Intro.php +++ b/app/Tasks/Intro.php @@ -285,7 +285,7 @@ class Intro { ], [ 'type' => 'paragraph', - 'content' => 'Warning: our study does NOT work with "incognito" or "private" browsers. If your current browser is in incognito/private mode, please copy the link below and reopen the study in a browser that is NOT incognito/private. If your browser is not incognito/private, just click next Otherwise, click next.' + 'content' => 'Warning: our study does NOT work with "incognito" or "private" browsers. If your current browser is in incognito/private mode, please copy the link below and reopen the study in a browser that is NOT incognito/private. If your browser is not incognito/private, just click Next.' ], [ 'type' => 'paragraph', From 7acc906b509910d3b85ea0f0613a56b0edec9094 Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 19 Nov 2021 09:19:36 -0500 Subject: [PATCH 061/154] remove device check --- app/GroupTask.php | 4 ++-- app/Tasks/Conclusion.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/GroupTask.php b/app/GroupTask.php index 27d8eb3e..40a5a31e 100644 --- a/app/GroupTask.php +++ b/app/GroupTask.php @@ -310,7 +310,7 @@ public static function initializeLabIndividualPilotTasks($group_id, $randomize) {"taskName":"Cryptography","taskParams":{"intro":"individual_alt","hasIndividuals":"true","hasGroup":"false","mapping":"random","maxResponses":"10"}}, {"taskName":"Intro","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"selection_page"}}, {"taskName":"Intro","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"selection_followup"}}, - {"taskName":"Conclusion","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"mturk","hasCode":"false","displayScoreGroup":"false","digitalReceipt":"false","feedback":"true", "feedbackLinkType":"individual_pilot"}} + {"taskName":"Conclusion","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"individual_pilot","hasCode":"false","displayScoreGroup":"false","digitalReceipt":"false","feedback":"true", "feedbackLinkType":"individual_pilot"}} ]'; } else{ @@ -334,7 +334,7 @@ public static function initializeLabIndividualPilotTasks($group_id, $randomize) {"taskName":"Leadership","taskParams":{"hasIndividuals":"true","hasGroup":"false","statementOrder":"random"}}, {"taskName":"Cryptography","taskParams":{"intro":"intro","hasIndividuals":"true","hasGroup":"false","mapping":"random","maxResponses":"10"}}, {"taskName":"Cryptography","taskParams":{"intro":"individual_alt","hasIndividuals":"true","hasGroup":"false","mapping":"random","maxResponses":"10"}}, - {"taskName":"Conclusion","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"mturk","hasCode":"false","displayScoreGroup":"false","digitalReceipt":"false","feedback":"true", "feedbackLinkType":"individual_pilot"}} + {"taskName":"Conclusion","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"individual_pilot","hasCode":"false","displayScoreGroup":"false","digitalReceipt":"false","feedback":"true", "feedbackLinkType":"individual_pilot"}} ]'; } diff --git a/app/Tasks/Conclusion.php b/app/Tasks/Conclusion.php index 40ebeafa..f53169f6 100644 --- a/app/Tasks/Conclusion.php +++ b/app/Tasks/Conclusion.php @@ -25,7 +25,7 @@ class Conclusion { ], 'individual_pilot' => [[ 'type' => 'sub-header', - 'content' => 'You\'ve completed yhr individual tasks! Congratulations.' + 'content' => 'You\'ve completed the individual tasks! Congratulations.' ], [ 'type' => 'sub-header', From 5c929cb70b83628da112fe99555f23e5647bf724 Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 19 Nov 2021 10:30:11 -0500 Subject: [PATCH 062/154] remove device check --- .../participants/participant-study-conclusion.blade.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/resources/views/layouts/participants/participant-study-conclusion.blade.php b/resources/views/layouts/participants/participant-study-conclusion.blade.php index b10aa62f..0d3a0ea6 100644 --- a/resources/views/layouts/participants/participant-study-conclusion.blade.php +++ b/resources/views/layouts/participants/participant-study-conclusion.blade.php @@ -108,9 +108,11 @@ @endif @if($feedbackLink) -

- To finish the study, please complete this feedback survey -

+ @if($type != 'individual_pilot') +

+ To finish the study, please complete this feedback survey +

+ @endif @if($type == 'individual_pilot') Go to Qualtrics From 6bcf674a043376b158440d00f3f3653461de1a38 Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 19 Nov 2021 10:52:28 -0500 Subject: [PATCH 063/154] remove device check --- app/Tasks/Intro.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Tasks/Intro.php b/app/Tasks/Intro.php index a346c5e2..2c4c1fce 100644 --- a/app/Tasks/Intro.php +++ b/app/Tasks/Intro.php @@ -357,12 +357,12 @@ class Intro { [ 'type' => 'paragraph', 'content' => 'Leaders direct the group, and are responsible for answering questions.
- - Leaders are paid based on group performance.
' + - Leader bonus payments are based on group performance.' ], [ 'type' => 'paragraph', 'content' => 'Team members are essential for group success.
- - Team Members receive the same payment regardless of group performance.
' + - Team Member bonuses are fixed, regardless of group performance.' ], [ 'type' => 'paragraph', From a3ccfc2749632156e05eb6c7ce2de4681138717d Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 22 Nov 2021 09:06:05 -0500 Subject: [PATCH 064/154] added randomization scheme to AssignGroups --- .../Controllers/WaitingRoomController.php | 15 +--- app/Jobs/AssignGroups.php | 85 +++++++++++++++++++ 2 files changed, 89 insertions(+), 11 deletions(-) diff --git a/app/Http/Controllers/WaitingRoomController.php b/app/Http/Controllers/WaitingRoomController.php index e24acb84..1b5637d4 100644 --- a/app/Http/Controllers/WaitingRoomController.php +++ b/app/Http/Controllers/WaitingRoomController.php @@ -78,16 +78,9 @@ public function getWaitingRoom(Request $request){ $this_user = User::where('id',$user_id)->first(); $this_user->touch(); - if($this_user->group_role == ''){ + //if($this_user->group_role == ''){ - if(rand(1,3) == 1) - $this_user->group_role = 'leader'; - else - $this_user->group_role = 'follower1'; - $this_user->save(); - // - //return view('layouts.participants.no-role-assigned'); - } + //} //WE USE SIGNATURE_DATE AS A WAY OF INDICATING WHO ENTERED THE WAITING ROOM AT ALL, FOR CREDIT GRANTING PURPOSES IN THE PILOT STAGE $this_user->signature_date = \Carbon\Carbon::now(); @@ -412,8 +405,8 @@ public function beginSession(Request $request){ #IF THERE AREN'T AT LEAST 1 LEADERS AND 2 FOLLOWERS IN WAITING ROOM, DON'T START SESSION $leaders = User::where('in_room',1)->where('id','!=',1)->where('status','Active')->where('group_role','leader')->orderBy('waitnum','desc')->get(); $members = User::where('in_room',1)->where('id','!=',1)->where('status','Active')->where('group_role','!=','leader')->orderBy('waitnum','desc')->get(); - if(count($leaders) < 1 || count($members) < 2) - return 'NO'; + #if(count($leaders) < 1 || count($members) < 2) + #return 'NO'; $admin = User::where('id',1)->first(); if(!is_null($admin->current_session)) diff --git a/app/Jobs/AssignGroups.php b/app/Jobs/AssignGroups.php index 17c140c5..4837c392 100644 --- a/app/Jobs/AssignGroups.php +++ b/app/Jobs/AssignGroups.php @@ -9,6 +9,7 @@ use Illuminate\Foundation\Bus\Dispatchable; use Teamwork\User; use Teamwork\Group; +use Teamwork\Response; use Teamwork\Events\SendToTask; use Teamwork\Events\EndSubsession; use Teamwork\Events\AlertWaiter; @@ -59,9 +60,93 @@ public function handle() //GET ACTIVE WAITING ROOM MEMBERS $in_room = User::where('in_room',1)->where('id','!=',1)->where('status','Active')->get()->shuffle(); + foreach($in_room as $key => $roomie){ + $roomie->group_role = ''; + $roomie->save(); + } + if(count($in_room) >= 3){ Log::debug('first condition met'); + $choosers = []; + $chosen = []; + + foreach($in_room as $key => $user){ + $res = Response::where('prompt','role_select')->where('user_id',$user->id)->first(); + if($res) + $choosers[] = $user->id; + else + $chosen[] = $user->id; + } + + $choosers = User::whereIn('id',$choosers)->get(); + $chosen = User::whereIn('id',$chosen)->get(); + + Log::debug(count($choosers)); + Log::debug(count($chosen)); + + foreach($choosers as $key => $chooser){ + $res = Response::where('prompt','role_select')->where('user_id',$chooser->id)->first(); + + if($res->response == 'leader'){ + $flip = random_int(0,2); + Log::debug($chooser->participant_id.'\'s Flip = '.$flip); + + if($flip == 0){ + $chooser->group_role = "follower"; + } + else{ + $chooser->group_role = 'leader'; + } + } + else{ + $flip = random_int(0,2); + Log::debug($chooser->participant_id.'\'s Flip = '.$flip); + if($flip == 0){ + $chooser->group_role = "leader"; + } + else{ + $chooser->group_role = 'follower'; + } + } + + $chooser->save(); + } + + $room_size = count($in_room); + $num_groups = intdiv($room_size,3); + + + $leaders = User::where('in_room',1)->where('id','!=',1)->where('status','Active')->where('group_role','leader')->orderBy('waitnum','desc')->get(); + $members = User::where('in_room',1)->where('id','!=',1)->where('status','Active')->where('group_role','!=','leader')->orderBy('waitnum','desc')->get(); + + if(count($leaders) > $num_groups){ + for($i = 0; $i < $count($leaders) - $num_groups; $i++){ + $follower = $leaders->pop(); + $follower->group_role = "follower"; + $follower->save(); + } + } + + $leaders = User::where('in_room',1)->where('id','!=',1)->where('status','Active')->where('group_role','leader')->orderBy('waitnum','desc')->get(); + $members = User::where('in_room',1)->where('id','!=',1)->where('status','Active')->where('group_role','!=','leader')->orderBy('waitnum','desc')->get(); + + $leaders_left = $num_groups - count($leaders); + $members_left = $num_groups*2 - count($members); + + foreach($chosen as $key => $cho){ + if($leaders_left > 0){ + $cho->group_role = 'leader'; + $cho->save(); + $leaders_left -= 1; + } + elseif($members_left > 0){ + $cho->group_role = 'follower'; + $cho->save(); + $members_left -= 1; + } + } + $leaders = User::where('in_room',1)->where('id','!=',1)->where('status','Active')->where('group_role','leader')->orderBy('waitnum','desc')->get(); $members = User::where('in_room',1)->where('id','!=',1)->where('status','Active')->where('group_role','!=','leader')->orderBy('waitnum','desc')->get(); From 2983675fe9ffd90d78c310f0678130b0c42f3d65 Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 22 Nov 2021 09:12:27 -0500 Subject: [PATCH 065/154] added randomization scheme to AssignGroups --- app/Tasks/Conclusion.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Tasks/Conclusion.php b/app/Tasks/Conclusion.php index f53169f6..98e35686 100644 --- a/app/Tasks/Conclusion.php +++ b/app/Tasks/Conclusion.php @@ -110,7 +110,7 @@ class Conclusion { 'pilot' => 'https://docs.google.com/forms/d/1ZZV8P_dyifFn4DRhalN82126POz3R-SgCWXvTo7DMaU/viewform?ts=5d35ccb7&edit_requested=true', 'group5Pilot' => 'https://docs.google.com/forms/d/1KNfcSCGmdNy4vqKtx2R8paFvSeklTfQyvtWBPaINRwk/viewform?usp=sharing_eip&ts=5d405d8c&edit_requested=true', 'groupTwo' => 'https://urldefense.proofpoint.com/v2/url?u=https-3A__docs.google.com_forms_d_e_1FAIpQLSfL8x7CTs9I6vPreeXAdw5-2DURJMj5G17SqKZuMyCNC-5F1EQw1w_viewform-3Fusp-3Dsf-5Flink&d=DwMFaQ&c=WO-RGvefibhHBZq3fL85hQ&r=tAX8kL7P9f6gcapc67VgDbxuAn6xB0Zl7vfMQBORGpQ&m=23Mvsql-PxIiPW6hhQRvCrbd4sGrl4FDLjm7r5XrFVM&s=Xa0buQFFydQM--IKsMwZf0uuKzfcX4YiwTD54YkoiHE&e=', - 'qualtrics' => 'https://harvard.az1.qualtrics.com/jfe/form/SV_2tLibq6KB8AlxnE',#https://harvard.az1.qualtrics.com/jfe/form/SV_b7cZXgNyfCeTUB8' + 'qualtrics' => 'https://harvard.az1.qualtrics.com/jfe/form/SV_egMFHEN94sz97RY',#https://harvard.az1.qualtrics.com/jfe/form/SV_b7cZXgNyfCeTUB8' 'memory' => 'https://harvard.az1.qualtrics.com/jfe/form/SV_82l3wcljCQ3QBH8', 'individual_pilot' => 'https://harvard.az1.qualtrics.com/jfe/form/SV_5mrgmDl8AmQaYF8' ]; From 4a9bca9eb8ab4b09dd986861f9c0e83616f43c40 Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 22 Nov 2021 11:03:54 -0500 Subject: [PATCH 066/154] added randomization scheme to AssignGroups --- app/Http/Controllers/IndividualTaskController.php | 2 ++ app/Tasks/Conclusion.php | 4 ++-- .../participants/tasks/cryptography-group-intro.blade.php | 4 ++-- .../layouts/participants/tasks/cryptography-group.blade.php | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/Http/Controllers/IndividualTaskController.php b/app/Http/Controllers/IndividualTaskController.php index a45d3ad3..042a272b 100644 --- a/app/Http/Controllers/IndividualTaskController.php +++ b/app/Http/Controllers/IndividualTaskController.php @@ -230,6 +230,8 @@ public function groupSurvey(Request $request){ $alt_intro_length = env('MEMORY_ALT_INTRO_LENGTH',30); + + if($admin->waiting == 2){ $alt_task_length = $task_length - $intro_length + $alt_intro_length; diff --git a/app/Tasks/Conclusion.php b/app/Tasks/Conclusion.php index 98e35686..4aeb03e9 100644 --- a/app/Tasks/Conclusion.php +++ b/app/Tasks/Conclusion.php @@ -12,11 +12,11 @@ class Conclusion { private $conclusions = [ 'mturk' => [[ 'type' => 'sub-header', - 'content' => 'You\'ve completed all the tasks!' + 'content' => 'You\'ve completed the group tasks for today\'s session!' ], [ 'type' => 'sub-header', - 'content' => 'The final step involves providing feedback and scheduling your next session. Once this is done, you\'ll enter your Prolific ID to get paid.' + 'content' => 'The final step involves providing feedback and entering your Prolific ID to get paid.' ], [ 'type' => 'sub-header', diff --git a/resources/views/layouts/participants/tasks/cryptography-group-intro.blade.php b/resources/views/layouts/participants/tasks/cryptography-group-intro.blade.php index 664b7bde..3cd87f05 100644 --- a/resources/views/layouts/participants/tasks/cryptography-group-intro.blade.php +++ b/resources/views/layouts/participants/tasks/cryptography-group-intro.blade.php @@ -197,7 +197,7 @@ Please take a moment to introduce yourselves.
- Note that you have 3 minutes to learn about the group task before it begins! (There is a timer at the top of the screen). + Note that you have 3 minutes to learn about the group task before it begins! (The group leader has information about time remaining).
@@ -282,7 +282,7 @@ Your teammates are only compensated for their time.
You are compensated based on group performance.
- If your group solves the puzzle, you will receive a payment of $7.00. Each 'round' costs you $0.50. Breaking a rule costs $2.00. You will get partial payment for partially solving the puzzle. + If your group solves the puzzle, you will receive a bonus of $8.00. Each 'round' costs you $0.50. Breaking a rule costs $2.00. You will get partial payment for partially solving the puzzle.
Whether you share information about how you are compensated as leader is up to you. diff --git a/resources/views/layouts/participants/tasks/cryptography-group.blade.php b/resources/views/layouts/participants/tasks/cryptography-group.blade.php index 1e2393dc..2763ea35 100644 --- a/resources/views/layouts/participants/tasks/cryptography-group.blade.php +++ b/resources/views/layouts/participants/tasks/cryptography-group.blade.php @@ -597,7 +597,7 @@ function clear_timer(){
-

LEADER PAYMENT: $7.00
+

TASK BONUS: $8.00
Each 'round' costs $0.50


From 514a1ca2cb300b9e99e4c6c39d0f104ca8eafe00 Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 22 Nov 2021 11:15:06 -0500 Subject: [PATCH 067/154] added randomization scheme to AssignGroups --- public/js/cryptography.js | 4 ++-- .../layouts/participants/tasks/cryptography-group.blade.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/public/js/cryptography.js b/public/js/cryptography.js index e115f0ba..a6635abd 100644 --- a/public/js/cryptography.js +++ b/public/js/cryptography.js @@ -6,7 +6,7 @@ var Cryptography = class Cryptography { this.mapping = mapping; this.operators = ['-', '+']; this.allowedChars = mapping.concat(this.operators); - this.ruleset = ruleset; + this.ruleset = [0].concat(ruleset) console.log('yooo'); console.log(ruleset); console.log(this.ruleset[1]); @@ -53,7 +53,7 @@ var Cryptography = class Cryptography { var rule_broken = 0; - this.ruleset = [0].concat(this.ruleset); + //this.ruleset = [0].concat(this.ruleset); console.log(this.ruleset); diff --git a/resources/views/layouts/participants/tasks/cryptography-group.blade.php b/resources/views/layouts/participants/tasks/cryptography-group.blade.php index 2763ea35..4599c10e 100644 --- a/resources/views/layouts/participants/tasks/cryptography-group.blade.php +++ b/resources/views/layouts/participants/tasks/cryptography-group.blade.php @@ -1,7 +1,7 @@ @extends('layouts.bare') @section('js') - + @stop From 89b74e61afb3d3fa92b08795d0f7232effa4d738 Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 22 Nov 2021 11:17:18 -0500 Subject: [PATCH 068/154] added randomization scheme to AssignGroups --- .../layouts/participants/tasks/cryptography-group.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/layouts/participants/tasks/cryptography-group.blade.php b/resources/views/layouts/participants/tasks/cryptography-group.blade.php index 4599c10e..b9556917 100644 --- a/resources/views/layouts/participants/tasks/cryptography-group.blade.php +++ b/resources/views/layouts/participants/tasks/cryptography-group.blade.php @@ -91,7 +91,7 @@ function clear_timer(){ } } //UPDATE PAYMENT AND TRIAL COUNTER - $('#payment').text(payment.toFixed(2)); + $('#payment').text(payment > 0 ? payment.toFixed(2) : "0.00"); $("#trial-counter").html(trials); } From cc772c70be86a20dfaa384614589c85084bcd3d3 Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 22 Nov 2021 11:19:50 -0500 Subject: [PATCH 069/154] added randomization scheme to AssignGroups --- app/Http/Controllers/GroupTaskController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/GroupTaskController.php b/app/Http/Controllers/GroupTaskController.php index 14d54c0a..b42d087a 100644 --- a/app/Http/Controllers/GroupTaskController.php +++ b/app/Http/Controllers/GroupTaskController.php @@ -691,7 +691,7 @@ public function ruleBroken(Request $request) { $r->user_id = $user->id; $r->prompt = 'Rule Broken'; - $r->response = 'n/a'; + $r->response = $rule_broken; $r->save(); return '200'; } From 4be6ed4cefabee528c452ad61ff91a8425571da4 Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 22 Nov 2021 11:41:35 -0500 Subject: [PATCH 070/154] added randomization scheme to AssignGroups --- .../layouts/participants/participant-study-conclusion.blade.php | 2 +- .../participants/tasks/cryptography-group-intro.blade.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/views/layouts/participants/participant-study-conclusion.blade.php b/resources/views/layouts/participants/participant-study-conclusion.blade.php index 0d3a0ea6..0f09875a 100644 --- a/resources/views/layouts/participants/participant-study-conclusion.blade.php +++ b/resources/views/layouts/participants/participant-study-conclusion.blade.php @@ -108,7 +108,7 @@ @endif @if($feedbackLink) - @if($type != 'individual_pilot') + @if($type != 'individual_pilot' && $type != "hdsl")

To finish the study, please complete this feedback survey

diff --git a/resources/views/layouts/participants/tasks/cryptography-group-intro.blade.php b/resources/views/layouts/participants/tasks/cryptography-group-intro.blade.php index 3cd87f05..09362fd5 100644 --- a/resources/views/layouts/participants/tasks/cryptography-group-intro.blade.php +++ b/resources/views/layouts/participants/tasks/cryptography-group-intro.blade.php @@ -282,7 +282,7 @@ Your teammates are only compensated for their time.
You are compensated based on group performance.
- If your group solves the puzzle, you will receive a bonus of $8.00. Each 'round' costs you $0.50. Breaking a rule costs $2.00. You will get partial payment for partially solving the puzzle. + You start the task with a "task bonus" of $8.00. Each 'round' costs you $0.50. Breaking a rule costs $2.00. You will receive partial payment for partially solving the puzzle.
Whether you share information about how you are compensated as leader is up to you. From ea75b0a364f05904a0469d9af178f41d3a4e9fe0 Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 22 Nov 2021 11:42:37 -0500 Subject: [PATCH 071/154] added randomization scheme to AssignGroups --- .../participants/participant-study-conclusion.blade.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/resources/views/layouts/participants/participant-study-conclusion.blade.php b/resources/views/layouts/participants/participant-study-conclusion.blade.php index 0f09875a..d0388532 100644 --- a/resources/views/layouts/participants/participant-study-conclusion.blade.php +++ b/resources/views/layouts/participants/participant-study-conclusion.blade.php @@ -108,11 +108,6 @@ @endif @if($feedbackLink) - @if($type != 'individual_pilot' && $type != "hdsl") -

- To finish the study, please complete this feedback survey -

- @endif
@if($type == 'individual_pilot') Go to Qualtrics From 90fb6427ca1e8e2af029233384230f280a01f457 Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 24 Nov 2021 11:29:49 -0500 Subject: [PATCH 072/154] added mic level check for device check --- app/GroupTask.php | 2 +- app/Http/Controllers/LoginController.php | 2 +- public/js/room-test.js | 98 ++++++++++++++++++- public/js/room.js | 2 + .../participants/device-check.blade.php | 19 +++- 5 files changed, 118 insertions(+), 5 deletions(-) diff --git a/app/GroupTask.php b/app/GroupTask.php index 40a5a31e..462ca1cb 100644 --- a/app/GroupTask.php +++ b/app/GroupTask.php @@ -160,7 +160,7 @@ public static function initializePhaseTwoTasks($group_id, $randomize) { #FOR DEV PURPOSES public static function initializeTestTasks($group_id, $randomize) { $taskArray = '[ - {"taskName":"GroupSurvey","taskParams":{"hasIndividuals":"false","hasGroup":"true","type":"1","statementOrder":"ordered"}} + {"taskName":"DeviceCheck","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"eligibility"}} ]'; diff --git a/app/Http/Controllers/LoginController.php b/app/Http/Controllers/LoginController.php index 36f5cfed..bfebfcf9 100644 --- a/app/Http/Controllers/LoginController.php +++ b/app/Http/Controllers/LoginController.php @@ -182,7 +182,7 @@ public function postParticipantLogin(Request $request) { return redirect('/task-room'); } elseif($request->task_package == 'test'){ - \Teamwork\GroupTask::initializeTestingTasks(\Auth::user()->group_id, $randomize = false); + \Teamwork\GroupTask::initializeTestTasks(\Auth::user()->group_id, $randomize = false); } elseif($request->task_package == 'group-1'){ \Teamwork\GroupTask::initializeGroupOneTasks(\Auth::user()->group_id, $randomize = false); diff --git a/public/js/room-test.js b/public/js/room-test.js index 991809b2..adad87be 100644 --- a/public/js/room-test.js +++ b/public/js/room-test.js @@ -148,14 +148,28 @@ function Toastify (options) { $('#video-connected').css('color','red'); } if(evt.stream.video && evt.stream.audio){ - $('#continue-button').text('Proceed with experiment'); - $('#continue-button').attr('disabled',false); + //$('#continue-button').text('Proceed with experiment'); + // $('#continue-button').attr('disabled',false); + $('#miccheck').attr('hidden',false); } else{ $('#continue-button').text('Connection Failed'); $('#continue-button').attr('disabled',false); } + canvasContext = document.getElementById( "meter" ).getContext("2d"); + + window.AudioContext = window.AudioContext || window.webkitAudioContext; + + audioContext = new AudioContext(); + + mediaStreamSource = audioContext.createMediaStreamSource(rtc.localStream.stream); + + meter = createAudioMeter(audioContext); + mediaStreamSource.connect(meter); + + onLevelChange(); + }); // Occurs when the remote stream is added. rtc.client.on("stream-added", function (evt) { @@ -344,6 +358,29 @@ function Toastify (options) { } + function onLevelChange( time ) { + // clear the background + canvasContext.clearRect(0,0,WIDTH,HEIGHT); + + // check if we're currently clipping + if (meter.checkClipping()) + canvasContext.fillStyle = "red"; + else + canvasContext.fillStyle = "green"; + + console.log(meter.volume); + if(meter.volume >= 0.15){ + $('#continue-button').text('Proceed with experiment'); + $('#continue-button').attr('disabled',false); + } + + // draw a bar based on the current volume + canvasContext.fillRect(0, 0, meter.volume * WIDTH * 1.4, HEIGHT); + + // set up the next visual callback + rafID = window.requestAnimationFrame( onLevelChange ); +} + function unpublish (rtc) { if (!rtc.client) { Toast.error("Please Join Room First"); @@ -364,6 +401,63 @@ function Toastify (options) { rtc.published = false; } +function createAudioMeter(audioContext,clipLevel,averaging,clipLag) { + var processor = audioContext.createScriptProcessor(512); + processor.onaudioprocess = volumeAudioProcess; + processor.clipping = false; + processor.lastClip = 0; + processor.volume = 0; + processor.clipLevel = clipLevel || 0.98; + processor.averaging = averaging || 0.95; + processor.clipLag = clipLag || 750; + + // this will have no effect, since we don't copy the input to the output, + // but works around a current Chrome bug. + processor.connect(audioContext.destination); + + processor.checkClipping = + function(){ + if (!this.clipping) + return false; + if ((this.lastClip + this.clipLag) < window.performance.now()) + this.clipping = false; + return this.clipping; + }; + + processor.shutdown = + function(){ + this.disconnect(); + this.onaudioprocess = null; + }; + + return processor; +} + +function volumeAudioProcess( event ) { + var buf = event.inputBuffer.getChannelData(0); + var bufLength = buf.length; + var sum = 0; + var x; + + // Do a root-mean-square on the samples: sum up the squares... + for (var i=0; i=this.clipLevel) { + this.clipping = true; + this.lastClip = window.performance.now(); + } + sum += x * x; + } + + // ... then take the square root of the sum. + var rms = Math.sqrt(sum / bufLength); + + // Now smooth this out with the averaging factor applied + // to the previous sample - take the max here because we + // want "fast attack, slow release." + this.volume = Math.max(rms, this.volume*this.averaging); +} + function leave (rtc) { if (!rtc.client) { Toast.error("Please Join First!"); diff --git a/public/js/room.js b/public/js/room.js index ee32dbc2..99ee6e84 100644 --- a/public/js/room.js +++ b/public/js/room.js @@ -285,6 +285,8 @@ function Toastify (options) { // initialize local stream. Callback function executed after intitialization is done rtc.localStream.init(function () { console.log("init local stream success"); + console.log(rtc.localStream.audioTrack); + console.log('big bri'); // play stream with html element id "local_stream" //rtc.localStream.play("local_stream"); //if (rtc.localStream.audio && !rtc.localStream.video) diff --git a/resources/views/layouts/participants/device-check.blade.php b/resources/views/layouts/participants/device-check.blade.php index f2d38ff9..b8e9b137 100644 --- a/resources/views/layouts/participants/device-check.blade.php +++ b/resources/views/layouts/participants/device-check.blade.php @@ -3,7 +3,9 @@ @section('title','Device Check') @section('js') - + + + @@ -138,9 +142,14 @@

+
+
+
+
+
From f3d10813628e805ce9130bd50c911f1a89877f6d Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 29 Nov 2021 10:00:57 -0500 Subject: [PATCH 076/154] fixed device check style --- .../participants/device-check.blade.php | 8285 ++++++++++++++++- 1 file changed, 8278 insertions(+), 7 deletions(-) diff --git a/resources/views/layouts/participants/device-check.blade.php b/resources/views/layouts/participants/device-check.blade.php index 35c7d626..82aae812 100644 --- a/resources/views/layouts/participants/device-check.blade.php +++ b/resources/views/layouts/participants/device-check.blade.php @@ -3,7 +3,8273 @@ @section('title','Device Check') @section('css') - + @stop @section('js') @@ -136,11 +8402,7 @@

-
- - - -
+
@@ -149,9 +8411,18 @@
+
+
+ + +

From e62fe7750cf72c8525f96add265f2bd2698fdbf9 Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 29 Nov 2021 10:02:09 -0500 Subject: [PATCH 077/154] added video feed to devicecheck --- public/css/room-test.css | 8266 ++++++++++++++++ .../participants/device-check.blade.php | 8268 +---------------- 2 files changed, 8267 insertions(+), 8267 deletions(-) create mode 100644 public/css/room-test.css diff --git a/public/css/room-test.css b/public/css/room-test.css new file mode 100644 index 00000000..9a750b83 --- /dev/null +++ b/public/css/room-test.css @@ -0,0 +1,8266 @@ + + @stop @section('js') From 8173d6a572e62fe559c10ef88150f8cce3f0a42e Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 29 Nov 2021 10:20:33 -0500 Subject: [PATCH 078/154] added video feed to devicecheck --- app/Tasks/Conclusion.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Tasks/Conclusion.php b/app/Tasks/Conclusion.php index 4aeb03e9..fb4764f1 100644 --- a/app/Tasks/Conclusion.php +++ b/app/Tasks/Conclusion.php @@ -16,7 +16,7 @@ class Conclusion { ], [ 'type' => 'sub-header', - 'content' => 'The final step involves providing feedback and entering your Prolific ID to get paid.' + 'content' => 'The final step involves providing feedback and entering your Prolific ID.' ], [ 'type' => 'sub-header', From 61a6eabbb1ad359ea72fa5b315476d361be7c2ba Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 29 Nov 2021 10:25:37 -0500 Subject: [PATCH 079/154] added video feed to devicecheck --- app/Tasks/Intro.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Tasks/Intro.php b/app/Tasks/Intro.php index 10d89086..2e6a3ab2 100644 --- a/app/Tasks/Intro.php +++ b/app/Tasks/Intro.php @@ -57,15 +57,15 @@ class Intro { ], [ 'type' => 'paragraph', - 'content' => 'Sometimes, not everyone will be allocated. If you are not in a group, stay in the waiting room and be ready for the next group allocation. The wait will be about 11 minutes. If you miss out, we try our best to make sure you are in a group in the next round.' + 'content' => 'Sometimes, not everyone will be allocated. If you are not in a group, stay in the waiting room and be ready for the next group allocation. The wait will be 12-14 minutes. If you miss out, we try our best to make sure you are in a group in the next round.' ], [ 'type' => 'paragraph', - 'content' => 'Overall, there are 3 rounds. After each round, we ask you some questions about your teammates. Your answers are strictly confidential.' + 'content' => 'After each round, we ask you some questions about your teammates. Your answers are strictly confidential.' ], [ 'type' => 'paragraph', - 'content' => 'After the final round, there is also a survey about the experiment in general. As this is a pilot, please answer the questions as honestly and thoroughly as possible!' + 'content' => 'After the final round, there is also a survey about the experiment in general. These questions won\'t affect payments. Please answer them as honestly as possible!' ], [ 'type' => 'paragraph', From 2538f576bc72a662802902c69900b617ca25f446 Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 29 Nov 2021 11:28:05 -0500 Subject: [PATCH 080/154] added video feed to devicecheck --- resources/views/layouts/participants/device-check.blade.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/views/layouts/participants/device-check.blade.php b/resources/views/layouts/participants/device-check.blade.php index f62f6cc6..8cc6f02f 100644 --- a/resources/views/layouts/participants/device-check.blade.php +++ b/resources/views/layouts/participants/device-check.blade.php @@ -120,7 +120,7 @@

-
+

Audio Status: Connecting...

@@ -128,7 +128,7 @@
-
+

Video Status: Connecting...

@@ -138,7 +138,7 @@

-
+
From 0d116b41a99b7e7e8c9994e60704984707b31f90 Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 29 Nov 2021 12:06:17 -0500 Subject: [PATCH 081/154] fixed admin-page timer bug --- app/Http/Controllers/WaitingRoomController.php | 2 ++ resources/views/layouts/participants/admin-page.blade.php | 6 +++--- resources/views/layouts/participants/device-check.blade.php | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/Http/Controllers/WaitingRoomController.php b/app/Http/Controllers/WaitingRoomController.php index 19bd9b9e..71723282 100644 --- a/app/Http/Controllers/WaitingRoomController.php +++ b/app/Http/Controllers/WaitingRoomController.php @@ -434,6 +434,8 @@ public function beginSession(Request $request){ } + event(new SessionBegun($admin)); + return '200'; diff --git a/resources/views/layouts/participants/admin-page.blade.php b/resources/views/layouts/participants/admin-page.blade.php index c3848f26..54d95051 100644 --- a/resources/views/layouts/participants/admin-page.blade.php +++ b/resources/views/layouts/participants/admin-page.blade.php @@ -105,7 +105,7 @@ function convertTZ(date) { if(time_remaining == 0){ - if( session_count.toString() === $('#num_sessions').val().toString()){ + if( session_count == max_sessions){ time_remaining = null; @@ -191,7 +191,7 @@ function convertTZ(date) { //IF TIME RUNS OUT, CHECK IF THIS IS THE LAST SUBSESSION if(time_remaining == 0){ //IF IT IS, THEN SWITCH BACK TO INACTIVE SESSION DISPLAY - if( session_count.toString() === $('#num_sessions').val().toString()){ + if( session_count == max_sessions){ time_remaining = null; @@ -315,7 +315,7 @@ function convertTZ(date) { if(time_remaining == 0){ - if( session_count.toString() === $('#num_sessions').val().toString()){ + if(( session_count == max_sessions)){ time_remaining = null; diff --git a/resources/views/layouts/participants/device-check.blade.php b/resources/views/layouts/participants/device-check.blade.php index 8cc6f02f..ca705500 100644 --- a/resources/views/layouts/participants/device-check.blade.php +++ b/resources/views/layouts/participants/device-check.blade.php @@ -148,7 +148,7 @@ Video: please make sure that you appear in the video feed on this page.
- Mic: test your microphone by speaking into it. If your microphone is picking up audio, the button below will say "Proceed to Experiment". If you're having problems, contact the researchers on this site using the green button (top right of screen). + Mic: test your microphone by speaking into it. If your microphone is picking up audio, the button below will say "Proceed with Experiment". If you're having problems, contact the researchers on this site using the green button (top right of screen).
From 1f0d73c695395ca97a0fc67bd7fbc0685be5b610 Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 1 Dec 2021 09:34:03 -0500 Subject: [PATCH 082/154] added send to conclusion function --- app/Http/Controllers/LoginController.php | 1 + .../Controllers/WaitingRoomController.php | 61 +++++++++++++++++++ app/Jobs/SendIntroComplete.php | 9 ++- .../layouts/participants/admin-page.blade.php | 4 ++ .../participant-study-conclusion.blade.php | 5 +- .../tasks/cryptography-group-intro.blade.php | 2 +- .../participants/waiting-room.blade.php | 5 ++ routes/web.php | 6 ++ 8 files changed, 88 insertions(+), 5 deletions(-) diff --git a/app/Http/Controllers/LoginController.php b/app/Http/Controllers/LoginController.php index 433bc662..025f3906 100644 --- a/app/Http/Controllers/LoginController.php +++ b/app/Http/Controllers/LoginController.php @@ -128,6 +128,7 @@ public function postParticipantLogin(Request $request) { $group->save(); $user->group_id = $group->id; + $user->current_session = 0; $user->save(); } diff --git a/app/Http/Controllers/WaitingRoomController.php b/app/Http/Controllers/WaitingRoomController.php index 71723282..37e63258 100644 --- a/app/Http/Controllers/WaitingRoomController.php +++ b/app/Http/Controllers/WaitingRoomController.php @@ -540,6 +540,67 @@ public function clearRoom(Request $request){ return redirect('/admin-page'); } + #SEND PARTICIPANT TO CONCLUSION AND BOOT THEIR PARTNERS FROM THE TASK + public function forceConclusion($id,Request $request){ + + $admin = User::where('id',1)->first(); + $user = User::find($id); + + if($admin->waiting == 1) + $qualtrics_type = 'qualtrics'; + else + $qualtrics_type = 'memory'; + + if($user->in_room){ + $g = new Group; + $g->save(); + $user->group_id = $g->id; + $user->current_session = 2; + $user->in_room = 0; + $user->save(); + + \Teamwork\GroupTask::initializeConclusionTasks($user->group_id,$randomize=false,$qualtrics_type); + + event(new SendToTask($user)); + } + else{ + $currentTask = GroupTask::where('group_id',$user->group_id)->where('completed',0)->orderBy('order','asc')->first(); + + + + + + $group_tasks = GroupTask::whereIn('name',array('Cryptography','Memory','GroupSurvey','Intro','DeviceCheck','Consent'))->where('group_id',$user->group_id)->get(); + + foreach($group_tasks as $key => $gt){ + $gt->completed = 1; + $gt->save(); + } + + $teammates = User::where('group_id',$user->group_id)->where('id','!=',$user->id)->get(); + + foreach($teammates as $key => $w){ + $w->current_session = 2; + $w->save(); + + event(new EndSubsession($w,$currentTask->order)); + } + + $g = new Group; + $g->save(); + $user->group_id = $g->id; + $user->current_session = 2; + $user->save(); + + \Teamwork\GroupTask::initializeConclusionTasks($user->group_id,$randomize=false,$qualtrics_type); + + event(new EndSubsession($user,$currentTask->order)); + } + + + return '200'; + } + #SAVE NOTE FOR USER-SESSION IN HISTORICAL DATA TABLE public function saveNotes(Request $request){ diff --git a/app/Jobs/SendIntroComplete.php b/app/Jobs/SendIntroComplete.php index 4eaf01dd..2fccd075 100644 --- a/app/Jobs/SendIntroComplete.php +++ b/app/Jobs/SendIntroComplete.php @@ -46,8 +46,11 @@ public function handle() if($admin->waiting == 2) $name = "Memory"; $group_task = GroupTask::where('group_id',$this_user->group_id)->where('name',$name)->where('order',1)->first(); - $group_task->completed = 1; - $group_task->save(); - event(new IntroEnding($this_user)); + if(!is_null($group_task)){ + $group_task->completed = 1; + $group_task->save(); + event(new IntroEnding($this_user)); + } + } } diff --git a/resources/views/layouts/participants/admin-page.blade.php b/resources/views/layouts/participants/admin-page.blade.php index 54d95051..b72eb95b 100644 --- a/resources/views/layouts/participants/admin-page.blade.php +++ b/resources/views/layouts/participants/admin-page.blade.php @@ -60,6 +60,7 @@ function convertTZ(date) {
Refresh Group Send To Waiting Room Send Group To Waiting Room + Force Conclusion
@@ -587,6 +588,7 @@ function convertTZ(date) { Refresh Group Send To Waiting Room Send Group To Waiting Room + Force Conclusion
@@ -617,6 +619,8 @@ function convertTZ(date) { Refresh User Refresh Group Send To Waiting Room + Send Group To Waiting Room + Force Conclusion
diff --git a/resources/views/layouts/participants/participant-study-conclusion.blade.php b/resources/views/layouts/participants/participant-study-conclusion.blade.php index d0388532..41aa47a8 100644 --- a/resources/views/layouts/participants/participant-study-conclusion.blade.php +++ b/resources/views/layouts/participants/participant-study-conclusion.blade.php @@ -33,7 +33,10 @@
-
+
+ @if($user->current_session == 2) +

NOTE: Your last session was ended early due to technical issues.

+ @endif @foreach($conclusionContent as $content) @if($content['type'] == 'header') diff --git a/resources/views/layouts/participants/tasks/cryptography-group-intro.blade.php b/resources/views/layouts/participants/tasks/cryptography-group-intro.blade.php index 9351db83..22b45ae6 100644 --- a/resources/views/layouts/participants/tasks/cryptography-group-intro.blade.php +++ b/resources/views/layouts/participants/tasks/cryptography-group-intro.blade.php @@ -70,7 +70,7 @@ //IF SUBSESSION ENDS, END TASK channel.bind('end-subsession', function(data){ - if(data['user']['id'] == user_id && data['order'] == 2){ + if(data['user']['id'] == user_id && data['order'] == 1){ window.location.href='/end-intro'; } }); diff --git a/resources/views/layouts/participants/waiting-room.blade.php b/resources/views/layouts/participants/waiting-room.blade.php index 262997e2..e4389fce 100644 --- a/resources/views/layouts/participants/waiting-room.blade.php +++ b/resources/views/layouts/participants/waiting-room.blade.php @@ -103,6 +103,11 @@ function shuffle(a) {

You were not selected for a group this round, but PLEASE STAY around for the next session in order to continue and complete the study.

+ @elseif($user->current_session == 2) +

Waiting Room

+
+

Your session was ended early because of technical issues with your teammates. Stay here in the waiting room so you can be matched to a new group in the next round.

+
@else

Waiting Room

@endif diff --git a/routes/web.php b/routes/web.php index 56e4df38..7d98594e 100644 --- a/routes/web.php +++ b/routes/web.php @@ -108,6 +108,12 @@ 'roles' => ['Researcher'] // Only a logged in user can view this page ]); +Route::get('/force-conclusion/{id}', [ + 'middleware' => ['auth', 'roles'], // A 'roles' middleware must be specified + 'uses' => 'WaitingRoomController@forceConclusion', + 'roles' => ['Researcher'] // Only a logged in user can view this page +]); + Route::post('/begin-session', [ 'middleware' => ['auth', 'roles'], // A 'roles' middleware must be specified From 6981afb37e694b088350cd05bc7d30c7ecf40cb6 Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 6 Dec 2021 09:28:30 -0500 Subject: [PATCH 083/154] changed timings and made instruction text dependent on timing variables --- app/Http/Controllers/GroupTaskController.php | 32 +++++++++++++++++++ .../Controllers/IndividualTaskController.php | 21 ++++++++++++ app/Tasks/Intro.php | 2 +- .../participants/device-check.blade.php | 2 +- .../participant-study-intro.blade.php | 2 ++ .../tasks/cryptography-group-intro.blade.php | 8 ++--- 6 files changed, 61 insertions(+), 6 deletions(-) diff --git a/app/Http/Controllers/GroupTaskController.php b/app/Http/Controllers/GroupTaskController.php index f44c0b60..c54e9be2 100644 --- a/app/Http/Controllers/GroupTaskController.php +++ b/app/Http/Controllers/GroupTaskController.php @@ -730,6 +730,33 @@ public function cryptographyIntro(Request $request) { $sorted = $mapping; sort($sorted); // Sort and re-index + $admin = User::find(1); + + if($admin->waiting == 1){ + $task_length = env("CRYPTO_TASK_LENGTH"); + if($admin->current_session == 1){ + $intro_length = env("CRYPTO_INTRO_LENGTH"); + } + else{ + $intro_length = env("CRYPTO_ALT_INTRO_LENGTH"); + } + $task_length -= $intro_length; + } + else{ + $task_length = env("MEMORY_TASK_LENGTH"); + if($admin->current_session == 1){ + $intro_length = env("MEMORY_INTRO_LENGTH"); + } + else{ + $intro_length = env("MEMORY_ALT_INTRO_LENGTH"); + } + $task_length -= $intro_length; + } + + $buffer_length = env("BUFFER_LENGTH"); + $survey_length = env("SURVEY_LENGTH"); + $total_length = $task_length + $intro_length + $buffer_length + $survey_length; + return view('layouts.participants.tasks.cryptography-group-intro') ->with('user', \Auth::user()) ->with('maxResponses', $maxResponses) @@ -739,6 +766,11 @@ public function cryptographyIntro(Request $request) { ->with('sorted', $aSorted) ->with('instructions',$currentTask->instructions) ->with('session_length',env('TASK_LENGTH',120)) + ->with('task_length',$task_length) + ->with('buffer_length',$buffer_length) + ->with('survey_length',$survey_length) + ->with('total_length',$total_length) + ->with('intro_length',$intro_length) ->with('introType', $parameters->intro);//$introType); } diff --git a/app/Http/Controllers/IndividualTaskController.php b/app/Http/Controllers/IndividualTaskController.php index c689a0af..648d955f 100644 --- a/app/Http/Controllers/IndividualTaskController.php +++ b/app/Http/Controllers/IndividualTaskController.php @@ -566,9 +566,30 @@ public function studyIntro(Request $request) { $introContent = (new \Teamwork\Tasks\Intro)->getIntro($parameters->type); + $admin = User::find(1); + + if($admin->waiting == 1){ + $task_length = env("CRYPTO_TASK_LENGTH"); + $min_task_length = $task_length - env("CRYPTO_INTRO_LENGTH") + env("CRYPTO_ALT_INTRO_LENGTH"); + } + else{ + $task_length = env("MEMORY_TASK_LENGTH"); + $min_task_length = $task_length - env("CRYPTO_INTRO_LENGTH") + env("CRYPTO_ALT_INTRO_LENGTH"); + } + + $buffer_length = env("BUFFER_LENGTH"); + $survey_length = env("SURVEY_LENGTH"); + $max_total_length = $task_length + $buffer_length + $survey_length; + $min_total_length = $min_task_length + $buffer_length +$survey_length; + return view('layouts.participants.participant-study-intro') ->with('introContent', $introContent) ->with('user',$this_user) + ->with('task_length',$task_length) + ->with('buffer_length',$buffer_length) + ->with('survey_length',$survey_length) + ->with('max_total_length',$max_total_length) + ->with('min_total_length',$min_total_length) ->with('type',$parameters->type); } diff --git a/app/Tasks/Intro.php b/app/Tasks/Intro.php index 2e6a3ab2..74530ba2 100644 --- a/app/Tasks/Intro.php +++ b/app/Tasks/Intro.php @@ -57,7 +57,7 @@ class Intro { ], [ 'type' => 'paragraph', - 'content' => 'Sometimes, not everyone will be allocated. If you are not in a group, stay in the waiting room and be ready for the next group allocation. The wait will be 12-14 minutes. If you miss out, we try our best to make sure you are in a group in the next round.' + 'content' => 'Sometimes, not everyone will be allocated. If you are not in a group, stay in the waiting room and be ready for the next group allocation. The wait will be 12-14 minutes. If you miss out, we try our best to make sure you are in a group in the next round.' ], [ 'type' => 'paragraph', diff --git a/resources/views/layouts/participants/device-check.blade.php b/resources/views/layouts/participants/device-check.blade.php index ca705500..ae92d904 100644 --- a/resources/views/layouts/participants/device-check.blade.php +++ b/resources/views/layouts/participants/device-check.blade.php @@ -153,7 +153,7 @@

-
+
diff --git a/resources/views/layouts/participants/participant-study-intro.blade.php b/resources/views/layouts/participants/participant-study-intro.blade.php index 9ddbb0c5..145d9adb 100644 --- a/resources/views/layouts/participants/participant-study-intro.blade.php +++ b/resources/views/layouts/participants/participant-study-intro.blade.php @@ -58,6 +58,8 @@ } } + + $('#task_length').text('about {{ intdiv($min_total_length,60) }}-{{ intdiv($max_total_length,60) }} minutes'); }); @stop diff --git a/resources/views/layouts/participants/tasks/cryptography-group-intro.blade.php b/resources/views/layouts/participants/tasks/cryptography-group-intro.blade.php index 22b45ae6..bcadff95 100644 --- a/resources/views/layouts/participants/tasks/cryptography-group-intro.blade.php +++ b/resources/views/layouts/participants/tasks/cryptography-group-intro.blade.php @@ -191,13 +191,13 @@

Welcome to your new group

- You will be working together for 10-12 minutes, trying to solve the GROUP CRYPTOGRAPHY puzzle. + You will be working together for about {{ intdiv($task_length + $intro_length,60) }} minutes, trying to solve the GROUP CRYPTOGRAPHY puzzle.
Please take a moment to introduce yourselves.
- Note that you have 3 minutes to learn about the group task before it begins! (The group leader has information about time remaining). + Note that you have {{ intdiv($intro_length,60) }} minutes to learn about the group task before it begins! (The group leader has information about time remaining).
@@ -307,13 +307,13 @@

Welcome to your new group

- You will again be working together for ~10 minutes, trying to solve another GROUP CRYPTOGRAPHY puzzle. + You will again be working together for about {{ intdiv($task_length + $intro_length,60) }} minutes, trying to solve another GROUP CRYPTOGRAPHY puzzle.
You may have a different role this time.
- You have 2 minutes before the puzzle begins. Please introduce yourselves! If you click next, you can review the instructions for your role. + You have {{ intdiv($intro_length,60) }} minute(s) before the puzzle begins. Please introduce yourselves! If you click next, you can review the instructions for your role.
From ae63e117d8a01f88debfeafa5be47d0db6c240c2 Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 6 Dec 2021 10:09:48 -0500 Subject: [PATCH 084/154] changed timings and made instruction text dependent on timing variables --- app/Http/Controllers/WaitingRoomController.php | 9 ++++----- .../tasks/cryptography-group-intro.blade.php | 4 ++-- .../participants/tasks/cryptography-group.blade.php | 8 ++++---- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/app/Http/Controllers/WaitingRoomController.php b/app/Http/Controllers/WaitingRoomController.php index 37e63258..9e674bbe 100644 --- a/app/Http/Controllers/WaitingRoomController.php +++ b/app/Http/Controllers/WaitingRoomController.php @@ -371,11 +371,10 @@ public function setActive(Request $request){ #BEGIN 1-4 ROUND SESSION WITH CURRENT USERS IN WAITING ROOM public function beginSession(Request $request){ - #IF THERE AREN'T AT LEAST 1 LEADERS AND 2 FOLLOWERS IN WAITING ROOM, DON'T START SESSION - $leaders = User::where('in_room',1)->where('id','!=',1)->where('status','Active')->where('group_role','leader')->orderBy('waitnum','desc')->get(); - $members = User::where('in_room',1)->where('id','!=',1)->where('status','Active')->where('group_role','!=','leader')->orderBy('waitnum','desc')->get(); - #if(count($leaders) < 1 || count($members) < 2) - #return 'NO'; + #IF THERE AREN'T AT LEAST 3 PARTICIPANTS IN WAITING ROOM, DON'T START SESSION + $parts = User::where('in_room',1)->where('id','!=',1)->where('status','Active')->orderBy('waitnum','desc')->get(); + if(count($leaders) < 1 || count($members) < 2) + return 'NO'; $admin = User::where('id',1)->first(); if(!is_null($admin->current_session)) diff --git a/resources/views/layouts/participants/tasks/cryptography-group-intro.blade.php b/resources/views/layouts/participants/tasks/cryptography-group-intro.blade.php index bcadff95..9301c0ae 100644 --- a/resources/views/layouts/participants/tasks/cryptography-group-intro.blade.php +++ b/resources/views/layouts/participants/tasks/cryptography-group-intro.blade.php @@ -240,7 +240,7 @@ This is the last step in each 'round'.
- You are also responsible for making sure that the group follows the "equation rules".
+ You are also responsible for making sure that the group follows the 'equation rules'.
@endif @if ($user->group_role == "follower1") @@ -282,7 +282,7 @@ Your teammates are only compensated for their time.
You are compensated based on group performance.
- You start the task with a "task bonus" of $8.00. Each 'round' costs you $0.50. Breaking a rule costs $2.00. You will receive partial payment for partially solving the puzzle. + You start the task with a 'task bonus' of $8.00. Each 'round' costs you $0.50. Breaking a rule costs $2.00. You will receive partial payment for partially solving the puzzle.
Whether you share information about how you are compensated as leader is up to you. diff --git a/resources/views/layouts/participants/tasks/cryptography-group.blade.php b/resources/views/layouts/participants/tasks/cryptography-group.blade.php index b9556917..6bd88690 100644 --- a/resources/views/layouts/participants/tasks/cryptography-group.blade.php +++ b/resources/views/layouts/participants/tasks/cryptography-group.blade.php @@ -623,7 +623,7 @@ function clear_timer(){
Round 1

Enter an equation

Enter the left-hand side of an equation, using letters, addition and - subtraction: e.g. “A+B”. Please only use the letters A-J plus '+' and '-'. + subtraction: e.g. 'A+B'. Please only use the letters A-J plus '+' and '-'.
@@ -742,9 +742,9 @@ function clear_timer(){
Each letter from A to J has a value from 0 to 9. Each letter has a different value. Your goal is to uncover the value of each letter by - completing "rounds". A round has three steps. First you enter an equation + completing 'rounds'. A round has three steps. First you enter an equation (e.g. “A+B”). You can only use addition and subtraction. Second, you - make a hypothesis (e.g. “D=4”) and the computer will tell you if this + make a hypothesis (e.g. 'D=4') and the computer will tell you if this hypothesis is TRUE or FALSE. Third, you can guess the values of each letter. You don’t have to make guesses for all the letters.
@@ -831,7 +831,7 @@ function clear_timer(){ If your teammates can't hear or see you, your browser may be blocking the site from accessing your microphone/camera.
+ Refresh your page. Wait and see if the web browser asks you to allow access to the microphone. Select 'allow' and proceed with the task.
From 52ff00d1f2375860df1c51c99b43cb092b14797c Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 6 Dec 2021 10:39:20 -0500 Subject: [PATCH 085/154] fixed admin-page timer bug --- app/Http/Controllers/WaitingRoomController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/WaitingRoomController.php b/app/Http/Controllers/WaitingRoomController.php index 9e674bbe..a22a2a79 100644 --- a/app/Http/Controllers/WaitingRoomController.php +++ b/app/Http/Controllers/WaitingRoomController.php @@ -373,7 +373,7 @@ public function beginSession(Request $request){ #IF THERE AREN'T AT LEAST 3 PARTICIPANTS IN WAITING ROOM, DON'T START SESSION $parts = User::where('in_room',1)->where('id','!=',1)->where('status','Active')->orderBy('waitnum','desc')->get(); - if(count($leaders) < 1 || count($members) < 2) + if(count($parts) >= 3) return 'NO'; $admin = User::where('id',1)->first(); From 8c30cd6210848cafc189fe8cddabdeefc873de94 Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 6 Dec 2021 10:41:11 -0500 Subject: [PATCH 086/154] fixed admin-page timer bug --- app/Http/Controllers/WaitingRoomController.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/WaitingRoomController.php b/app/Http/Controllers/WaitingRoomController.php index a22a2a79..3d81426e 100644 --- a/app/Http/Controllers/WaitingRoomController.php +++ b/app/Http/Controllers/WaitingRoomController.php @@ -371,7 +371,9 @@ public function setActive(Request $request){ #BEGIN 1-4 ROUND SESSION WITH CURRENT USERS IN WAITING ROOM public function beginSession(Request $request){ - #IF THERE AREN'T AT LEAST 3 PARTICIPANTS IN WAITING ROOM, DON'T START SESSION + #IF THERE AREN'T AT LEAST 3 IN WAITING ROOM, DON'T START SESSION + $leaders = User::where('in_room',1)->where('id','!=',1)->where('status','Active')->where('group_role','leader')->orderBy('waitnum','desc')->get(); + $members = User::where('in_room',1)->where('id','!=',1)->where('status','Active')->where('group_role','!=','leader')->orderBy('waitnum','desc')->get(); $parts = User::where('in_room',1)->where('id','!=',1)->where('status','Active')->orderBy('waitnum','desc')->get(); if(count($parts) >= 3) return 'NO'; From 0d22170f82db73dc2ffba6ca4891a6535af51c0e Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 6 Dec 2021 10:42:53 -0500 Subject: [PATCH 087/154] changed timings and made instruction text dependent on timing variables --- app/Http/Controllers/WaitingRoomController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/WaitingRoomController.php b/app/Http/Controllers/WaitingRoomController.php index 3d81426e..bc3ded96 100644 --- a/app/Http/Controllers/WaitingRoomController.php +++ b/app/Http/Controllers/WaitingRoomController.php @@ -375,7 +375,7 @@ public function beginSession(Request $request){ $leaders = User::where('in_room',1)->where('id','!=',1)->where('status','Active')->where('group_role','leader')->orderBy('waitnum','desc')->get(); $members = User::where('in_room',1)->where('id','!=',1)->where('status','Active')->where('group_role','!=','leader')->orderBy('waitnum','desc')->get(); $parts = User::where('in_room',1)->where('id','!=',1)->where('status','Active')->orderBy('waitnum','desc')->get(); - if(count($parts) >= 3) + if(count($parts) < 3) return 'NO'; $admin = User::where('id',1)->first(); From 130996f718b576a8c7b11707e8ee93dd057225c1 Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 6 Dec 2021 11:02:01 -0500 Subject: [PATCH 088/154] changed timings and made instruction text dependent on timing variables --- app/Http/Controllers/WaitingRoomController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/WaitingRoomController.php b/app/Http/Controllers/WaitingRoomController.php index bc3ded96..d9ff4c9a 100644 --- a/app/Http/Controllers/WaitingRoomController.php +++ b/app/Http/Controllers/WaitingRoomController.php @@ -545,7 +545,7 @@ public function clearRoom(Request $request){ public function forceConclusion($id,Request $request){ $admin = User::where('id',1)->first(); - $user = User::find($id); + $user = User::where('participant_id',$id)->first(); if($admin->waiting == 1) $qualtrics_type = 'qualtrics'; From 5c16b552cabf6ae561cfe36c5c0123894a46ee2d Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 6 Dec 2021 11:13:29 -0500 Subject: [PATCH 089/154] changed timings and made instruction text dependent on timing variables --- app/Http/Controllers/LoginController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/LoginController.php b/app/Http/Controllers/LoginController.php index 025f3906..1c44ef0c 100644 --- a/app/Http/Controllers/LoginController.php +++ b/app/Http/Controllers/LoginController.php @@ -135,7 +135,7 @@ public function postParticipantLogin(Request $request) { //ELSE FIND IT else $group = Group::find($user->group_id); - + $user->current_session = 0; $user->save(); \Auth::login($user); From 9c6d1cc77fcd5b086dcfb0aa6133e65c83cd25ec Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 6 Dec 2021 11:41:55 -0500 Subject: [PATCH 090/154] fixed admin-page timer bug --- .../layouts/participants/tasks/cryptography-group.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/layouts/participants/tasks/cryptography-group.blade.php b/resources/views/layouts/participants/tasks/cryptography-group.blade.php index 6bd88690..c90b2303 100644 --- a/resources/views/layouts/participants/tasks/cryptography-group.blade.php +++ b/resources/views/layouts/participants/tasks/cryptography-group.blade.php @@ -187,7 +187,7 @@ function clear_timer(){ //WARNS THEM WHEN THEY HAVE A MINUTE LEFT setTimeout(function() { $("#timer-warning").modal(); - }, 540 * 1000); + }, 480 * 1000); //PINGS SERVER PERIODICALLY TO CONFIRM STILL ON PAGE var itv = setInterval(function() { From c2843ef8b4b136c9cde3c65b7af9f1fe514d4d1c Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 8 Dec 2021 15:32:52 -0500 Subject: [PATCH 091/154] changed css for memory and added individual crypto to end of memory pilot --- app/GroupTask.php | 1 + .../participants/device-check.blade.php | 2 +- .../participants/tasks/memory-group.blade.php | 47 +++++++++---------- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/app/GroupTask.php b/app/GroupTask.php index f87a3682..a8f076af 100644 --- a/app/GroupTask.php +++ b/app/GroupTask.php @@ -226,6 +226,7 @@ public static function initializeMemoryTasks($group_id, $randomize,$final,$test) {"taskName":"Memory","taskParams":{"hasIndividuals":"false","hasGroup":"true","test":"group_'.$test.'_instructions","type":"intro"}}, {"taskName":"Memory","taskParams":{"hasIndividuals":"false","hasGroup":"true","test":"group_'.$test.'","type":"task"}}, {"taskName":"GroupSurvey","taskParams":{"hasIndividuals":"false","hasGroup":"true","type":"1","statementOrder":"ordered","task_name":"Memory"}}, + {"taskName":"Cryptography","taskParams":{"intro":"combined_pilot","hasIndividuals":"true","hasGroup":"false","mapping":"random","maxResponses":"10"}}, {"taskName":"Conclusion","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"mturk","hasCode":"false","displayScoreGroup":"false", "digitalReceipt":"false", "sonaId": "547", "payment": "30", "feedback":"true", "feedbackLinkType":"memory"}} ]'; } diff --git a/resources/views/layouts/participants/device-check.blade.php b/resources/views/layouts/participants/device-check.blade.php index ae92d904..97472132 100644 --- a/resources/views/layouts/participants/device-check.blade.php +++ b/resources/views/layouts/participants/device-check.blade.php @@ -10,7 +10,7 @@ - + - + +@stop + +@section('css') + +@stop + +@section('content') + + +
+
+
Instructions end in: {{ gmdate('i:s',$time_remaining) }}
+
+
+ +
+
+

Individual Cryptography Task

+

+ Welcome to the final task of the study! +

+

+ You will complete 1 cryptography puzzle, by yourself. +

+

+ You completed a very similar task by yourself at the very beginning of the study. +

+

+ The next page has a reminder about how the task works. It should be familiar. +

+

+ There is a timer at the top of the screen. The task will begin when the timer reaches 0:00. +

+

+ Best of luck! +

+
+
+

+ To review: +

+

+ You will have a maximum of {{ $maxResponses }} trials and 10 minutes to solve + the cryptography task. Each round has three steps: you're now working BY YOURSLEF, so you are responsible for all three steps: +

+
+
+

+ 1. Enter an equation (e.g. CC + B - A = ?)
+ 2. Make a hypothesis (e.g. C = 1)
+ 3. Guess the letter values +

+
+
+

+ The overall goal is to solve the whole puzzle IN THE SMALLEST NUMBER OF ROUNDS.
+ If you don’t solve the task, you will get some points for + each letter-number combination you correctly identify. +

+

+ You will have a maximum of {{ $maxResponses }} trials and 8 minutes to + solve the cryptography task.
+ The puzzle will begin when your TIMER (above) reaches 0:00. +

+
+
+ +
+
+
+
+
+@stop diff --git a/resources/views/layouts/participants/tasks/group-survey.blade.php b/resources/views/layouts/participants/tasks/group-survey.blade.php index 26504cb7..e0901d26 100644 --- a/resources/views/layouts/participants/tasks/group-survey.blade.php +++ b/resources/views/layouts/participants/tasks/group-survey.blade.php @@ -135,10 +135,13 @@

@if($user->group_role != 'leader') - We would like to ask some questions about your group's LEADER (who entered the groups guesses for all the letter values) + We would like to ask some questions about your group's LEADER + @if($admin->waiting == 1) + (who entered the groups guesses for all the letter values) + @endif @else - @if($task_name == "Cryptography") + @if($admin->waiting == 1) We would like to ask some questions about the person who Made Hypotheses (e.g. guessed things like A=7) @else We would like to ask some questions about Team Member 2 @@ -182,7 +185,7 @@

@if($user->group_role == 'leader') - @if($task_name == "Cryptography") + @if($admin->waiting == 1) We would like to ask some questions about the person who Entered the Equations (e.g. C+D+F=?) @else We would like to ask some questions about Team Member 1 diff --git a/resources/views/layouts/participants/tasks/memory-group.blade.php b/resources/views/layouts/participants/tasks/memory-group.blade.php index 0b58f5c1..0ceda915 100644 --- a/resources/views/layouts/participants/tasks/memory-group.blade.php +++ b/resources/views/layouts/participants/tasks/memory-group.blade.php @@ -425,7 +425,7 @@ function change_status(id,status){ @if($block['type'] == 'mixed_review')
-
Time Remaining:

+

Time Remaining:


@if(isset($block['header']))

{{ $block['header'] }}

@endif From 89dab7c6cf09254583074e9aaf2950886c64c9e8 Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 13 Dec 2021 11:49:19 -0500 Subject: [PATCH 095/154] edits for phase three link --- app/GroupTask.php | 1 + app/Http/Controllers/IndividualTaskController.php | 1 + app/Http/Controllers/WaitingRoomController.php | 4 ++-- app/Tasks/Memory.php | 2 +- public/css/tasks.css | 4 ---- public/js/room.js | 8 +++++--- .../layouts/participants/tasks/memory-group.blade.php | 4 ++-- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/app/GroupTask.php b/app/GroupTask.php index 854d104a..baf957e0 100644 --- a/app/GroupTask.php +++ b/app/GroupTask.php @@ -235,6 +235,7 @@ public static function initializeCryptoTasks($group_id, $randomize,$final,$first } public static function initializeMemoryTasks($group_id, $randomize,$final,$test) { + $test = 3; if($final){ $taskArray = '[ {"taskName":"Memory","taskParams":{"hasIndividuals":"false","hasGroup":"true","test":"group_'.$test.'_instructions","type":"intro"}}, diff --git a/app/Http/Controllers/IndividualTaskController.php b/app/Http/Controllers/IndividualTaskController.php index 4fe51c20..a9584fef 100644 --- a/app/Http/Controllers/IndividualTaskController.php +++ b/app/Http/Controllers/IndividualTaskController.php @@ -315,6 +315,7 @@ public function groupSurvey(Request $request){ ->with('time_remaining',$time_remaining) ->with('questions',$statements[$this_user->group_role == 'leader' ? 'leader' : 'member']) ->with('task_name',$task_name) + ->with('admin',$admin) ->with('user',$this_user); } diff --git a/app/Http/Controllers/WaitingRoomController.php b/app/Http/Controllers/WaitingRoomController.php index d9ff4c9a..784dbb9a 100644 --- a/app/Http/Controllers/WaitingRoomController.php +++ b/app/Http/Controllers/WaitingRoomController.php @@ -479,8 +479,8 @@ public function sendGroupToWaitingRoom(Request $request,$participant_id){ #GET PARTICIPANT'S ROLE public function getRole(Request $request){ - - $user = User::where('id',$request->id)->first(); + $user_id = \Auth::user()->id; + $user = User::where('id',$user_id)->first(); $currentTask = GroupTask::where('group_id',$user->group_id)->where('completed',0)->orderBy('order','asc')->first(); $user->task_name = $currentTask->name; return $user; diff --git a/app/Tasks/Memory.php b/app/Tasks/Memory.php index 178749e2..a494e980 100644 --- a/app/Tasks/Memory.php +++ b/app/Tasks/Memory.php @@ -2547,7 +2547,7 @@ class Memory { 'types' => [ ['type' => 'images', 'directory' => '/img/memory-task/bikes/', 'prompt' => 'Remember these target images', - 'targets' => ['3_targets_1.jpg', '3_targets_2.jpg', '3_targets_3.jpg'] + 'targets' => ['1_target_1.jpeg', '1_target_2.jpeg', '1_target_3.jpeg'] ], ['type' => 'words', 'prompt' => 'Remember these target words', diff --git a/public/css/tasks.css b/public/css/tasks.css index 5d1e91a8..30e79593 100644 --- a/public/css/tasks.css +++ b/public/css/tasks.css @@ -202,10 +202,6 @@ form#big-five-form th.rotate > div { width: 700px; } -.target-img-group_3 { - width: 900px!important; -} - .memory-img { width: 646px; height: auto; diff --git a/public/js/room.js b/public/js/room.js index b60aa8f6..b8b9d368 100644 --- a/public/js/room.js +++ b/public/js/room.js @@ -58,17 +58,19 @@ function Toastify (options) { id:id },function(data){ console.log(data); - if(id=="2") + if(id=="2"){ if(data['which_task'] == 'Cryptography') data = 'Equations'; else data = 'Team Member 1'; - if(id=="3") + } + else if(id=="3"){ if(data['which_task'] == 'Cryptography') data = 'Hypotheses'; else data = 'Team Member 2'; - if(id=="1") + } + else if(id=="1") data = 'Leader'; jQuery('#group_role_'+id).text(data); }) diff --git a/resources/views/layouts/participants/tasks/memory-group.blade.php b/resources/views/layouts/participants/tasks/memory-group.blade.php index 0ceda915..c4c8b6c0 100644 --- a/resources/views/layouts/participants/tasks/memory-group.blade.php +++ b/resources/views/layouts/participants/tasks/memory-group.blade.php @@ -425,7 +425,7 @@ function change_status(id,status){ @if($block['type'] == 'mixed_review')
-

Time Remaining:


+
Time Remaining for Review:

@if(isset($block['header']))

{{ $block['header'] }}

@endif @@ -588,7 +588,7 @@ function change_status(id,status){

{{ $choice }}

@if($user->group_role == 'leader') - From 062bafb7d5e8ccba690ef3c47ac94950a373e8a2 Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 13 Dec 2021 11:49:34 -0500 Subject: [PATCH 096/154] edits for phase three link --- app/GroupTask.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/GroupTask.php b/app/GroupTask.php index baf957e0..854d104a 100644 --- a/app/GroupTask.php +++ b/app/GroupTask.php @@ -235,7 +235,6 @@ public static function initializeCryptoTasks($group_id, $randomize,$final,$first } public static function initializeMemoryTasks($group_id, $randomize,$final,$test) { - $test = 3; if($final){ $taskArray = '[ {"taskName":"Memory","taskParams":{"hasIndividuals":"false","hasGroup":"true","test":"group_'.$test.'_instructions","type":"intro"}}, From 84b904b3deaf0efbb1e1552c2bb71b281208e99b Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 13 Dec 2021 13:38:52 -0500 Subject: [PATCH 097/154] added crypto link --- app/GroupTask.php | 9 +++++++++ app/Http/Controllers/LoginController.php | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/app/GroupTask.php b/app/GroupTask.php index 854d104a..bf3b0573 100644 --- a/app/GroupTask.php +++ b/app/GroupTask.php @@ -188,6 +188,15 @@ public static function initializeTestTasks($group_id, $randomize) { return Self::initializeTasks($group_id, $taskArray, $randomize); } + public static function initializeCryptoConclusionTasks($group_id, $randomize,$qualtrics_type) { + $taskArray = '[ + {"taskName":"Cryptography","taskParams":{"intro":"phase-three-alt","hasIndividuals":"true","hasGroup":"false","mapping":"random","maxResponses":"10"}}, + {"taskName":"Conclusion","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"mturk","hasCode":"false","displayScoreGroup":"false", "digitalReceipt":"false", "sonaId": "547", "payment": "30", "feedback":"true", "feedbackLinkType":"memory"}} + ]'; + + return Self::initializeTasks($group_id, $taskArray, $randomize); + } + public static function initializeConclusionTasks($group_id, $randomize,$qualtrics_type) { $taskArray = '[ {"taskName":"Conclusion","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"mturk","hasCode":"false","displayScoreGroup":"false", "digitalReceipt":"false", "sonaId": "547", "payment": "30", "feedback":"true", "feedbackLinkType":"'.$qualtrics_type.'"}} diff --git a/app/Http/Controllers/LoginController.php b/app/Http/Controllers/LoginController.php index 58196c2b..320551fa 100644 --- a/app/Http/Controllers/LoginController.php +++ b/app/Http/Controllers/LoginController.php @@ -245,6 +245,10 @@ public function postParticipantLogin(Request $request) { \Teamwork\GroupTask::initializePhaseThreeTasks(\Auth::user()->group_id, $randomize = false); return redirect('/get-individual-task'); } + elseif($request->task_package == 'crypto-conclusion'){ + \Teamwork\GroupTask::initializeCryptoConclusionTasks(\Auth::user()->group_id, $randomize = false); + return redirect('/get-individual-task'); + } //ASSIGN PHASE 2 PILOT TASKS elseif($request->task_package == 'group-pilot'){ \Teamwork\GroupTask::initializePhaseTwoTasks(\Auth::user()->group_id, $randomize = false); From 15275e54fd1c79b42ac4565a8b2c85cc011f3a49 Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 13 Dec 2021 13:50:02 -0500 Subject: [PATCH 098/154] added crypto link --- app/GroupTask.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/GroupTask.php b/app/GroupTask.php index bf3b0573..83613911 100644 --- a/app/GroupTask.php +++ b/app/GroupTask.php @@ -188,7 +188,7 @@ public static function initializeTestTasks($group_id, $randomize) { return Self::initializeTasks($group_id, $taskArray, $randomize); } - public static function initializeCryptoConclusionTasks($group_id, $randomize,$qualtrics_type) { + public static function initializeCryptoConclusionTasks($group_id, $randomize) { $taskArray = '[ {"taskName":"Cryptography","taskParams":{"intro":"phase-three-alt","hasIndividuals":"true","hasGroup":"false","mapping":"random","maxResponses":"10"}}, {"taskName":"Conclusion","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"mturk","hasCode":"false","displayScoreGroup":"false", "digitalReceipt":"false", "sonaId": "547", "payment": "30", "feedback":"true", "feedbackLinkType":"memory"}} From 1121ee30c6ba97279f11d31dcb52826adf1ed1a2 Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 10 Jan 2022 19:21:31 -0500 Subject: [PATCH 099/154] yourslef edit --- app/Http/Controllers/TaskRoomController.php | 2 -- app/Tasks/Memory.php | 25 ++++++++++--------- ...aphy-individual-phasethree-intro.blade.php | 2 +- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/app/Http/Controllers/TaskRoomController.php b/app/Http/Controllers/TaskRoomController.php index 17877e57..bc835179 100644 --- a/app/Http/Controllers/TaskRoomController.php +++ b/app/Http/Controllers/TaskRoomController.php @@ -123,8 +123,6 @@ public function taskRoom(Request $request){ $time_remaining -= $alt_task_length - $alt_intro_length; $time_label = "Time until Main Task begins"; } - - $time_label = "Time remaining for Instructions and Practice Exercise"; } $time_color = "red"; } diff --git a/app/Tasks/Memory.php b/app/Tasks/Memory.php index a494e980..67b882e6 100644 --- a/app/Tasks/Memory.php +++ b/app/Tasks/Memory.php @@ -2551,21 +2551,22 @@ class Memory { ], ['type' => 'words', 'prompt' => 'Remember these target words', - 'targets' => ['garlic', 'wood', 'sugar', 'coal', 'clarinet', - 'trumpet', 'cinnamon', 'flute', 'kerosine', - 'vanilla', 'gasoline', 'violin'] + 'targets' => ['bluebird', 'chisel', 'eagle', 'screwdriver', 'crow', + 'wrench', 'pants', 'nails', 'shoes', + 'canary', 'skirt', 'blouse'], ], ['type' => 'stories', 'prompt' => 'Remember these target stories', - 'targets' => ['Clothing makers in Europe and China have a problem. The shape of the - American male has changed. American men now have slimmer waists and larger chests - than they did in 1933 when the last measurements were taken. Manufacturers will - alter their designs and have promised to update their statistics more frequently.', - 'Michael Simpson earned a reputation for being stubborn after refusing to - accept pay cheques. Instead of cheques, he wanted his wages to be paid in - cash. He eventually collected ten thousand dollars in back pay. His wife - was pleased because she had been forced to cook on a camping stove, after - services to their home were cut off eighteen months ago.'], + 'targets' => ['At 7:35pm on Monday, Joe Garcia of San Francisco was watching television as he + dressed to go out. A weather bulletin interrupted the program to warn of a + thunderstorm. The announcer said the storm could bring hail and up to four + inches of rain. Joe decided to stay home. He took off his coat and sat down + to watch old movies.', + 'A Tokyo barmaid is suing a customer for two hundred and twenty thousand + dollars. The complaint arose after the man attempted a goodnight kiss, + causing the couple to fall down a flight of stairs. The forty six year + old woman suffered facial injuries in the fall but avoided the attempted + kiss.'], ] ], 'choices' => [['color' => 'success', 'type' => 'images'], diff --git a/resources/views/layouts/participants/tasks/cryptography-individual-phasethree-intro.blade.php b/resources/views/layouts/participants/tasks/cryptography-individual-phasethree-intro.blade.php index ae186b35..4abd7779 100644 --- a/resources/views/layouts/participants/tasks/cryptography-individual-phasethree-intro.blade.php +++ b/resources/views/layouts/participants/tasks/cryptography-individual-phasethree-intro.blade.php @@ -79,7 +79,7 @@

You will have a maximum of {{ $maxResponses }} trials and 10 minutes to solve - the cryptography task. Each round has three steps: you're now working BY YOURSLEF, so you are responsible for all three steps: + the cryptography task. Each round has three steps: you're now working BY YOURSELF, so you are responsible for all three steps:

From 0b605d9769e8a8c6ad38fd879ac672354312b5d7 Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 19 Jan 2022 07:38:28 -0500 Subject: [PATCH 100/154] changes to download data --- app/Http/Controllers/AdminController.php | 28 ++++++++++- .../participants/historical-data.blade.php | 47 +++++++++++++++++-- 2 files changed, 69 insertions(+), 6 deletions(-) diff --git a/app/Http/Controllers/AdminController.php b/app/Http/Controllers/AdminController.php index 8905026f..65b09a65 100644 --- a/app/Http/Controllers/AdminController.php +++ b/app/Http/Controllers/AdminController.php @@ -104,7 +104,7 @@ private function getGroups() { public function getUsers() { - $users = \Teamwork\User::where('id', '>', 667) // When we went live with the lab version + $users = \Teamwork\User::where('id', '>', 1) // When we went live with the lab version ->with('group') ->get(); @@ -283,6 +283,26 @@ public function getGroupCSV(Request $request) { } + //RULESETS + $rules = [ + 1=>[1,4], + 2=>[1,7], + 3=>[1,8], + 4=>[1,9], + 5=>[2,10], + 6=>[2,11], + 7=>[2,12], + 8=>[2,15], + 9=>[3,4], + 10=>[3,5], + 11=>[3,6], + 12=>[3,7], + 13=>[4,8], + 14=>[5,9], + 15=>[6,10], + 16=>[7,11] + ]; + $responseData = []; foreach($userData as $data) { foreach($data as $user) { @@ -298,9 +318,11 @@ public function getGroupCSV(Request $request) { #Log::debug($user); $responseData[] = ['user' => $user['user'], 'group' => $user['group'], + 'role' => $user['role'], 'score' => $user['score'], 'task' => $task['name'], 'taskTime' => $task['taskTime'], + 'ruleset' => $rules[$task['ruleset']][0].','.$rules[$task['ruleset']][1], 'prompt' => $response['prompt'], 'response' => $response['response'], 'correct' => $response['correct'], @@ -329,7 +351,7 @@ public function getGroupCSV(Request $request) { $data = $responseData; $callback = function () use ($responseData) { $fileHandle = fopen('php://output', 'w'); - fputcsv($fileHandle,array('user', 'group', 'score', 'task', 'taskTime','prompt', 'response', 'correct', 'points', 'time'),"\t"); + fputcsv($fileHandle,array('user', 'group', 'role','score', 'task', 'taskTime','rules','prompt', 'response', 'correct', 'points', 'time'),"\t"); foreach ($responseData as $row) { fputcsv($fileHandle, $row, "\t"); } @@ -449,6 +471,7 @@ private function collectResponses($users, $groupId) { 'score' => $user->score, 'surveyCode' => $user->survey_code, 'group'=> $groupId, + 'role'=>$user->group_role, 'tasks' => []]; $groupTasks = \Teamwork\GroupTask::with('response') @@ -498,6 +521,7 @@ private function collectResponses($users, $groupId) { 'parameters' => $params, 'taskTime' => $taskTime, 'introTime' => $introTime, + 'ruleset' => $task->task_id, 'responses' => []]; $responses = []; diff --git a/resources/views/layouts/participants/historical-data.blade.php b/resources/views/layouts/participants/historical-data.blade.php index f767ac0d..44531736 100644 --- a/resources/views/layouts/participants/historical-data.blade.php +++ b/resources/views/layouts/participants/historical-data.blade.php @@ -53,6 +53,44 @@ function confirmPayment(){ } +function downloadCSV(){ + items = adminTable.matchingItems; + console.log + items_csv = [['session_id','participant_id','pay','paid','session_time','type','num_subsessions','num_stragglers','total_sessions','group_ids','role','notes']]; + const parser = new DOMParser(); + items.forEach(e => items_csv.push([e['_values']['session_id'],e['_values']['participant_id'],e['_values']['pay'],e['_values']['paid'].includes('checked'),e['_values']['s_time'],e['_values']['type'],e['_values']['num_subsessions'],e['_values']['num_stragglers'],e['_values']['total_sessions'],e['_values']['group_ids'],e['_values']['role'],parser.parseFromString(e['_values']['notes'],'text/html').getElementsByTagName("span")[0].text])); + console.log(items_csv); + + let csvContent = ""; + items_csv.forEach(function(rowArray) { + let row = rowArray.join(","); + csvContent += row + "\r\n"; + }); + + var download = function(content, fileName, mimeType) { + var a = document.createElement('a'); + mimeType = mimeType || 'application/octet-stream'; + + if (navigator.msSaveBlob) { // IE10 + navigator.msSaveBlob(new Blob([content], { + type: mimeType + }), fileName); + } else if (URL && 'download' in a) { //html5 A[download] + a.href = URL.createObjectURL(new Blob([content], { + type: mimeType + })); + a.setAttribute('download', fileName); + document.body.appendChild(a); + a.click(); + document.body.removeChild(a); + } else { + location.href = 'data:application/octet-stream,' + encodeURIComponent(content); // only this mime type is supported + } + } + download(csvContent, 'session_data.csv', 'text/csv;encoding:utf-8'); + +} + var happened = false; $( document ).ready(function() { @@ -95,7 +133,7 @@ function confirmPayment(){ //FILTER TABLE TO REFLECT START-END WINDOW adminTable.filter(function(item){ - session_date = Date.parse(item.values().session); + session_date = Date.parse(item.values().session_time); if (session_date >= start_date && session_date <= end_date){ return true; } @@ -107,7 +145,7 @@ function confirmPayment(){ else{ //FILTER FROM START DATE TO PRESENT adminTable.filter(function(item){ - session_date = Date.parse(item.values().session); + session_date = Date.parse(item.values().session_time); if (session_date >= start_date) return true; else @@ -134,7 +172,7 @@ function confirmPayment(){ start_date = Date.parse($('#start_date').val()); //FILTER FOR WINDOW adminTable.filter(function(item){ - session_date = Date.parse(item.values().session); + session_date = Date.parse(item.values().session_time); if (session_date >= start_date && session_date <= end_date){ return true; } @@ -146,7 +184,7 @@ function confirmPayment(){ else{ //FILTER FROM DAWN OF TIME UNTIL END DATE adminTable.filter(function(item){ - session_date = Date.parse(item.values().session); + session_date = Date.parse(item.values().session_time); if (session_date <= end_date) return true; else @@ -276,6 +314,7 @@ function confirmPayment(){ +


From a443d7d50f28d1df4617df534ab26976e4c0202d Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 19 Jan 2022 07:45:06 -0500 Subject: [PATCH 101/154] changes to download data --- resources/views/layouts/participants/historical-data.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/layouts/participants/historical-data.blade.php b/resources/views/layouts/participants/historical-data.blade.php index 44531736..77384097 100644 --- a/resources/views/layouts/participants/historical-data.blade.php +++ b/resources/views/layouts/participants/historical-data.blade.php @@ -58,7 +58,7 @@ function downloadCSV(){ console.log items_csv = [['session_id','participant_id','pay','paid','session_time','type','num_subsessions','num_stragglers','total_sessions','group_ids','role','notes']]; const parser = new DOMParser(); - items.forEach(e => items_csv.push([e['_values']['session_id'],e['_values']['participant_id'],e['_values']['pay'],e['_values']['paid'].includes('checked'),e['_values']['s_time'],e['_values']['type'],e['_values']['num_subsessions'],e['_values']['num_stragglers'],e['_values']['total_sessions'],e['_values']['group_ids'],e['_values']['role'],parser.parseFromString(e['_values']['notes'],'text/html').getElementsByTagName("span")[0].text])); + items.forEach(e => items_csv.push([e['_values']['session_id'],e['_values']['participant_id'],e['_values']['pay'],e['_values']['paid'].includes('checked'),e['_values']['session_time'],e['_values']['type'],e['_values']['num_subsessions'],e['_values']['num_stragglers'],e['_values']['total_sessions'],e['_values']['group_ids'].replace(',',' '),e['_values']['role'],parser.parseFromString(e['_values']['notes'],'text/html').getElementsByTagName("span")[0].text])); console.log(items_csv); let csvContent = ""; From ee6ba16bda9d7f0b4337a41f8029fb384d2935c0 Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 19 Jan 2022 07:46:49 -0500 Subject: [PATCH 102/154] changes to download data --- resources/views/layouts/participants/historical-data.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/layouts/participants/historical-data.blade.php b/resources/views/layouts/participants/historical-data.blade.php index 77384097..bd0cabd8 100644 --- a/resources/views/layouts/participants/historical-data.blade.php +++ b/resources/views/layouts/participants/historical-data.blade.php @@ -58,7 +58,7 @@ function downloadCSV(){ console.log items_csv = [['session_id','participant_id','pay','paid','session_time','type','num_subsessions','num_stragglers','total_sessions','group_ids','role','notes']]; const parser = new DOMParser(); - items.forEach(e => items_csv.push([e['_values']['session_id'],e['_values']['participant_id'],e['_values']['pay'],e['_values']['paid'].includes('checked'),e['_values']['session_time'],e['_values']['type'],e['_values']['num_subsessions'],e['_values']['num_stragglers'],e['_values']['total_sessions'],e['_values']['group_ids'].replace(',',' '),e['_values']['role'],parser.parseFromString(e['_values']['notes'],'text/html').getElementsByTagName("span")[0].text])); + items.forEach(e => items_csv.push([e['_values']['session_id'],e['_values']['participant_id'],e['_values']['pay'],e['_values']['paid'].includes('checked'),e['_values']['session_time'],e['_values']['type'],e['_values']['num_subsessions'],e['_values']['num_stragglers'],e['_values']['total_sessions'],e['_values']['group_ids'].replace(',',' '),e['_values']['role'],parser.parseFromString(e['_values']['notes'],'text/html').getElementsByTagName("span")[0].text])); console.log(items_csv); let csvContent = ""; From fd3a9ba0da8e230ab55eac00f6d93e27f3c4f3b5 Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 19 Jan 2022 07:48:01 -0500 Subject: [PATCH 103/154] changes to download data --- resources/views/layouts/participants/historical-data.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/layouts/participants/historical-data.blade.php b/resources/views/layouts/participants/historical-data.blade.php index bd0cabd8..6f4b24bc 100644 --- a/resources/views/layouts/participants/historical-data.blade.php +++ b/resources/views/layouts/participants/historical-data.blade.php @@ -58,7 +58,7 @@ function downloadCSV(){ console.log items_csv = [['session_id','participant_id','pay','paid','session_time','type','num_subsessions','num_stragglers','total_sessions','group_ids','role','notes']]; const parser = new DOMParser(); - items.forEach(e => items_csv.push([e['_values']['session_id'],e['_values']['participant_id'],e['_values']['pay'],e['_values']['paid'].includes('checked'),e['_values']['session_time'],e['_values']['type'],e['_values']['num_subsessions'],e['_values']['num_stragglers'],e['_values']['total_sessions'],e['_values']['group_ids'].replace(',',' '),e['_values']['role'],parser.parseFromString(e['_values']['notes'],'text/html').getElementsByTagName("span")[0].text])); + items.forEach(e => items_csv.push([e['_values']['session_id'],e['_values']['participant_id'],e['_values']['pay'],e['_values']['paid'].includes('checked'),e['_values']['session_time'],e['_values']['type'],e['_values']['num_subsessions'],e['_values']['num_stragglers'],e['_values']['total_sessions'],e['_values']['group_ids'].replace(',',' '),parser.parseFromString(e['_values']['notes'],'text/html').getElementsByTagName("span")[0].text])); console.log(items_csv); let csvContent = ""; From 88a2812f6e610ec6c68574dc9783f4f445f325ff Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 19 Jan 2022 07:48:53 -0500 Subject: [PATCH 104/154] changes to download data --- resources/views/layouts/participants/historical-data.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/layouts/participants/historical-data.blade.php b/resources/views/layouts/participants/historical-data.blade.php index 6f4b24bc..6ed808f5 100644 --- a/resources/views/layouts/participants/historical-data.blade.php +++ b/resources/views/layouts/participants/historical-data.blade.php @@ -58,7 +58,7 @@ function downloadCSV(){ console.log items_csv = [['session_id','participant_id','pay','paid','session_time','type','num_subsessions','num_stragglers','total_sessions','group_ids','role','notes']]; const parser = new DOMParser(); - items.forEach(e => items_csv.push([e['_values']['session_id'],e['_values']['participant_id'],e['_values']['pay'],e['_values']['paid'].includes('checked'),e['_values']['session_time'],e['_values']['type'],e['_values']['num_subsessions'],e['_values']['num_stragglers'],e['_values']['total_sessions'],e['_values']['group_ids'].replace(',',' '),parser.parseFromString(e['_values']['notes'],'text/html').getElementsByTagName("span")[0].text])); + items.forEach(e => items_csv.push([e['_values']['session_id'],e['_values']['participant_id'],e['_values']['pay'],e['_values']['paid'].includes('checked'),e['_values']['session_time'],e['_values']['type'],e['_values']['num_subsessions'],e['_values']['num_stragglers'],e['_values']['total_sessions'],e['_values']['group_ids'].replace(',','/'),e['_values']['role'],parser.parseFromString(e['_values']['notes'],'text/html').getElementsByTagName("span")[0].text])); console.log(items_csv); let csvContent = ""; From a1c2fc50713935f24f81a88fac71b48163459e1c Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 19 Jan 2022 07:50:10 -0500 Subject: [PATCH 105/154] changes to download data --- resources/views/layouts/participants/historical-data.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/layouts/participants/historical-data.blade.php b/resources/views/layouts/participants/historical-data.blade.php index 6ed808f5..80098426 100644 --- a/resources/views/layouts/participants/historical-data.blade.php +++ b/resources/views/layouts/participants/historical-data.blade.php @@ -58,7 +58,7 @@ function downloadCSV(){ console.log items_csv = [['session_id','participant_id','pay','paid','session_time','type','num_subsessions','num_stragglers','total_sessions','group_ids','role','notes']]; const parser = new DOMParser(); - items.forEach(e => items_csv.push([e['_values']['session_id'],e['_values']['participant_id'],e['_values']['pay'],e['_values']['paid'].includes('checked'),e['_values']['session_time'],e['_values']['type'],e['_values']['num_subsessions'],e['_values']['num_stragglers'],e['_values']['total_sessions'],e['_values']['group_ids'].replace(',','/'),e['_values']['role'],parser.parseFromString(e['_values']['notes'],'text/html').getElementsByTagName("span")[0].text])); + items.forEach(e => items_csv.push([e['_values']['session_id'],e['_values']['participant_id'],e['_values']['pay'],e['_values']['paid'].includes('checked'),e['_values']['session_time'],e['_values']['type'],e['_values']['num_subsessions'],e['_values']['num_stragglers'],e['_values']['total_sessions'],e['_values']['group_ids'].replaceAll(',','/'),e['_values']['role'],parser.parseFromString(e['_values']['notes'],'text/html').getElementsByTagName("span")[0].text])); console.log(items_csv); let csvContent = ""; From c8ce05c6d39d6815dd96053d10bdd411082ff705 Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 19 Jan 2022 07:50:40 -0500 Subject: [PATCH 106/154] changes to download data --- resources/views/layouts/participants/historical-data.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/layouts/participants/historical-data.blade.php b/resources/views/layouts/participants/historical-data.blade.php index 80098426..6c92ae31 100644 --- a/resources/views/layouts/participants/historical-data.blade.php +++ b/resources/views/layouts/participants/historical-data.blade.php @@ -58,7 +58,7 @@ function downloadCSV(){ console.log items_csv = [['session_id','participant_id','pay','paid','session_time','type','num_subsessions','num_stragglers','total_sessions','group_ids','role','notes']]; const parser = new DOMParser(); - items.forEach(e => items_csv.push([e['_values']['session_id'],e['_values']['participant_id'],e['_values']['pay'],e['_values']['paid'].includes('checked'),e['_values']['session_time'],e['_values']['type'],e['_values']['num_subsessions'],e['_values']['num_stragglers'],e['_values']['total_sessions'],e['_values']['group_ids'].replaceAll(',','/'),e['_values']['role'],parser.parseFromString(e['_values']['notes'],'text/html').getElementsByTagName("span")[0].text])); + items.forEach(e => items_csv.push([e['_values']['session_id'],e['_values']['participant_id'],e['_values']['pay'],e['_values']['paid'].includes('checked'),e['_values']['session_time'],e['_values']['type'],e['_values']['num_subsessions'],e['_values']['num_stragglers'],e['_values']['total_sessions'],e['_values']['group_ids'].replaceAll(',',' '),e['_values']['role'],parser.parseFromString(e['_values']['notes'],'text/html').getElementsByTagName("span")[0].text])); console.log(items_csv); let csvContent = ""; From 55090c9a3745b416f49498a99e9e1a2192ce4d57 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 3 Feb 2022 07:52:01 -0500 Subject: [PATCH 107/154] added rules to individual etc --- app/GroupTask.php | 40 +++++- .../Controllers/IndividualTaskController.php | 44 +++++- app/Http/Controllers/LoginController.php | 4 + app/Jobs/AssignGroups.php | 4 +- app/Jobs/SendIntroComplete.php | 2 + public/js/cryptography-individual.js | 135 +++++++++++++++++- .../layouts/participants/admin-page.blade.php | 10 +- .../tasks/cryptography-group.blade.php | 16 ++- .../tasks/cryptography-individual.blade.php | 62 +++++++- 9 files changed, 295 insertions(+), 22 deletions(-) diff --git a/app/GroupTask.php b/app/GroupTask.php index 83613911..540f3710 100644 --- a/app/GroupTask.php +++ b/app/GroupTask.php @@ -243,6 +243,40 @@ public static function initializeCryptoTasks($group_id, $randomize,$final,$first return Self::initializeTasks($group_id, $taskArray, $randomize); } + //CALLED DURING THE ASSIGNGROUPS JOB TO CREATE SUBSESSION + public static function initializeCryptoWithIndividualTasks($group_id, $randomize,$final,$first) { + if($first && $final){ + $taskArray = '[ + {"taskName":"Cryptography","taskParams":{"intro":"combined_pilot","hasIndividuals":"true","hasGroup":"false","mapping":"random","maxResponses":"10"}}, + {"taskName":"Conclusion","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"mturk","hasCode":"false","displayScoreGroup":"false", "digitalReceipt":"false", "sonaId": "547", "payment": "30", "feedback":"true", "feedbackLinkType":"qualtrics"}} + ]'; + } + elseif($first){ + $taskArray = '[ + {"taskName":"Cryptography","taskParams":{"hasIndividuals":"false","intro":"group_1","hasGroup":"true","mapping":"random","maxResponses":"10","type":"intro"}}, + {"taskName":"Cryptography","taskParams":{"hasIndividuals":"false","intro":"group_1","hasGroup":"true","mapping":"random","maxResponses":"10","type":"task"}}, + {"taskName":"GroupSurvey","taskParams":{"hasIndividuals":"false","hasGroup":"true","type":"1","statementOrder":"ordered","task_name":"Cryptography"}}, + {"taskName":"WaitingRoom","taskParams":{"hasIndividuals":"false","hasGroup":"true","task":"1"}} + ]'; + } + elseif($final){ + $taskArray = '[ + {"taskName":"Cryptography","taskParams":{"intro":"combined_pilot","hasIndividuals":"true","hasGroup":"false","mapping":"random","maxResponses":"10"}}, + {"taskName":"Conclusion","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"mturk","hasCode":"false","displayScoreGroup":"false", "digitalReceipt":"false", "sonaId": "547", "payment": "30", "feedback":"true", "feedbackLinkType":"qualtrics"}} + ]'; + } + else{ + $taskArray = '[ + {"taskName":"Cryptography","taskParams":{"hasIndividuals":"false","intro":"not_first","hasGroup":"true","mapping":"random","maxResponses":"10","type":"intro"}}, + {"taskName":"Cryptography","taskParams":{"hasIndividuals":"false","intro":"group_1","hasGroup":"true","mapping":"random","maxResponses":"10","type":"task"}}, + {"taskName":"GroupSurvey","taskParams":{"hasIndividuals":"false","hasGroup":"true","type":"1","statementOrder":"ordered","task_name":"Cryptography"}}, + {"taskName":"WaitingRoom","taskParams":{"hasIndividuals":"false","hasGroup":"true","task":"1"}} + ]'; + } + + return Self::initializeTasks($group_id, $taskArray, $randomize); + } + public static function initializeMemoryTasks($group_id, $randomize,$final,$test) { if($final){ $taskArray = '[ @@ -276,11 +310,7 @@ public static function initializeMemoryTasks($group_id, $randomize,$final,$test) #TASK LIST FOR CRYPTO MTURK TEST public static function initializeCryptoMturkTasks($group_id, $randomize) { $taskArray = '[ - {"taskName":"Intro","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"chat_notification"}}, - {"taskName":"Intro","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"adblock"}}, - {"taskName":"DeviceCheck","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"eligibility"}}, - {"taskName":"Intro","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"mturk_test"}}, - {"taskName":"WaitingRoom","taskParams":{"hasIndividuals":"false","hasGroup":"true","task":"1"}} + {"taskName":"Cryptography","taskParams":{"intro":"default","hasIndividuals":"true","hasGroup":"false","mapping":"random","maxResponses":"10"}} ]'; diff --git a/app/Http/Controllers/IndividualTaskController.php b/app/Http/Controllers/IndividualTaskController.php index a9584fef..faa1aa2f 100644 --- a/app/Http/Controllers/IndividualTaskController.php +++ b/app/Http/Controllers/IndividualTaskController.php @@ -1295,7 +1295,7 @@ public function cryptographyIntro(Request $request) { elseif($parameters->intro == 'phase-three-alt') $duration = 60; else - $duration = 240; + $duration = 60; if($time){ $time_remaining = $duration - \Carbon\Carbon::parse($time->start_time)->diffInSeconds(\Carbon\Carbon::now()); Log::debug($time); @@ -1413,8 +1413,50 @@ public function cryptography(Request $request) { $time_remaining = 600; } + + $rules = [ + 1=>[0,1,4], + 2=>[0,1,7], + 3=>[0,1,8], + 4=>[0,1,9], + 5=>[0,2,10], + 6=>[0,2,11], + 7=>[0,2,12], + 8=>[0,2,15], + 9=>[0,3,4], + 10=>[0,3,5], + 11=>[0,3,6], + 12=>[0,3,7], + 13=>[0,4,8], + 14=>[0,5,9], + 15=>[0,6,10], + 16=>[0,7,11] + ]; + + $rule_desc = [ + 'No equation may contain all 10 letters', + 'The first equation must not contain more than 4 letters', + 'The first equation must contain at least 3 letters', + 'The first equation must contain a minus sign', + 'The second equation must contain the letter F', + 'The second equation must contain the letter G', + 'The second equation must contain the letter H', + 'The second equation must contain the letter I', + 'The third equation must NOT contain the letter A', + 'The third equation must NOT contain the letter B', + 'The third equation must NOT contain the letter C', + 'The third equation must NOT contain the letter D', + 'The fourth equation must contain a minus sign', + 'The fourth equation must NOT contain a minus sign', + 'The fifth equation must contain a minus sign', + 'The fifth equation must NOT contain a minus sign', + ]; + + return view('layouts.participants.tasks.cryptography-individual') ->with('user',$user) + ->with('rules',$rules[$currentTask->task_id]) + ->with('rule_desc',$rule_desc) ->with('task_id',$currentTask->task_id) ->with('mapping',json_encode($mapping)) ->with('sorted', $sorted) diff --git a/app/Http/Controllers/LoginController.php b/app/Http/Controllers/LoginController.php index 320551fa..f6f79920 100644 --- a/app/Http/Controllers/LoginController.php +++ b/app/Http/Controllers/LoginController.php @@ -241,6 +241,10 @@ public function postParticipantLogin(Request $request) { \Teamwork\GroupTask::initializePhaseTwoTasks(\Auth::user()->group_id, $randomize = false); return redirect('/get-individual-task'); } + elseif($request->task_package == 'phase-two-alt'){ + \Teamwork\GroupTask::initializeCryptoWithIndividualTasks(\Auth::user()->group_id, $randomize = false); + return redirect('/get-individual-task'); + } elseif($request->task_package == 'phase-three'){ \Teamwork\GroupTask::initializePhaseThreeTasks(\Auth::user()->group_id, $randomize = false); return redirect('/get-individual-task'); diff --git a/app/Jobs/AssignGroups.php b/app/Jobs/AssignGroups.php index 5d740646..4ac6b6df 100644 --- a/app/Jobs/AssignGroups.php +++ b/app/Jobs/AssignGroups.php @@ -239,8 +239,8 @@ public function handle() $task_name = "Memory"; } else{ - \Teamwork\GroupTask::initializeEmptyTasks($group->id,$randomize=false,$final=$admin->current_session == $admin->max_sessions); - $task_name = "EmptyTask"; + \Teamwork\GroupTask::initializeCryptoWithIndividualTasks($group->id,$randomize=false,$final=$admin->current_session == $admin->max_sessions,$first=$admin->current_session == 1); + $task_name = "Cryptography"; } //LINK GROUP TO TASK_ID, AKA SET OF RULES diff --git a/app/Jobs/SendIntroComplete.php b/app/Jobs/SendIntroComplete.php index 2fccd075..4755d770 100644 --- a/app/Jobs/SendIntroComplete.php +++ b/app/Jobs/SendIntroComplete.php @@ -45,6 +45,8 @@ public function handle() $name = "Cryptography"; if($admin->waiting == 2) $name = "Memory"; + if($admin->waiting == 3) + $name = "Cryptography"; $group_task = GroupTask::where('group_id',$this_user->group_id)->where('name',$name)->where('order',1)->first(); if(!is_null($group_task)){ $group_task->completed = 1; diff --git a/public/js/cryptography-individual.js b/public/js/cryptography-individual.js index cbf44ef0..033ffc1c 100644 --- a/public/js/cryptography-individual.js +++ b/public/js/cryptography-individual.js @@ -1,9 +1,10 @@ var Cryptography = class Cryptography { - constructor(mapping) { + constructor(mapping,ruleset) { this.mapping = mapping; this.operators = ['-', '+']; this.allowedChars = mapping.concat(this.operators); + this.ruleset = ruleset; } getMapping() { @@ -14,12 +15,140 @@ var Cryptography = class Cryptography { return this.allowedChars; } - parseEquation(eq) { + parseEquation(eq,round) { + console.log('parsing'); + var sym_count = { + 'A':0, + 'B':0, + 'C':0, + 'D':0, + 'E':0, + 'F':0, + 'G':0, + 'H':0, + 'I':0, + 'J':0, + '-':0, + '+':0 + } eq = eq.replace(/\s+/g, ''); eq = eq.toUpperCase(); eq = eq.trim(); var arr = eq.split(''); + var rule_broken = 0; + console.log(this.ruleset); + arr.forEach(function(value,i) { + console.log(value,i); + if(value in sym_count){ + sym_count[value.toString()] += 1; + } + }); + + this.ruleset.forEach(function(rule,i){ + console.log('checking rule '+rule.toString()); + console.log(' round:'+round.toString()); + console.log(rule_broken); + switch(rule){ + case 0: + + console.log(sym_count['A'] > 0 && sym_count['B'] > 0 && sym_count['C'] > 0 && sym_count['D'] > 0 && sym_count['E'] > 0 && sym_count['F'] > 0 && sym_count['G'] > 0 && sym_count['H'] > 0 && sym_count['I'] > 0 && sym_count['J'] > 0); + console.log(sym_count); + if(sym_count['A'] > 0 && sym_count['B'] > 0 && sym_count['C'] > 0 && sym_count['D'] > 0 && sym_count['E'] > 0 && sym_count['F'] > 0 && sym_count['G'] > 0 && sym_count['H'] > 0 && sym_count['I'] > 0 && sym_count['J'] > 0){ + console.log(rule+' broken'); + rule_broken += 1; + } + break; + case 1: + console.log(sym_count['A']+sym_count['B']+sym_count['C']+sym_count['D']+sym_count['E']+sym_count['F']+sym_count['G']+sym_count['H']+sym_count['I']+sym_count['J']) + console.log(round); + if(sym_count['A']+sym_count['B']+sym_count['C']+sym_count['D']+sym_count['E']+sym_count['F']+sym_count['G']+sym_count['H']+sym_count['I']+sym_count['J'] > 4 && round == 1){ + console.log(rule+' broken'); + rule_broken += 1;} + break; + case 2: + console.log(sym_count['A']+sym_count['B']+sym_count['C']+sym_count['D']+sym_count['E']+sym_count['F']+sym_count['G']+sym_count['H']+sym_count['I']+sym_count['J']) + console.log(round); + if(sym_count['A']+sym_count['B']+sym_count['C']+sym_count['D']+sym_count['E']+sym_count['F']+sym_count['G']+sym_count['H']+sym_count['I']+sym_count['J'] < 3 && round == 1){ + console.log(rule+' broken'); + rule_broken += 1;} + break; + case 3: + console.log(sym_count['-']); + if (sym_count['-'] == 0 && round == 1){ + console.log(rule+' broken'); + rule_broken += 1;} + break; + case 4: + console.log(sym_count['F']); + if (sym_count['F'] == 0 && round == 2){{ + console.log(rule+' broken'); + rule_broken += 1;}} + break; + case 5: + console.log(sym_count['G']); + if (sym_count['G'] == 0 && round == 2){ + console.log(rule+' broken'); + rule_broken += 1;} + break; + case 6: + console.log(sym_count['H']); + if (sym_count['H'] == 0 && round == 2){ + console.log(rule+' broken'); + rule_broken += 1;} + break; + case 7: + console.log(sym_count['I']); + if (sym_count['I'] == 0 && round == 2){ + console.log(rule+' broken'); + rule_broken += 1;} + break; + case 8: + console.log(sym_count['A']); + if (sym_count['A'] > 0 && round == 3){ + console.log(rule+' broken'); + rule_broken += 1;} + break; + case 9: + if (sym_count['B'] > 0 && round == 3){ + console.log(rule+' broken'); + rule_broken += 1;} + break; + case 10: + if (sym_count['C'] > 0 && round == 3){ + console.log(rule+' broken'); + rule_broken += 1;} + break; + case 11: + if (sym_count['D'] > 0 && round == 3){ + console.log(rule+' broken'); + rule_broken += 1;} + break; + case 12: + if (sym_count['-'] == 0 && round == 4){ + console.log(rule+' broken'); + rule_broken += 1;} + break; + case 13: + if (sym_count['-'] > 0 && round == 4){ + console.log(rule+' broken'); + rule_broken += 1;} + break; + case 14: + if (sym_count['-'] == 0 && round == 5){ + console.log(rule+' broken'); + rule_broken += 1;} + break; + case 15: + if (sym_count['-'] > 0 && round == 5){ + console.log(rule+' broken'); + rule_broken += 1;} + break; + default: + break; + } + }); + function parse(eq, allowedChars, mapping) { for(var i = 0; i < eq.length; i++) { @@ -60,7 +189,7 @@ var Cryptography = class Cryptography { n = parseInt(n / 10); } - return sign + answer; + return [sign + answer,rule_broken]; } diff --git a/resources/views/layouts/participants/admin-page.blade.php b/resources/views/layouts/participants/admin-page.blade.php index b72eb95b..41440984 100644 --- a/resources/views/layouts/participants/admin-page.blade.php +++ b/resources/views/layouts/participants/admin-page.blade.php @@ -267,7 +267,7 @@ function convertTZ(date) { channel.bind('player-joined-room', function(data) { //REMOVE FROM TABLE (JUST IN CASE, SO NO DUPLICATES) adminTable.remove('participant_id',data['user']['participant_id']); - //RE-ADD + //RE-ADD adminTable.add({ participant_id:data['user']['participant_id'], group_id:'WaitingRoom', @@ -477,9 +477,15 @@ function convertTZ(date) { @if($admin->waiting == 1) - @else + + @elseif($admin->waiting == 2) + + @else + + + @endif

diff --git a/resources/views/layouts/participants/tasks/cryptography-group.blade.php b/resources/views/layouts/participants/tasks/cryptography-group.blade.php index c90b2303..746e5bb1 100644 --- a/resources/views/layouts/participants/tasks/cryptography-group.blade.php +++ b/resources/views/layouts/participants/tasks/cryptography-group.blade.php @@ -30,7 +30,7 @@ var equations = []; var hypotheses = []; var mapping_guess = ''; -var payment = 5.00; +var payment = 8.00; var guesses = []; var page = 1; var tm; @@ -322,14 +322,15 @@ function clear_timer(){ channel.bind('task-complete', function(data){ if(data['user']['id'].toString() == '{{ $user->id }}'){ - $("#task-result").val(1); + //$("#task-result").val(1); $("#crypto-header").hide(); $("#crypto-ui").hide(); - $("#task-end").show(); - setTimeout(function(){ - $("#cryptography-end-form").submit() - },5000); + $("crypto_content").html("

") + //$("#task-end").show(); + //setTimeout(function(){ + //$("#cryptography-end-form").submit() + //},5000); } }); @@ -507,6 +508,7 @@ function clear_timer(){ if(result) { $("#task-result").val(1); $('#bonus_amt').val(payment); + $('#crypto-ui').html("

Congratulations! You've correctly identified all the letters and solved the puzzle. As a quick reminder, as the leader your payment depends not only on solving the puzzle, but also on whether you broke any rules and how many rounds you took.
You'll soon be sent to a short survey to review your group. Congrats again!

"); $.post('/task-complete', {_token: "{{ csrf_token() }}"}); } @@ -557,7 +559,7 @@ function clear_timer(){
-
+
@if ($user->group_role == "leader")
diff --git a/resources/views/layouts/participants/tasks/cryptography-individual.blade.php b/resources/views/layouts/participants/tasks/cryptography-individual.blade.php index 37b2beff..e6672de1 100644 --- a/resources/views/layouts/participants/tasks/cryptography-individual.blade.php +++ b/resources/views/layouts/participants/tasks/cryptography-individual.blade.php @@ -30,6 +30,8 @@ $( document ).ready(function() { time_remaining = parseInt('{{ $time_remaining }}'); + rules = {!! json_encode($rules) !!}; + console.log(rules); responses = $('
').html('{{ $responses }}')[0].textContent; responses = JSON.parse(responses); @@ -52,6 +54,7 @@ //mapping_guess = JSON.parse(mapping_guess); console.log(mapping_guess); trials++; + payment -= 0.50; } if(responses[i]['prompt'].includes('Propose Hypothesis')){ trialStage = 3; @@ -62,7 +65,12 @@ $("#answers").append('
' + responses[i]['response'].replace('=',' = ') + '
'); //equations.push(response[i]['response']); } + //IF RULE BROKEN RESPONSE + if(responses[i]['prompt'].includes('Rule Broken')){ + payment -= 2.00; + } } + $('#payment').text(payment > 0 ? payment.toFixed(2) : "0.00"); $("#trial-counter").html(trials); @@ -91,7 +99,7 @@ $('#hypothesis').slideUp(); } - var crypto = new Cryptography(mapping); + var crypto = new Cryptography(mapping,rules); initializeTimer(time_remaining, function() { @@ -137,13 +145,25 @@ try { - var answer = crypto.parseEquation(equation); + var res = crypto.parseEquation(equation,trials); + var answer = res[0] $("#answers").append('
' + equation + ' = ' + answer + '
'); $("#equation").val(''); $('#hypothesis-left option:eq(0)').prop('selected', true); $('#hypothesis-right option:eq(0)').prop('selected', true); $("#hypothesis").slideDown(); $("#propose-equation").slideUp(); + var rule_broken = res[1]; + console.log('TURDS'); + console.log(rule_broken); + if(rule_broken > 0){ + $('#rule_break_num').text(rule_broken.toString()); + $('#penalty_amt').text((2*rule_broken).toString()); + $("#rule_broken").modal('toggle'); + //UPDATE PAYMENT + sub_amount = 2.00 * rule_broken; + $('#payment').text((((parseFloat($('#payment').text()) - sub_amount) > 0.00) ? (parseFloat($('#payment').text()) - sub_amount) : 0.00).toFixed(2)); + } $.post("/cryptography", { _token: "{{ csrf_token() }}", @@ -200,6 +220,8 @@ mapping: JSON.stringify(mapping), guess: guessStr } ); + payment -= 0.50; + $('#payment').text((((parseFloat($('#payment').text()) - 0.50) > 0.00) ? (parseFloat($('#payment').text()) - 0.50) : 0.00).toFixed(2)); if(result) { $("#crypto-header").hide(); @@ -246,6 +268,11 @@ Cryptography Task
+
+
+ Payment: $8.00 +
+
@@ -262,6 +289,18 @@
+
+
+

Rules

+
    + @foreach($rules as $key => $el) +
  1. +
    {{ $rule_desc[$el] }}
    +
  2. + + @endforeach +
+
@@ -304,6 +343,7 @@ @endforeach
+
@@ -466,4 +506,22 @@
+ + @stop \ No newline at end of file From 30370589565224bd1f20e40832787e2266c6d522 Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 8 Feb 2022 07:53:58 -0500 Subject: [PATCH 108/154] git --- app/GroupTask.php | 8 +++- .../Controllers/IndividualTaskController.php | 5 --- .../tasks/cryptography-group.blade.php | 6 +-- ...aphy-individual-phasethree-intro.blade.php | 40 ++++++++++++++++++- .../tasks/cryptography-individual.blade.php | 35 ++++++++-------- 5 files changed, 64 insertions(+), 30 deletions(-) diff --git a/app/GroupTask.php b/app/GroupTask.php index 540f3710..ff8e4de9 100644 --- a/app/GroupTask.php +++ b/app/GroupTask.php @@ -247,7 +247,9 @@ public static function initializeCryptoTasks($group_id, $randomize,$final,$first public static function initializeCryptoWithIndividualTasks($group_id, $randomize,$final,$first) { if($first && $final){ $taskArray = '[ - {"taskName":"Cryptography","taskParams":{"intro":"combined_pilot","hasIndividuals":"true","hasGroup":"false","mapping":"random","maxResponses":"10"}}, + {"taskName":"Cryptography","taskParams":{"hasIndividuals":"false","intro":"group_1","hasGroup":"true","mapping":"random","maxResponses":"10","type":"intro"}}, + {"taskName":"Cryptography","taskParams":{"hasIndividuals":"false","intro":"group_1","hasGroup":"true","mapping":"random","maxResponses":"10","type":"task"}}, + {"taskName":"Cryptography","taskParams":{"intro":"phase-three-alt","hasIndividuals":"true","hasGroup":"false","mapping":"random","maxResponses":"10"}}, {"taskName":"Conclusion","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"mturk","hasCode":"false","displayScoreGroup":"false", "digitalReceipt":"false", "sonaId": "547", "payment": "30", "feedback":"true", "feedbackLinkType":"qualtrics"}} ]'; } @@ -261,7 +263,9 @@ public static function initializeCryptoWithIndividualTasks($group_id, $randomize } elseif($final){ $taskArray = '[ - {"taskName":"Cryptography","taskParams":{"intro":"combined_pilot","hasIndividuals":"true","hasGroup":"false","mapping":"random","maxResponses":"10"}}, + {"taskName":"Cryptography","taskParams":{"hasIndividuals":"false","intro":"group_1","hasGroup":"true","mapping":"random","maxResponses":"10","type":"intro"}}, + {"taskName":"Cryptography","taskParams":{"hasIndividuals":"false","intro":"group_1","hasGroup":"true","mapping":"random","maxResponses":"10","type":"task"}}, + {"taskName":"Cryptography","taskParams":{"intro":"phase-three-alt","hasIndividuals":"true","hasGroup":"false","mapping":"random","maxResponses":"10"}}, {"taskName":"Conclusion","taskParams":{"hasIndividuals":"true","hasGroup":"false","type":"mturk","hasCode":"false","displayScoreGroup":"false", "digitalReceipt":"false", "sonaId": "547", "payment": "30", "feedback":"true", "feedbackLinkType":"qualtrics"}} ]'; } diff --git a/app/Http/Controllers/IndividualTaskController.php b/app/Http/Controllers/IndividualTaskController.php index faa1aa2f..f2d68fc3 100644 --- a/app/Http/Controllers/IndividualTaskController.php +++ b/app/Http/Controllers/IndividualTaskController.php @@ -890,11 +890,6 @@ public function studyConclusion(Request $request) { $code = $conclusion->getConfirmationCode(\Auth::user()->id)->code; else $code = null; - if(\Auth::user()->survey_code){ - $url = 'https://harvarddecisionlab.sona-systems.com/services/SonaAPI.svc/WebstudyCredit?experiment_id=549&credit_token=0d9329ec68f446afa677b3dff496e3db&survey_code='.\Auth::user()->survey_code; - file_get_contents($url); - } - return view('layouts.participants.participant-study-conclusion') ->with('conclusionContent', $conclusionContent) diff --git a/resources/views/layouts/participants/tasks/cryptography-group.blade.php b/resources/views/layouts/participants/tasks/cryptography-group.blade.php index 746e5bb1..21cc05d0 100644 --- a/resources/views/layouts/participants/tasks/cryptography-group.blade.php +++ b/resources/views/layouts/participants/tasks/cryptography-group.blade.php @@ -324,9 +324,9 @@ function clear_timer(){ if(data['user']['id'].toString() == '{{ $user->id }}'){ //$("#task-result").val(1); - $("#crypto-header").hide(); - $("#crypto-ui").hide(); - $("crypto_content").html("

") + //$("#crypto-header").hide(); + //$("#crypto-ui").hide(); + //$("crypto_content").html("

") //$("#task-end").show(); //setTimeout(function(){ //$("#cryptography-end-form").submit() diff --git a/resources/views/layouts/participants/tasks/cryptography-individual-phasethree-intro.blade.php b/resources/views/layouts/participants/tasks/cryptography-individual-phasethree-intro.blade.php index 4abd7779..edef4133 100644 --- a/resources/views/layouts/participants/tasks/cryptography-individual-phasethree-intro.blade.php +++ b/resources/views/layouts/participants/tasks/cryptography-individual-phasethree-intro.blade.php @@ -24,7 +24,7 @@ $("#next").on('click', function(event) { page_count += 1; $(window).scrollTop(0); - if(page_count == 2){ + if(page_count == 6){ $('#next').attr('disabled',true); } }); @@ -73,9 +73,10 @@ Best of luck!

+

- To review: + To Review

You will have a maximum of {{ $maxResponses }} trials and 10 minutes to solve @@ -90,6 +91,41 @@

+
+
+

+ Equation Rules +

+

+ Each time you solve the cryptography puzzle there will be a different set of rules about the equations you can enter. +

+

+ An example rule is: "the 2nd equation has to contain the letter F". In this case, if the 2nd equation you enter is "G+H", you will have broken the rule, because you did not include the letter F. +

+

+ If you break a rule, you lose $3.00 +

+
+
+

+ Rules only apply to the part of the equation you enter. +

+

+ Consider the following rule: "the 1st equation must not contain the letter A". If you enter "B+D", you will NOT have broken the rule, even if the answer to the equation is "B+D=A". +

+

+ To repeat: rules only apply to the part of the equation that you enter. +

+
+
+

+ note that some rules apply to multiple equations. +

+

+ For example, you may see a rule that "all equations must contain at least 2 different letters". If you enter an equation such as "G+G" (an equation which does not includes 2 different letters) you would have broken this rule. The rule applies to all equations! +

+
+

The overall goal is to solve the whole puzzle IN THE SMALLEST NUMBER OF ROUNDS.
If you don’t solve the task, you will get some points for diff --git a/resources/views/layouts/participants/tasks/cryptography-individual.blade.php b/resources/views/layouts/participants/tasks/cryptography-individual.blade.php index e6672de1..21dd688d 100644 --- a/resources/views/layouts/participants/tasks/cryptography-individual.blade.php +++ b/resources/views/layouts/participants/tasks/cryptography-individual.blade.php @@ -264,12 +264,12 @@

-

+

Cryptography Task

-
+
Payment: $8.00
@@ -278,9 +278,18 @@
Round 1 of {{ $maxResponses }}
+
+

Rules about equations you enter

+
    + @foreach($rules as $key => $el) +
  1. +
    {{ $rule_desc[$el] }}
    +
  2. -
    -

    + @endforeach +
+
+

Enter an equation

Enter the left-hand side of an equation, using letters, addition and subtraction: e.g. “A+B”. Please only use the letters A-J plus '+' and '-'. @@ -290,17 +299,6 @@

-
-

Rules

-
    - @foreach($rules as $key => $el) -
  1. -
    {{ $rule_desc[$el] }}
    -
  2. - - @endforeach -
-
@@ -348,9 +346,7 @@
-
- -
+
@@ -379,6 +375,9 @@ I = --- J = ---
+
+ +
@endif
From 870cf5ad49129c8c6451f72c1285138b53e746c9 Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 8 Feb 2022 08:02:39 -0500 Subject: [PATCH 109/154] git --- .../participants/tasks/cryptography-individual.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/layouts/participants/tasks/cryptography-individual.blade.php b/resources/views/layouts/participants/tasks/cryptography-individual.blade.php index 21dd688d..ce0859c6 100644 --- a/resources/views/layouts/participants/tasks/cryptography-individual.blade.php +++ b/resources/views/layouts/participants/tasks/cryptography-individual.blade.php @@ -511,7 +511,7 @@