Question Order When Importing Hot Pot Quiz

Question Order When Importing Hot Pot Quiz

Nosūtīja Kathleen Edelman
Atbilžu skaits: 6

When I upload my hotpot quizzes, Moodle uploads it very well.  When we view the questions it orders them 1, 11,12, 13  etc.  and I want it in order of 1, 2, 3, 4.

What can I do about this?

Vidējais novērtējums: -
Atbildot uz Kathleen Edelman

Re: Question Order When Importing Hot Pot Quiz

Nosūtīja Gordon Bateson
Core developers attēls Peer reviewers attēls Plugin developers attēls
Maybe we could order them 001, 002, 003 ? I'll look into it.
Atbildot uz Gordon Bateson

Re: Question Order When Importing Hot Pot Quiz

Nosūtīja Joseph Rézeau
Core developers attēls Particularly helpful Moodlers attēls Plugin developers attēls Testers attēls Translators attēls
Hi Gordon,
Maybe using the php natcasesort function?
Joseph
Atbildot uz Joseph Rézeau

Re: Question Order When Importing Hot Pot Quiz

Nosūtīja Gordon Bateson
Core developers attēls Peer reviewers attēls Plugin developers attēls
Hi Joseph,
it's a very interesting idea to use PHP's "natcasesort" sorting function. At the moment, the sorting is done by the database functions when the questions are fetched by the following line in the in the "question_list" function in "question/editlib.php" (about line 255)

$questions = get_records_select(
'question',
"category IN ($categorylist) AND parent = '0' $showhidden",
$sortorder
,

'*',
$page*$perpage,
$perpage
)

at this point, $sortorder is one of the following:
  • name, qtype ASC : Sort by name
  • qtype, name ASC : Sort by type, name
  • id ASC : Sort by age
I myself am not able to update this script, but I think it would certainly be worth mentioning "natural" sorting over on the forum for the Quiz module

regards
Gordon
Atbildot uz Gordon Bateson

Re: Question Order When Importing Hot Pot Quiz

Nosūtīja Glenys Hanson
Hello,

I'm not sure if this is the same problem or a different one.
The same thing happened when I imported Hot Pot JQuiz questions into a Moodle Quiz: the questions were ordered as described above. A colleague told me to select "sort by age" and it solved the problem.

Cheers,
Glenys
Atbildot uz Glenys Hanson

Re: Question Order When Importing Hot Pot Quiz

Nosūtīja Gordon Bateson
Core developers attēls Peer reviewers attēls Plugin developers attēls
Bingo! Nice work Glenys.

What's more this setting seems to be "sticky", so that one you have used it on the Edit Quiz/Question page, then it is remembered and used again when you come back to that page later.

Kathleen, does this work for you?