<commit_before>---
layout: contribute-form
title: "Add a Resource"
sidebar:
  nav: "side-nav"
---
<style>
  small {
  	margin-top: -10px;
  }
</style>
<p class="instuctions">To add to the content of this library please fill out the following fields in regards to your resource.</p>
<form action="//formspree.io/{{ site.email }}" method="POST">
    <fieldset>
        <label for="name">Name:</label><br>
        <input type="text" name="name" placeholder="Name">
        <label><small>This will be used to acknowledge you as a contributor. If you wish to remain anonymous, leave it blank.</small></label>
    </fieldset>
    <fieldset>
        <label for="_replyto">GA Tech ID:</label><br>
        <input type="email" name="_replyto" placeholder="<EMAIL>">
        <label><small>If you are a Georgia Tech student, this is required to obtain participation credit.</small></label>
    </fieldset>
    <fieldset>
    	<label for="resource-group">Resource Group:</label><br>
    	<select name="resource-group" multiple onchange="setCategories()">
    		<option value="introduction-to-edtech">Introduction to Educational Technology</option>
    		<option value="research-principles-and-methodologies">Research Principles and Methodologies</option>
    		<option value="pedagogical-styles">Pedagogical Styles</option>
    		<option value="technologies">Technologies</option>
    		<option value="broader-issues">Broader Issues</option>
    	</select>
    </fieldset>
    <fieldset>
    	<label for="resource-category">Resource Category:</label><br>
    	<select name="resource-category" multiple>
    	</select>
    </fieldset>
    <fieldset>
        <label for="resource-topic">Resource Topic:</label><br>
        <select name="resource-topic">
            <option value="introductory-resources">Introductory Resources</option>
			<option value="scholarly-readings">Scholarly Readings</option>
			<option value="biographies">Biographies</option>
			<option value="ongoing-projects">Ongoing Projects</option>
			<option value="in-the-media">In the Media</option>
			<option value="interviews">Interviews</option>
        </select>
    </fieldset>
    <fieldset>
        <label for="resourceType">Resource Type:</label><br>
        <select name="resourceType">
        {% for resource in site.data.resource_types %}
            <option value="{{ resource.name }}">{{ resource.text }}</option>
        {% endfor %}
        </select>
    </fieldset>
    <fieldset>
        <label for="title">Resource Title:</label><br>
        <input type="text" name="title" placeholder="Add a resource title..." required>
    </fieldset>
    <fieldset>
        <label for="title-url">Resource URL:</label><br>
        <input type="text" name="title-url" placeholder="Add a resource URL..." required>
    </fieldset>
    <fieldset>
        <label for="author">Resource Author:</label><br>
        <input type="text" name="author" placeholder="Add the resource's author, if applicable...">
    </fieldset>
    <fieldset>
        <label for="author">Published Date (YYYY-MM-DD):</label><br>
        <input type="text" name="author" placeholder="Add the resource's publish date, if applicable, in the form YYYY-MM-DD.">
    </fieldset>
    <fieldset>
        <label for="summary">Resource Description:</label><br>
        <textarea name="summary" rows="6" placeholder="Add a brief description for the resource. If your resource has one, an abstract works great!"></textarea>
    </fieldset>
    <fieldset>
        <label for="cite">APA Citation:</label><br>
        <textarea name="cite" rows="2" placeholder="If you can, add an APA citation to help other students."></textarea>
    </fieldset>
    <input class="hidden" type="text" name="_gotcha" style="display:none">
    <input class="hidden" type="hidden" name="_subject" value="Message via http://domain.com">

    <input class="button submit" type="submit" value="Submit" style="margin-bottom: 30px"><br><br><br>
</form>
<script>
var setCategories = function() {
	var groupEl = document.getElementsByName('resource-group')[0];
	if (groupEl) {
		var result = [];
		var options = groupEl.options;
		var opt;

		for (var i=0; i < options.length; i++) {
		  opt = options[i];

		  if (opt.selected) {
		    result.push(opt.value || opt.text);
		  }
		}
		
		var catOpts = "";
		for (var i=0; i < result.length; i++) {
			var gr = result[i];
			if (gr == 'introduction-to-edtech') {
				catOpts += '<option value="survey-of-edtech">Survey of EdTech</option>';
				catOpts += '<option value="views-on-edtech">Views on Educational Technology</option>';
				catOpts += '<option value="educational-technology-in-the-media">Educational Technology in the Media</option>';
				catOpts += '<option value="useful-web-sites">Useful Web Sites</option>';
			} else if (gr == 'research-principles-and-methodologies') {
				catOpts += '<option value="research-basics">Research Basics</option>';
				catOpts += '<option value="controlled-experiments">Controlled Experiments</option>';
				catOpts += '<option value="survey-research">Survey Research</option>';
				catOpts += '<option value="qualitative-research">Qualitative Research</option>';
				catOpts += '<option value="quantitative-research">Quantitative Research</option>';
				catOpts += '<option value="design-based-research">Design-Based Research</option>';
			} else if (gr == 'pedagogical-styles') {
				catOpts += '<option value="constructionism">Constructionism</option>';
				catOpts += '<option value="project-based-learning">Project-Based Learning</option>';
				catOpts += '<option value="problem-based-learning">Problem-Based Learning</option>';
				catOpts += '<option value="communities-of-practice">Communities of Practice</option>';
				catOpts += '<option value="social-learning">Social Learning</option>';
				catOpts += '<option value="metacognition">Metacognition</option>';
				catOpts += '<option value="formative-assessment">Formative Assessment</option>';
			} else if (gr == 'technologies') {
				catOpts += '<option value="learning-management-systems">Learning Management Systems</option>';
				catOpts += '<option value="intelligent-tutoring-systems">Intelligent Tutoring Systems</option>';
				catOpts += '<option value="online-learning">Online Learning</option>';
				catOpts += '<option value="moocs">MOOCs</option>';
				catOpts += '<option value="social-networking">Social Networking</option>';
				catOpts += '<option value="computer-supported-collaborative-work">Computer-Supported Collaborative Work</option>';
				catOpts += '<option value="game-based-learning">Game-Based Learning</option>';
				catOpts += '<option value="simulation-based-learning">Simulation-Based Learning</option>';
				catOpts += '<option value="mobile-devices">Mobile Devices</option>';
			} else if (gr == 'broader-issues') {
				catOpts += '<option value="gender-technology-and-education">Gender, Technology, and Education</option>';
				catOpts += '<option value="underserved-communities">Underserved Communities and Educational Technology</option>';
				catOpts += '<option value="ethics-and-edtech">Ethics and EdTech</option>';
				catOpts += '<option value="identity-technology-and-education">Identity, Technology, and Education</option>';
				catOpts += '<option value="privacy-in-educational-technology">Privacy in Educational Technology</option>';
				catOpts += '<option value="technology-in-the-classroom">Technology in the Classroom</option>';
				catOpts += '<option value="the-business-of-edtech">The Business of EdTech</option>';
				catOpts += '<option value="computer-science-education">Computer Science Education</option>';
				catOpts += '<option value="open-problems">Open Problems</option>';
			}
		}

		if (catOpts != "") {
			var catEl = document.getElementsByName('resource-category')[0];
			if (catEl) {
				catEl.innerHTML = catOpts;
			}
		}
	}
}
</script>

<script>
var fillForm = function () {
    var queryString = document.location.search.split("+").join(" ");
    var params = {}, tokens, re = /[?&]?([^=]+)=([^&]*)/g;

    while (tokens = re.exec(queryString)) {
        params[decodeURIComponent(tokens[1])] = decodeURIComponent(tokens[2]);
    }

    if (params.refpage == undefined){
        // no value in the query string
        // here you have to manage this use case : redirect or print a message to user
    }else{
        // filling form fields with query string values
        // document.getElementsByName('url')[0].value = params.refpage;
        // document.getElementsByName('url')[0].placeholder = params.refpage;
        console.log(params.refpage);
        // params.refpage.substring(1);
    }
} ();
</script><commit_msg>Added ability to pre-fill form based on group and category<commit_after>---
layout: contribute-form
title: "Add a Resource"
sidebar:
  nav: "side-nav"
---
<p class="instuctions">To add to the content of this library please fill out the following fields in regards to your resource.</p>
<form action="//formspree.io/{{ site.email }}" method="POST">
    <fieldset>
        <label for="name">Name:</label><br>
        <input type="text" name="name" placeholder="Name">
        <label><small>This will be used to acknowledge you as a contributor. If you wish to remain anonymous, leave it blank.</small></label>
    </fieldset>
    <fieldset>
        <label for="_replyto">GA Tech ID:</label><br>
        <input type="email" name="_replyto" placeholder="<EMAIL>">
        <label><small>If you are a Georgia Tech student, this is required to obtain participation credit.</small></label>
    </fieldset>
    <fieldset>
    	<label for="resource-group">Resource Group:</label><br>
    	<select name="resource-group" multiple onchange="setCategories()">
    		<option value="introduction-to-edtech">Introduction to Educational Technology</option>
    		<option value="research-principles-and-methodologies">Research Principles and Methodologies</option>
    		<option value="pedagogical-styles">Pedagogical Styles</option>
    		<option value="technologies">Technologies</option>
    		<option value="broader-issues">Broader Issues</option>
    	</select>
    </fieldset>
    <fieldset>
    	<label for="resource-category">Resource Category:</label><br>
    	<select name="resource-category" multiple>
    	</select>
    </fieldset>
    <fieldset>
        <label for="resource-topic">Resource Topic:</label><br>
        <select name="resource-topic">
            <option value="introductory-resources">Introductory Resources</option>
			<option value="scholarly-readings">Scholarly Readings</option>
			<option value="biographies">Biographies</option>
			<option value="ongoing-projects">Ongoing Projects</option>
			<option value="in-the-media">In the Media</option>
			<option value="interviews">Interviews</option>
        </select>
    </fieldset>
    <fieldset>
        <label for="resourceType">Resource Type:</label><br>
        <select name="resourceType">
        {% for resource in site.data.resource_types %}
            <option value="{{ resource.name }}">{{ resource.text }}</option>
        {% endfor %}
        </select>
    </fieldset>
    <fieldset>
        <label for="title">Resource Title:</label><br>
        <input type="text" name="title" placeholder="Add a resource title..." required>
    </fieldset>
    <fieldset>
        <label for="title-url">Resource URL:</label><br>
        <input type="text" name="title-url" placeholder="Add a resource URL..." required>
    </fieldset>
    <fieldset>
        <label for="author">Resource Author:</label><br>
        <input type="text" name="author" placeholder="Add the resource's author, if applicable...">
    </fieldset>
    <fieldset>
        <label for="author">Published Date (YYYY-MM-DD):</label><br>
        <input type="text" name="author" placeholder="Add the resource's publish date, if applicable, in the form YYYY-MM-DD.">
    </fieldset>
    <fieldset>
        <label for="summary">Resource Description:</label><br>
        <textarea name="summary" rows="6" placeholder="Add a brief description for the resource. If your resource has one, an abstract works great!"></textarea>
    </fieldset>
    <fieldset>
        <label for="cite">APA Citation:</label><br>
        <textarea name="cite" rows="2" placeholder="If you can, add an APA citation to help other students."></textarea>
    </fieldset>
    <input class="hidden" type="text" name="_gotcha" style="display:none">
    <input class="hidden" type="hidden" name="_subject" value="Message via http://domain.com">

    <input class="button submit" type="submit" value="Submit" style="margin-top: 1em; margin-bottom: 3em"><br><br><br>
</form>
<script>
var setCategories = function() {
	var groupEl = document.getElementsByName('resource-group')[0];
	if (groupEl) {
		var result = [];
		var options = groupEl.options;
		var opt;

		for (var i=0; i < options.length; i++) {
		  opt = options[i];

		  if (opt.selected) {
		    result.push(opt.value || opt.text);
		  }
		}
		
		var catOpts = "";
		for (var i=0; i < result.length; i++) {
			var gr = result[i];
			if (gr == 'introduction-to-edtech') {
				catOpts += '<option value="survey-of-edtech">Survey of EdTech</option>';
				catOpts += '<option value="views-on-edtech">Views on Educational Technology</option>';
				catOpts += '<option value="educational-technology-in-the-media">Educational Technology in the Media</option>';
				catOpts += '<option value="useful-web-sites">Useful Web Sites</option>';
			} else if (gr == 'research-principles-and-methodologies') {
				catOpts += '<option value="research-basics">Research Basics</option>';
				catOpts += '<option value="controlled-experiments">Controlled Experiments</option>';
				catOpts += '<option value="survey-research">Survey Research</option>';
				catOpts += '<option value="qualitative-research">Qualitative Research</option>';
				catOpts += '<option value="quantitative-research">Quantitative Research</option>';
				catOpts += '<option value="design-based-research">Design-Based Research</option>';
			} else if (gr == 'pedagogical-styles') {
				catOpts += '<option value="constructionism">Constructionism</option>';
				catOpts += '<option value="project-based-learning">Project-Based Learning</option>';
				catOpts += '<option value="problem-based-learning">Problem-Based Learning</option>';
				catOpts += '<option value="communities-of-practice">Communities of Practice</option>';
				catOpts += '<option value="social-learning">Social Learning</option>';
				catOpts += '<option value="metacognition">Metacognition</option>';
				catOpts += '<option value="formative-assessment">Formative Assessment</option>';
			} else if (gr == 'technologies') {
				catOpts += '<option value="learning-management-systems">Learning Management Systems</option>';
				catOpts += '<option value="intelligent-tutoring-systems">Intelligent Tutoring Systems</option>';
				catOpts += '<option value="online-learning">Online Learning</option>';
				catOpts += '<option value="moocs">MOOCs</option>';
				catOpts += '<option value="social-networking">Social Networking</option>';
				catOpts += '<option value="computer-supported-collaborative-work">Computer-Supported Collaborative Work</option>';
				catOpts += '<option value="game-based-learning">Game-Based Learning</option>';
				catOpts += '<option value="simulation-based-learning">Simulation-Based Learning</option>';
				catOpts += '<option value="mobile-devices">Mobile Devices</option>';
			} else if (gr == 'broader-issues') {
				catOpts += '<option value="gender-technology-and-education">Gender, Technology, and Education</option>';
				catOpts += '<option value="underserved-communities">Underserved Communities and Educational Technology</option>';
				catOpts += '<option value="ethics-and-edtech">Ethics and EdTech</option>';
				catOpts += '<option value="identity-technology-and-education">Identity, Technology, and Education</option>';
				catOpts += '<option value="privacy-in-educational-technology">Privacy in Educational Technology</option>';
				catOpts += '<option value="technology-in-the-classroom">Technology in the Classroom</option>';
				catOpts += '<option value="the-business-of-edtech">The Business of EdTech</option>';
				catOpts += '<option value="computer-science-education">Computer Science Education</option>';
				catOpts += '<option value="open-problems">Open Problems</option>';
			}
		}

		if (catOpts != "") {
			var catEl = document.getElementsByName('resource-category')[0];
			if (catEl) {
				catEl.innerHTML = catOpts;
			}
		}
	}
}
</script>

<script>
var fillForm = function () {
    var queryString = document.location.search.split("+").join(" ");
    var params = {}, tokens, re = /[?&]?([^=]+)=([^&]*)/g;

    while (tokens = re.exec(queryString)) {
        params[decodeURIComponent(tokens[1])] = decodeURIComponent(tokens[2]);
    }

    if (params.refpage == undefined){
        // no value in the query string
        // here you have to manage this use case : redirect or print a message to user
    }else{
        // filling form fields with query string values
        // document.getElementsByName('url')[0].value = params.refpage;
        // document.getElementsByName('url')[0].placeholder = params.refpage;
        // console.log(params.refpage);
        var url_split = params.refpage.substring(1).split('/');
        if (url_split[0] && url_split[0].length > 0) {
        	var groupEl = document.getElementsByName('resource-group')[0];
        	if (groupEl) {
        		groupEl.value = url_split[0];
        		setCategories();
        		if (url_split[1] && url_split[1].length > 0) {
        			var catEl = document.getElementsByName('resource-category')[0];
					if (catEl) {
        				catEl.value = url_split[1];
					}
        		}
        	}
        }
    }
} ();
</script>
{'fraction_non_alphanumeric': 0.1648203340268796, 'fraction_numerical': 0.002136872293763707, 'mean_word_length': 3.9941027801179443, 'pattern_counts': {'":': 0, '<': 399, '<?xml version=': 0, '>': 397, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1016099', 'n_tokens_mistral': 5567, 'n_tokens_neox': 5123, 'n_words': 1190}