Something very odd is happening to our TII installation. Basically when I submit a file to TII I am quickly returned a similarity score of 0%. When I click on the report I am offered the error:
Originality report not generated yet in fid 6, fcmd 1
After a little time the similarity report with a TII score is generated, but the Moodle database is already populated with a TII score of 0% and TII code "success". It seems to me the following function in lib/turnitinlib.php is returning a TII score when before it wasn't:
$tiiscore = tii_post_to_api ( $tii, 61, 'GET', $tiifile, false );
This triggers the TII submission to be set to successful on Moodle and for the wrong TII score to be set.
if (isset ( $tiiscore )) {
$tiifile->tiiscore = $tiiscore;
$tiifile->tiicode = 'success';
$count ++;
if (! update_record ( 'tii_files', $tiifile )) {
error ( "update tii score failed" );
}
I have added some code so users can manually refresh their TII score, but this isn't the solution.
Has anyone else experienced this or have any leads as to the solution?
Thanks a lot,
Paolo