Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
rhul-scripts
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Whyte Cameron (2023) ZMAC302
rhul-scripts
Commits
f7043e76
Commit
f7043e76
authored
1 year ago
by
Hague Matthew UXAC009
Browse files
Options
Downloads
Patches
Plain Diff
Get all Moodle cookies and wait for timing click
parent
4bcebe76
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
moodle/quiz-change-times.py
+6
-4
6 additions, 4 deletions
moodle/quiz-change-times.py
moodle/quiz-download-data.py
+0
-2
0 additions, 2 deletions
moodle/quiz-download-data.py
moodle/select-users.py
+0
-2
0 additions, 2 deletions
moodle/select-users.py
with
6 additions
and
8 deletions
moodle/quiz-change-times.py
+
6
−
4
View file @
f7043e76
...
...
@@ -42,7 +42,6 @@ QUIZ_ID_GRP = 1
WAIT_TIMEOUT
=
60
# seconds
MOODLE_DOMAIN
=
"
moodle.royalholloway.ac.uk
"
MOODLE_SESSION_COOKIE
=
"
MoodleSession
"
class
Browser
:
"""
Simple container of browser setup and teardown
...
...
@@ -78,7 +77,6 @@ class Browser:
return
[
{
"
name
"
:
c
.
name
,
"
value
"
:
c
.
value
}
for
c
in
cookie_jar
if
c
.
name
==
MOODLE_SESSION_COOKIE
]
def
get_quiz_edit_url
(
quiz_url
:
str
)
->
str
:
...
...
@@ -154,9 +152,13 @@ def update_quiz(
# Open edit timing section
browser
.
driver
.
get
(
get_quiz_edit_url
(
quiz
))
browser
.
driver
.
find_element
(
expander
=
browser
.
driver
.
find_element
(
By
.
CSS_SELECTOR
,
"
#id_timing .ftoggler a
"
).
click
()
)
WebDriverWait
(
browser
.
driver
,
WAIT_TIMEOUT
).
until
(
ec
.
element_to_be_clickable
(
expander
)
)
expander
.
click
()
# Make sure open/close quiz checkbox matches notime
check_box
=
browser
.
driver
.
find_element
(
...
...
This diff is collapsed.
Click to expand it.
moodle/quiz-download-data.py
+
0
−
2
View file @
f7043e76
...
...
@@ -26,7 +26,6 @@ from collections import namedtuple
from
typing
import
Dict
,
List
MOODLE_DOMAIN
=
"
moodle.royalholloway.ac.uk
"
MOODLE_SESSION_COOKIE
=
"
MoodleSession
"
RESPONSES_DOWNLOAD_URL
=
"
https://moodle.royalholloway.ac.uk/mod/quiz/report.php?download=csv&id={}&mode=responses&attempts=all_with
"
SCORES_DOWNLOAD_URL
=
"
https://moodle.royalholloway.ac.uk/mod/quiz/report.php?download=csv&id={}&mode=overview&attempts=all_with
"
...
...
@@ -38,7 +37,6 @@ def get_moodle_cookies() -> Dict[str, str]:
cookies
=
{
c
.
name
:
c
.
value
for
c
in
cookie_jar
if
c
.
name
==
MOODLE_SESSION_COOKIE
}
if
len
(
cookies
)
==
0
:
...
...
This diff is collapsed.
Click to expand it.
moodle/select-users.py
+
0
−
2
View file @
f7043e76
...
...
@@ -50,7 +50,6 @@ PASS_CMD = [os.path.expanduser('~/.config/mutt/getpass.sh'), 'rhul']
MOODLE_URL
=
"
https://moodle.royalholloway.ac.uk
"
MOODLE_DOMAIN
=
"
moodle.royalholloway.ac.uk
"
MOODLE_SESSION_COOKIE
=
"
MoodleSession
"
WAIT_TIMEOUT
=
10
# s
...
...
@@ -99,7 +98,6 @@ class Browser:
return
[
{
"
name
"
:
c
.
name
,
"
value
"
:
c
.
value
}
for
c
in
cookie_jar
if
c
.
name
==
MOODLE_SESSION_COOKIE
]
class
LDAPEmailGetter
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment