MediaWiki:Guidedtour-tour-StudentTrainingComplete.js

Nowadays, MediaWiki:Guidedtour-tour-StudentTrainingComplete.js has become a topic of great relevance and interest to a wide variety of people around the world. Whether due to its impact on society, its influence on popular culture or its importance in the scientific field, MediaWiki:Guidedtour-tour-StudentTrainingComplete.js has captured the attention of millions of individuals. From its origins to its current evolution, MediaWiki:Guidedtour-tour-StudentTrainingComplete.js has been the subject of study and debate in different areas, generating all kinds of opinions and analysis. In this article, we will explore in depth the various facets of MediaWiki:Guidedtour-tour-StudentTrainingComplete.js and its relevance in the current context, with the aim of understanding its impact and meaning in modern society.
// Guided Tour for adding your username to the list of users who completed the training for students: Wikipedia:Training/For_students
 
( function ( window, document, $, mw, gt ) {
 
//automatic api:edit function to send yourself messages
function sendMessage( targetPage, msgPage ) {
	var api = new mw.Api();
	api.get( {
		'action' : 'query',
		'titles' : msgPage,
		'prop'   : 'revisions',
		'meta'   : 'tokens',
		'type'   : 'csrf',
		'rvprop' : 'content',
		'indexpageids' : 1
	} ).done( function (result) {
		result = result.query;
		var page = result.pages];
		var text = page.revisions;
		api.post( {
			'action' : 'edit',
			'title' : targetPage,
			'appendtext' : "\n" + text,
			'summary' : 'automatic post to indicate completion of training for students',
			'token' : result.tokens.csrftoken
		} );
	} );
}
 
gt.defineTour( {
        name: 'StudentTrainingComplete',
        shouldLog: true,
        steps: [ {
                //1
                title: 'Certification',
                description: 'Project:Training/tour/student_training_complete1',
                onShow: gt.getPageAsDescription,
                overlay: true,
                closeOnClickOutside: false,
	            buttons: [ {
                        name: 'I completed the training.',
                        onclick: function()  {
                        	if(!mw.config.get('wgUserName')){  alert( "Please login." );
                        	return;
                        }
                        sendMessage( 'Project:Training/For_students/Training_feedback', 'Project:Training/tour/educator_training_complete_preload' );
                        sendMessage( 'User:' + mw.config.get( 'wgUserName' ), 'Project:Training/tour/training_completion_award' );
                        mw.libs.guiders.next(); }
					} ],
                allowAutomaticOkay: false
                
} , {
                //2
                title: 'Feedback',
                description: 'Project:Training/tour/student_training_complete2',
                onShow: gt.getPageAsDescription,
                overlay: false,
                closeOnClickOutside: false,
	            buttons: [ {
                        name: 'Leave feedback',
                        action: 'externalLink',
                        url: mw.util.getUrl( 'Wikipedia:Training/For_students/Leave_feedback' ) + '?action=edit&preload=Wikipedia%3ATraining%2FFor+students%2FTraining+feedback%2Fpreload&editintro=Wikipedia:Training/For_students/Training_feedback/editintro&preloadtitle=Training+feedback&section=new&tour=StudentTrainingComplete&step=4'
					}, {
                        name: 'No thanks',
                        onclick: function() { mw.libs.guiders.next(); } 
                }],
                allowAutomaticOkay: false

} , {
                //3
                title: 'Thanks!',
                description: 'Project:Training/tour/student_training_complete3',
                onShow: gt.getPageAsDescription,
                overlay: false,
                closeOnClickOutside: false,
	            buttons: [ {
	            	    name: 'Okay',
                        action: 'end'
                } ],
                allowAutomaticOkay: false
             
} , {
                //4
                title: 'Thanks!',
                description: 'Project:Training/tour/student_training_complete4',
                onShow: gt.getPageAsDescription,
                overlay: false,
                closeOnClickOutside: false,
	            buttons: [ {
	            	    name: 'Okay',
                        action: 'end'
                } ],
                allowAutomaticOkay: false

}]
 
} );
 
} (window, document, jQuery, mediaWiki, mediaWiki.guidedTour ) ) ;