On-click next question & Log out after submit

On-click next question & Log out after submit

by Deleted user -
Number of replies: 8

Hi,

I'm new to moodle and trying to customize many things especially for quiz section. Hope someone could help/guide me. I tried "googling" the answers & finding in the forum but not all were there.

Let me give a brief description on what I'm suppose to do

  1. When a user enters course it goes to the quiz straight (Done)
  2. The user unable to see any block except for the quiz/questionnaire (Partially Done.. Unable to remove the profile block)
  3. Utilize full screen for question (there a blank space at the left of the screen )
  4. User should not be able access/view to profile.php/ disable link to profile by clicking name as we do not want student to change the informations. (Tried the role > prohibit but its still possible)
  5. User clicks the answer the quiz/questionnaire and it jumps to the next question [on-click] (Unable to get the solution).
  6. User should not be able to see summary, should log out after submit successful. (Unable to get the best method)

Hope someone could guide me / share me the link to the solution.

Thank you very much.

Average of ratings: -
In reply to Deleted user

Re: On-click next question & Log out after submit

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi,

From your description it looks like you only want to use your moodle site to administer quizzes. If that is the case, maybe Moodle is not the best solution for you. There are plenty of other ways to administer online quizzes, which do not require installing a full-fledged CMS such as Moodle.

Joseph

PS Please note that in Moodlespeak, Quiz and Questionnaire are not equivalent but two totally independent activities.

In reply to Joseph Rézeau

Re: On-click next question & Log out after submit

by Deleted user -

Hi Joseph,

Thanks for the fast reply.

We are using moodle & all it's functionality just that certain accounts are created specific for a course.

I'm trying to do this task for this particular course, where the students are given Ids for a quiz (might be an one-off event). e.g. course entry quiz event. We don't want to waste time as we have limited number of PCs in the lab so we planned to do this to make the process fast.

we dont mind hard coding / separate a moodle for the event as we are using existing moodle's DB

 

Thanks.

In reply to Deleted user

Re: On-click next question & Log out after submit

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Thanks for the clarification, now your original question does make sense. I'll leave it to others to give relevant help in your use scenario.

Joseph

In reply to Joseph Rézeau

Re: On-click next question & Log out after submit

by Deleted user -

Thanks.

Hope someone could help me out as i'm bit running out of time.

In reply to Deleted user

Re: On-click next question & Log out after submit

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

For 1., you should not need to do anything. Use the Single-activity course format. (Add-on for 2.4 and 2.5, part of standard 2.6)

2. Do you understand how blocks in Moodle really work?

3. This should be just a matter of CSS.

4. Capabilities are the right way to control this. However, you need to understand that students are only Students within particular courses, and hte user profile is a system-wide thing. So you need to change the permissions for the Authenticated user role, not the Studnet role.

5. You really don't want to do this. You will learn why the first time a student's mouse accidnetally slips as they are about to click their chosen answer. There is a reason why the Quiz UI is the way it is: first select the answer you want, and confirm you ahve done that, then click next.

6. You can do this with the quiz review option settings. Turn off all the review options you can.

Average of ratings: Useful (1)
In reply to Tim Hunt

Re: On-click next question & Log out after submit

by Deleted user -

Hi Tim Hunt,

Pass few days i have done some research and with some trial and error I have done the following:

1.Yes I found the single activity and using it as my solution to it.

2. I am new to the moodle still but i have already learnt to hide them without touching the codes.

3. Css is also done.

4. Permission also done.

5. I realize that we can skip the question and go next. We want to make sure the student answers the question before proceeding to the next page. Is this possible ? I'm still looking and finding the best way.

6. Yes I just turned it off. Thanks for the tip.

I'm now pending on the No.5 as we need all the answers to be answered (criteria is to ensure all answered as we do not want any students saying that they missed it , blame the system and etc ).

I hope you can guide me in this. Thanks you so much..

In reply to Deleted user

Re: On-click next question & Log out after submit

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

2. You probably need to look in lib/blocklib.php. Read the code and put some print_object(...) calls in the block_manager class where it loads the block on the current page, and decides whether they should be visibile. That should let you work out what is going on.

Hang on. Are you talking about the Quiz navigation bock, which has shows which questions have been answered? If so, that is not a real block. Search in the quiz code for add_fake_block to see where that comes from.

5. The only way to do this will be to change core code. Specifically attempt.php and/or processattempt.php. (Have you seen this docs page: http://docs.moodle.org/dev/Quiz_user_interface_overview ?)

When the user submits a page of the quiz, a POST goes to processattempt.php, which then redirects back to attempt.php to display the next page. That redirect involves a page number. What you need to do is to look at the question they just tried to answer, and see what state it is in.

All the processing is hidden in one line, $attemptobj->process_submitted_actions(...) in processattempt.php. That calls $this->quba->process_all_actions(...). The key think to know is that the questions within an attempt are identfied by 'slot' which is an index that counts from 1. Look at the slots on the current page, then inspect $quba->get_question_state($slot) and see if that is question_state::complete or not. Based on that decide whether the redirect should go to the next page, or back to the page they were on.

Average of ratings: Useful (1)
In reply to Tim Hunt

Re: On-click next question & Log out after submit

by Deleted user -

Thank you Tim Hunt,

Will work on it and hoping it will work.