Lernstick / glados

The exam server webinterface
https://glados-doc.readthedocs.io/en/latest/
Other
8 stars 4 forks source link

Link shutdown command to "Prüfung abgeben" (hand exam in) #76

Open sm8ps opened 4 years ago

sm8ps commented 4 years ago

The shutdown command from the desktop should be replaced by /usr/bin/finishExam. Reasoning: it can be misleading to students that they can successfully shut down the computer from a running exam session without realizing that they in fact did not finish the exam. Furthermore I do not see any reason why one should need to shut down the computer in the midst of an exam. This even is a security flaw. Students might turn off the computer and walk away from the exam room. Provided they have an exam stick, they can boot back into the exam and modify it without supervision. If the teacher does not keep an eye on the state of the students' tickets there is no way to recognize this.

chaoos commented 4 years ago

Until now, I found no reasonable, satisfying and general solution to hook into gnome's shutdown mechanism and interrupt or inhibit it until the exam has been handed in correctly. Unfortunately, this is misleading to the student.

But nonetheless, even with this mechanism, the student can still just turn of the computer with the power button without handing in the exam. But, if you have set a time limit in the exam, the tickets will be valid only that amount of time after starting the exam (or 3 hours if no time limit is set). After that time has passed, the system will not allow to boot back into the exam.

However, if the student would boot back into the exam, this would be visible in the activity log, even more verbose in the new history feature coming in version 1.0.6.

sm8ps commented 4 years ago

OK, I see your point with the possibility for cheating and the countermeasures. I had forgotten about the intended meaning of the time limit. I would say that this was due to the help message in Glados 1.5 for the time limit. It says: "If this value (in minutes) is set, the exam status view of the student will show the time left. This has NO indication elsewhere. It is just of informative purpose. Set to 0 or leave empty for no time limit." In my understanding this seems to say that the time limit itself "is just of informative purpose". However, this is not the way I interpret your statement. Is there need for rephrasing the help text?

In the olden days it would have been enough to sym-link /sbin/shutdown to something else. Nowadays it is sym-linked itself to /bin/systemctl and maybe replacing it by something else is not a good idea. How about having the command for handing in the exam be executed before running the shutdown command. From browsing through some such questions on stackexchange etc. this looks promising. Far be it from me to make real suggestions but what do you think?

chaoos commented 4 years ago

Indeed, I should change the help message to address this. :)

Also after looking through the code, I realized that what I said with the 3 hours is not true. If no time limit is set or time limit is set to 0, then the exam will never expire. So the student can boot back, if that setting is not set or set to 0. Sorry for the confusion. Although it's still visible in the log.

Unfortunately the good old ways, don't work anymore to hook system shutdown in a general way. The problem is that in the menus of gnome, the shutdown is sent via dbus to the underlying event daemon (systemd on debian, which is also the binary /bin/systemctl). The event daemon then checks for permission to execute that task (via policykit? not sure) and shuts the system down for you. I'm not into that problem anymore, but there's plenty of ideas out there, but none of them gives a satisfying and working solution. Despite that, or actually because of it, I'm very open for a pull request on this :) Else I will look into this myself again - when time allows.