Skip to content

Commit

Permalink
Merge pull request #58 from talview/bug/proctor-link-not-available
Browse files Browse the repository at this point in the history
Added temporary logging and fixed retries for attempt not found error
  • Loading branch information
rakeshprabhu committed Sep 5, 2023
2 parents 16c295f + 35d025b commit 34fa532
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion datastore.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@

if ($post && ($post->sesskey == sesskey())) {
$attempt = $DB->get_record('quiz_attempts',
array('quiz' => $post->quiz_id, 'userid' => $post->user_id, 'state' => 'inprogress'));
array('quiz' => $post->quiz_id, 'userid' => $USER->id, 'state' => 'inprogress'));
var_dump('$attempt =>', $attempt); // ToDo: Remove this after debugging.
if ($attempt && $attempt->id) {
// Inserting attempt data in local_proview table.
$response = $DB->insert_record('local_proview', [
Expand All @@ -50,9 +51,14 @@
]);
print $response;
return;
} else {
// ToDo: Remove this after debugging. Dump all the attempts for the quiz in question.
$attempt = $DB->get_record('quiz_attempts', array('quiz' => $post->quiz_id));
var_dump('$USER =>', $USER->id, '$attempt =>', $attempt);
}
http_response_code(404);
print "Attempt not found";
return;
}

$query = $_SERVER['QUERY_STRING'];
Expand Down

0 comments on commit 34fa532

Please sign in to comment.