5 posts / 0 new
Last post
BdN
Offline
Last seen: 4 years 11 months ago
Joined: 09/12/2014
As teacher not able to see students answers

I found a problem: when a teacher wants to view a students' results answers, an 'Access denied' page comes up.

How to reproduce:

  1. Log in as Teacher on the demo site: http://dev.opigno.org/
  2. Go to the students' "My results": http://dev.opigno.org/user/2/myresults
  3. 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!

James Aparicio
James Aparicio's picture
Offline
Last seen: 1 week 3 days ago
Staff
Joined: 10/30/2013
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

 

BdN
Offline
Last seen: 4 years 11 months ago
Joined: 09/12/2014
Hi James

Ah you are right, that is the page I'm looking for. So there are 2 pages that are exactly the same, but with different paths and credentials. That is a little confusing ;-)

Many thanks for your answer! I will figure out how to redirect the teachers to the correct place :-)

raf
Offline
Last seen: 1 year 3 months ago
Joined: 06/13/2018
Same issue

For some reason, My teachers cannot see or grade the assignments. How did you get it to work? My teachers have the role as Teacher.

natacon
Offline
Last seen: 1 year 11 months ago
Joined: 01/30/2017
Displaying user results/certificate
  • deleted - posted in wrong thread *