Forums
I found a problem: when a teacher wants to view a students' results answers, an 'Access denied' page comes up.
How to reproduce:
Log in as Teacher on the demo site: http://dev.opigno.org/ Go to the students' "My results": http://dev.opigno.org/user/2/myresults Click on a 'View answers' link
The problem is caused by wrong use of the 'og_quiz_access_my_result' in the og_quiz module:
<?php $time_end = db_query('SELECT time_end FROM {quiz_node_results} WHERE result_id = :result_id AND uid = :uid', array(':result_id' => $rid, ':uid' => $user->uid))->fetchField(); ?>
It searches for the result_id in combination with the user_id of the current user. But in this case, that is not correct because we are looking for the students' result.
The query fails and returns false, so the teacher is never granted to access see the answers.
I hope this can be fixed!
Thanks!
Hi BdN
Hi BdN
When teachers want to see their student results usually they go to the course and then they click on the results or on the admin tab results.
Depending on the context, the teacher should be able to see the student results.
For example if you log in as the teacher and do user/quiz/1744/userresults, you have access denied.
If you go to the course, node/346/results/1744, you see that the teacher has access.
But yes. we should probably change this, ill take a look at it.
Best regards
Hi James
Displaying user results/certificate
In reply to Hi James by BdN
Same issue