Hello Mike,
Do you have a time line or rough idea when the questionnaire will be back ported for Moodle 1.9
The latest version works fine in Moodle 1.9
In the upgrade.php file, l change the if ($oldversion < 2008031904) code to something like
$studentroles = get_roles_with_capability('moodle/legacy:student', CAP_ALLOW);
$teacherroles = get_roles_with_capability('moodle/legacy:teacher', CAP_ALLOW);
$editingteacherroles = get_roles_with_capability('moodle/legacy:editingteacher', CAP_ALLOW);
$capview = 'mod/questionnaire:view';
$capsubmit = 'mod/questionnaire:submit';
while ($questionnaire = rs_fetch_next_record($rs)) {
$
context = get_context_instance(CONTEXT_MODULE, $questionnaire->cmid);
/// Convert questionnaires with resp_eligible = 'all' so that students & teachers have view and submit
if ($questionnaire->resp_eligible == 'all') {
foreach ( $editingteacherroles as $editteach) {
assign_capability($capsubmit, CAP_ALLOW, $editteach->id, $context->id, true);
}
foreach ($teacherroles as $teach) {
assign_capability($capsubmit, CAP_ALLOW, $teach->id, $context->id, true);
}
/// Convert questionnaires with resp_eligible = 'students' so that just students have view and submit
} else if ($questionnaire->resp_eligible == 'students') {
/// This is the default; no changes necessary.
/// Convert questionnaires with resp_eligible = 'teachers' so just teachers have view and submit
} else if ($questionnaire->resp_eligible == 'teachers') {
foreach ( $editingteacherroles as $editteach) {
assign_capability($capsubmit, CAP_ALLOW, $editteach->id, $context->id, true);
}
foreach ($teacherroles as $teach) {
assign_capability($capsubmit, CAP_ALLOW, $teach->id, $context->id, true);
}
foreach ($studentroles as $stud) {
assign_capability($capview, CAP_PREVENT, $stud->id, $context->id, true);
assign_capability($capsubmit, CAP_PREVENT, $stud->id, $context->id, true);
}
}
}
rs_close($rs);
Will it be possible to add this or something like this to the latest version?