From c725ad3d774b5dcf3b1b841b2650d6c76de4c640 Mon Sep 17 00:00:00 2001 From: Miguel BarĂ£o Date: Sat, 5 Jan 2019 00:40:03 +0000 Subject: [PATCH] - topics can be started by clicking anywhere in the table row - updated QUESTIONS.md --- QUESTIONS.md | 39 ++++++++++++++++++++++----------------- static/js/maintopics.js | 3 +++ templates/maintopics-table.html | 4 +--- 3 files changed, 26 insertions(+), 20 deletions(-) diff --git a/QUESTIONS.md b/QUESTIONS.md index c963448..441ba67 100644 --- a/QUESTIONS.md +++ b/QUESTIONS.md @@ -1,33 +1,38 @@ # Questions -Questions are saved in files in the [YAML](http://www.yaml.org/start.html) format. Each file has a list of questions with the following structure: +Questions are saved in files in the [YAML](http://www.yaml.org/start.html) format. Each file contains a list of questions like ```yaml - type: radio - ref: question1 + ref: myquestion1 ... - type: checkbox - ref: question2 + ref: myquestion2 ... ``` -The following kinds kinds of questions are supported: +where each question is specified in a dictionary. +The `type` key is mandatory and specifies the type of question (multiple choice, text, etc). +The other keys available will depend on the type of question. +The field `ref` is not strictly required but still recommended, if not defined it will default to a string with the filename and the question index, e.g., `questions.yaml:12`. + +The following types of questions are supported: type | kind of answer -----|----------------- -[radio](#radio) | Choose exactly one option from list of options. +[radio](#radio) | Choose exactly one option from a list of options. [checkbox](#checkbox) | Choose zero, one or more options. -[text](#text) | Line of text which is matched against a list of acceptable answers. +[text](#text) | Line of text which is compared against a list of acceptable answers. [text-regex](#text-regex) | Similar to text, but the answer is validated by a regular expression. -[numeric-interval](#numeric-interval) | Answer is interpreted as a floating point value (e.g. `1.2e-3`), which is checked against a closed interval. -[textarea](#textarea) | The answer is a multiline block of text that is sent to an external program for assessment. The printed output of the external program is parsed to obtain the result. -[information, warning, alert and success](#information-warning-alert-and-success) | These are not really questions, just information panels intended to be used in tests to convey information. There is no answer and it's always correct. -[generator](#generator) | This is not a really a question type. It means that this question will be generated by an external program, and the actual type is defined there. +[numeric-interval](#numeric-interval) | Answer is interpreted as a floating point value (e.g. `1.2e-3`), and is checked against a closed interval. +[textarea](#textarea) | The answer is a multiline block of text that is sent to an external program for assessment. The printed output of the external program is parsed (yaml) to obtain the result. +[information, warning, alert, success](#information-warning-alert-and-success) | These are not really questions, just information panels intended to be used to convey information. There is no space for an answer and the correction returns always correct. +[generator](#generator) | This is not a real question type. It means that this question will be generated by an external program, and the actual type is defined there. -In all questions, the field `type` is required. The field `ref` is not strictly required but still recommended, if not defined will default to FIXME. +## Question types -## radio +### radio Only one option can be selected as the answer. If no option is selected, the question is considered unanswered. @@ -53,18 +58,18 @@ All fields are optional except `type` and `options`. `title` and `text` default The `correct` field can be used in multiple ways and in combination with `shuffle`, `discount` and `choose` fields: -- if not present, the first option is considered correct (options are usually shuffled...). -- it can be the index (0-based) of the correct option, e.g., `correct: 0`. +- if not present, the first option is considered correct (options are shuffled by default when presented to the student). +- it can be the index (0-based) of the correct option, e.g., `correct: 0` for the first option. - it can be a list of numbers between 0 and 1, e.g., `correct: [1, 0, 0]`. In this case, the first option is 100% correct while the others are 0%. If `discount: true` (the default), then the wrong ones will be penalized by $-1/(n-1)=-\tfrac{1}{2}$, where $n$ is the number of options. - there can be more than one correct option in the list, which is then marked in the correct field, e.g. `correct: [1, 1, 0]`. In this case, one of the correct options will be randomly selected, and the remaining wrong ones appended. - there can also be a long list of right and wrong options from which to build the question options. E.g. if `correct: [1,1,1,0,0,0,0]` and `choose: 3` is defined, then 1 correct option and 2 wrong ones are randomly selected from the list. - finally it's also possible to have a question that is *"not-completely-right"* or *"not-completely-wrong"*. This can be done using numbers between 0 and 1, e.g., `correct: [1, 0.3, 0]`. This practice is discouraged. -In some situations one may not want the options to be shuffled, e.g., if they show several steps of a proof and the student should mark the wrong step. In that case use `shuffle: false`. +In some situations one may not want the options to be shuffled. In that case use `shuffle: false`. -## checkbox +### checkbox -Zero, one or multiple options can be selected. The question is always considered as answered, even if no options are selected, which is also a valid answed. +Zero, one or multiple options can be selected. The question is always considered as answered, even if no options are selected. The simplest format is diff --git a/static/js/maintopics.js b/static/js/maintopics.js index 3f6642f..6f91ca5 100644 --- a/static/js/maintopics.js +++ b/static/js/maintopics.js @@ -29,4 +29,7 @@ function change_password() { $(document).ready(function() { $("#change_password").click(change_password); + $(".clickable-row").click(function () { + window.location = $(this).data("href"); + }); }); diff --git a/templates/maintopics-table.html b/templates/maintopics-table.html index 8a4630e..d9b08a5 100644 --- a/templates/maintopics-table.html +++ b/templates/maintopics-table.html @@ -87,7 +87,7 @@ {% else %} - + {% if t['type']=='chapter' %}
@@ -98,7 +98,6 @@ {% end %} - {% if t['level'] < 0.01 %} {% elif t['type']=='chapter' %} @@ -112,7 +111,6 @@
{% end %} - {% end %} -- libgit2 0.21.2