turnitin / moodle-plagiarism_turnitin

Turnitin Plagiarism plugin for Moodle
http://www.turnitin.com
45 stars 65 forks source link

plagiarism_turnitin_quiz_testcase::test_update_mark does not generate correct identifier hash #664

Open cameron1729 opened 1 year ago

cameron1729 commented 1 year ago

This code:

$identifier = sha1($answer);
$tiiquiz->update_mark($attempt->id, $identifier, $user->id, 75, $quiz->grade);

Produces a hash which will never be matched by this code (from classes/modules/turnitin_quiz.class.php):

// Check if this is the slot the mark is for by matching content.
if (sha1($answer.$slot) == $identifier) {

https://github.com/turnitin/moodle-plagiarism_turnitin/pull/648 modified the code for turnitin_quiz.class.php without updating the corresponding test.