identify questions that viewed by user in sequential nav method

identify questions that viewed by user in sequential nav method

by Davood Rahimi Kinchaa -
Number of replies: 7

Hi,

We want to identify questions that viewed by user in sequential navigation method. Which variable is for this?

$slot is for question number. For navigating to previous questions I need this.   

Average of ratings: -
In reply to Davood Rahimi Kinchaa

Re: identify questions that viewed by user in sequential nav method

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

In the database it is quiz_attempt.currentpage

In the code, $attemptobj->get_currentpage()

In reply to Tim Hunt

Re: identify questions that viewed by user in sequential nav method

by Davood Rahimi Kinchaa -

Thanks alot

We added some code to implement it like below:

Now we want to make previous questions NOT changeable by students and they can only view their responses. Can we show previous questions in review mode?

In reply to Davood Rahimi Kinchaa

Re: identify questions that viewed by user in sequential nav method

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Displaying a question is done by the question_usage_by_activity::render_question method, right?

One of the arugments passed to that method is $options, an instance of the question_display_options class. I direct your attention to the $readonly field of that class.

In reply to Tim Hunt

Re: identify questions that viewed by user in sequential nav method

by Davood Rahimi Kinchaa -

Hi,

We did it using quba->get_display_option but when we are in Q5 and go back to Q2 only Q2 is in review mode and Q3 and Q4 are changeable. I think we should use a bool to check the question has been visited before or not. Is there such a var to do it? 

In reply to Davood Rahimi Kinchaa

Re: identify questions that viewed by user in sequential nav method

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Well, I suppose you need to track the highest numbered page visited. The quiz only tracks the most recently visited page. You may be able to work this out from the state of each questoin ($quba->get_question_state($slot), I guess).

In reply to Tim Hunt

Re: identify questions that viewed by user in sequential nav method

by Davood Rahimi Kinchaa -

There are 

get_question_state_class($slot, $showcorrectness)

and

get_question_status($slot, $showcorrectness)

and there is not visited property for question in none of them.

 

In reply to Davood Rahimi Kinchaa

Re: identify questions that viewed by user in sequential nav method

by ano ano -

How can I implement this? Explain in brief.