ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Randomize order of blocks
@ 2021-01-05 16:18 Jairo A. del Rio
  2021-01-06  8:41 ` Otared Kavian
  0 siblings, 1 reply; 4+ messages in thread
From: Jairo A. del Rio @ 2021-01-05 16:18 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 232 bytes --]

Hi, list.

Some time ago I realized ConTeXt has "blocks" which allow one to make
quizzes, exams and related with ease. However, I want to know if there's an
option to randomize their order when printed. Thank you in advance.

Jairo

[-- Attachment #1.2: Type: text/html, Size: 306 bytes --]

[-- Attachment #2: Type: text/plain, Size: 493 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Randomize order of blocks
  2021-01-05 16:18 Randomize order of blocks Jairo A. del Rio
@ 2021-01-06  8:41 ` Otared Kavian
  2021-01-06  8:55   ` Otared Kavian
  0 siblings, 1 reply; 4+ messages in thread
From: Otared Kavian @ 2021-01-06  8:41 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi Jairo,

One can indeed make quizzes and exams with randomized order of problems, randomized values and even randomized names of functions and variables.
I have some examples which I have been using for several years (they are useful especially in these days of giving exams online…): I can send them to you as they are, or if you tell me what kind of problems you want, then I can adapt my examples before sending them to you.

Best regards: Otared 

> On 5 Jan 2021, at 17:18, Jairo A. del Rio <jairoadelrio6@gmail.com> wrote:
> 
> Hi, list.
> 
> Some time ago I realized ConTeXt has "blocks" which allow one to make quizzes, exams and related with ease. However, I want to know if there's an option to randomize their order when printed. Thank you in advance.
> 
> Jairo
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Randomize order of blocks
  2021-01-06  8:41 ` Otared Kavian
@ 2021-01-06  8:55   ` Otared Kavian
  2021-01-07  1:36     ` Jairo A. del Rio
  0 siblings, 1 reply; 4+ messages in thread
From: Otared Kavian @ 2021-01-06  8:55 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Following up my previous message, here is an example:

%% begin shuffled list of exercises
\setuprandomize[2021]

\startluacode
	function shuffle(tableau)
		local maxsize, t, tt
		maxsize = #tableau
		tt = {}
		t = {}
		for i = 1, maxsize do
			t[i] = {}
			t[i]["columnOne"] = tableau[i]
			t[i]["columnTwo"] = math.random(1,100*maxsize)
		end
		table.sort(t, function(a,b) return a.columnTwo < b.columnTwo end)
		for i = 1, maxsize do
			tt[i] = t[i]["columnOne"]
		end
		return tt
	end
\stopluacode

% We define three arrays
% with the names, the functions and their derivatives
% One could also add a ListOfVariables...

\startluacode

	ListOfNames = {
		"f",
		"g",
		"h",
		"u",
		"v",
		"F",
		"G",
		"H",
	}
	
	ListOfFunctions = {
		"\\cos(x^2)",
		"x\\sin(x)",
		"\\tan(x)",
		"x^3 - 3x^2 + 1",
		"\\frac{1}{1 + x^2}",
		"\\sin(\\log(x))",
		}
		
	ListOfDerivatives = {
		"-2x\\sin(x^2)",
		"x\\cos(x) + \\sin(x)",
		"1 + \\tan(x)^2",
		"3x^2 - 6x",
		"\\frac{-2x}{(1 + x^2)^2}",
		"\\frac{\\cos(\\log(x))}{x}",
		}
		
\stopluacode

\starttext

% We define a buffer and a shuffled list of integers

\startbuffer[test-derivatives]
\startluacode
	ShuffledList = shuffle({1,2,3,4,5,6})
\stopluacode

Let $\cldcontext{ListOfNames[ShuffledList[\recurselevel]]}(x) := \cldcontext{ListOfFunctions[ShuffledList[\recurselevel]]}$. Prove that
\startformula
\cldcontext{ListOfNames[ShuffledList[\recurselevel]]}'(x) = \cldcontext{ListOfDerivatives[ShuffledList[\recurselevel]]}
\stopformula
\stopbuffer
	
\dorecurse{6}{\blank[medium]{\bf Exercise #1.}
	\getbuffer[test-derivatives]
	}

\stoptext

%% end shuffled list of exercises


> On 6 Jan 2021, at 09:41, Otared Kavian <otared@gmail.com> wrote:
> 
> Hi Jairo,
> 
> One can indeed make quizzes and exams with randomized order of problems, randomized values and even randomized names of functions and variables.
> I have some examples which I have been using for several years (they are useful especially in these days of giving exams online…): I can send them to you as they are, or if you tell me what kind of problems you want, then I can adapt my examples before sending them to you.
> 
> Best regards: Otared 
> 
>> On 5 Jan 2021, at 17:18, Jairo A. del Rio <jairoadelrio6@gmail.com> wrote:
>> 
>> Hi, list.
>> 
>> Some time ago I realized ConTeXt has "blocks" which allow one to make quizzes, exams and related with ease. However, I want to know if there's an option to randomize their order when printed. Thank you in advance.
>> 
>> Jairo
>> ___________________________________________________________________________________
>> If your question is of interest to others as well, please add an entry to the Wiki!
>> 
>> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
>> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
>> archive  : https://bitbucket.org/phg/context-mirror/commits/
>> wiki     : http://contextgarden.net
>> ___________________________________________________________________________________
> 

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Randomize order of blocks
  2021-01-06  8:55   ` Otared Kavian
@ 2021-01-07  1:36     ` Jairo A. del Rio
  0 siblings, 0 replies; 4+ messages in thread
From: Jairo A. del Rio @ 2021-01-07  1:36 UTC (permalink / raw)
  To: mailing list for ConTeXt users, otared


[-- Attachment #1.1: Type: text/plain, Size: 4821 bytes --]

Nice. I had something a little bit different in mind, but your examples
gave me some ideas, especially the shuffling stuff. If I have something new
to add, I will share my results with the list. Thank you a lot.

Best regards,

Jairo

El mié, 6 de ene. de 2021 a la(s) 03:56, Otared Kavian (otared@gmail.com)
escribió:

> Following up my previous message, here is an example:
>
> %% begin shuffled list of exercises
> \setuprandomize[2021]
>
> \startluacode
>         function shuffle(tableau)
>                 local maxsize, t, tt
>                 maxsize = #tableau
>                 tt = {}
>                 t = {}
>                 for i = 1, maxsize do
>                         t[i] = {}
>                         t[i]["columnOne"] = tableau[i]
>                         t[i]["columnTwo"] = math.random(1,100*maxsize)
>                 end
>                 table.sort(t, function(a,b) return a.columnTwo <
> b.columnTwo end)
>                 for i = 1, maxsize do
>                         tt[i] = t[i]["columnOne"]
>                 end
>                 return tt
>         end
> \stopluacode
>
> % We define three arrays
> % with the names, the functions and their derivatives
> % One could also add a ListOfVariables...
>
> \startluacode
>
>         ListOfNames = {
>                 "f",
>                 "g",
>                 "h",
>                 "u",
>                 "v",
>                 "F",
>                 "G",
>                 "H",
>         }
>
>         ListOfFunctions = {
>                 "\\cos(x^2)",
>                 "x\\sin(x)",
>                 "\\tan(x)",
>                 "x^3 - 3x^2 + 1",
>                 "\\frac{1}{1 + x^2}",
>                 "\\sin(\\log(x))",
>                 }
>
>         ListOfDerivatives = {
>                 "-2x\\sin(x^2)",
>                 "x\\cos(x) + \\sin(x)",
>                 "1 + \\tan(x)^2",
>                 "3x^2 - 6x",
>                 "\\frac{-2x}{(1 + x^2)^2}",
>                 "\\frac{\\cos(\\log(x))}{x}",
>                 }
>
> \stopluacode
>
> \starttext
>
> % We define a buffer and a shuffled list of integers
>
> \startbuffer[test-derivatives]
> \startluacode
>         ShuffledList = shuffle({1,2,3,4,5,6})
> \stopluacode
>
> Let $\cldcontext{ListOfNames[ShuffledList[\recurselevel]]}(x) :=
> \cldcontext{ListOfFunctions[ShuffledList[\recurselevel]]}$. Prove that
> \startformula
> \cldcontext{ListOfNames[ShuffledList[\recurselevel]]}'(x) =
> \cldcontext{ListOfDerivatives[ShuffledList[\recurselevel]]}
> \stopformula
> \stopbuffer
>
> \dorecurse{6}{\blank[medium]{\bf Exercise #1.}
>         \getbuffer[test-derivatives]
>         }
>
> \stoptext
>
> %% end shuffled list of exercises
>
>
> > On 6 Jan 2021, at 09:41, Otared Kavian <otared@gmail.com> wrote:
> >
> > Hi Jairo,
> >
> > One can indeed make quizzes and exams with randomized order of problems,
> randomized values and even randomized names of functions and variables.
> > I have some examples which I have been using for several years (they are
> useful especially in these days of giving exams online…): I can send them
> to you as they are, or if you tell me what kind of problems you want, then
> I can adapt my examples before sending them to you.
> >
> > Best regards: Otared
> >
> >> On 5 Jan 2021, at 17:18, Jairo A. del Rio <jairoadelrio6@gmail.com>
> wrote:
> >>
> >> Hi, list.
> >>
> >> Some time ago I realized ConTeXt has "blocks" which allow one to make
> quizzes, exams and related with ease. However, I want to know if there's an
> option to randomize their order when printed. Thank you in advance.
> >>
> >> Jairo
> >>
> ___________________________________________________________________________________
> >> If your question is of interest to others as well, please add an entry
> to the Wiki!
> >>
> >> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> >> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> >> archive  : https://bitbucket.org/phg/context-mirror/commits/
> >> wiki     : http://contextgarden.net
> >>
> ___________________________________________________________________________________
> >
>
>
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki     : http://contextgarden.net
>
> ___________________________________________________________________________________
>

[-- Attachment #1.2: Type: text/html, Size: 7100 bytes --]

[-- Attachment #2: Type: text/plain, Size: 493 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-01-07  1:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-05 16:18 Randomize order of blocks Jairo A. del Rio
2021-01-06  8:41 ` Otared Kavian
2021-01-06  8:55   ` Otared Kavian
2021-01-07  1:36     ` Jairo A. del Rio

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).