def METHOD_NAME(request, *args, **kwargs):
    """
    Returns all modules taught on a particular course.
    """
    try:
        course_id = request.GET["course"]
    except KeyError:
        response = JsonResponse({
            "ok": False,
            "error": "No course ID provided."
        }, custom_header_data=kwargs)
        response.status_code = 400
        return response
    if not validate_amp_query_params(request.query_params):
        response = JsonResponse({
            "ok": False,
            "error": "Given parameter is not of corrrect type"
        }, custom_header_data=kwargs)
        response.status_code = 400
        return response
    if request.query_params.get('only_compulsory'):
        try:
            strtobool(request.query_params.get('only_compulsory'))
        except ValueError:
            response = JsonResponse({
                "ok": False,
                "error": "Given parameter is not of correct type"
            }, custom_header_data=kwargs)
            response.status_code = 400
            return response
    if request.query_params.get('only_available'):
        try:
            strtobool(request.query_params.get('only_available'))
        except ValueError:
            response = JsonResponse({
                "ok": False,
                "error": "Given parameter is not of correct type"
            }, custom_header_data=kwargs)
            response.status_code = 400
            return response
    if (request.query_params.get('only_available') and
            request.query_params.get('only_compulsory')):
        if (strtobool(request.query_params.get('only_available')) and
                strtobool(request.query_params.get('only_compulsory'))):
            response = JsonResponse({
                "ok": False,
                "error": "only_available and only_compulsory"
                         " cannot both be true"
            }, custom_header_data=kwargs)
            response.status_code = 400
            return response
    modules = {
        "ok": True,
        "modules": get_course_modules(course_id, request.query_params)
    }
    return JsonResponse(modules, custom_header_data=kwargs)