We made a new quiz navigation

We made a new quiz navigation

написао/ла Dominik Anonymous -
Број одговора: 30
We altered the actual quiz module to have an advanced navigation panel. The Timer now shows the user which questions he already anwered (and saved). In this case question 4 was not answered. The gray background indicates wich questions are actually displayed on the site.
quiznav1c82a7.png



In addition we made a second quiz type called "noback" which does not allow students to go back to a page they were before. in fact you can just click "next":
quiznav2021e0.png


If some moodle developer is interested i can post the code
У одговору на Dominik Anonymous

Re: We made a new quiz navigation

написао/ла Tieku Bortei-Doku -

Dominik,

I am very interested in your advanced navigation panel. I have been looking for this feature for a very long time.

Here is one application of this feature: When a student gets to a question that he finds difficult and doesn’t want to spend a lot of time on the question (at the expense of time needed for the other questions) he should be able to “flag” a question so that he can know which question is unanswered and go straight back to it, (after answering the easier questions).

Could you please send me the code?

Tieku

У одговору на Dominik Anonymous

Re: We made a new quiz navigation

написао/ла Marco Lehre -
Слика Testers
Hi Dominik,

I am very interested in your advanced navigation panel as well.

We also support the idea of Tieku to "flag" a question when a student wnats to come back to a question.

Could you please send me the code? Is it written for Moodle 1.9.x or 2.0?

Best regards
Marco
У одговору на Marco Lehre

Re: We made a new quiz navigation

написао/ла Dominik Anonymous -
Hi Tieku and Marco,

the code marks a question red only if no answer is selected. Flaging a question is not possible and i dont know if we will implement this here, because we are only working for the next 2-3 weeks on moodle.

In addition we have to do some bugfixing as well bevore releasing the code to the community.

Because i will stop working on it in 2-3 weeks (i get paid for that) i would appreciate if some developer would take it over.
У одговору на Dominik Anonymous

Re: We made a new quiz navigation

написао/ла Tieku Bortei-Doku -

Hi Dominik,

I do hope we get someone to work on the ability to flag questions (answered or unanswered). In the meantime, your code that marks a question red only if no answer is selected is a good first step. I look forward to seeing it (once you have work through all the bugs).

 

Tieku

У одговору на Tieku Bortei-Doku

Re: We made a new quiz navigation

написао/ла Dominik Anonymous -
Hi Tieku,
here is the patch to install the new navigation. But be aware that there could be some bugs left, so dont use it on a productive site yet. (But you might test it locally смешак )

The patch is for 1.9.2 Build 20080711 but it works on the newest 1.9.2 relase as well (with a bit handwork)

In addition you have to put the following strings in your language quiz.php file:

$string['noback'] = 'Allow to page back';
$string['answered_questions'] = 'Answered questions:';
$string['no_timelimit'] = 'No timelimit';

That schould be everything, tell me if you encounter some problems with the script.


У одговору на Dominik Anonymous

Re: We made a new quiz navigation

написао/ла Tieku Bortei-Doku -

Hello Dominik,

i am ready to give the patch a try. Could you let me know how to go about applying it to attempt.php?

What do these symbols in the patch mean mean (I am not a programmer)

---
+++

@@ -1,4 +1,4 @@
-

+

У одговору на Tieku Bortei-Doku

Re: We made a new quiz navigation

написао/ла Tim Hunt -
Слика Core developers Слика Documentation writers Слика Particularly helpful Moodlers Слика Peer reviewers Слика Plugin developers
У одговору на Tieku Bortei-Doku

Re: We made a new quiz navigation

написао/ла Dominik Anonymous -
Hi Tieku, if your not a programmer, make sure you have the right build of the moodle version or you will be screwed up because you'll have to solve code conflicts by hand. What i want to say is that the patch might fail on an other build of moodle (than you have to know what you have to do by hand)

I apply patches with Eclipse (windows). If your running Linux, than its really easy, there is a patch command.


Tim: Did you take a look at it?
У одговору на Dominik Anonymous

Re: We made a new quiz navigation

написао/ла Tieku Bortei-Doku -

Dominik,

If i sent you my attempt.php file, could you apply the patch to it for me? Then i can try it on a test (non production) server.

What version of Eclipse do you use?

Tieku

У одговору на Tieku Bortei-Doku

Re: We made a new quiz navigation

написао/ла Dominik Anonymous -
tieku attach your file in your next post and i'll have a look at it.

ill also make the green ones bold. thanks for the hint!
У одговору на Dominik Anonymous

Re: We made a new quiz navigation

написао/ла Tieku Bortei-Doku -

Dominik,

Here is my attempt.php. I hope you can apply your patch to it for me. i have made a few changes to the original file but have not applied you patch yet.

Thanks

Tieku

У одговору на Tieku Bortei-Doku

Re: We made a new quiz navigation

написао/ла Dominik Anonymous -
hi tieku, here it is. hope i did no mistake ;)

... if you wanna have the noback mod work as well than execute following sql command on your database. (you should if you run the new navigation. i forgot to post the command at first gemischt)

SQL:
ALTER TABLE `mdl_quiz` ADD `noback` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '1';
ALTER TABLE `mdl_quiz_attempts` ADD `lastpage` INT UNSIGNED NOT NULL DEFAULT '0';

Append to yourmoodledata/lang/en_utf8_local/quiz.php: (or create it)
$string['noback'] = 'Allow to page back';
$string['answered_questions'] = 'Answered questions:';
$string['no_timelimit'] = 'No timelimit';


Did you sucessfully patch the other files?
У одговору на Dominik Anonymous

Re: We made a new quiz navigation

написао/ла Tieku Bortei-Doku -

I have tried the new attempt.php but unfortunately it did not work. I just get a blank screen under the quiz name after i click "Attempt quiz now".

You asked: Did you successfully patch the other files?

Which other files? Do i need to do anything else if am am just interested in the new navigation bar and not the "noback" feature?

Tieku

У одговору на Tieku Bortei-Doku

Re: We made a new quiz navigation

написао/ла Dominik Anonymous -
yes you have to patch all five files. unfortunately you have to install the noback feature too, but you dont have to use it.

Execute the SQL command too or php will generate errors. though they wont show up because moodle will supress them and although script will function (i think), this is not a clean method.

Send me the other files too if you cant patch them yourself. (jstimer.php, locallib.php, mod_form.php and quiz.php - all located in the same folder as attempt.php)
У одговору на Dominik Anonymous

Re: We made a new quiz navigation

написао/ла Tieku Bortei-Doku -
And finally quiz.php which i found in \lang\en_utf8? Is this right? Hopefully you can get to these before the start of your vacation.
У одговору на Tieku Bortei-Doku

Re: We made a new quiz navigation

написао/ла Dominik Anonymous -
ahh i see... i made a typing mistake. i meant quiz.js witch is located in the same directory as the others. but now its too late... ill patch the other files and send you mine quiz.js. you can try to overwrite yours, this could work.

ill post your patches in a few minutes


edit: so here we go, hope this workes смешак if not than we'll have to wait 2 weeks ;)

edit2: tieku, if you have a look at your quiz.js... here is what to do:

@@ -7,9 +7,9 @@ << the lines where you should find the following code
*/

/* Used by quiz navigation links to force a form submit, and hence save the user's data. */
-function navigate(page) { Remove the lines prefixed by a -
+function navigate(page,anker) { and replace them by lines prefixed by a +
var ourForm = document.getElementById('responseform'); lines not prefixed with + or - have to be left as they are. you schould find these lines in YOUR unmodified code.
- ourForm.action = ourForm.action.replace(/page=.*/, 'page=' + page);
+ ourForm.action = ourForm.action.replace(/page=.*/, 'page=' + page+anker);
if (ourForm.onsubmit) {
ourForm.onsubmit();
}
@@ -87,7 +87,20 @@
}
if (pos == old) {
timerbox.style.top = pos + 'px'; if ther are only lines prefixed with a +, then simply add them
+ if (typeof window.innerWidth == "undefined") {
+ timerbox.style.margin = '0 0 0 ' + (document.body.clientWidth - timerbox.offsetWidth) + 'px';
+ }
+ else {
+ timerbox.style.margin = '0 0 0 ' + (window.innerWidth - timerbox.offsetWidth - 30) + 'px';
+ }
}
old = pos;
temp = setTimeout('movecounter(timerbox)',100);
}
+
+function highlight(id) {
+ document.getElementById("qid_"+id).style.textDecoration="underline overline";
+}
+function dehighlight(id) {
+ document.getElementById("qid_"+id).style.textDecoration="none";
+}


for the first example this would be: DO NOT forget to delete the prefixing + or - symbols!

function navigate(page,anker) {
var ourForm = document.getElementById('responseform');
ourForm.action = ourForm.action.replace(/page=.*/, 'page=' + page+anker);
if (ourForm.onsubmit) {
ourForm.onsubmit();
}


У одговору на Dominik Anonymous

Re: We made a new quiz navigation

написао/ла Olli Savolainen -
This looks really good, especially for exams that have a lot of questions.

One side note though: about 7-10% of all males are estimated to have red-green colour blindness, and thus it is a basic rule in user interface design not to rely on solely colour to communicate anything, but to have it communicated also by some other means: displaying the differing elements in bold or with an apostrophe.

A simple introduction about the subject on wikipedia:
http://en.wikipedia.org/wiki/Color_blindness#Design_implications_of_color_blindness

It would seem to me that displaying the unanswered question numbers also in bold would work.
У одговору на Olli Savolainen

Re: We made a new quiz navigationed

написао/ла Dominik Anonymous -
here is the new patch with bold an none bold symbols.

if you already applied the patch, here is how to edit the files by hand.

simply edit line 129 in jstimer.php from
edit: the forum screws up my php code -.-
echo "<td><span>".$i_question."</span></td>"; in echo "<td>".$i_question."</td>";

(Fixed by Martin Dougiamas - original submission Monday, 18 August 2008, 05:30 PM)

У одговору на Olli Savolainen

Re: We made a new quiz navigation

написао/ла Dominik Anonymous -
У одговору на Dominik Anonymous

Re: We made a new quiz navigation

написао/ла Dominik Anonymous -
if you try my script, please take a special look at the cloze question type. i only tested it with the cloze example from the moodle help yet.
У одговору на Dominik Anonymous

Re: We made a new quiz navigation

написао/ла Michael Deininger -

From what I am reading, I have only been a member for a short time frame and am using Moodle as our LMS fo5r students, there is nothing else they can use.  I like the new navigation talked about and I keep seeing patches being posted; how can I get the new features starting now, I do not want to miss anything or skip a step.  I see people sending files and getting patches applied, is that an option until I can get current?

I did post a topic for either moving the timer to the right side or making it static at teh top, do either of these get addressed in the patches?

Thank you for everything and if you can help with the patches please let me know, at least until I get my feet wet and get current.

Michael

У одговору на Michael Deininger

Re: We made a new quiz navigation

написао/ла Dominik Anonymous -
>> I did post a topic for either moving the timer to the right side or making it static at teh top, do either of these get addressed in the patches?

Its not a patch about your post, but in this new navigation the timer is indeed positioned on the right side. But as already mentioned, you have to patch your moodle files which can be done in windows using eclipse or in linux using the patch command. if you are not using moodel 1.9.2 BUILD 20080711 than you even have to apply the patch by hand. If you take a look at the patchfile you can see witch lines of the code have to be replaced. But its recommended to know at least a bit of programming in order to do that.
У одговору на Dominik Anonymous

Re: We made a new quiz navigation

написао/ла Michael Deininger -

OK, I'll get the newest weekly build and patch the files.  I am looking for Eclipse, I have not heard of the program so I will search.  I have programming experience but am new to the files so I will try the Eclipse option first, best place to get the version I need?

Thanks