Skip to content

Commit

Permalink
v1.3.4
Browse files Browse the repository at this point in the history
- configure custom course info via `INFO`
  • Loading branch information
andreas-schwenk committed Oct 4, 2024
1 parent ea945b1 commit 3017357
Show file tree
Hide file tree
Showing 11 changed files with 811 additions and 794 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# v1.3.4

- configure custom course info via `INFO`

# v1.3.3

- fixed a bug, where no title for a question is given

# v1.3.2

- removed left and right borders in question box on mobile devices
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,12 +186,12 @@ z = x * y
Calculate $x \cdot y =$ %z
```

![](https://raw.githubusercontent.com/andreas-schwenk/pysell/refs/heads/main/img/example2.jpg)

## Syntax

This section describes the syntax of `pySELL`. Many aspects are self-explanatory and can be understood from the [example file](https://github.com/andreas-schwenk/pysell/blob/main/examples/ex1.txt).

![](https://raw.githubusercontent.com/andreas-schwenk/pysell/refs/heads/main/img/example2.jpg)

### Global

- `LANG` defines the natural language used in the few built-in output strings. Currently supported languages are `en`, `de`, `es`, `it`, and `fr`.
Expand All @@ -200,7 +200,7 @@ This section describes the syntax of `pySELL`. Many aspects are self-explanatory

- `AUTHOR` defines the author or institution of the quizzes. You may include HTML code, but everything must be written on the same line where the author keyword starts.

- `QUESTION` marks the beginning of a new question. The title of the question should be written on the same line.
- `QUESTION` indicates the start of a new question, with its title specified on the same line. By default, each correctly answered question earns the student one point. To specify a different point value, include the desired points in parentheses, such as `(X pts)`, where `X` is the number of points. For example: `QUESTION Turing Machine (3 pts)`

- `TIMER` restricts the time students have to complete the quiz page. The time, specified in seconds, is written after a space.

Expand Down
5 changes: 4 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
#!/bin/bash

# DEPENDENCIES
# pip install hatchling twine

# update pySELL itself
python3 build-pysell.py

# update the python package
rm dist/*.whl
rm dist/*.tar.gz
python3 -m build
echo "upload to pypi.org via: twine upload dist/*"
echo "upload to pypi.org via: twine upload dist/*"
4 changes: 2 additions & 2 deletions docs/ex1.html

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions examples/ex2.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
LANG en
TITLE pySELL demo with time limit
AUTHOR Andreas Schwenk
INFO My custom information, displayed at the top of the page.


TIMER 30 # all questions will be evaluated when the timer runs out.
Expand Down
5 changes: 1 addition & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
# DEPENDENCIES
# pip install hatchling twine

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "pysell"
version = "1.3.2"
version = "1.3.4"
description = "A Python-based Simple E-Learning Language for the Rapid Creation of Interactive and Mobile-Friendly STEM Courses"
readme = "README.md"
requires-python = ">=3.8"
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
s
1,542 changes: 772 additions & 770 deletions sell.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion todo.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# TODO: TIMER, PTS in README.md

# TODO: CSS: all-camel case or hyphens

# TODO: show points in exercises

# TODO: variables with negative values -> auto-parentheses
Expand Down
6 changes: 3 additions & 3 deletions web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@
</style>
</head>
<body>
<div id="timer" class="timer">02:34</div>
<div id="timer" class="timer">99:99</div>
<h1 id="title"></h1>
<div style="margin-top: 15px"></div>
<div class="author" id="author"></div>
Expand Down Expand Up @@ -312,7 +312,7 @@ <h1 id="debug" class="debugCode" style="display: none">DEBUG VERSION</h1>
class="button"
style="background-color: var(--green)"
>
jetzt auswerten (TODO: translate)
jetzt auswerten
</button>
</div>
<br />
Expand Down Expand Up @@ -349,7 +349,7 @@ <h1 id="questions-eval-percentage">0 %</h1>
fetch("../examples/ex2.json?v=" + Date.now())
.then((data) => data.json())
.then((quizSrc) => {
let debug = false; // !!!TODO: was true
let debug = true; // !!!TODO: was true
init(quizSrc, debug);
});
</script>
Expand Down
25 changes: 16 additions & 9 deletions web/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,22 @@ export class Quiz {
document.getElementById("date").innerHTML = this.quizSrc.date;
document.getElementById("title").innerHTML = this.quizSrc.title;
document.getElementById("author").innerHTML = this.quizSrc.author;
document.getElementById("courseInfo1").innerHTML =
courseInfo1[this.quizSrc.lang];
let reload =
'<span onclick="location.reload()" style="text-decoration: none; font-weight: bold; cursor: pointer">' +
courseInfo3[this.quizSrc.lang] +
"</span>";
document.getElementById("courseInfo2").innerHTML = courseInfo2[
this.quizSrc.lang
].replace("*", reload);

if (this.quizSrc.info.length > 0) {
// custom info
document.getElementById("courseInfo1").innerHTML = this.quizSrc.info;
} else {
// default info
document.getElementById("courseInfo1").innerHTML =
courseInfo1[this.quizSrc.lang];
let reload =
'<span onclick="location.reload()" style="text-decoration: none; font-weight: bold; cursor: pointer">' +
courseInfo3[this.quizSrc.lang] +
"</span>";
document.getElementById("courseInfo2").innerHTML = courseInfo2[
this.quizSrc.lang
].replace("*", reload);
}

document.getElementById("data-policy").innerHTML =
dataPolicy[this.quizSrc.lang];
Expand Down

0 comments on commit 3017357

Please sign in to comment.