Online Assessments

Installation & Setup on Windows

Online assignments currently work with Shibboleth's single sign-on to automatically pick a student's ID. The ID is then used to randomize the questions in the assignment.

The source code for a sample individualized assignment on Arithmetic operations is here. The assignment asks a student to find the sum and product of a given set of numbers, where the numbers are individualized. To get started, cd to the folder you have unzipped the sample assignment to, and issue the command dotnet build) to build it. Then cd to the bin folder (typically bin\Debug\netX.X) where you will find Arithmetic.dll — and this DLL is the assignment plugin. You can use the command Cwgen -uid 123456 Arithmetic.dll to generate and review the individualized assignment for the student ID 123456. This command creates two files: 123456.html that contains the assignment and 123456.txt that contains a blank answer sheet.

The files Arithmetic.dll, Arithmetic.Template.html, and Arithmetic.txt can eventually be deployed to the assignment server for disseminating assignments once the assignment is finalized. The sections below provide more details on testing and deployment.

Testing Individualized Assignments

The tool CwGen can be used for testing individualized assignments. It can also be used for generating student-specific assignment sheets and answer sheets. This can be of value when helping students offline. Help is available using CwGen -help.

The command CwGen -uid 123456 Arithmetic will generate the assignment and answer sheets for our sample assignment on Arithmetic operations for student ID 123456. Similarly, the command CwGen -uid 123456 -admin Arithmetic will generate the assignment and answer sheets with expected answers.

Deploying Assignments Locally

The app CwSvcHost is the self-hosted assignment server which we can use to deploy the assignment locally to test. Place your assignment plugin files (Arithmetic.Template.html, Arithmetic.dll, and Arithmetic.txt) within the plugin root folder (by default C:/WebRoot/Assignments/) inside a folder named after the plugin's name. For instance, if your plugin root is C:/WebRoot/Assignments/ then the plugin Arithmetic.dll will need to be placed under the folder C:/WebRoot/Assignments/Arithmetic/. If you want to change the location of the plugin root folder, open the file appsettings.json and change the default entry in the line:

"PluginFolder": "C:/WebRoot/Assignments/"

Run CwSvcHost.exe. Here 8881 is the port number that the service will listen on. The URL http://localhost:5000/swagger/ will show the endpoints the service supports, while http://localhost:5000/Core/Coursework?cid=Arithmetic will show you the Arithmetic assignment.

The coursework service passes to each plugin the ID of the logged-in user from the SSO. In a test environment, you won't get any user logins. However, you can simulate the behavior by setting up the environment variable UOAid with its value set to any positive integer value representing an ID. The plugin will then receive this ID you set up rather than receiving a default 0.

To see the assignment in an admin mode, place in C:/WebRoot/Coursework/Arithmetic/ a file named Arithmetic.txt which contains IDs of the admin users – each ID must be on a new line. The admin mode allows the user to see answers in the assignment, as well as allowing the user to download answer sheets containing the expected answer. The admin endpoint is /Core/CourseworkAA, and the URL http://localhost:5000/Core/CourseworkAA?cid=Arithmetic&id=123456 will show assignment sheet for user ID 123456 along with the expected answers, provided that Arithmetic.txt is correctly setup.

Marking Individualized Assignments

The tool CwGrader is used for marking individualized assignments. Help is available using CwGrader -help. The following is a quick-start step-by-step guide to marking solutions to our sample assignment on Arithmetic.

  1. Create a folder called Answers
  2. Create a sub-folder called Arithmetic
  3. Copy Arithmetic.dll and its HTML template to the Arithmetic folder
  4. Create a sub-folder called Sub in the Answers folder
  5. Copy the student answer sheets to the folder Sub
  6. Open Windows PowerShell
  7. Go to the folder Answers
  8. The command one would run to show the marks on the console is CwGrader -coursework Arithmetic -submissions Sub -mark -csv. This creates a text file for each student that can be emailed. The option -answer provides the expected answer in the text file.
  9. The command Mailman can be used to email the results files to the students. Mailman requires a file that maps StudentIDs to their emailIDs. This file should contain a tab-separated sequence of tuples of the form StudentID emailID where each tuple should be in its own line.