How do I create a cloze question type with a combination of single and multiple choices? - moodle

My problem occurs in questions exported to moodle.
I intend to create a cloze question that has a part being single choice (schoice) and another part being multiple choice (mchoice). When exporting using the exams2moodle function I have two possible behaviors: either all questions are displayed as schoice (drop-down menu) or all are displayed as mchoice (check box). Visually the second case may even work, however it does not correctly score points or penalties, as the questions is treated as mchoice, regardless of its definition.
How do these distinct behaviors occur? The first item defines the behavior of the question, if the first is schoice then everyone will appear as such and vice versa.
Minimal example (all questions are shown as mchoice in moodle)
\begin{question}
This is the question. This is the question
\begin{answerlist}
\item Multiple choice answer 1.
\item Multiple choice answer 2.
\item Multiple choice answer 3.
\item Multiple choice answer 4.
\item Single choice 1.
\item Single choice 2.
\end{answerlist}
\end{question}
\exname{cloze_schoice_mchoice}
\extype{cloze}
\exclozetype{mchoice|schoice}
\exsolution{1100|10}
Minimal example (all questions are shown as schoice in moodle)
\begin{question}
This is the question. This is the question
\begin{answerlist}
\item Single choice 1.
\item Single choice 2.
\item Multiple choice answer 1.
\item Multiple choice answer 2.
\item Multiple choice answer 3.
\item Multiple choice answer 4.
\end{answerlist}
\end{question}
\exname{cloze_schoice_mchoice}
\extype{cloze}
\exclozetype{schoice|mchoice}
\exsolution{10|1100}
Is it possible to get a proper behavior or do some workaround?

This was a bug in exams2moodle(), thanks for pointing this out. I have fixed it in exams 2.4-0. If you install that, running exams2moodle() gives you check boxes for the mchoice questions and a drop-down menu for the schoice questions. These defaults can be modified via
exams2moodle(...,
cloze = list(cloze_mchoice_display = ..., cloze_schoice_display = ...))

Related

How to use a formatted reference as a source in Word?

I apologize if the title doesn't properly describe the issue or if solutions have already been posted, I wasn't sure what to call this.
I have a list of scientific articles as references. The format is:
Mazourek, M., Pujar, A., Borovsky, Y., Paran, I., Mueller, L., Jahn, M. M. (2009). A dynamic interface for capsaicinoid systems biology. Plant Physiology, 150(4), 1806-1821.
I get these from Google Scholar directly (APA format) and want to maintain this format. Can I use this as a source in Word without having to fill out the entire form and write one-by-one every author and all the fields about journal, year, etc.? I want to reference this using its number in a numbered list, and for word to automatically update the numbers of in-text citations if I add a new reference to the start of the list, for example. Thanks.

What does lexicographically mean? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
I saw a program in codeforces where it says, "Now Petya wants to compare those two strings lexicographically."
I didn't understand it. What does lexicographically mean?
I'm not sure if this is more of a stackoverflow question or not, but I could be wrong. . . Based on your question and its usage I would prefer a breakdown of the word "lexicographically".
The root appears to be "lexicon", which we can see by this reference the definition is:
"a book containing an alphabetical arrangement of the words in a language and their definitions"
OR
"the vocabulary of a language, an individual speaker or group of speakers, or a subject"
OR (more related to computers)
"the total stock of morphemes in a language"
In this pdf the author says,
"The lexicon of a computer language is its total inventory of words and symbols."
Next, we want to look at the word "lexicography", this is the next layer to our process of building the word up from the root. First, let us look at the general definition. According to Merriam-Webster in this reference we see that lexicography is defined as such:
"the editing or making of a dictionary"
OR
"the principles and practices of dictionary making"
In this reference regarding Computation Lexicography the author states, "Computational Lexicology is the use of computers in the study of the lexicon. It has been more narrowly described by others (Amsler, 1980) as the use of computers in the study of machine-readable dictionaries."
The next-to-last step is to look at the word without its description of the action occurring, that would be "lexicographic", as in lexicographic order. In this reference we see, "In mathematics, the lexicographic or lexicographical order (also known as lexical order, or dictionary order) is a generalization of the alphabetical order of the dictionaries to sequences of ordered symbols or, more generally, of elements of a totally ordered set."
Lastly, we can see that the word is an adverb since in the example sentence it is describing the action that is occurring - also we see the use of "-ly" at the end of the word.
It would appear that Petya would like to compare the two strings alphabetically and with regard to their potentially symbolic, or definitive, meaning within the dictionary of lexicons from which they exist.
A fun little analysis project that took me on.

How can i beautify my code in Matlab (tabs, deleting unnecessary spaces etc.)? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
i'm looking to find a way to beautify my code in MATLAB. I'm talking about tabs, deleting unnecessary spaces etc., the way Eclipse does it with Ctrl+Shift+F
The smart indentation (ctrl + I) is probably all you need (as #Matteo V and #Cris Luengo already mentioned).
However, there are a few other neat tricks that you might want to have a look at if you are really into code development:
Well, first have a look at the Improve Code Readability site of MATLAB. You could use the Apply smart indenting while typing option in the Preferences > MATLAB > Editor/Debugger > Language > Indenting section (it should be turned on per default but I like the Indent all functions setting). There are a bunch of other settings that you may want to explore
If you dig yourself deeper in the MATLAB IDE, you will notice that you can adjust almost everything to your preferences, but the way is not always documented in the web.... however, the local documentation (call doc) contains the info you may be looking for, see this blog-post
I am not aware of an automatic detection of double spaces or similar but you might end up writing your own little callback-function. Most languages ignore this anyway (perhaps except for Python). Code readability is usually a topic that the programmer(s) should care about... and not the machines ;)
Further tips:
respect the Right-hand text limit, which is the vertical gray line in your editor and shall indicate how many characters a single line of code should have as maximum. If it is a comment, wrap it. If it is an expression, try to outsource some commands to a dedicated variable
use equally long variable names. (There is no style guide as in Python, which says that you should use normal words and underscores etc) E.g. if you have two variables describing a commanded and a measured velocity, you could call them v_cmd and v_act and your code perfectly aligns if you apply the same manipulations to both variables ;)
use section. With %% (the space is important) at the beginning of a line in the editor, you create a section (you'll note the slight yellow background color and the bold writing that follows this command). It is convenient to structure your code. You can even run entire sections Editor-Tab > Run > Run section
Although there are programmers claiming that a good code speaks for itself (and therefore doesn't need any comments), to my experience writing comments has never been a bad idea. It improves the readability of your code
The answer might have been a bit elaborate for such an innocent question ... oO

Cloze with numerical and multiple-choice items

I am using Moodle to make my subjects exams. I would like to mix a numerical cloze question, with a single-choice or a multiple-choice question. And each question should have different percentages on the final mark of the question, for example: first numerical question 5%, second numerical question 15%, third multichoice question 20% and so on. I made a cloze_mchoice.Rnw file:
<<echo=FALSE, results=hide>>=
#
\usepackage{Sweave}
\usepackage[spanish]{babel}
\usepackage[utf8]{inputenc}
\SweaveOpts{pdf=false}
\begin{question}
%
%
This is the question. This is the question
\begin{answerlist}
\item Numerical answer 1. %Solution: 10
\item Numerical answer 2. %Solution: 20
\item Multiple choice answer 1. %true
\item Multiple choice answer 2. %true
\item Multiple choice answer 3. %false
\item Multiple choice answer 4. %false
\item Numerical answer 3. %Solution: 30
\item Numerical answer 4. %Solution: 35
\end{answerlist}
%
\end{question}
\exname{cloze_mchoice}
\extype{cloze}
\exclozetype{num|num|mchoice|num|num}
%percentage of rigth answer:
% (5%-15%-20%-25%-35%)
\exsolution{10|20|1100|30|35|}
\extol{0.1*10|0.1*20|0.1*30|0.1*35} %Numerical Answer Tolerance
First I use to compile in HTML but I receive this warning:
exams2html("cloze_mchoice.Rnw", encoding = "UTF-8", template = "plain8")
## Warning message:
## In do.call(paste("as", type, sep = "."), list(rval)) :
## NAs introduced by coercion
I have been trying to compile into xml using
rmx <- exams2moodle("cloze_mchoice.Rnw", n = 1, name = "p_cloze_mchoice",
mchoice = list(abstention = "No answer."))
but I received the same warning message shown above. The p_cloze_mchoice.xml file is not reading by Moodle.
The file Rnw is a template, I will use a csv file to import input data and output data.
Main problem: The error has got nothing to do with the specific question, it's just due to expoints being set to something that is not numeric. For example, instead of 0.1 * 10 you should use 1. When you want to compute expoints dynamically, you need to do that in an R code chunk and then insert it with \Sexpr{} into \expoints{}.
Further aspects:
Multiple-choice items within cloze questions have been added relatively recently in Moodle XML. They do not offer all features, though, that are available for single-choice items or some of them do not work reliably, see: Cloze question combining mchoice and num import in Moodle
R/exams has been improved recently to adapt to the behavior of Moodle. To make use of these features, please install at least version 2.4-0 of the package.
Currently you cannot add an abstention option to multiple-choice questions within a cloze, at least not reliably to the best of my knowledge.
The percentages for the cloze items cannot be specified like that in Moodle. Moodle wants integer "weights". Hence, exams2moodle() multiplies fractions with a suitable constant (here 100). However, Moodle does not always scale the default grade with these weights. We suspect that this is a problem in Moodle and recommend to use integer expoints instead.
The extol has to be the same length as exclozetype (and not just the same as the number of num items). Here, you could insert a 0 for the mchoice itemm.
The LaTeX \usepackage{} are completely ignored by R/exams. For conversion to HTML (as for Moodle) they wouldn't have any effect on the HTML converter anyway. And for producing PDF output, these commands should be in the LaTeX master template as opposed to the individual exercises.
Jargon: You had used "multichoice" in your original question to refer to multiple-choice questions (mchoice in R/exams). I changed this because in Moodle "multichoice" refers to single-choice questions (with dropdown menu). Jargon simply isn't unified across systems here and I tried to avoid confusion.
The best version of your exercise I could come up with is included below. Note that the fractional expoints lead to a warning in R/exams and do not work correctly in Moodle (as explained above).
\begin{question}
This is the question. This is the question
\begin{answerlist}
\item Numerical answer 1.
\item Numerical answer 2.
\item Multiple choice answer 1.
\item Multiple choice answer 2.
\item Multiple choice answer 3.
\item Multiple choice answer 4.
\item Numerical answer 3.
\item Numerical answer 4.
\end{answerlist}
\end{question}
\exname{cloze_mchoice}
\extype{cloze}
\exclozetype{num|num|mchoice|num|num}
\exsolution{10|20|1100|30|35|}
\extol{1|2|0|3|3.5}
\expoints{0.05|0.15|0.2|0.25|0.35}
Thanks for the interesting thread. Is there a template file that mixes single choice and numerical answers? Also, is it possible to start each single/multiple choice question with text common to all MC fields, such as
\begin{question}
This is the general question
\begin{answerlist}
\item question with numerical answer 1.
\item question for MC :
\begin{answerlist}
\item Multiple choice answer 1.
\item Multiple choice answer 2.
\item Multiple choice answer 3.
\end{answerlist}
\end{answerlist}
\end{question}
Thanks,

How to create a multi-level ordered (numbered) plain list in org-mode?

In org-mode, if I have an ordered list such as
first item
second item
third item
fourth item
and I demote an item, the demoted item is automatically renumbered restarting from 1:
first item
second item
third item
fourth item
Is there a way to make org-mode (or emacs in general) to automatically renumber demoted items like when using legal numbering?
I mean this:
first item
second item
2.1. third item
2.1.1. fourth item
Org-mode doesn't currently provide this functionality, and nor, to my knowledge, does any existing minor mode. The only emacs package I'm aware of which does is hyperbole, whose koutline module (here is an example-document, exported to html) provides an impressive suite of outline-editing tools, and supports hierarchical legal numbering.
(koutline also supports "klinks" between numbered paragraphs which refer to an invariant ID assigned to each paragraph on creation, so that the links remain valid even if one moves a paragraph from its original position in the document hierarchy.)
Unfortunately koutline is incompatible with org-mode. It does have a rudimentary HTML-export, but this is unlikely, in its present form, to satisfy anyone used to the wide range of export options provided by org-export. Nevertheless, depending on your use-case, koutline might be an adequate tool.
Org-mode's built-in list styles include
unordered lists, using -, + or *,
ordered lists, using 1. or 1), and
definition lists, using :: to separate terms from definitions.
You can cycle a given list between these styles using S-left and S-right.
There are a number of forum posts and mailing list entries asking for legal numbering, but unfortunately I don't think it's supported.
I can create a multi-level lists with:
1. Step 1
1. Substep 1
1. Substep 2
1. Step 2
1. Step 3
When rendered in Gitea, it will use different number systems for the two levels, e.g. "1,2,3" or "i,ii,iii".