bsom quizzes embedding

Curl the files

for f in `grep -o "https://.*ratest..\.html" ../graph.json | sort | uniq`; do out=`echo $f | grep -o "ratest..\.html"`; curl $f > $out; done

Copy the files to correct destination

for node in nodes:
    myid = nodes[node]["id"]
    if re.match(r'.*ratest.*', myex):
        ratest = re.findall(r'https://.*(ratest..\.html)', myex)[0]
        shutil.copyfile(f'/home/fabian/gitlab/pontifex-hugo/nodes/downloads/{ratest}', f'/home/fabian/gitlab/pontifex-hugo/nodes/{myid}/{ratest}')

Git add the files

for f in `find . -iname "ratest??.html"`; do git add -f $f; done
  • adapt json to use local HTML
  • delete buttons, impressum, links

This solution keeps using iframes but for embedding local htmlfiles. This is necessary because of different bootstrap and mathjax versions used in Pontifex vs. Quizzes

grep -o "ratest.." nodes/graph.json | sort | uniq

gives the quizzes:

ratest07
ratest09
ratest10
ratest11
ratest13
ratest21
ratest22
ratest23
ratest24
ratest25
ratest29
ratest30
ratest31
ratest37
ratest40
ratest45
ratest47
ratest48
ratest49
ratest50
ratest51
ratest52
ratest53
ratest56
ratest61

Embedding goes via

<script src="https://cdnjs.cloudflare.com/ajax/libs/iframe-resizer/4.3.2/iframeResizer.min.js"></script>

<iframe
  class="embed-responsive-item"
  style="border-width: 0"
  src="./ratest.html"
  width="100%"
>

</iframe><script>iFrameResize({log:true,inPageLinks:true,resizeFrom:'child'})</script>
Edited by Fabian Nuraddin Alexander Gabel