• Resolved sergio345

    (@sergio345)


    Your plugin is great and really usefull to us. We have some suggestions to make it better:

    1. Import all users with a role in the site. We have a custom WordPress role for students, and would be great if we can import all in one step. Also can be usefull to have a selection step to select the users of the site to add to a course.

    2. Widget or frontend page.

    Thanks for this fantastic plugin and your hard work! Sorry for my bad English.

    https://www.ads-software.com/plugins/an-gradebook/

Viewing 15 replies - 1 through 15 (of 17 total)
  • Plugin Author Aori Nevo

    (@anevo)

    Hi sergio345,

    Thank you for your feedback.

    Item 1 is definitely something that needs to be integrated into this plugin.
    Item 2 has been suggested in the past, but I’ve been reluctant to add it because I couldn’t find a nice, easy, and reliable way to render the gradebook in the wordpress frontend (there are a ton of themes to choose from, how should I handle rendering the gradebook so it looks the same in all of them). I think now the plugin is in a much better place and better suited to add such a feature.

    Regards,

    Aori Nevo

    Plugin Author Aori Nevo

    (@anevo)

    Hi sergio345,

    You can use the following code to insert the gradebook plugin into the frontend of your wordpress site. This code should go at the bottom of the GradeBook.php file just before the ?> symbol. It’s a hack, but it should work. Let me know how this works out for you.

    add_action('wp_head','an_gradebook_ajaxurl');
    function an_gradebook_ajaxurl() {
    ?>
    <script type="text/javascript">
    var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>';
    </script>
    <?php
    }
    
    function an_gradebook_shortcode (){
    	init_an_gradebook();
    	$an_gradebook_develop = false;
    	$app_base = plugins_url('js',__FILE__);
    	wp_register_style( 'jquery_ui_css', $app_base.'/lib/jquery-ui/jquery-ui.css', array(), null, false );
    	wp_register_style( 'GradeBook_css', plugins_url('GradeBook.css',__File__), array('bootstrap_css','jquery_ui_css'), null, false );
    	wp_register_style( 'bootstrap_css', $app_base.'/lib/bootstrap/css/bootstrap2.css', array(), null, false);
    	wp_register_script( 'requirejs', $app_base.'/require.js', array(), null, true);
    	if( 1==1 ){
    		wp_enqueue_style('GradeBook_css');
    		wp_enqueue_script('requirejs');
    		if(gradebook_check_user_role('administrator')){
    			wp_localize_script( 'requirejs', 'require', array(
    				'baseUrl' => $app_base,
    				'deps'    => array( $app_base . ($an_gradebook_develop ? '/app_instructor.js' : '/app-instructor-min.js')
    				)
    			));
    		} else {
    			wp_localize_script( 'requirejs', 'require', array(
    				'baseUrl' => $app_base,
    				'deps'    => array( $app_base . ($an_gradebook_develop ? '/app_student.js' : '/app-student-min.js')
    				)
    			));
    		}
    	} else {
    		return;
    	};
    	return '<div id="wpbody-content"></div>';
    }
    add_shortcode('an_gradebook', 'an_gradebook_shortcode');

    Regards,

    Aori Nevo

    Thread Starter sergio345

    (@sergio345)

    Thanks! I coudn’t try it before.

    Do you have plans to make the plugin work with multisite?

    Plugin Author Aori Nevo

    (@anevo)

    Hi sergio345,

    Some users have successfully used the plugin on multisite installation of wordpress, but we do not support it. I’ll add this to the list of requested features and see what we can do.

    Regards,

    Aori Nevo

    Hi – regarding the shortcode hack – I tried it, but nothing happens – I emptied my cache, reloaded my page, and [an_gradebook] just does nothing – other shortcodes work ok on the page. The shortcode is recognized, because the [an_gradebook] is not echo’ed to the screen. Looks like it just comes back – I was logged in as Site Admin. Can you please take a look as having the ability for students to see their grades on their Portal Page on my site would be great! Thanks!

    This is the full content of my page:

    [xyz-ips snippet=”LearningPortalLoginMessage”]
    Gradebook should be here:
    [an_gradebook]
    Now the Student Profile:
    [ld_profile]

    Here is what appears:

    Plugin Author Aori Nevo

    (@anevo)

    Hi asimjaved,

    That hack is old and probably will only work for much earlier versions of the plugin. Let me see what all needs to be changed to get it to work again.

    Regards,
    Aori Nevo

    Plugin Author Aori Nevo

    (@anevo)

    Hi asimjaved,

    You’ll need to do two things. First, edit an-gradebook/GradeBook.php. Place the code below at the end of the file just before ?>.

    function an_gradebook_shortcode (){
    	init_an_gradebook();
    	$an_gradebook_develop = true;
    	$app_base = plugins_url('js',__FILE__);
    	wp_register_script( 'init_front_end_gradebookjs', $app_base.'/../init_front_end_gradebook.js', array('jquery'), null, true);
    	wp_enqueue_script('init_front_end_gradebookjs');
    	if( 1==1){
    		wp_register_style( 'jquery_ui_css', $app_base.'/lib/jquery-ui/jquery-ui.css', array(), null, false );
    		wp_register_style( 'GradeBook_css', plugins_url('GradeBook.css',__File__), array('bootstrap_css','jquery_ui_css'), null, false );
    		wp_register_style( 'bootstrap_css', $app_base.'/lib/bootstrap/css/bootstrap.css', array(), null, false);
    		wp_register_script( 'requirejs', $app_base.'/require.js', array(), null, true);
    		wp_enqueue_style('GradeBook_css');
    		wp_enqueue_script('requirejs');
    		wp_localize_script( 'requirejs', 'require', array(
    			'baseUrl' => $app_base,
    			'deps'    => array( $app_base . ($an_gradebook_develop ? '/an-gradebook-app.js' : '/an-gradebook-app-min.js')
    		)));
    	} else {
    		return;
    	}
    	return '<div id="wpbody-content"></div>';
    }
    add_shortcode('an_gradebook', 'an_gradebook_shortcode');

    Second, add a new file under the an-gradebook directory named init_front_end_gradebook.js and inside this file insert the code below.

    (function($){
    	var _x = window.location.href + "#courses";
    	window.location.href = _x;
    })(jQuery);

    Also, you will likely want to change the value of $an_gradebook_develop to false. This will shorten the load time of the page.

    Let me know how this turns out.

    Regards,
    Aori Nevo

    Thanks Aori – it’s trying to load now, but it hangs with the circle showing and continually moving … just fyi, I only have 2 students, 1 course and 1 assignment.

    Plugin Author Aori Nevo

    (@anevo)

    Can you send me screeshots of the page with Google Chrome Developer Tools window open and the networks tab selected?

    Plugin Author Aori Nevo

    (@anevo)

    Select the XHR tab and click on the item named admin-ajax.php?action=course_list. Send me a screenshot of this.

    admin-ajax wasn’t there – only this:
    https://www.taqwaseminary.com/dev/images/devtoolsscreenshot2.png

    Plugin Author Aori Nevo

    (@anevo)

    It looks like you are getting two errors. Click on the console tab and send me a screenshot.

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘Suggestions’ is closed to new replies.