Coder Social home page Coder Social logo

LMS Quiz Random Generator about lms HOT 7 CLOSED

thida-bcn avatar thida-bcn commented on September 26, 2024 1
LMS Quiz Random Generator

from lms.

Comments (7)

mkashif1973 avatar mkashif1973 commented on September 26, 2024 4

I made the following changes in the quiz.js file and successfully achieved the random question generation every time, details are as below:

file location: lms/lms/templates/quiz/quiz.js

Insert the below codes between line 8 and line 9
// Shuffle questions once on page load
let questions = $(".question");
questions = Array.from(questions);
const totalQuestions = questions.length;

for (let i = questions.length - 1; i > 0; i--) {
    const j = Math.floor(Math.random() * (i + 1));
    [questions[i], questions[j]] = [questions[j], questions[i]];
}

changed line 51, 54, 56, 62 with the following (in sequence order):
51 let current_index = self.current_index;

54 if (self.show_answers) {

56 } else if (!self.show_answers && next_index == total_questions) {

62 $(questions[next_index - 1])

I have checked this with 2 separate students login from different computers and from start to end both had different orders of questions secondly, I also reloaded the browser to start again also the sequence changed.

Please let me know your input.............

from lms.

pateljannat avatar pateljannat commented on September 26, 2024 1

You can shuffle quiz questions on the latest version

from lms.

pateljannat avatar pateljannat commented on September 26, 2024

There is no such feature in the app. @thida-bcn

from lms.

thida-bcn avatar thida-bcn commented on September 26, 2024

hello,
will it be in system?

from lms.

zeel-codder avatar zeel-codder commented on September 26, 2024

can I work on a solution to this issue? @pateljannat

from lms.

thida-bcn avatar thida-bcn commented on September 26, 2024

can I work on a solution to this issue? @pateljannat

thanks

from lms.

thida-bcn avatar thida-bcn commented on September 26, 2024

from lms.

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.