Re: To add two language button on quiz block: reg.
appreciate you Sir,
God bless you.
Re: To add two language button on quiz block: reg.
Re: To add two language button on quiz block: reg.
I'm waiting your reply, I believe that you will be find the solution of the aforesaid query.
Have a good 😊 day sir.
Re: To add two language button on quiz block: reg.
Hello Virendra,
You will find two examples of language selector, one with multiple buttons and one with a single button, at https://dynamiccourseware.org/course/view.php?id=119§ion=3➚. Click on "HTML code for the language selector above" to see the codes.
Essentially, it's simply adding the language to the URL, for example &lang=en for English, &lang=fr for French, &lang=es for Spanish, etc. Once the language is added, it does not change until changed again.
You can format the buttons as you wish. To place the buttons in the menu, you will need a line of JavaScript that I haven't included because I don't know exactly where you want them. Feel free to ask me for help if you have no one to assist you.
If you have access to the site administration, you can put the script in Site administration / Appearance / Additional HTML. If you don't have access, you can put it in a Text block, which you can display on all pages of your site, your course or your quiz, or only on certain pages as needed.
Re: To add two language button on quiz block: reg.
First I appreciate you for this kind work.
Just I have added this code in Additional HTML block and for quiz pages, i have added this code in text block separately but does not work . please see screenshot. If I am doing wrong, then suggest me please .I want to add this button in specially for quiz block, where anyone can simply change the language as per need.
I have added this code in text block look like this:
Dear sir , please see screenshot also. I am seeing any button
Re: To add two language button on quiz block: reg.
I have added your code systematically, please see screenshot. It is good. thank you again.
But when we attempt the quiz it is not showing there. Would be added this code for every question?
It is not showing on quiz attempt page, please see screenshot.
Re: To add two language button on quiz block: reg.
Hello Virendra,
I will assume that you are using the Boost theme, but it's not important if you're using another theme because we can make adjustments.
As I mentioned earlier, you can place the script in either Site Administration / etc. or within a block. Let's first place the script in a quiz Text block, i.e. a text block that appears on the various pages of a given quiz. We can explore other placement options later.
- In the quiz settings and under 'Appearance / Show more...', set 'Show blocks during quiz attempts' to 'Yes'.
- In your Preferences, set the editor to 'Plain text area' (recommended).
- Click on the quiz icon to get to the 'Quiz' tab page.
- Add a text block. Place the code below in the 'Content' field of the block. There is no need to give a 'Text block title'. Save changes.
- Click on the cog icon of the block and select 'Configure text block'.
- Under 'Where this block appears', set 'Display on page types' to 'Any quiz module page'. Save changes.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script> <script> $(document).ready(function() { $("#page-mod-quiz-attempt #usernavigation").prepend('<div style="position: relative; padding-top: 5px; left: -30px;"><button class="btn-danger" id="DCen">English</button><button class="btn-danger" id="DChi">हिंदी</button></div>'); $("#DCen, #DChi").css({"display":"inline-block", "cursor":"pointer", "padding":"5px 16px 8px", "background-color":"red", "color":"#FFF", "border-radius":"20px", "margin-left":"20px", "box-shadow":"-8px 15px 15px #aaa"}); $("#DCen").mousedown(function(){ // Format the button. $(this).css({"box-shadow":"-3px 3px 6px #aaa", "padding":"6px 16px 7px"}); $("#DChi").css({"position":"relative", "top":"-1px"}); }); $("#DCen").mouseup(function(){ // Format the button. $(this).css({"box-shadow":"-8px 15px 15px #aaa", "padding":"5px 16px 8px"}); $("#DChi").css({"position":"relative", "top":"0px"}); }); $("#DChi").mousedown(function(){ $(this).css({"box-shadow":"-3px 3px 6px #aaa", "padding":"6px 16px 7px"}); $("#DCen").css({"position":"relative", "top":"-1px"}); }); $("#DChi").mouseup(function(){ $(this).css({"box-shadow":"-5px 10px 10px #aaa", "padding":"5px 16px 8px"}); $("#DCen").css({"position":"relative", "top":"0px"}); }); $("#DCen").click(function(){ // Get the current URL. let url = window.location.href; // Remove any occurrence of &lang=en and &lang=hi in the current URL. url = url.replaceAll("&lang=en",""); url = url.replaceAll("&lang=hi",""); // Add &lang=en to the current URL. window.location.href = url + "&lang=en" }); $("#DChi").click(function(){ let url = window.location.href; url = url.replaceAll("&lang=en",""); url = url.replaceAll("&lang=hi",""); window.location.href = url + "&lang=hi" }); }); </script>
You should get something like this:
Re: To add two language button on quiz block: reg.
I appreciate your knowledge and helpful attitude also.
I have few questions, I want to add this language button in the menu. Please help for this kind work.
Please look this example link:
Embed multiple questions - sequential navigation, yes
In this demo quiz, when click on next button we move on without delay and I am seeing a fun javascript that it is not browsing like other quizzes.
I humble request that provide javascript as above please.
best regards.
Re: To add two language button on quiz block: reg.
Re: To add two language button on quiz block: reg.
I am satisfied with your language button code. I have added the code as per your direction. It has been successfully implemented on quiz pages. I shall be grateful to you for this kind work.
Thank you so much sir.
In reply of Second question, I know that you have provided the code on website I have added that code in our end but the code is not working for the Moodle quiz. I have added the code but not worked in my case. Will that code work for Moodle quiz, because that code is specially coded for embedded type question, is'nt?
Sir, if not sure with my query that what am I asking.. I am providing a quiz link. You can dig it your end. I want to make like this which is telling with you. When you click the next button this is not browsing and move on next question page. Please look at this quiz link.
Sir, Please resolve the issue.
Re: To add two language button on quiz block: reg.
You are great person. You have good knowledge and have a positive attitude.
You are helpful person.
Thank you so much thousands time.
Re: To add two language button on quiz block: reg.
Virendra,
Thank you for your kind words.
Will that code work for Moodle quiz, because that code is specially coded for embedded type question, is'nt?
You are correct, the code is only intended for embedded questions.
For regular quizzes, in the quiz settings you can choose various question behaviours, such as interactive with multiple tries, immediate feedback, deferred feedback, etc., and choose between free or sequential navigation methods. Additionally, on the question page, you can apply restrictions to questions using locks, preventing students from moving on to the next question until the previous one has been completed.
I suggest carefully exploring all these standard options first to see if any combination of them suits your needs. If not, then custom-made snippets may be useful.
Re: To add two language button on quiz block: reg.
I like your suggestion
Please look at this plugin:
https://moodle.org/plugins/quizaccess_honestycheck
It is not working, I installed it on website but it is not working.
I want to do like this if any student want to start quiz, then it should be mandate.
Quiz screenshot is here;
Re: To add two language button on quiz block: reg.
It is working but the plugin does not have default settings so you must set the acknowledgment in each and every quiz as follows:
Re: To add two language button on quiz block: reg.
When I click on quiz setting page, only 4 option is given here.
Please see this screenshot
Here , I am not able to find that restriction which is said by you.
Re: To add two language button on quiz block: reg.
Thank you sir
I appreciate you.
Re: To add two language button on quiz block: reg.
Please add the same language button in menu as of you added on quiz block pages.
Please made up some js code.
Please look at this screenshot:
How to find this code for embedded question ❓
Q{category_20210429_0003/question_20210429_0020|6c60cdeb8288b7072cebde62a1d607175ff2d4c83cc9eb23c619d3543406a697}Q
Please look at this screenshot, this code is made by you.
Virendra,
Did you forget to include the screen shot?
Where does this embed question code come from? Could you be more specific?
This code has come from your website.
I have already installed plugin as per your general guidelines.
But I am unable to embedded question filters.
The code which is mentioned the above between
{Q{...…….....}Q}. How to find that embedded code.
For example:
Q{category_20210429_0003/question_20210429_0020|6c60cdeb8288b7072cebde62a1d607175ff2d4c83cc9eb23c619d3543406a697}Q
Virendra,
These codes are generated by the Moodle Embed Question plugin, which must be installed on your Moodle site in order to use it: https://moodle.org/plugins/filter_embedquestion➚. Please read all the instructions carefully at https://github.com/moodleou/moodle-filter_embedquestion/blob/main/internaldoc/functionality.txt➚.
It is an excellent plugin, very user-friendly and easy to use.
As per your guidelines, I have installed the plugins and their dependencies plugins also. And I have added 'ambedquestion' word in the list of Toolbar_config but insert question option is not being show in toolbar editor. Therefore, I am unable to add embedded question in anywhere.
Please look at this screenshot:
Sir,
Can I give any numbers or words for course ID and questions ID? That means a different ID would be different for each question. Right sir?
You have to give a question bank 'category' id and a 'question' id. The question id's must be unique within the same quiz. Id's can be numbers or words or a combination of numbers and letters.
One way to make sure that an id is unique is to name it with the date and time at which it is created, for example "question_20240401_1429" which could be used for a question id created on the 1st of April 2024 at 14:29.
1. Can I use any numbers or word for Course iD and Questions iD ?
2. In question bank, each question has different question ID, but course ID would be separate from question iD. Is it right?
Dear sir,
I have added ID in the question category and also added ID in some questions which is in associated category. But I could not solve it.
Please look at this screenshot:
I have ID in the question bank for each question.
after completing the process, I insert a page, in which I click on insert embedded question, but embedded category is not being shown. Please look at this screenshot:
Please see, what am I doing wrong?
guide me, please.
Best regards.
Not a 'course' category, but rather a 'question' category in the question bank!
See https://docs.moodle.org/en/Question_categories
It may be possible or not that when we start any quiz, we see that a time start in total time as per by given time for the quiz
But I want here, that when we start the quiz the time should be start for particular question
That means for question -1, time start should be from 1 second
And for question-2 , again time should be start from 1 second.
Here you can see time spend for each question generally.
Re: To add two language button on quiz block: reg.
Re: To add two language button on quiz block: reg.
Because it is more fun. Also, it is more direct and faster. Also, it is something that Virendra wants to have, whatever his reasons may be. Moodle is not a high security jail guarded by developers.