Skip to content

Create Assignment tab appears when disabled #1645

Closed

Description

Operating system

Ubuntu 20.04 within k8s single user pod spawned by jupyterhub pod.

nbgrader --version

nbgrader version 0.8.0a2

jupyterhub --version (if used with JupyterHub)

Image jupyterhub is jupyterhub/k8s-hub:1.1.3-n616.he76e1e57

jupyter notebook --version

6.4.12

jupyter lab --version

3.4.3

Expected behavior

In JupyterLab, when logging in as an instructor:

  • Create Assignment tab in the right sidebar is open when clicking on it, and it allows instructors to create assignments.

In JupyterLab, when logging in as a student:

  • Create Assignment tab in the right sidebar should not appear, as students cannot create assignments.

Actual behavior

In JupyterLab, when logging in as an instructor:

  • Create Assignment appears and allow instructors to create assignments.

In JupyterLab, when logging in as a student:

  • Create Assignment tab in the right sidebar still appears, and shouldn't, as it allows students to create assignments.

Steps to reproduce the behavior

Next are relevant contents in Dockerfile to install nbgrader:

RUN \
pip install git+https://github.com/jupyter/nbgrader.git@v0.8.0a2 && \
clean-layer.sh
RUN \
/opt/conda/bin/jupyter server extension enable --sys-prefix --py nbgrader.server_extensions.formgrader && \
/opt/conda/bin/jupyter server extension enable --sys-prefix --py nbgrader.server_extensions.assignment_list && \
/opt/conda/bin/jupyter server extension enable --sys-prefix --py nbgrader.server_extensions.course_list && \
/opt/conda/bin/jupyter server extension enable --sys-prefix --py nbgrader.server_extensions.validate_assignment && \
/opt/conda/bin/jupyter labextension disable --level=sys_prefix nbgrader/create_assignment && \
/opt/conda/bin/jupyter labextension disable --level=sys_prefix nbgrader/formgrader && \
/opt/conda/bin/jupyter labextension enable --level=sys_prefix nbgrader/assignment-list && \
/opt/conda/bin/jupyter labextension disable --level=sys_prefix nbgrader/course-list && \
/opt/conda/bin/jupyter labextension enable --level=sys_prefix nbgrader/validate-assignment && \
clean-layer.sh

Later, at single user boot time (when spawned), a bootstrap script executes next:

### only instructors can create assignments
if [[ "${IS_INSTRUCTOR}" == "true" ]]; then
        jupyter labextension enable --level=sys_prefix nbgrader/create_assignment
        jupyter labextension enable --level=sys_prefix nbgrader/formgrader
fi

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions