Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions converter/rst/avembed.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ def _avembed(self, matchobj):
f'?selfLoggingEnabled=false&localMode=true&JXOP-debug=true&JOP-lang=en&JXOP-code=java' \
f'&scoringServerEnabled=false&threshold=5&points=1.0&required=True" ' \
f'class="embeddedExercise" width="{iframe_width}" height="{iframe_height}"' \
f' data-showhide="show" scrolling="yes" ' \
f'style="position: relative; top: 0px;">Your browser does not support iframes.</iframe>' \
f' data-showhide="show" scrolling="no" ' \
f'style="position: relative; top: 0px; border: none;">Your browser does not support iframes.</iframe>' \
f'{caret_token}{caret_token}{{Check It!|assessment}}({assessment_id}){caret_token}{caret_token}\n'

@staticmethod
Expand Down
5 changes: 4 additions & 1 deletion converter/rst/code_include.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ def _code_include(self, matchobj):
caret_token = self._caret_token
opt = matchobj.group('options')
tag = self._get_tag_by_opt(opt) if opt else None
for file_path in self._get_file_paths(matchobj):
file_paths = self._get_file_paths(matchobj)
if file_paths is None:
return
for file_path in file_paths:
index = file_path.parts.index(self.source_code_dir)
self._source_code_paths.append('/'.join(file_path.parts[index+1:]))
try:
Expand Down
1 change: 0 additions & 1 deletion converter/rst/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ def _get_image_options(raw_options):
def _image(self, matchobj):
caret_token = self._caret_token
image_path = matchobj.group('path')
image_path = f'{self._open_dsa_cdn}/{image_path}'
output = MASK_IMAGE_TO_MD.replace('{image}', image_path)
output = self._set_alt(output, matchobj.group('options'))
figure_number = matchobj.group('figure_number') if matchobj.group('figure_number') is not None else ''
Expand Down
2 changes: 1 addition & 1 deletion converter/rst2markdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
from converter.rst.preparer_math_block import PreparerMathBlock
from converter.rst.character import Character

OPEN_DSA_CDN = 'https://global.codio.com/opendsa/v5'
OPEN_DSA_CDN = 'https://global.codio.com/opendsa/v6'


class Rst2Markdown(object):
Expand Down
10 changes: 5 additions & 5 deletions tests/unit/cases_rst/avembed.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
Each '0' bit indicates a left branch while each '1' bit indicates a right branch. The following slideshow shows an example for how to decode a message by traversing the tree appropriately.


<iframe id="huffmanDecodeCON_iframe" src="https://global.codio.com/opendsa/v5/jsav/iframe/v1/huffmandecodecon.html" width="950" height="250" scrolling="yes" style="position: relative; top: 0px; border: 0; margin: 0; overflow: hidden;">Your browser does not support iframes.</iframe>
<iframe id="huffmanDecodeCON_iframe" src="https://global.codio.com/opendsa/v6/jsav/iframe/v1/huffmandecodecon.html" width="950" height="250" scrolling="yes" style="position: relative; top: 0px; border: 0; margin: 0; overflow: hidden;">Your browser does not support iframes.</iframe>
<br/>
<center>Figure 0.0.1 </center><br/>



<iframe id="HuffmanDecodePRO_iframe" src="https://global.codio.com/opendsa/v5/Exercises/Binary/HuffmanDecodePRO.html?selfLoggingEnabled=false&localMode=true&JXOP-debug=true&JOP-lang=en&JXOP-code=java&scoringServerEnabled=false&threshold=5&amp;points=1.0&required=True" class="embeddedExercise" width="950" height="800" data-showhide="show" scrolling="yes" style="position: relative; top: 0px;">Your browser does not support iframes.</iframe>
<iframe id="HuffmanDecodePRO_iframe" src="https://global.codio.com/opendsa/v6/Exercises/Binary/HuffmanDecodePRO.html?selfLoggingEnabled=false&localMode=true&JXOP-debug=true&JOP-lang=en&JXOP-code=java&scoringServerEnabled=false&threshold=5&amp;points=1.0&required=True" class="embeddedExercise" width="950" height="800" data-showhide="show" scrolling="no" style="position: relative; top: 0px; border: none;">Your browser does not support iframes.</iframe>

{Check It!|assessment}(custom-huffmandecodepro)

Expand All @@ -22,16 +22,16 @@ In theory, Huffman coding is an optimal coding method whenever the true frequenc



![Mid-square method example](https://global.codio.com/opendsa/v5/Images/MidSquare.png)
![Mid-square method example](Images/MidSquare.png)


<iframe id="MidSquare_iframe" src="https://global.codio.com/opendsa/v5/AV/Hashing/MidSquare.html?selfLoggingEnabled=false&localMode=true&JXOP-debug=true&JOP-lang=en&JXOP-code=java&scoringServerEnabled=false&threshold=5&amp;points=1.0&required=True" class="embeddedExercise" width="950" height="800" data-showhide="show" scrolling="yes" style="position: relative; top: 0px;">Your browser does not support iframes.</iframe>
<iframe id="MidSquare_iframe" src="https://global.codio.com/opendsa/v6/AV/Hashing/MidSquare.html?selfLoggingEnabled=false&localMode=true&JXOP-debug=true&JOP-lang=en&JXOP-code=java&scoringServerEnabled=false&threshold=5&amp;points=1.0&required=True" class="embeddedExercise" width="950" height="800" data-showhide="show" scrolling="no" style="position: relative; top: 0px; border: none;">Your browser does not support iframes.</iframe>

{Check It!|assessment}(custom-midsquare)




<iframe id="MidSquare1_iframe" src="https://global.codio.com/opendsa/v5/AV/Hashing/MidSquare1.html?selfLoggingEnabled=false&localMode=true&JXOP-debug=true&JOP-lang=en&JXOP-code=java&scoringServerEnabled=false&threshold=5&amp;points=1.0&required=True" class="embeddedExercise" width="950" height="800" data-showhide="show" scrolling="yes" style="position: relative; top: 0px;">Your browser does not support iframes.</iframe>
<iframe id="MidSquare1_iframe" src="https://global.codio.com/opendsa/v6/AV/Hashing/MidSquare1.html?selfLoggingEnabled=false&localMode=true&JXOP-debug=true&JOP-lang=en&JXOP-code=java&scoringServerEnabled=false&threshold=5&amp;points=1.0&required=True" class="embeddedExercise" width="950" height="800" data-showhide="show" scrolling="no" style="position: relative; top: 0px; border: none;">Your browser does not support iframes.</iframe>

{Check It!|assessment}(custom-midsquare1)
2 changes: 1 addition & 1 deletion tests/unit/cases_rst/image.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![Dynamic "left-child/right-sibling" representation](https://global.codio.com/opendsa/v5/Images/GenBin.png)
![Dynamic "left-child/right-sibling" representation](Images/GenBin.png)

**Figure 0.0.1:** *A general tree converted to the dynamic "left-child/right-sibling" representation.*

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/cases_rst/inlineav.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

<iframe id="ChomskyCON_iframe" src="https://global.codio.com/opendsa/v5/jsav/iframe/v1/chomskycon.html" width="950" height="250" scrolling="yes" style="position: relative; top: 0px; border: 0; margin: 0; overflow: hidden;">Your browser does not support iframes.</iframe>
<iframe id="ChomskyCON_iframe" src="https://global.codio.com/opendsa/v6/jsav/iframe/v1/chomskycon.html" width="950" height="250" scrolling="yes" style="position: relative; top: 0px; border: 0; margin: 0; overflow: hidden;">Your browser does not support iframes.</iframe>
<br/>
<center>Figure 0.0.1: </center><br/>

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/cases_rst/sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

**Portrait of Carl Gauss**

![**Figure 0.0.1:** *Carl Friedrich Gauss by G. Biermann (1824-1908)*](https://global.codio.com/opendsa/v5/Images/Carl_Friedrich_Gauss.jpg)
![**Figure 0.0.1:** *Carl Friedrich Gauss by G. Biermann (1824-1908)*](Images/Carl_Friedrich_Gauss.jpg)

**Figure 0.0.1:** *Carl Friedrich Gauss by G. Biermann (1824-1908)*

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_render_rst.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def test_bibliography_render(self):
self.run_case('bibliography')

def test_code_include_render(self):
self.run_case('code_include', pathlib.Path.cwd().joinpath('./tests/unit/cases_rst'))
self.run_case('code_include', pathlib.Path.cwd().joinpath('./cases_rst'))

def test_glossary_render(self):
self.run_case('glossary')
Expand Down