def initialize_subtask_info(entry, action_name, total_num, subtask_id_list):
 task_progress = {'action_name': action_name, 'attempted': 0, 'failed': 0, 'skipped': 0, 'succeeded': 0, 'total': total_num, 'duration_ms': int(0), 'start_time': time()}
 entry.task_output = InstructorTask.create_output_for_success(task_progress)
 entry.task_state = PROGRESS
 num_subtasks = len(subtask_id_list)
 subtask_status = {subtask_id: SubtaskStatus.create(subtask_id).to_dict() for subtask_id in subtask_id_list}
 subtask_dict = {'total': num_subtasks, 'succeeded': 0, 'failed': 0, 'status': subtask_status}
 entry.subtasks = json.dumps(subtask_dict)
 entry.save_now()
 return task_progress

def initialize_subtask_info ( entry , action_name , total_num , subtask_id_list ) : task_progress = { 'action_name' : action_name , 'attempted' : 0 , 'failed' : 0 , 'skipped' : 0 , 'succeeded' : 0 , 'total' : total_num , 'duration_ms' : int ( 0 ) , 'start_time' : time ( ) } entry . task_output = InstructorTask . create_output_for_success ( task_progress ) entry . task_state = PROGRESS num_subtasks = len ( subtask_id_list ) subtask_status = { subtask_id : SubtaskStatus . create ( subtask_id ) . to_dict ( ) for subtask_id in subtask_id_list } subtask_dict = { 'total' : num_subtasks , 'succeeded' : 0 , 'failed' : 0 , 'status' : subtask_status } entry . subtasks = json . dumps ( subtask_dict ) entry . save_now ( ) return task_progress
store initial subtask information to instructortask object .