@@ -125,7 +125,7 @@ int main(int argc, char* argv[]) {
125125 config.semester = config_file_json.value (" semester" , " ERROR" );
126126 config.course = config_file_json.value (" course" , " ERROR" );
127127 config.gradeable = config_file_json.value (" gradeable" , " ERROR" );
128- config.sequence_length = config_file_json.value (" sequence_length " , 1 );
128+ config.hash_size = config_file_json.value (" hash_size " , 1 );
129129 config.threshold = config_file_json.value (" threshold" , 5 );
130130
131131 // error checking, confirm there are hashes to work with
@@ -140,8 +140,8 @@ int main(int argc, char* argv[]) {
140140 boost::filesystem::path provided_code_file = lichen_gradeable_path / " provided_code" / " hashes.txt" ;
141141 // if file exists in that location, the provided code mode is enabled.
142142 config.provided_code_enabled = boost::filesystem::exists (provided_code_file);
143- // path to prior gradeables' data
144- boost::filesystem::path prior_terms_dir = lichen_gradeable_path / " other_gradeables" ;
143+ // path to other gradeables' data
144+ boost::filesystem::path other_gradeables_dir = lichen_gradeable_path / " other_gradeables" ;
145145
146146
147147 // ===========================================================================
@@ -153,7 +153,7 @@ int main(int argc, char* argv[]) {
153153 std::vector<Submission*> all_submissions;
154154 // Stores all hashes from the instructor provided code
155155 std::unordered_set<hash> provided_code;
156- // stores all hashes from other prior term gradeables
156+ // stores all hashes from other gradeables
157157 std::unordered_map<hash, std::unordered_map<user_id, std::vector<HashLocation>>> other_gradeables;
158158 // stores the highest match for every student, used later for generating overall_rankings.txt
159159 std::unordered_map<std::string, std::pair<int , float >> highest_matches;
@@ -171,10 +171,10 @@ int main(int argc, char* argv[]) {
171171 }
172172 }
173173
174- // load prior gradeables' hashes
174+ // load other gradeables' hashes
175175 // iterate over all other gradeables
176176 boost::filesystem::directory_iterator end_iter;
177- for (boost::filesystem::directory_iterator other_gradeable_itr (prior_terms_dir ); other_gradeable_itr != end_iter; ++other_gradeable_itr) {
177+ for (boost::filesystem::directory_iterator other_gradeable_itr (other_gradeables_dir ); other_gradeable_itr != end_iter; ++other_gradeable_itr) {
178178 boost::filesystem::path other_gradeable_path = other_gradeable_itr->path ();
179179 assert (is_directory (other_gradeable_path));
180180 std::string other_gradeable_str = other_gradeable_itr->path ().filename ().string ();
@@ -193,7 +193,7 @@ int main(int argc, char* argv[]) {
193193 version_number other_version = std::stoi (str_other_version);
194194 assert (other_version > 0 );
195195
196- // load the hashes from this prior submission
196+ // load the hashes from this submission from another gradeable
197197 boost::filesystem::path other_hash_file = other_version_path / " hashes.txt" ;
198198 std::ifstream istr (other_hash_file.string ());
199199 assert (istr.good ());
@@ -371,7 +371,7 @@ int main(int argc, char* argv[]) {
371371 std::vector<nlohmann::json> matchingpositions;
372372 nlohmann::json position;
373373 position[" start" ] = matching_positions_itr->location ;
374- position[" end" ] = matching_positions_itr->location + config.sequence_length - 1 ;
374+ position[" end" ] = matching_positions_itr->location + config.hash_size - 1 ;
375375 matchingpositions.push_back (position);
376376
377377 // search for all matching positions of the suspicious match in other submissions
@@ -393,7 +393,7 @@ int main(int argc, char* argv[]) {
393393
394394 if (matchingpositions.size () >= lichen_config[" max_matching_positions" ]) {
395395 std::cout << " Matching positions array truncated for user: [" << other[" username" ] << " ] version: " << other[" version" ] << std::endl;
396- std::cout << " - Try increasing the sequence length to fix this problem." << std::endl;
396+ std::cout << " - Try increasing the hash size to fix this problem." << std::endl;
397397 break ;
398398 }
399399
@@ -403,7 +403,7 @@ int main(int argc, char* argv[]) {
403403 other[" source_gradeable" ] = matching_positions_itr->source_gradeable ;
404404 }
405405 position[" start" ] = matching_positions_itr->location ;
406- position[" end" ] = matching_positions_itr->location + config.sequence_length - 1 ;
406+ position[" end" ] = matching_positions_itr->location + config.hash_size - 1 ;
407407 matchingpositions.push_back (position);
408408 }
409409 }
@@ -414,7 +414,7 @@ int main(int argc, char* argv[]) {
414414
415415 nlohmann::json info;
416416 info[" start" ] = location_itr->first ;
417- info[" end" ] = location_itr->first + config.sequence_length - 1 ;
417+ info[" end" ] = location_itr->first + config.hash_size - 1 ;
418418 info[" type" ] = " match" ;
419419 info[" others" ] = others;
420420
@@ -431,7 +431,7 @@ int main(int argc, char* argv[]) {
431431
432432 nlohmann::json info;
433433 info[" start" ] = *location_itr;
434- info[" end" ] = *location_itr + config.sequence_length - 1 ;
434+ info[" end" ] = *location_itr + config.hash_size - 1 ;
435435 info[" type" ] = " common" ;
436436
437437 result.push_back (info);
@@ -447,7 +447,7 @@ int main(int argc, char* argv[]) {
447447
448448 nlohmann::json info;
449449 info[" start" ] = *location_itr;
450- info[" end" ] = *location_itr + config.sequence_length - 1 ;
450+ info[" end" ] = *location_itr + config.hash_size - 1 ;
451451 info[" type" ] = " provided" ;
452452
453453 result.push_back (info);
0 commit comments