-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fallback for proctorlink #70
Conversation
@rohansharmasitoula please don't tag me or so many people for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rohansharmasitoula as discussed provides a resync option to the end user. Looping for all attempts will have a performance impact.
@@ -1 +1 @@ | |||
* @rakeshprabhu @harish-talview @merlano17 @devang1281 @manquer @KeerthiHarish | |||
* @rakeshprabhu @harish-talview @merlano17 @devang1281 @KeerthiHarish |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing @manquer from code owner as part of #70 (comment)
classes/local/api/tracker.php
Outdated
$auth_payload->password = trim(get_config('quizaccess_proctor', 'proview_admin_password')); | ||
$auth_response = self::generate_auth_token($api_base_url, $auth_payload); | ||
$auth_token = json_decode($auth_response)->access_token; | ||
$base_url = get_config('quizaccess_proctor', 'proview_callback_url'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rohansharmasitoula $api_base_url
itself can be used here
classes/local/api/tracker.php
Outdated
$auth_response = self::generate_auth_token($api_base_url, $auth_payload); | ||
$auth_token = json_decode($auth_response)->access_token; | ||
$base_url = get_config('quizaccess_proctor', 'proview_callback_url'); | ||
$proctor_token = get_config('local_proview', 'token'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rohansharmasitoula Please trim the values taken from config
classes/local/api/tracker.php
Outdated
} | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rohansharmasitoula Why are empty lines added at EOF
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed.
classes/local/api/tracker.php
Outdated
$context = stream_context_create($options); | ||
$response = file_get_contents($url, false, $context); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rohansharmasitoula What is the benefit of using stream_context_create
and file_get_contents
instead of curl here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using file_get_contents seemed to be easier than Curl, was unaware about the pros of curl. Changed to curl implementation.
templates/tracker.mustache
Outdated
if(proctor_type=='ai_proctor'||proctor_type=='record_and_review'||proctor_type=='live_proctor'){ | ||
if(proctor_type=='ai_proctor'||proctor_type=='record_and_review'){ | ||
external_session_id= quiz_id+'-'+user_id+'-'+attempt_no; | ||
} | ||
else if(proctor_type=='live_proctor'){ | ||
external_session_id= quiz_id+'-'+user_id; | ||
} | ||
fetchSecureToken(external_session_id, external_attendee_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rohansharmasitoula This can be written as a function and reused
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
refactored
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
Github Issue
Checklist before requesting a review
Type of change