Feature Requests

Please do NOT use this section of the forum to request help if Joomdle does not work for you in some particular way. Your post will be deleted.

Allow teachers to view students' gradebook

  • Web Buster UK Ltd
  • Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
6 years 7 months ago - 6 years 7 months ago #1 by Web Buster UK Ltd
Allow teachers to view students' gradebook was created by Web Buster UK Ltd
This may be a bit of a stretch, but is it possible for a teacher to view a student's gradebook? Ideally it will be the mygrades view.

Edit: We have modified the mygrades view to allow teachers to view student's gradebook - it isn't really a clean modification but it does work for now.
Last edit: 6 years 7 months ago by Web Buster UK Ltd.

Please Log in or Create an account to join the conversation.

More
6 years 7 months ago #2 by Antonio Durán
Replied by Antonio Durán on topic Allow teachers to view students' gradebook
Hi.

Have you looked into the childrengrades view?

Please Log in or Create an account to join the conversation.

  • Web Buster UK Ltd
  • Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
6 years 6 months ago #3 by Web Buster UK Ltd
Replied by Web Buster UK Ltd on topic Allow teachers to view students' gradebook
Hi Antonio, it wasn't quite what we wanted as that only displays the grade for your mentees. We needed the teachers to be able to view any of their students' gradebook.

We have basically edited the My Grades php files to allow to view other user's gradebook.

Please Log in or Create an account to join the conversation.

  • Web Buster UK Ltd
  • Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
6 years 5 months ago - 6 years 5 months ago #4 by Web Buster UK Ltd
Replied by Web Buster UK Ltd on topic Allow teachers to view students' gradebook
Just to share what we have done to allow teachers to view students' grades. We basically replicated the mygrades view, the only file changed was view.html.php.

Code:
<?php /** * @package Joomdle * @copyright Qontori Pte Ltd * @license http://www.gnu.org/licenses/gpl-3.0.html GNU/GPL */ // no direct access defined('_JEXEC') or die('Restricted access'); jimport( 'joomla.application.component.view'); require_once(JPATH_SITE.'/components/com_joomdle/helpers/content.php'); /** * HTML View class for the Joomdle component */ class JoomdleViewStudentgrades extends JViewLegacy { function display($tpl = null) { global $mainframe; $app = JFactory::getApplication(); $params = $app->getParams(); $this->assignRef('params', $params); $user = JFactory::getUser(); $id = $user->id; $student = $_GET['student']; $username = $student; $db = JFactory::getDbo(); $query3 = $db->getQuery(true); $query3->select('cb_usertype'); $query3->from($db->quoteName('#__comprofiler')); $query3->where($db->quoteName('id')." = " . $id); $db->setQuery($query3); $usertype = $db->loadResult(); if ( !in_array($usertype, ['teacher','admin'], true ) ) { throw new Exception(JText::_('Restricted Access'), 701); }; $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select('id'); $query->from($db->quoteName('#__users')); $query->where($db->quoteName('username'). " = '" . $student . "'"); $db->setQuery($query); $studentid = $db->loadResult(); if (!array_key_exists('8', $user->groups)) { $db = JFactory::getDbo(); $query2 = $db->getQuery(true); $query2->select('cb_school'); $query2->from($db->quoteName('#__comprofiler')); $query2->where($db->quoteName('id')." = " . $id, 'OR') ->where($db->quoteName('id')." = " . $studentid); $db->setQuery($query2); $column= $db->loadColumn(); if ($column[0] !== $column[1]) { throw new Exception(JText::_('Restricted Access'), 801); }; }; $layout = $params->get('layout'); if ($layout == 'basic') { $this->tasks = JoomdleHelperContent::call_method ("get_my_grades", $username); } else { $this->tasks = JoomdleHelperContent::call_method ("get_my_grade_user_report", $username); $tpl = 'cats'; } $this->pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx')); $this->_prepareDocument(); parent::display($tpl); } protected function _prepareDocument() { $app = JFactory::getApplication(); $menus = $app->getMenu(); $title = null; // Because the application sets a default page title, // we need to get it from the menu item itself $menu = $menus->getActive(); if ($menu) { $this->params->def('page_heading', $this->params->get('page_title', $menu->title)); } else { $this->params->def('page_heading', JText::_('COM_JOOMDLE_MY_GRADES')); } } } ?>

We added a link to view the studentgrades from their joomla profile. As the URL for joomla profile contains their username, we retrieved the last part of the URL to be input as part of the link, hence the $_GET bit at the start.
Last edit: 6 years 5 months ago by Web Buster UK Ltd.

Please Log in or Create an account to join the conversation.

More
6 years 5 months ago #5 by Antonio Durán
Replied by Antonio Durán on topic Allow teachers to view students' gradebook
Thanks for sharing. I will take a look soon to see if we can include it in Joomdle.

Please Log in or Create an account to join the conversation.

More
6 years 3 months ago #6 by Antonio Durán
Replied by Antonio Durán on topic Allow teachers to view students' gradebook
Looking at the code I see this is too specific to be included, as it relies on your CB custom settings.
In order for it to be included in Joomdle, it would need to work quite different, and be part of some for-teachers side in Joomdle. Right now I don't see enough demand to work on that, so I am afraid you will need to keep your custom view for now.

Please Log in or Create an account to join the conversation.

  • Web Buster UK Ltd
  • Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
6 years 2 months ago #7 by Web Buster UK Ltd
Replied by Web Buster UK Ltd on topic Allow teachers to view students' gradebook
Yeah it was coded specifically for our own use - it wasn't meant for everyone's use, but if they know a bit of coding they should be able to adapt it for themselves. As we have different schools using the same website, we needed some layer of filter to block them from seeing other school's students.

I presume it should be much simpler if you only needed any teacher to be able to view any student on the site.

Please Log in or Create an account to join the conversation.

More
6 years 2 months ago #8 by Antonio Durán
Replied by Antonio Durán on topic Allow teachers to view students' gradebook
You are totally right: people can see it and it will help them to think about their own solution for their use case. As always, thanks for sharing!

Please Log in or Create an account to join the conversation.