Hi, I teach a CS course, and I was wondering if there is a practical way in which to setup a server that would accept student’s tar files, run some tests, and show them the results.

I could go “full unix mode” and roll up some accounts let them ssh into a server, scp their their files… but I was wondering if there is a prepacked solution for this that is nicer to the eye. And I thought maybe you know some.

  • billwashere@lemmy.world
    link
    fedilink
    English
    arrow-up
    0
    ·
    10 days ago

    I actually work for a large university in the digital education department. We do have tools like this but I’m pretty sure it’s for python. It could probably be modified for other uses however. I’m a hardware guy or I’d know more about it. If you’re interested I could probably get some more info or get you in touch with the devs that created it. DM if you want some more details.

  • foggy@lemmy.world
    link
    fedilink
    English
    arrow-up
    0
    ·
    11 days ago

    Instead of that, simplify.

    Use unique salts for each assignment per student.

    Align hashes with those salts to check the outcome for each students assignment.

    Literally have them send you a CTF style sha256 string.

    Do it step by step where each step doesn’t depend on the next, grade as a percentage of flags accurately procured.

    • 𝔻𝕒𝕧𝕖@lemmy.world
      link
      fedilink
      English
      arrow-up
      0
      ·
      11 days ago

      Absolutely this. Even if you had fancy jails or docker setups for each submission, this will be a nightmare to properly handle. Students DOSing each other exactly before the submission deadline, too.

      • foggy@lemmy.world
        link
        fedilink
        English
        arrow-up
        0
        ·
        edit-2
        10 days ago

        I mean just for the love of God don’t spin up something on your company’s infrastructure that accepts file uploads.

        Just don’t.

        If you’re reading this and going “well, it’s just internal,” or “well, it doesn’t do much it just accepts this exact file type.” My god. Ask your CISA. And if they’re okay with it, cool. That’s on them.

        Unless your whole business is transferring files, don’t. And even then… Don’t.

        And if you’re still confused, the answer is to use another company’s infrastructure for this. Use Azure. Use AWS. Use Google cloud or even g suites. Don’t accept that liability. Let the trillionaires do it.

        • sugar_in_your_tea@sh.itjust.works
          link
          fedilink
          English
          arrow-up
          0
          ·
          10 days ago

          You can accept them on internal networks, just have a file size limit and don’t extract them locally, but send to some cloud service for handling. You could even have it work with email attachments if you want.

          Basically:

          1. Put file somewhere
          2. Spin up runner
          3. Upload and execute code
          4. Spin down runner either upon success or after a time limit
          5. Send result to the student (if it to took too long, that’s a fail too)
  • marcos@lemmy.world
    link
    fedilink
    English
    arrow-up
    0
    ·
    11 days ago

    If you use moodle, it has a plugin for that, with instructions.

    If you don’t use moodle, you may want to check the instructions on the plugin anyway.

  • EarMaster@lemmy.world
    link
    fedilink
    English
    arrow-up
    0
    ·
    11 days ago

    You could use automated testing tools to do the work for you. You define your requirements as individual tests and every input is tested separately giving you a report which tests failed and which succeeded.

  • Scrubbles@poptalk.scrubbles.tech
    link
    fedilink
    English
    arrow-up
    0
    ·
    11 days ago

    Did a takehome for a company recently that did it well. They required that I make a docker file (you could give them one if you wanted) where when ran it would run tests. It was a neat use of docker IMO, it standardized that builds were just “build the docker file” and running was just “run the dockerfile”. You would t have to deal with tar or anything then.

    Thousand ways to skin a cat there

  • elDalvini@discuss.tchncs.de
    link
    fedilink
    English
    arrow-up
    0
    ·
    11 days ago

    My university used Artemis to do basically what you’re describing. Files are uploaded via git. But it seems like selfhosting would be a lot of work.

  • PeriodicallyPedantic@lemmy.ca
    link
    fedilink
    English
    arrow-up
    0
    ·
    10 days ago

    This is basically what CI/CD pipelines do.

    Compile the code, run tests, run static analysis. If results pass, submit the code. If results fail, reject it with an explanation.

    Idk the details of how you’d implement this for a class, without letting everyone see eachother’s completed work, but I’m sure it could be done.

  • JakenVeina@midwest.social
    link
    fedilink
    English
    arrow-up
    0
    ·
    10 days ago

    When I was in college, I took a 100-level CS course that required me to ssh into a server and run a command to submit my homework. It’s not crazy.

  • aubeynarf@lemmynsfw.com
    link
    fedilink
    English
    arrow-up
    0
    ·
    edit-2
    11 days ago

    Full unix mode is probably easier than working up some kind of sandboxing mechanism that accepts arbitrary scripts/binaries.

    As far as nice to the eye, you can spin up a python FastAPI site and frontend in about 10 minutes with Claude Code