def pct_max_weekly_submissions(quiz_df, quiz_meta_df):
    """
    Helper function to compute student weekly submissions as a percentage of max # of submissions, and as a percentage of the highest number of student submissions that week.
    :param quiz_df: pd.DataFrame of quiz submission data.
    :param quiz_meta_df: pd.DataFrame of quiz metadata.
    :return: df_out; pd.DataFrame with session_user_id, assignment_week, total_user_submissions_week, and weekly_pct_max_submissions
    """
    # submissions as percentage of maximum instructor-allowed submissions that week
    max_submission_df = quiz_meta_df.groupby('assignment_week')['maximum_submissions'].agg('sum').rename('max_allowed_submissions_week').reset_index()
    total_submission_df = quiz_df[['session_user_id', 'assignment_week']].groupby(['session_user_id', 'assignment_week']).size().rename('total_user_submissions_week').reset_index()
    df_out = total_submission_df.merge(max_submission_df)
    df_out['weekly_pct_max_allowed_submissions'] = df_out['total_user_submissions_week']/df_out['max_allowed_submissions_week']
    df_out.drop('max_allowed_submissions_week', axis = 1, inplace = True)
    # submissions as a percentage of maximum/highest number of student submissions that week
    max_student_submission_df = df_out.groupby('assignment_week')['total_user_submissions_week'].agg('max').rename('max_student_submissions_week').reset_index()
    df_out = df_out.merge(max_student_submission_df)
    df_out['weekly_pct_max_student_submissions'] = df_out['total_user_submissions_week']/df_out['max_student_submissions_week']
    df_out.drop('max_student_submissions_week', axis = 1, inplace = True)
    return df_out