Check if a GitHub user profile exists by checking its homepage.

Get the list of required parameters to identify a student from the URL.

check_profile(profile, url_profile)

query_params_list()

is_correct_query(query)

profile_from_query(query)

Arguments

profile

Profile data gathered from the LRS

url_profile

Profile data gathered from the URL

query

The query part of the URL (text after ?, like in https://mysite.org?params1=1&param2=2). The query is a character string with each value, named with the parameters names.

Value

TRUE if the profile is correct, FALSE otherwise.

A character vector with the list of parameters

TRUE if all required parameters are in the query, FALSE otherwise.

A list with the required parameters

Details

In Moodle, the URL variables must be set as follows:

  • iemail = Student's email

  • iid = Student' ID ("Nom d'utilisateur" in French in Moodle)

  • ifirstname = First name of the student

  • ilastname = Last name of the student

  • institution = Institution

  • icourse = Identifier for the course

  • ictitle = Title of the course

  • iurl = URL of the Moodle server

  • iref = Moodle ID

Examples

query_params_list()
#> [1] "iemail"      "iid"         "ifirstname"  "ilastname"   "institution"
#> [6] "icourse"     "ictitle"     "iurl"        "iref"       
is_correct_query(c(iemail = "student@uni.edu", iid = "1234",
  ifirstname = "John", ilastname = "Doe", institution = "University",
  icourse = "123", ictitle = "Course title", iurl = "https://moodle.uni.edu",
  iref = "2FAB3EE8-42B5-4B61-DA23-2167FACD7B569"))
#> [1] TRUE
is_correct_query(c(iemail = "student@uni.edu"))
#> [1] FALSE
profile_from_query(c(iemail = "student@uni.edu", iid = "1234", other = "a"))
#>            iemail               iid              <NA>              <NA> 
#> "student@uni.edu"            "1234"                NA                NA 
#>              <NA>              <NA>              <NA>              <NA> 
#>                NA                NA                NA                NA 
#>              <NA> 
#>                NA