github-education-resources / autograding

GitHub Education Auto-grading and Feedback for GitHub Classroom
MIT License
59 stars 68 forks source link

Need help with autograding HTML files. #74

Open marionlester opened 1 year ago

marionlester commented 1 year ago

Hello. I'm a teaching html to my class and need some help setting up autograding my assignments. I'm (very) new to github and github classroom so please be patient with me.

What I need is a simple check for erroneous tags and I experimented with the Input/Output test as shown in the official Github Classroom youtube video. I just followed it and hoped for the best (I used npm install and npm test). I have no idea about what to type on the setup/run command field, and I guess that's the reason why I'm stuck on my issue. There are also some errors as indicated on the picture.

https://drive.google.com/file/d/122ADDeQaEyHt5zTfKqaBhpR1B6mMzL0D/view?usp=share_link https://drive.google.com/file/d/1YAUuEltic0tpC65AMnwrciDeDbm9H59D/view?usp=share_link

I have around 80 students in my laboratory, so autograding will definitely help. Thanks in advance.

Lnk2past commented 1 year ago

Disclaimer - I am not familiar with autograding (or grading...) HTML files! 😊

Do your repositories have some some node.js components that test their HTML files? The Input/Output test cases need something to run in order to check the output, and so if you do not have an actual test suite that npm can install from and execute then simply telling it to use npm is not going to help you. The error message you are getting is from npm install failing because the repositories being graded do not contain an npm package.

Do you have a script that you can run to check the HTML files? For example, you can write a Python script that loads the HTML files and parses them for specific tags, and if everything is good then your script can output something like "passed". Then you can tell the autograding to run your Python script and to expect the output "passed".

While the autograding is pretty "auto", you still need to tell it how to grade. Hope this helps!

marionlester commented 1 year ago

Disclaimer - I am not familiar with autograding (or grading...) HTML files! 😊

Do your repositories have some some node.js components that test their HTML files? The Input/Output test cases need something to run in order to check the output, and so if you do not have an actual test suite that npm can install from and execute then simply telling it to use npm is not going to help you. The error message you are getting is from npm install failing because the repositories being graded do not contain an npm package.

Do you have a script that you can run to check the HTML files? For example, you can write a Python script that loads the HTML files and parses them for specific tags, and if everything is good then your script can output something like "passed". Then you can tell the autograding to run your Python script and to expect the output "passed".

While the autograding is pretty "auto", you still need to tell it how to grade. Hope this helps!

it's working now, I used the built in test feature with this parameter in the setup npm install jsdom --save and npm test in run. I modified a test script from @jge162 to be able to suite my needs and detect doctypes and other things as well. the package.json also has to be modified. I was stuck since then, since javascript is not my area of expertise. I'm still searching for ways to hide or restrict the access of those files tho.

As you can see, I think I'm having more fun than my students in this platform.

Lnk2past commented 1 year ago

Glad it working! At this point in time I don't think there is a way to restrict/hide those files. There are ways you can flag if those files have been changed, but I have never gone through the trouble of setting something like that up via GitHub Actions. This is something I'd like to figure out for next semester (maybe open an issue on their repo if they changed anything under .github, or something to that effect).

In the past for my courses I have just downloaded all of their repos and use a script to copy/overwrite the autograding files when grading locally. This at least lets me confirm that their code is being graded against what I intended (it is less important to me that they can see the autograding files as it seeing it all does not aid them in any way).