Skip to content
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

Merged
merged 19 commits into from
Oct 2, 2023

Conversation

rohansharmasitoula
Copy link
Contributor

@rohansharmasitoula rohansharmasitoula commented Sep 12, 2023

Description

  • Added fallback for no proctor link.

Github Issue

Checklist before requesting a review

  • One line description of the changes is added in the PR
  • Issue is linked to the PR via commits (eg: resolves #123)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires only a documentation update

@rohansharmasitoula rohansharmasitoula marked this pull request as ready for review September 12, 2023 20:06
@rohansharmasitoula rohansharmasitoula linked an issue Sep 12, 2023 that may be closed by this pull request
@manquer
Copy link
Contributor

manquer commented Sep 13, 2023

@rohansharmasitoula please don't tag me or so many people for review.

Copy link
Contributor

@rakeshprabhu rakeshprabhu left a 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
Copy link
Contributor

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)

$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');
Copy link
Contributor

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

$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');
Copy link
Contributor

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

}
}


Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed.

Comment on lines 73 to 74
$context = stream_context_create($options);
$response = file_get_contents($url, false, $context);
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Comment on lines 164 to 171
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)
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

refactored

Copy link
Contributor

@devang1281 devang1281 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rohansharmasitoula rohansharmasitoula merged commit 750443b into release/v3.2.0 Oct 2, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fallback in case of no proctor link displayed
4 participants