Situation which confused students: course that is open to guests. Authenticated user (not enrolled in this course) enter in quiz and doesn't see "Attempt quiz now" button.
I think it will be good to add some description and button "Enrol me in this course" after quiz introduction. I try search similar bug or improvment request, but didn't find...
P.S. I have moodle 1.8
This is definitely not the right behaviour. Please can you file a bug in the tracker.
Ok. added bug 10370
I have just reported this as
MDL-10376
I have included some rather crude code that may address it as follows
//Guests can't do a quiz, so offer them a choice of logging in or going back
The code should be internationalized for its strings and I have not given it serious testing but it might make a reasonable start?
MDL-10376
I have included some rather crude code that may address it as follows
$context = get_context_instance(CONTEXT_MODULE, $cm->id); if(!isguest()){ if(!has_capability('mod/quiz:attempt',$context)){ print"<div align=center>"; print "<h3> You need to be enrolled to make quiz attempts </h3>"; print "<a href=".$CFG->wwwroot."/course/enrol.php?id=".$course->id .">Click here to enrol </a>"; print "</div>"; } }This is to go in mod\quiz\view.php just above the comment that reads
//Guests can't do a quiz, so offer them a choice of logging in or going back
The code should be internationalized for its strings and I have not given it serious testing but it might make a reasonable start?