Skip to content

Commit

Permalink
rework menu, outline grade flow
Browse files Browse the repository at this point in the history
  • Loading branch information
DryCreations committed Oct 22, 2021
1 parent ae0d71e commit f45017c
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 18 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.env
/tmp/
/tmp/
/data/
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ I suggest using gvisor to create sandboxed environments for grading, this will s
docker build -t grading .
docker run --runtime=runsc --rm -it grading
deno run -A --unstable --no-check mod.js
```
```

the `/data/` folder is optional and should contain any rosters and grades exports from github classroom you plan on using during the grading process.
31 changes: 15 additions & 16 deletions mod.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import AuthFlow from "./modules/auth.js";
import auth_flow from "./modules/auth.js";
import grade_flow from "./modules/grade.js";

import { Select } from "https://deno.land/x/cliffy/prompt/select.ts";
import { config } from "https://deno.land/x/dotenv/mod.ts";
import { Input } from "https://deno.land/x/cliffy/prompt/input.ts";
import { parseFlags } from "https://deno.land/x/cliffy/flags/mod.ts";

import {exists} from "https://deno.land/std/fs/mod.ts"

import { delete_repos, download_repos } from './modules/git.js';

const read_perm = Deno.permissions.request({ name: "read", path: "." })
Expand Down Expand Up @@ -32,6 +35,9 @@ if (!clientId) {
let octokit;

while(true) {

let repos_dir_exists = await exists("./tmp/repos/");

let options = {
'download': {
disabled: octokit === undefined,
Expand All @@ -41,38 +47,31 @@ while(true) {
}
},
'delete': {
disabled: false,
disabled: !repos_dir_exists,
name: 'Delete Repositories',
action: async () => {
await delete_repos();
}
},
'grade': {
disabled: false,
disabled: octokit === undefined,
name: 'Grade Assignment',
action: async () => {
console.log('grade assignment');
await grade_flow(octokit);
}
},
'test': {
disabled: false,
name: 'Run Tests',
'archive': {
disabled: octokit === undefined,
name: 'Archive',
action: async () => {
console.log('run tests');
console.log('archive classroom');
}
},
'auth': {
disabled: false,
name: 'Authenticate',
action: async () => {
octokit = await AuthFlow(clientId);
}
},
'archive': {
disabled: false,
name: 'Archive',
action: async () => {
console.log('archive classroom');
octokit = await auth_flow(clientId);
}
},
'exit': {
Expand Down
21 changes: 21 additions & 0 deletions modules/grade.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
export default async function(octokit) {
console.log("Start Grading");
/*
Select CSV (Hold State) (Optional, will set select repos)
Pick file from data folder
Select Grader (Hold State) (Required)
Select grader repo, then clone it locally
Select Repos (Hold State) (Required, will unset CSV)
Select repos from downloaded
Start Grading (Disabled if (!Repos || !Grader))
Runs tests
combines data with grading CSV, if present
print tabulated data of all students
options:
Export CSV
Export Feedback
Push feedback to student repos in issue
*/
}

0 comments on commit f45017c

Please sign in to comment.