-
-
Notifications
You must be signed in to change notification settings - Fork 222
More config values for Runcstone components #867
base: master
Are you sure you want to change the base?
Changes from 6 commits
0b1a55a
ad5bb1d
ae91929
7ab3f18
5d8ae5d
750ef5a
789815e
90d33ed
203de5d
eed1f01
ac5b251
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -48,6 +48,7 @@ build_info | |
|
|
||
| # IDEs | ||
| .vscode/ | ||
| .vs/ | ||
| **/sphinx-enki-info.txt | ||
| # Mac stuff | ||
| .DS_Store | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,6 +44,9 @@ def runestone_extensions(): | |
| modules = [ 'runestone.{}'.format(x) for x in module_paths if os.path.exists('{}/__init__.py'.format(os.path.join(basedir,x)))] | ||
| # Place ``runestone.common`` first, so it can run init code needed by all other modules. This assumes that the first module in the list is run first. An alternative to this to guarantee this ordering is to call ``app.setup_extension('runestone.common')`` in every extension. | ||
| modules.insert(0, modules.pop(modules.index('runestone.common'))) | ||
| # ``runestone.updateConfig`` is reserved for testing and will only be included if you are in a directory with ``test`` in its name | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This comment doesn't match the code -- it's only included if
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed the wording to more accurately match the code |
||
| if('test' not in (os.path.split(os.getcwd())[-1])): | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Awkward. There's an unnecessary set of parens around the if statement. Also, use
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Cleaned up the code. Is there a solution you would recommend which would be better suited for separating this directive from the rest? Is it necessary to do that. I was going off of
brought up in this thread previously
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great! Please push your latest commits so I can see them. I like your approach -- create a special-purpose testing directive, which is only available in a testing environment. I'm just nit-picking the implementation. |
||
| modules.pop(modules.index('runestone.updateConfig')) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
| return modules | ||
|
|
||
| def get_master_url(): | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,7 +33,7 @@ def setup(app): | |
| app.add_directive('timed', TimedDirective) | ||
|
|
||
| app.add_config_value('mchoice_div_class', 'runestone alert alert-warning', 'html') | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There should be left unchanged -- it looks like code that black processed in the original vs. no-formatted code in the diff. |
||
|
|
||
| app.add_config_value('mchoice_compare_button_show', True, 'html'); | ||
| app.add_autoversioned_javascript('mchoice.js') | ||
| app.add_autoversioned_javascript('timedmc.js') | ||
| app.add_autoversioned_javascript('timed.js') | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -297,3 +297,5 @@ htmlhelp_basename = 'PythonCoursewareProjectdoc' | |
| #shortanswer_optional_div_class = 'journal alert alert-success' | ||
| #showeval_div_class = 'runestone explainer alert alert-warning' | ||
| #tabbed_div_class = 'alert alert-warning' | ||
| #mchoice_compare_button_show = True | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add a brief description of what this option controls for both of these.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In fitb.py and multiplechoice.py there are these two comments:
Should I add these to conf.tmpl as well?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, exactly. |
||
| #fitb_compare_button_show = True | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
|
|
||
| from .update import * |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,119 @@ | ||
| ============================== | ||
| Testing update-config direcive | ||
| ============================== | ||
|
|
||
|
|
||
| Multiple Choice | ||
| --------------- | ||
|
|
||
| .. mchoice:: question1 | ||
| :multiple_answers: | ||
| :correct: a,b,d | ||
| :answer_a: red | ||
| :answer_b: yellow | ||
| :answer_c: black | ||
| :answer_d: green | ||
| :feedback_a: Red is a definitely on of the colors. | ||
| :feedback_b: Yes, yellow is correct. | ||
| :feedback_c: Remember the acronym...ROY G BIV. B stands for blue. | ||
| :feedback_d: Yes, green is one of the colors. | ||
|
|
||
| Which colors might be found in a rainbow? (choose all that are correct) | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| Fill in the Blank | ||
| ----------------- | ||
| .. fillintheblank:: fill1 | ||
|
|
||
| Fill in the blanks to make the following sentence: "The red car drove away." | ||
|
|
||
| The |blank| car drove |blank|. | ||
|
|
||
| - :red: Correct. | ||
| :x: Incorrect. Try 'red'. | ||
| - :away: Correct. | ||
| :x: Incorrect. Try 'away'. | ||
|
|
||
|
|
||
|
|
||
|
|
||
| .. update-config:: | ||
| :set_config_option: mchoice_compare_button_show False | ||
| .. update-config:: | ||
| :set_config_option: fitb_compare_button_show False | ||
|
|
||
|
|
||
| Multiple Choice | ||
| --------------- | ||
|
|
||
| .. mchoice:: question2 | ||
| :multiple_answers: | ||
| :correct: a,b,d | ||
| :answer_a: red | ||
| :answer_b: yellow | ||
| :answer_c: black | ||
| :answer_d: green | ||
| :feedback_a: Red is a definitely on of the colors. | ||
| :feedback_b: Yes, yellow is correct. | ||
| :feedback_c: Remember the acronym...ROY G BIV. B stands for blue. | ||
| :feedback_d: Yes, green is one of the colors. | ||
|
|
||
| Which colors might be found in a rainbow? (choose all that are correct) | ||
|
|
||
|
|
||
|
|
||
| Fill in the Blank | ||
| ----------------- | ||
| .. fillintheblank:: fill2 | ||
|
|
||
| Fill in the blanks to make the following sentence: "The red car drove away." | ||
|
|
||
| The |blank| car drove |blank|. | ||
|
|
||
| - :red: Correct. | ||
| :x: Incorrect. Try 'red'. | ||
| - :away: Correct. | ||
| :x: Incorrect. Try 'away'. | ||
|
|
||
|
|
||
| .. update-config:: | ||
| :set_config_option: mchoice_compare_button_show True | ||
|
|
||
|
|
||
| Multiple Choice | ||
| --------------- | ||
|
|
||
| .. mchoice:: question3 | ||
| :multiple_answers: | ||
| :correct: a,b,d | ||
| :answer_a: red | ||
| :answer_b: yellow | ||
| :answer_c: black | ||
| :answer_d: green | ||
| :feedback_a: Red is a definitely on of the colors. | ||
| :feedback_b: Yes, yellow is correct. | ||
| :feedback_c: Remember the acronym...ROY G BIV. B stands for blue. | ||
| :feedback_d: Yes, green is one of the colors. | ||
|
|
||
|
|
||
| .. update-config:: | ||
| :set_config_option: fitb_compare_button_show True | ||
|
|
||
| Fill in the Blank | ||
| ----------------- | ||
| .. fillintheblank:: fill3 | ||
|
|
||
| Fill in the blanks to make the following sentence: "The red car drove away." | ||
|
|
||
| The |blank| car drove |blank|. | ||
|
|
||
| - :red: Correct. | ||
| :x: Incorrect. Try 'red'. | ||
| - :away: Correct. | ||
| :x: Incorrect. Try 'away'. | ||
|
|
||
|
|
||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is duplicated -- see line 78.