-
Notifications
You must be signed in to change notification settings - Fork 0
/
ImageManager.cpp
43 lines (29 loc) · 1.07 KB
/
ImageManager.cpp
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
32
33
34
35
36
37
38
39
40
41
42
/**
* ImageManager.cpp : Implementation for the ImageManager namespace
*
* @author Nikko Schaff
*
*/
// Local header includes
#include "ImageManager.h"
using namespace std;
// Grades the assignment by making an AssignmentImage through
// ImageEvaluator, then extracing the data and placing it in the
// Assignment, for every image in the imagefile
std::vector< std::pair< int, std::vector< std::string > > >
ImageManager::readAssignmentSetFromImage( std::vector<
std::pair< int, std::string > > theFilenames, int numQ ) {
std::vector< std::pair< int, std::vector< std::string > > > results;
ImageEvaluator imgEval( numQ );
vector< string > answers;
int id;
// Reads through each and gets the answers
for( unsigned int i = 0; i < theFilenames.size(); i++ ) {
answers = imgEval.readExamImage( theFilenames.at( i ).second );
id = theFilenames.at( i ).first;
// NOTE pops of back end here, but otherwise should be used to coordinate name
answers.pop_back();
results.push_back( pair< int, vector< string > >( id, answers ) );
}
return results;
}