Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
IDATT2900-072
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
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
Mattias Agentoft Eggen
IDATT2900-072
Commits
3d6376f9
Commit
3d6376f9
authored
3 years ago
by
magnus2142
Browse files
Options
Downloads
Patches
Plain Diff
ADded some notes to help start creating the content services
parent
0be62b35
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bbcli/services/ContentService.py
+34
-0
34 additions, 0 deletions
bbcli/services/ContentService.py
with
34 additions
and
0 deletions
bbcli/services/ContentService.py
+
34
−
0
View file @
3d6376f9
import
json
from
subprocess
import
call
from
typing
import
Dict
,
Any
import
requests
from
bbcli.services.course_service
import
list_courses
import
click
# User gets a tree structure view of the courses content
# where each content is listed something like this: _030303_1 Lectures Folder
def
list_course_content
(
cookies
:
Dict
,
course_id
:
str
):
print
(
'
Getting course content!
'
)
# If it is a folder, list it like a tree structure view like mentioned above.
# If it is a document, download and open the document maybe?
# Find all types of content and have an appropriate response for them. This
# should maybe be handled in the view...
def
get_content
(
cookies
:
Dict
,
course_id
:
str
,
content_id
:
str
):
print
(
'
Getting content by its ID.
'
)
# List all contents of type assignment, should be executed if a flag for example like --content-type assignment or smth is used
def
list_assignments
(
cookies
:
Dict
,
course_id
:
str
):
print
(
'
Getting all assignments
'
)
# TODO: add methods for all content types like the one above
# Create content. This should have a flag which says what kind of content type it is
# Create assignment. Creates an assignment
# Delete spesific content
# Update spesific content
\ No newline at end of file
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