Difference between revisions of "Projects/open edx"

Jump to navigation Jump to search
m
add info about VM
m (add exemple of api usage)
m (add info about VM)
 
(2 intermediate revisions by the same user not shown)
Line 13: Line 13:
it's use [https://en.wikipedia.org/wiki/XBlock Xblocks] and we can get them with the API. List of Xblocks is available here : https://openedx.atlassian.net/wiki/display/COMM/XBlocks+Directory
it's use [https://en.wikipedia.org/wiki/XBlock Xblocks] and we can get them with the API. List of Xblocks is available here : https://openedx.atlassian.net/wiki/display/COMM/XBlocks+Directory


<nowiki>===Exemple using API===</nowiki><syntaxhighlight lang="python3" line="1">
VM of basic openedx is available at bitnami (Require at least 3Go of RAM): [https://bitnami.com/stack/edx/virtual-machine] with exemple course.
#!/usr/bin/env python3
VM of Fun version of openedx is here : [https://github.com/openfun/fun-boxes]
 
import requests
import json


url = "https://www.fun-mooc.fr/api/courses/v1/courses/"
===Exemple using API===
data={"pagination" : { "next" :url } }
<syntaxhighlight lang="python3" line="1">
#data["pagination"]["next"] = url
while data["pagination"]["next"] != None:
    r = requests.get(data["pagination"]["next"])
    data=r.json()
    for course in data["results"]:
        print(course["course_id"] , " : ", course["name"])
</syntaxhighlight><syntaxhighlight lang="python3" line="1">
#!/usr/bin/env python3
#!/usr/bin/env python3
 
#List course of fun
import requests
import requests
import json
import json
Line 35: Line 25:
url = "https://www.fun-mooc.fr/api/courses/v1/courses/"
url = "https://www.fun-mooc.fr/api/courses/v1/courses/"
data={"pagination" : { "next" :url } }
data={"pagination" : { "next" :url } }
#data["pagination"]["next"] = url
while data["pagination"]["next"] != None:
while data["pagination"]["next"] != None:
     r = requests.get(data["pagination"]["next"])
     r = requests.get(data["pagination"]["next"])
14

edits

Navigation menu