Jump to content

Recommended Posts

Posted

Scripts used can be found at https://github.com/browolf/Pearson-exam-scripts

Some knowledge of Python is necessary as python is used to create the codes and rename the files.

 

 

1. "the centre is required to set up a secure user area, such as a Windows user profile or equivalent"

 

There's 1 account blocked from the internet. The logon script of this account presents a box asking for a code. Entering a valid code connects an associated user area.

Names of students and codes are printed on slips and placed in front of the computers before the exam. The computers are logged in with the box presenting before the exam starts. Students type the code in themselves.

 

a shared folder mapped to w: contains portable python - students use the builtin ide.

 

(the exams officer needs to pre allocate the codes to the students in a csv. Our file normally has these columns: candidate_number, fullname in the form "surname,forename",Controlassess_code) Need this file later

 

2. The folders "STUDENT CODING" and "COMPLETED CODING" need to be created in the exam areas. If not all the exam folders are being used, put the folder names in a text file and do ('type name.txt) instead

 

for /f %a in ('dir  *. /b') do md "%a\COMPLETED CODING"

 

3. Files need to be copied to student coding. Put the files in assessment root

 

for /f %a in ('dir  *. /b') do copy Q??.py "%a\STUDENT CODING" 

 

 

4. After the exam the completed folder needs to be zipped using the console version of 7zip

https://www.7-zip.org/a/7z2107-extra.7z

 

copy the x64 files 7za.dll, 7za.exe to the exam root

for /f %a in ('dir  *. /b') do 7za.exe a -tzip "%a\completedcoding.zip" ".\%a\completed coding\*"

 

this leaves a zip file in each of the exam folders

 

5. The zip files need to be renamed with the convention CENTRE NUMBER_CANDIDATE NUMBER_SURNAME_FORENAME

This is what the csv file is for.

 

the renamed files are copied into a subfolder. You can tell from the size of the files how much work has been done.

 

The exams officer can then upload the zip files.

  • Thanks 1
Posted

Nice.

 

A couple of comments - mostly around styling.

 

If you use argpass you could make the scripts more generic, so that you can hardcode your centerID/filepath but allow others to override these with a flag on the cli - also global variables should be uppercase

Make more use of functions, and use the __main__ function - Use a double line to signify the end of a function (makes things much more readable) and use docstrings to document the individual functions

format the files with black (there's tonnes of whitespace at the end of lines)

lint with pylint

you're importing sys in rename-files.py but not using it (also rename-files.py should be snake case)

the logging module is awesome, instead of just printing errors. This would be useful if you automated these scripts based on a trigger - you'd want the logs to go to a system log rather than print to stdout.

sys.exit() should be sys.exit(1) if you intend to quit on an error so the operating system know the exit code.

 

Hope that wasn't too harsh. The senior python developers at my company really rip into my code - it's all part of the learning process.

  • Thanks 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...