paul2708 / cercet Goto Github PK
View Code? Open in Web Editor NEWA Collaborative Educational Remote Code Execution and Teaching (CERCET) system
Home Page: https://cercet.paul-hoger.de
License: MIT License
A Collaborative Educational Remote Code Execution and Teaching (CERCET) system
Home Page: https://cercet.paul-hoger.de
License: MIT License
If the teacher clicks on "View", the current editor of the student is shown.
However, if the student is not typing anything, the editor shows the default template.
To avoid this, it requires an "initial request" that will be broadcasted to the student.
The student replies with his current editor content.
A GitHub action (CI/CD pipeline) would be fancy.
At the moment, the domain has to be configured manually in docker-compose.yaml
and frontend/src/environments/environment.prod.ts/
(see https://github.com/Paul2708/cercet#run-it).
It would be great if both - docker-compose and angular - could use an environment variable e.g. CERCET_DOMAIN
instead of a hardcoded URL.
At the moment, the name of the teachers are hard-coded in source code.
They should be extracted to a separate file that is read at runtime.
I added a config file that got mounted:
- "./config.yaml:/app/config.yaml"
If the config exists, everything works fine.
If the config doesn't exist, the following error occurs when using Docker:
backend_1 | java.io.FileNotFoundException: ./config.yaml (Is a directory)
backend_1 | at java.base/java.io.FileInputStream.open0(Native Method)
backend_1 | at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
backend_1 | at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
backend_1 | at de.paul2708.server.config.Configuration.load(Configuration.java:30)
backend_1 | at de.paul2708.server.JavalinServer.configureAndStart(JavalinServer.java:59)
backend_1 | at de.paul2708.server.Main.main(Main.java:7)
See Configuration.load
.
If I run the jar locally, everything works fine.
CERCET should use a real stream protocol like JetBrains does with CodeWithMe (cf. How and what data is going through JetBrains’ servers?).
Code shouldn't be compiled and executed on the real machine.
A container would be a better solution for this.
Should there be a container for each compilation?
cause it's unsafe af.
If you run a while (true)
loop, the code execution will be terminated after a certain timeout.
However, if the code contains output like
while (true) {
System.out.println("spam");
}
the output will be buffered and sent to the student although the process is already termianted.
A simple fix would be to count each output in OutputObserver
and ignore further messages.
There should be a docker image that runs server and website.
Imprint & Privacy Statement
The current frontend code is absolutely unmaintainable and should get a hole rewrite. I think angular is way to overkill for this project. I thought to rewrite it either with Vue, Svelte, or React.
The current frontend is working for the mvp, but implementing more features is very difficult to impossible.
The following error occurs multiple times:
backend_1 | [Connector-Scheduler-7ea9e1e2-1] WARN io.javalin.Javalin - Uncaught exception in WebSocket handler
backend_1 | java.lang.NullPointerException
backend_1 | at de.paul2708.server.user.User.hasSameSocket(User.java:33)
backend_1 | at de.paul2708.server.user.UserRegistry.lambda$findUser$0(UserRegistry.java:27)
backend_1 | at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:176)
backend_1 | at java.base/java.util.HashMap$ValueSpliterator.tryAdvance(HashMap.java:1696)
backend_1 | at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:127)
backend_1 | at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:502)
backend_1 | at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:488)
backend_1 | at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
backend_1 | at java.base/java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:150)
backend_1 | at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
backend_1 | at java.base/java.util.stream.ReferencePipeline.findAny(ReferencePipeline.java:548)
backend_1 | at de.paul2708.server.user.UserRegistry.findUser(UserRegistry.java:28)
backend_1 | at de.paul2708.server.ws.event.CloseListener.handle(CloseListener.java:25)
backend_1 | at io.javalin.websocket.WsHandlerController$onClose$1.invoke(WsHandlerController.kt:56)
backend_1 | at io.javalin.websocket.WsHandlerController$onClose$1.invoke(WsHandlerController.kt:24)
backend_1 | at io.javalin.websocket.WsHandlerController.tryBeforeAndEndpointHandlers(WsHandlerController.kt:74)
backend_1 | at io.javalin.websocket.WsHandlerController.onClose(WsHandlerController.kt:56)
backend_1 | at jdk.internal.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
backend_1 | at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
backend_1 | at java.base/java.lang.reflect.Method.invoke(Method.java:566)
backend_1 | at org.eclipse.jetty.websocket.common.events.annotated.CallableMethod.call(CallableMethod.java:70)
backend_1 | at org.eclipse.jetty.websocket.common.events.annotated.OptionalSessionCallableMethod.call(OptionalSessionCallableMethod.java:68)
backend_1 | at org.eclipse.jetty.websocket.common.events.JettyAnnotatedEventDriver.onClose(JettyAnnotatedEventDriver.java:146)
backend_1 | at org.eclipse.jetty.websocket.common.WebSocketSession.callApplicationOnClose(WebSocketSession.java:393)
backend_1 | at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.close(AbstractWebSocketConnection.java:225)
backend_1 | at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.onReadTimeout(AbstractWebSocketConnection.java:564)
backend_1 | at org.eclipse.jetty.io.AbstractConnection.onFillInterestedFailed(AbstractConnection.java:172)
backend_1 | at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.onFillInterestedFailed(AbstractWebSocketConnection.java:539)
backend_1 | at org.eclipse.jetty.io.AbstractConnection$ReadCallback.failed(AbstractConnection.java:317)
backend_1 | at org.eclipse.jetty.io.FillInterest.onFail(FillInterest.java:140)
backend_1 | at org.eclipse.jetty.io.AbstractEndPoint.onIdleExpired(AbstractEndPoint.java:407)
backend_1 | at org.eclipse.jetty.io.IdleTimeout.checkIdleTimeout(IdleTimeout.java:171)
backend_1 | at org.eclipse.jetty.io.IdleTimeout.idleCheck(IdleTimeout.java:113)
backend_1 | at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
backend_1 | at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
backend_1 | at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
backend_1 | at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
backend_1 | at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
backend_1 | at java.base/java.lang.Thread.run(Thread.java:834)
After 5 minutes, a timeout occurs if the socket didn't read or write.
There are two possibilities to avoid this:
I would prefer (1) if it's possible.
Given a teacher that views a student.
If the student disconnects, the teacher view updates and removes the student from the list.
However, the editor of the student is still open. This leads to exceptions if the teacher sends cursor updates.
So next to the list update, the editor should disappear.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.