src/schoology-extractor/data_generation/assignments.py
def generate_extra_assignments_without_enrollments(
    request_client: RequestClient, sections: List[Dict]
) -> Dict[str, List[Dict]]:
    """
    Generate assignments without any enrollments, with random content size.
    One per section. Adjust as needed.

    Parameters
    ----------
    assignments_per_section : int
        The number of assignments per section to generate.
    sections: List[Dict]
        A list of JSON-like section objects from a bulk create response    Returns
    -------
    Dict[str, List[Dict]]
        A Dict of mappings from Schoology section id to a list of JSON-like assignment objects
        in a form suitable for submission to the Schoology assignment create endpoint.
    """

    logging.info("Generating extra assignment per section")

    result: Dict[str, List[Dict]] = {}
    for s in sections:
        section_id = str(s["id"])
        result[section_id] = list()

        for i in range(1):
            assignment = {
                "title": fake.catch_phrase(),
                "description": fake.paragraph(
                    variable_nb_sentences=True, nb_sentences=40
                ),
                "due": datetime.strftime(fake.future_datetime(), "%Y-%m-%d %H:%M:%S"),
                "type": "assignment",
                "assignees": list(),
            }
            result[section_id] += load_assignments(
                request_client, section_id, [assignment]
            )

    return result

    Generate assignments without any enrollments, with random content size.
    One per section. Adjust as needed.

    Parameters
    ----------
    assignments_per_section : int
        The number of assignments per section to generate.
    sections: List[Dict]
        A list of JSON-like section objects from a bulk create response    Returns
    -------
    Dict[str, List[Dict]]
        A Dict of mappings from Schoology section id to a list of JSON-like assignment objects
        in a form suitable for submission to the Schoology assignment create endpoint.
    
Generate assignments without any enrollments, with random content size.
One per section. Adjust as needed.

Parameters

assignments_per_section : int
The number of assignments per section to generate.
sections: List[Dict]
A list of JSON-like section objects from a bulk create response    Returns

Dict[str, List[Dict]]
A Dict of mappings from Schoology section id to a list of JSON-like assignment objects
in a form suitable for submission to the Schoology assignment create endpoint.
Generate assignments without any enrollments with random content size . One per section . Adjust as needed . Parameters assignments_per_section : int The number of assignments per section to generate . sections : List [ Dict ] A list of JSON - like section objects from a bulk create response Returns Dict [ str List [ Dict ]] A Dict of mappings from Schoology section id to a list of JSON - like assignment objects in a form suitable for submission to the Schoology assignment create endpoint .
def generate_extra_assignments_without_enrollments(
    request_client: RequestClient, sections: List[Dict]
) -> Dict[str, List[Dict]]:
    logging.info("Generating extra assignment per section")
    result: Dict[str, List[Dict]] = {}
    for s in sections:
        section_id = str(s["id"])
        result[section_id] = list()
        for i in range(1):
            assignment = {
                "title": fake.catch_phrase(),
                "description": fake.paragraph(
                    variable_nb_sentences=True, nb_sentences=40
                ),
                "due": datetime.strftime(fake.future_datetime(), "%Y-%m-%d %H:%M:%S"),
                "type": "assignment",
                "assignees": list(),
            }
            result[section_id] += load_assignments(
                request_client, section_id, [assignment]
            )
    return result
def generate_extra_assignments_without_enrollments ( request_client : RequestClient , sections : List [ Dict ] ) -> Dict [ str , List [ Dict ] ] : logging . info ( "Generating extra assignment per section" ) result : Dict [ str , List [ Dict ] ] = { } for s in sections : section_id = str ( s [ "id" ] ) result [ section_id ] = list ( ) for i in range ( 1 ) : assignment = { "title" : fake . catch_phrase ( ) , "description" : fake . paragraph ( variable_nb_sentences = True , nb_sentences = 40 ) , "due" : datetime . strftime ( fake . future_datetime ( ) , "%Y-%m-%d %H:%M:%S" ) , "type" : "assignment" , "assignees" : list ( ) , } result [ section_id ] += load_assignments ( request_client , section_id , [ assignment ] ) return result
Generate assignments without any enrollments, with random content size.
Generate assignments without any enrollments with random content size .
"""
    Generate assignments without any enrollments, with random content size.
    One per section. Adjust as needed.

    Parameters
    ----------
    assignments_per_section : int
        The number of assignments per section to generate.
    sections: List[Dict]
        A list of JSON-like section objects from a bulk create response    Returns
    -------
    Dict[str, List[Dict]]
        A Dict of mappings from Schoology section id to a list of JSON-like assignment objects
        in a form suitable for submission to the Schoology assignment create endpoint.
    """
request_client
RequestClient
sections
List[Dict]