Advertisement
math230

Auto-grade SWC

Jan 25th, 2023
2,280
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Winbatch 2.23 KB | Source Code | 0 0
  1. // REM name of this file: nppGradingScript.bat.  It's named a bat batch file to enable syntax coloring, but it's actually a text file
  2. NPP_SAVE  //saves current file
  3.  
  4. CD $(CURRENT_DIRECTORY)  //make sure this is executed in the directory of (viewing) the source code!!!!!!
  5.  
  6. echo $(CURRENT_DIRECTORY)
  7.  
  8. SET  MAINDIR  = C:\Users\BruceSmith\Google Drive\courses\m140\assignments\18fa\P4-Binsort
  9.  
  10. // REM  *************************  adjust these for current assignment ******************************
  11. // REM    AFTER COMPILING (via ctrl-shft-j) :
  12. // REM    $(INPUT1)    is the name of the file containing genomic data we are searching through
  13. // REM    
  14. // REM    "C:\Program Files\Java\jdk1.8.0_11\bin\java.exe" $(NAME_PART)  $(INPUT1)  3  //3 is number of trials
  15. // REM   where the input files are in a directory noted below
  16.  
  17. SET  GRADED_RESULT  = $(CURRENT_DIRECTORY)\p4grade.txt
  18. SET  STU_NAME       = $(CURRENT_DIRECTORY)\stuName.txt
  19. SET  OUTFILE        = "$(CURRENT_DIRECTORY)\out.txt"
  20. SET  TIMESTAMP      = "$(CURRENT_DIRECTORY)\ts.txt"
  21.  
  22. SET  RUBRICMASTER   = $(MAINDIR)\P4rubric.txt
  23. SET  INPUT1         = $(MAINDIR)\data sets\input02.txt
  24. SET  INPUT2         = $(MAINDIR)\data sets\input03.txt
  25. SET  OUTPUT         = $(CURRENT_DIRECTORY)\out.csv
  26.  
  27.  
  28. //cmd /c del "$(STU_NAME)"
  29.  
  30. // REM ******************************************************************
  31. // REM Use DOS powershell to read name and email in first 3 lines  
  32. cmd /c powershell -command "& {get-content "$(FILE_NAME)" | select-object -first 3}" > "$(STU_NAME)"  < nul
  33.  
  34. // REM Append rubric master to 3 lines with student name:
  35. cmd /c type  "$(RUBRICMASTER)"  >> "$(STU_NAME)"
  36.  
  37. //REM generate a more sensible file name
  38. cmd /c copy "$(STU_NAME)"  "$(GRADED_RESULT)"
  39.  
  40.  
  41. //REM Run at least two data sets and write to a file, concatenate  runs to first
  42. cmd /c echo ------- 1 --------- >>  "$(GRADED_RESULT)"
  43. cmd /c  java  $(NAME_PART) "$(INPUT1)"   "$(OUTPUT)" >>  "$(GRADED_RESULT)"    
  44.  
  45. cmd /c pause
  46.  
  47. cmd /c echo ------- 2 --------- >>  "$(GRADED_RESULT)"
  48. cmd /c  java  $(NAME_PART) "$(INPUT2)"   "$(OUTPUT)" >>  "$(GRADED_RESULT)"
  49.  
  50.  
  51. //REM append output  to rubric to give student results
  52. //REM cmd /c type  $(STU_NAME) >> $(GRADED_RESULT)
  53.  
  54.  
  55. NPP_OPEN $(GRADED_RESULT)
  56. cmd /c explorer $(CURRENT_DIRECTORY)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement