Giter Site home page Giter Site logo

Word Select question when attempted, the Response history displays the submitted words in random order and without delimiters about moodle-qtype_wordselect HOT 15 CLOSED

marcusgreen avatar marcusgreen commented on August 30, 2024
Word Select question when attempted, the Response history displays the submitted words in random order and without delimiters

from moodle-qtype_wordselect.

Comments (15)

marcusgreen avatar marcusgreen commented on August 30, 2024

Just to be certain, can you confirm that this issue only shows up for someone with site admin role?

from moodle-qtype_wordselect.

marcusgreen avatar marcusgreen commented on August 30, 2024

Am about to attempt to reproduce it locally

from moodle-qtype_wordselect.

AnupamaSarjoshi avatar AnupamaSarjoshi commented on August 30, 2024

Thanks Marcus. Though I haven't tried, I don't think it is specific to site admin role. Anyone with the capability to access Response history probably will see the same

from moodle-qtype_wordselect.

rezeau avatar rezeau commented on August 30, 2024

@AnupamaSarjoshi I would like to try to reproduce your problem, but...
You forgot to mention a) the instructions given to the student ("click such and such words")
b) if your question uses the Multiword mode
c) you forgot to mention the "How questions behave" options you are using
Could you please export and attach your question to your reply? Thanks!

from moodle-qtype_wordselect.

marcusgreen avatar marcusgreen commented on August 30, 2024

I think the question is taken directly from the included examples. I will add instructions in the next release... Good catch on the question behaviour, though I don't think it will be a decider (could be wrong). It seems a strange one. Hope to look further this evening.

from moodle-qtype_wordselect.

rezeau avatar rezeau commented on August 30, 2024

Just tested this locally on my Moodle 4.0.1. Works as expected, The submitted words are in the same order as in the text. Agree with @AnupamaSarjoshi however that some kind of separator between those submitted words (or groups of words) would be useful

from moodle-qtype_wordselect.

marcusgreen avatar marcusgreen commented on August 30, 2024

I wonder if however the core ddwtos question does it might be an inspiration...

from moodle-qtype_wordselect.

marcusgreen avatar marcusgreen commented on August 30, 2024

My first attempt
image

from moodle-qtype_wordselect.

marcusgreen avatar marcusgreen commented on August 30, 2024

I need confirmation of what question behaviour is being used, I suspect from the word submit at the start that it is Deferred feedback. I can see the code that generates the output in the summarise_response method of question.php

public function summarise_response(array $response) {

Braces could be added like this

        $summary .= "{ " . $allwords[substr($index, 1)]->get_without_delim() . "} ";

With reference to word order, I cannot reproduce what you are seeing. The order is probably determined from how the words are returned from

    $allwords = $this->get_words();

But at the moment I cannot figure out how it would be returned in an order other than how it appears in the original text.

from moodle-qtype_wordselect.

timhunt avatar timhunt commented on August 30, 2024

I can't work this out either, but I can confirm we are seeing this.

I don't believe the behaviour matters. I just reproduced the issue by previewing Anu's question on our system, and only afterwards notice that was using Interactive with multiple tries.

In case it helps, here is the question: (Github does not like XML files, so I had to rename to add .txt.)
questions-U101-20B-WordSelect Reading Comprehension-20220622-1654.xml.txt

There were bugs like this in the past in some core qtypes. Baiscally, when a DB server is new, then in theory, the order of results from any query will be random unless you specify an order-by. However, when DBs are new then typically rows are returned in id order at first, and then with time start getting more random. So, that might possibly explain this hard-to-reproduce bug ... except I just quickly looked at the code, and from what I can see, all the queries have an order-by id. (Example old bugs: MDL-27394 or commit f07d1d319716a0b381ece29435c72999a798f778 - so old, it came before the tracker.)

More debugging needed, but I am out of time for today.

from moodle-qtype_wordselect.

marcusgreen avatar marcusgreen commented on August 30, 2024

Thanks for the feedback Tim. The behaviour thing was partly to ensure I was seeing exactly the same text before it showed the words, but as you suggest, that is probably not relevant. I was wondering about the order of stuff returned from the db, but I couldn't see how that would happen in this case. I will look further.

from moodle-qtype_wordselect.

marcusgreen avatar marcusgreen commented on August 30, 2024

I think the the order of the words returned is determined somewhere after here

if (strpos($questiontextnodelim, $l . $l) !== false) {

Possibly on the line that reads
$matches = preg_split($fieldregex, $questiontextnodelim, null, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);

from moodle-qtype_wordselect.

timhunt avatar timhunt commented on August 30, 2024

But the order of things returned from preg_split is always the order they were in the original string, so it is not clear how this could lead to the problem. It really is a mystery.

from moodle-qtype_wordselect.

marcusgreen avatar marcusgreen commented on August 30, 2024

That was my assumption. I would be happier if I could reproduce it. I now want to set one up with exactly the same version of PHP and Postgress, which of course should/could not make any difference whatsoever but you never know (even when you feel you do know)

from moodle-qtype_wordselect.

marcusgreen avatar marcusgreen commented on August 30, 2024

I am closing this as I don't have the time to work towards a fix. If anyone comes up with a code fix I will be happy to review it.

from moodle-qtype_wordselect.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.