Skip to content
This repository was archived by the owner on Jun 7, 2023. It is now read-only.

Commit bd7aa9c

Browse files
committed
Merge branch 'master' of https://github.com/ram8647/RunestoneComponents into ram8647-master
2 parents 388a224 + e2af37f commit bd7aa9c

3 files changed

Lines changed: 375 additions & 2 deletions

File tree

runestone/quizly/quizly.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,7 @@ def purge_activecodes(app, env, docname):
154154
pass
155155

156156

157-
#class Quizly(RunestoneIdDirective):
158-
class Quizly(Assessment):
157+
class Quizly(RunestoneIdDirective):
159158
"""
160159
.. quizly:: some_unique_id, e.g., q1
161160

runestone/quizly/test/conf.py

Lines changed: 304 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,304 @@
1+
# *************************************************************
2+
# |docname| - Sphinx configuration file for a Runestone project
3+
# *************************************************************
4+
#
5+
# Problem Solving with Algorithms and Data Structures documentation build configuration file, created by
6+
# sphinx-quickstart on Thu Oct 27 08:17:45 2011.
7+
#
8+
# This file is execfile()d with the current directory set to its containing dir.
9+
#
10+
# Note that not all possible configuration values are present in this
11+
# autogenerated file.
12+
#
13+
# All configuration values have a default; values that are commented out
14+
# serve to show the default.
15+
16+
import sys, os
17+
18+
# If extensions (or modules to document with autodoc) are in another directory,
19+
# add these directories to sys.path here. If the directory is relative to the
20+
# documentation root, use os.path.abspath to make it absolute, like shown here.
21+
#sys.path.insert(0, os.path.abspath('../modules'))
22+
23+
from runestone import runestone_static_dirs, runestone_extensions, setup
24+
import pkg_resources
25+
26+
# -- General configuration -----------------------------------------------------
27+
28+
# If your documentation needs a minimal Sphinx version, state it here.
29+
#needs_sphinx = '1.0'
30+
31+
# Add any Sphinx extension module names here, as strings. They can be extensions
32+
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
33+
extensions = ['sphinx.ext.mathjax'] + runestone_extensions()
34+
35+
#,'runestone.video','runestone.reveal','runestone.poll','runestone.tabbedStuff','runestone.disqus','runestone.codelens','runestone.activecode', 'runestone.assess', 'runestone.animation','runestone.meta', 'runestone.parsons', 'runestone.blockly', 'runestone.livecode','runestone.accessibility']
36+
37+
# This sets up your project to use the defaults. If you want to create a custom set of templates
38+
# for your own project you can over ride them by creating your own _templates folder
39+
templates_path = [pkg_resources.resource_filename('runestone', 'common/project_template/_templates')]
40+
41+
# The suffix of source filenames.
42+
source_suffix = '.rst'
43+
44+
# The encoding of source files.
45+
#source_encoding = 'utf-8-sig'
46+
47+
# The master toctree document.
48+
master_doc = 'index'
49+
50+
# General information about the project.
51+
project = 'Quizly Test'
52+
copyright = '2017 rmorelli'
53+
54+
# The version info for the project you're documenting, acts as replacement for
55+
# |version| and |release|, also used in various other places throughout the
56+
# built documents.
57+
#
58+
# The short X.Y version.
59+
version = '0.0.1'
60+
# The full version, including alpha/beta/rc tags.
61+
release = '0.0'
62+
63+
# The language for content autogenerated by Sphinx. Refer to documentation
64+
# for a list of supported languages.
65+
#language = None
66+
67+
# There are two options for replacing |today|: either, you set today to some
68+
# non-false value, then it is used:
69+
#today = ''
70+
# Else, today_fmt is used as the format for a strftime call.
71+
#today_fmt = '%B %d, %Y'
72+
73+
# List of patterns, relative to source directory, that match files and
74+
# directories to ignore when looking for source files.
75+
exclude_patterns = []
76+
77+
# The reST default role (used for this markup: `text`) to use for all documents.
78+
#default_role = None
79+
80+
# If true, '()' will be appended to :func: etc. cross-reference text.
81+
#add_function_parentheses = True
82+
83+
# If true, the current module name will be prepended to all description
84+
# unit titles (such as .. function::).
85+
#add_module_names = True
86+
87+
# If true, sectionauthor and moduleauthor directives will be shown in the
88+
# output. They are ignored by default.
89+
#show_authors = False
90+
91+
# The name of the Pygments (syntax highlighting) style to use.
92+
pygments_style = 'sphinx'
93+
94+
# A list of ignored prefixes for module index sorting.
95+
#modindex_common_prefix = []
96+
97+
# `keep_warnings <http://www.sphinx-doc.org/en/stable/config.html#confval-keep_warnings>`_:
98+
# If true, keep warnings as “system message” paragraphs in the built documents.
99+
# Regardless of this setting, warnings are always written to the standard error
100+
# stream when sphinx-build is run.
101+
keep_warnings = True
102+
103+
# `rst_prolog <http://www.sphinx-doc.org/en/stable/config.html#confval-rst_prolog>`_:
104+
# A string of reStructuredText that will be included at the beginning of every
105+
# source file that is read.
106+
rst_prolog = (
107+
# For fill-in-the-blank questions, provide a convenient means to indicate a blank.
108+
"""
109+
110+
.. |blank| replace:: :blank:`x`
111+
"""
112+
113+
# For literate programming files, provide a convenient way to refer to a source file's name. See `runestone.lp.lp._docname_role`.
114+
""".. |docname| replace:: :docname:`name`
115+
"""
116+
)
117+
118+
# Select whether to use server-side grading where possible. Server-side grading
119+
# requires **all** the following:
120+
#
121+
# - The use of Runestone services (``eBookConfig.useRunestoneServices === true``)
122+
# - Logging enabled (``eBookConfig.logLevel > 0``)
123+
#
124+
# The first two conditions cause the ``RunestoneBase.logBookEvent`` in ``runestonebase.js`` to post a student response to the server. The last conditions ensures that ``hsblog`` in ``ajax.py`` on the server will return a response containing grading information.
125+
runestone_server_side_grading = False
126+
127+
# Extensions
128+
# ==========
129+
# CodeChat
130+
# --------
131+
# **CodeChat note:** A dict of {glob_, lexer_alias}, which uses lexer_alias
132+
# (e.g. a lexer's `short name <http://pygments.org/docs/lexers/>`_) to analyze
133+
# any file wihch matches the given `glob
134+
# <https://docs.python.org/2/library/glob.html>`_.
135+
CodeChat_lexer_for_glob = {
136+
# Otherwise, Pygments picks the wrong lexer for CSS...
137+
'*.css': 'CSS',
138+
# ... and for JavaScript.
139+
'*.js': 'JavaScript',
140+
}
141+
#
142+
# **CodeChat note::** This is a list of exclude_patterns_ which applies only to
143+
# source documents; exclude_patterns_ will exclude the given files from all of
144+
# Sphinx (for example, files here won't be included even if they're mentioned in
145+
# html_static_path_.
146+
CodeChat_excludes = []
147+
#
148+
# Inline syntax highlight
149+
# -----------------------
150+
# `inline_highlight_respect_highlight <https://sphinxcontrib-inlinesyntaxhighlight.readthedocs.io/en/latest/#confval-inline_highlight_respect_highlight>`_:
151+
# Use the language specified by the ``highlight`` directive to syntax highlight ``code`` role contents.
152+
inline_highlight_respect_highlight = True
153+
inline_highlight_literals = False
154+
155+
# -- Options for HTML output ---------------------------------------------------
156+
157+
# The theme to use for HTML and HTML Help pages. See the documentation for
158+
# a list of builtin themes.
159+
html_theme = 'sphinx_bootstrap'
160+
161+
# Theme options are theme-specific and customize the look and feel of a theme
162+
# further. For a list of options available for each theme, see the
163+
# documentation.
164+
#html_theme_options = {'nosidebar': 'true'}
165+
html_theme_options = {
166+
# Navigation bar title. (Default: ``project`` value)
167+
'navbar_title': "Quizly",
168+
169+
# Tab name for entire site. (Default: "Site")
170+
'navbar_site_name': "Chapters",
171+
172+
# Global TOC depth for "site" navbar tab. (Default: 1)
173+
# Switching to -1 shows all levels.
174+
'globaltoc_depth': 1,
175+
176+
# Include hidden TOCs in Site navbar?
177+
#
178+
# Note: If this is "false", you cannot have mixed ``:hidden:`` and
179+
# non-hidden ``toctree`` directives in the same page, or else the build
180+
# will break.
181+
#
182+
# Values: "true" (default) or "false"
183+
'globaltoc_includehidden': "true",
184+
185+
# HTML navbar class (Default: "navbar") to attach to <div> element.
186+
# For black navbar, do "navbar navbar-inverse"
187+
'navbar_class': "navbar",
188+
189+
# Fix navigation bar to top of page?
190+
# Values: "true" (default) or "false"
191+
'navbar_fixed_top': "true",
192+
193+
# Location of link to source.
194+
# Options are "nav" (default), "footer" or anything else to exclude.
195+
'source_link_position': "nav",
196+
197+
# Bootswatch (http://bootswatch.com/) theme.
198+
#
199+
# Options are nothing with "" (default) or the name of a valid theme
200+
# such as "amelia" or "cosmo".
201+
#
202+
# Note that this is served off CDN, so won't be available offline.
203+
#'bootswatch_theme': "slate",
204+
}
205+
206+
207+
# This is set up to use the default runestone themes, you can override them by
208+
# creating your own folder and modifying this path.
209+
# Add any paths that contain custom themes here, relative to this directory.
210+
html_theme_path = [pkg_resources.resource_filename('runestone', 'common/project_template/_templates/plugin_layouts')]
211+
212+
213+
# The name for this set of Sphinx documents. If None, it defaults to
214+
# "<project> v<release> documentation".
215+
html_title = 'Quizly'
216+
217+
# A shorter title for the navigation bar. Default is the same as html_title.
218+
html_short_title ='Quizly'
219+
220+
# The name of an image file (relative to this directory) to place at the top
221+
# of the sidebar.
222+
223+
# logo is included in layout file
224+
#html_logo = "../source/_static/logo_small.png"
225+
226+
# The name of an image file (within the static path) to use as favicon of the
227+
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
228+
# pixels large.
229+
#html_favicon = None
230+
231+
# Add any paths that contain custom static files (such as style sheets) here,
232+
# relative to this directory. They are copied after the builtin static files,
233+
# so a file named "default.css" will overwrite the builtin "default.css".
234+
235+
html_static_path = runestone_static_dirs() + ['_static']
236+
237+
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
238+
# using the given strftime format.
239+
#html_last_updated_fmt = '%b %d, %Y'
240+
241+
# If true, SmartyPants will be used to convert quotes and dashes to
242+
# typographically correct entities.
243+
#html_use_smartypants = True
244+
245+
# Custom sidebar templates, maps document names to template names.
246+
#html_sidebars = {}
247+
248+
# Additional templates that should be rendered to pages, maps page names to
249+
# template names.
250+
#html_additional_pages = {}
251+
252+
# If false, no module index is generated.
253+
#html_domain_indices = True
254+
255+
# If false, no index is generated.
256+
#html_use_index = True
257+
258+
# If true, the index is split into individual pages for each letter.
259+
#html_split_index = False
260+
261+
# If true, links to the reST sources are added to the pages.
262+
html_show_sourcelink = False
263+
264+
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
265+
#html_show_sphinx = True
266+
267+
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
268+
#html_show_copyright = True
269+
270+
# If true, an OpenSearch description file will be output, and all pages will
271+
# contain a <link> tag referring to it. The value of this option must be the
272+
# base URL from which the finished HTML is served.
273+
#html_use_opensearch = ''
274+
275+
# This is the file name suffix for HTML files (e.g. ".xhtml").
276+
#html_file_suffix = None
277+
278+
# Output file base name for HTML help builder.
279+
htmlhelp_basename = 'PythonCoursewareProjectdoc'
280+
281+
# .. _accessibility_style:
282+
#
283+
# accessibility_style
284+
# -------------------
285+
# This config value is defined in the `../../accessibility/accessibility.py` extension.
286+
# By this config value you can select what accessibility stylesheet
287+
# you want to add (``normal``, ``light``, ``darkest`` or ``none``).
288+
#accessibility_style = 'normal'
289+
290+
# Config values for specific Runestone components
291+
#
292+
quizly_div_class = 'runestone alert alert-warning'
293+
#activecode_hide_load_history = False
294+
#mchoice_div_class = 'runestone alert alert-warning'
295+
#clickable_div_class = 'runestone alert alert-warning'
296+
#codelens_div_class = 'alert alert-warning cd_section'
297+
#dragndrop_div_class = 'runestone'
298+
#fitb_div_class = 'runestone'
299+
#parsons_div_class = 'runestone'
300+
#poll_div_class = 'alert alert-warning'
301+
#shortanswer_div_class = 'journal alert alert-warning'
302+
#shortanswer_optional_div_class = 'journal alert alert-success'
303+
#showeval_div_class = 'runestone explainer alert alert-warning'
304+
#tabbed_div_class = 'alert alert-warning'

runestone/quizly/test/pavement.py

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
import os
2+
import sys
3+
import pkg_resources
4+
from socket import gethostname
5+
6+
from paver.easy import options, Bunch
7+
import paver.setuputils
8+
9+
from runestone import get_master_url
10+
from runestone import build # NOQA: F401 -- build is called implicitly by the paver driver.
11+
from runestone.server import get_dburl
12+
13+
paver.setuputils.install_distutils_tasks()
14+
sys.path.append(os.getcwd())
15+
16+
# The project name, for use below.
17+
project_name = 'quizly'
18+
19+
master_url = 'http://127.0.0.1:8000'
20+
if not master_url:
21+
master_url = get_master_url()
22+
23+
# The root directory for ``runestone serve``.
24+
serving_dir = "./build/" + project_name
25+
# The destination directory for ``runestone deploy``.
26+
dest = "../../static"
27+
28+
options(
29+
sphinx=Bunch(docroot=".",),
30+
31+
build=Bunch(
32+
builddir=serving_dir,
33+
sourcedir="_sources",
34+
outdir=serving_dir,
35+
confdir=".",
36+
template_args={
37+
'login_required': 'false',
38+
'loglevel': 0,
39+
'course_title': project_name,
40+
'python3': 'false',
41+
'dburl': '',
42+
'default_ac_lang': 'python',
43+
'jobe_server': 'http://jobe2.cosc.canterbury.ac.nz',
44+
'proxy_uri_runs': '/jobe/index.php/restapi/runs/',
45+
'proxy_uri_files': '/jobe/index.php/restapi/files/',
46+
'downloads_enabled': 'false',
47+
'enable_chatcodes': 'false',
48+
'allow_pairs': 'false',
49+
'dynamic_pages': False,
50+
'use_services': 'false',
51+
'basecourse': project_name,
52+
'course_id': project_name,
53+
# These are used for non-dynamic books.
54+
'appname': 'runestone',
55+
'course_url': master_url,
56+
}
57+
)
58+
)
59+
60+
# if we are on runestone-deploy then use the proxy server not canterbury
61+
if gethostname() == 'runestone-deploy':
62+
del options.build.template_args['jobe_server']
63+
del options.build.template_args['proxy_uri_runs']
64+
del options.build.template_args['proxy_uri_files']
65+
66+
version = pkg_resources.require("runestone")[0].version
67+
options.build.template_args['runestone_version'] = version
68+
69+
# If DBURL is in the environment override dburl
70+
options.build.template_args['dburl'] = get_dburl(outer=locals())

0 commit comments

Comments
 (0)