-
Notifications
You must be signed in to change notification settings - Fork 0
/
Grader.h
31 lines (23 loc) · 1.01 KB
/
Grader.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ifndef GRADER_H_
#define GRADER_H_
#include <vector>
#include <string>
#include <sstream>
#include "DBManager.h"
// Takes information to compare and grade. The functions to grade are only
// reliant on input. They require a key (explicit or ID if info is in XML),
// assignmentID, answers ( studentID and answers, explicit or ID if info is in XML).
// After comparing responses to key, the data is then stored in the database, including
// storage of grade and responses
// Grades are stored as a value out of 100, so a 95% result will be stored as 95
namespace Grader {
// Main lead-in function for grading
// ALL it does is call the helper function to get the grade,
// Then sets the score and answers
void grade( int assignmentID, std::pair< int, std::vector< std::string > > keyAnswers,
std::vector< std::pair< int, std::vector< std::string > > > studentAnswers );
// Helper to grade a single assignment
double gradeSingleAssignment( std::vector< std::string > key,
std::vector< std::string > answers );
};
#endif