-
Notifications
You must be signed in to change notification settings - Fork 317
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open formgrader with a local configuration file #1859
Conversation
Excellent! Our next project to grade is on February the 9th. So I have to |
Tiny update: the debug flag is actually |
I just tried this branch on my machine. In my home directory
All of this went smoothly :-) However, when going to For the record, another difference is that the current configuration is displayed in a long single line in the second case, and properly line wrapped and indented in the first case. I am not sure how to proceed to debug further. In case this can help, I am available tomorrow starting from 10:30 for live debugging. Cheers, |
Thanks, I updated the description. |
Ok, I found the issue and a workaround. In my
However the formgrader apparently fetches the gradebook from
then I can see my student's submissions. |
Another issue: if RTC is enabled, then the local formgrader seems to be opened with
Forcing the url:
works around this. |
Aside from this, it seems at this stage completely functional. I'll grade |
Hello @brichet, After experimenting, I confirm that the workaround we discussed this morning about paths relative to the course root in
Ideally, we could make the idiom into:
And then it would only be a question of documenting it together with |
@nthiery I haven't found a way to retrieve the config from the config file. |
Ok, too bad. Thanks for trying out! For the record, the trick above worked smoothly while I graded a bunch of
|
e8ee57a
to
f19da15
Compare
Failures seems to be related to incompatibility between |
f19da15
to
719e9fe
Compare
Hi @brichet, For the record: in fact absolute paths work for the gradebook. This is a bit simpler, and in fact
|
I don't have something solid to report yet, but it seems that there is some hidden state somewhere. If a local formgrader is loaded once with We have a grading session this afternoon, so I'll try to use the occasion to analyse further. Let me know if you manage to reproduce it. |
@nthiery I can't reproduce it. |
No haven't been able to reproduce it lately. So I'll assume it was related to our server having |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some feedback after using the local formgrader on the field.
It has been working smoothly and resolves as hoped for the motivating
use case: we can now easily have multiple nbgrader courses
configuration on the same infrastructure, e.g. Jupyterhub.
That's really cool. Thank you @brichet!
The procedure to access the feature through the UI is a bit complex:
go to the settings; find nbgrader; activate the local formgrader; find
Local formgrader
in the UI. At the end, it was simpler to just tell
collaborators to open the URL /formgrader?path=...
. Also, the
standard UI in JupyterLab to run an application in a local directory
is to do it from the launcher; not from a global menu.
Suggestions:
- Scrap the "local formgrader" item in the global menu and the
configuration option to activate it. - Enable the ?path=... also for subpaths of the formgrader. E.g.
/formgrader/grading/?path=... - Upon opening a local formgrader on a specified path, test whether an
existing formgrader is already open with a different path (is that
possible?). If yes, abort with a message "please close the other
running formgraders". - Scrap the optional command line option
"--FormgradeExtension.debug=true. Instead, always display a line in
the formgrader "Formgrader with configuration taken from directory
xxx (click to expand)". It's indeed always useful for the user to
have a visual clue on where the formgrader is running, and it grants
easy access to debugging information. We should presumably not worry
too much about vertical space at this stage; anyway at some point
there will be a UI overhaul which will be the occasion to optimize
it. Let's just make sure relevant information is easily accessible.
With that, I believe this PR would be good to go from the user's perspective.
UI suggestion for this or a later PR:
- Add a new activity "Local formgrader" in the launcher, with a
tooltip "Launch nbgrader's formgrader, with configuration taken from
this directory".
Thanks for the feedback @nthiery.
What is the motivation to remove it?
I like the idea of keeping it intentional, as it changes the server configuration when used.
I'll see if there is an easy way to handle it.
Let's set it to true by default, so that people can disable it. |
That's with the alternate UI (activity in the launcher) in mind to avoid having two UI's for the same action.
To make sure I get the technical details right: you could actually have two users use the local It seems to me that launching the formgrader from the URL with a path argument, or through
Yes, that works too. |
This is right. Indeed, if the users open formgrader in the same directory it will work. Let's take an example:
How to fix it ?We could manage several I'd advocate the first solution, but it will require (much?) more work, and could be done in a later PR. |
Thanks for the confirmation! Agreed the first solution is definitely the proper solution and we should eventually have it. Presumably the proper granularity is one configuration object per directory on the server (with lazyness: the configuration is only created if a formagrader is open with that directory); I guess that's what you meant by "one per config". Agreed also that the current solution is just temporary, so it's not worth investing a lot of energy polishing/hardening it, let alone discussing it :-) Also, presumably it will be a rare event that people will use local configuration on a shared jupyter server. With that in mind, I let you finalize this PR as you see fit. If some of the hardening actions (like warning against already running sessions with different config) are trivial to implement, that's great. Otherwise that's fine too! |
Hi @brichet ! A quick update: we have been using this branch smoothly this semester and it worked great. That was much more robust. Thank you so much for your work on it! Yesterday, we made a few tests with 2-3 other courses, and updated the dashboard in Travo to use it. With that, we plan to use it systematically next semester. If we could move forward and get this branch merged, that would be great so that we could use a stock nbgrader! What would remain to be done? |
Thanks for the live deployment testing and your feedback @nthiery, glad to hear it's pretty robust. |
fabc98e
to
082ad41
Compare
Thanks for the progress! Just for information: I tried to install the latest version with:
This used to work last time I tried. However now the nbgrader menu does not appear when launching JupyterLab, and I see the following error in the logs:
I also tried a developer install following the nbgrader doc. It worked, up to one point: I had to install manually the schema file Cheers, |
I have the same issue, I think it is related to #1875 |
27bb76f
to
f30881b
Compare
For information: I installed with pip the current version of the branch, and it seems to work smoothly. Thank you! |
It should be fixed now EDIT: I haven't seen your previous message. |
f6d5e7f
to
60d6a15
Compare
…uration in formgrader UI
…b instance, and show the configuration by default in formgrader
60d6a15
to
d1ba2ff
Compare
Thanks again @nthiery for suggestions and feedback |
Yiiah!!! That was quite a sprint. Thank you so much. Will install it right away! |
* Allow formgrader to update its config from the current directory in lab * Restore the config to avoid confusion * Initialize configuration only if necessary * Add a debuf flag to FormgraderExtension to display the current configuration in formgrader UI * Add a setting to enable/disable the local formgrader * Avoid loading CWD config when API is called too * Fix UI tests * Update documentation * Add a warning about using it with several users on the same Jupyterlab instance, and show the configuration by default in formgrader * Add tests on local formgrader and increase time for doc test * Fix ui-tests on notebook * Skip test on formgrader exchange on windows
This PR aims to open formgrader with a configuration file (nbgrader_config.py) from the local directory.
Currently, the formgrader loads the nbgrader_config.py files from:
jupyter_config_path
os.cwd()
CourseDirectory.root
(which can be configured by one of the previous files)With this PR, it will be possible to start the Formgrader with a config file in the curent directory in lab filebrowser, by using the new menu entry Formgrader (local).
It will reinitialize the
FormgradeExtension
object with the additional configuration of the current directory.In this case, the configuration file existing in the root directory of Jupyter lab app will not been loaded.
Using the classic menu entry
Formgrader
will restore theFormgradeExtension
object with the initial configuration.This feature is not enabled by default, and must be set by user in settings panel (or user settings file):
This PR also adds a command line configuration to display the current config in the formgrader UI:
--FormgradeExtension.debug=true
.This can be helpful to test this PR (at least).
I tested it on a local jupyterlab server and using jupyterhub in docker (demo multiple classes), but I think it must be tested in some real environments to ensure it does not break any existing behavior.
** CAUTION **
FormgradeExtension
object on the server.CourseDirectory.root
configuration (which is the case on jupyterhub AFAIK), this parameter must be overwritten in the local config file. This is intentional, we don't silently remove certain parameters from the loaded files, we just change the files that are loaded.cc. @nthiery