Quantcast
Channel: Assignment
Viewing all articles
Browse latest Browse all 9615

Re: How to get the 'rownumber' from assign tables

$
0
0
by Aaricia Thorgalson (aka Mari Cruz García).  

Sorry Andreas, I misunderstood you. Just to let you know that the solution you proposed was the right one.


I managed to upgrade my block. I attach the code as it may be of use for other Moodlers:

foreach ($assignments as $assignment) {

    $cm = get_coursemodule_from_instance('assign', $assignment->id, $courseid);
    
  


     $submission = $DB->get_record('assign_submission', array('userid' => $userid,
                                                                      'assignment' => $assignment->id));
            
if ( !$submission ) { 
  
  continue ;
  
 
  
   }
  
 
  
   if ( $submission ) { 
  
  
$urlparams = array('id' => $cm->id,
'rownum'=>'0',
'action'=>grade,
'userid' => $userid,
);

$assignurl = new moodle_url('/mod/assign/view.php', $urlparams);
    echo '<li>';
          
    echo html_writer::link($assignurl, $assignment->name, array('target' => '_blank'));
echo '</li>';
  }//end if submission



} //end of foreach


Viewing all articles
Browse latest Browse all 9615

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>