<commit_before>
//TODO: Add imports
import mcqTmpl from './mcq-view-mcq.html!text';
import mcqlEditTmpl from './mcq-view-mcq-edit.html!text';

const noop = () => undefined;

//TODO: implement logic for creating of mcq questions
export function showTmpl(){
    console.log('template is returned');
    return mcqTmpl;
}


//todo: amos to finish up config
/*export function configRoute($routeProvider, routes) {
    $routeProvider
        .when(routes.newMCQ, {
            template: mcqTmpl,
            controller: viewCtrl,
            controllerAs: 'ctrl',
            resolve: {
                initialData:
            }
        })
}*/

//inject config route
//configRoute.$inject = ['$routeProvider', 'routes'];

//TODO: implement logic for rendering of mcq questions

// this function controls the view behaviours
function viewCtrl ($mdDialog,$location,urlFor){
    this.isSingleAnswer = false;

    //this function double checks with user if he wishes to go back and discard all changes thus far
    this.discardChanges = function (ev,task){
        var confirm = $mdDialog.confirm()
            .title('Would you like to discard your changes?')
            .textContent('All of the information input will be discarded. Are you sure you want to continue?')
            .ariaLabel('Discard changes')
            .targetEvent(ev)
            .ok('Discard All')
            .cancel('Do Not Discard');
        $mdDialog.show(confirm).then(function() {
            // decided to discard data, bring user to previous page

            //todo: link back to previous page
            //$location.path(urlFor('editEvent', {eventId: self.event.$id}));

        }), function() {
            //go back to the current page
            //todo: preserve the data that was keyed into form. (data should not be saved into the db yet)
            //eg. this.task.title = task.title


        };
    }
}

//inject viewctrl
viewCtrl.$inject = [
    '$mdDialog',
    '$location',
    'urlFor'
];<commit_msg>attempts to add option field dynamically<commit_after>
//TODO: Add imports
import mcqTmpl from './mcq-view-mcq.html!text';
import mcqEditTmpl from './mcq-view-mcq-edit.html!text';

const noop = () => undefined;

//this export function return the template when creating a new mcq challenge
export function newMcqTmpl(){
    return mcqTmpl;
}

export function editMcqTmpl(){
    return mcqEditTmpl;
}

//TODO: implement logic for rendering of mcq questions

// this function controls the view behaviours
function viewCtrl ($mdDialog,$location,urlFor, $scope){
    this.isSingleAnswer = false;

    //this function double checks with user if he wishes to go back and discard all changes thus far
    this.discardChanges = function (ev,task){
        var confirm = $mdDialog.confirm()
            .title('Would you like to discard your changes?')
            .textContent('All of the information input will be discarded. Are you sure you want to continue?')
            .ariaLabel('Discard changes')
            .targetEvent(ev)
            .ok('Discard All')
            .cancel('Do Not Discard');
        $mdDialog.show(confirm).then(function() {
            // decided to discard data, bring user to previous page

            //todo: link back to previous page
            //$location.path(urlFor('editEvent', {eventId: self.event.$id}));

        }), function() {
            //go back to the current page
            //todo: preserve the data that was keyed into form. (data should not be saved into the db yet)
            //eg. this.task.title = task.title

        };
    }

}

//inject viewctrl
viewCtrl.$inject = [
    '$mdDialog',
    '$location',
    'urlFor',
    '$scope'
];

function editCtrl (){
  console.log("hello. this is edit ctl");
};

//testing
{'fraction_non_alphanumeric': 0.11418685121107267, 'fraction_numerical': 0.0, 'mean_word_length': 2.454044117647059, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '5101203', 'n_tokens_mistral': 1073, 'n_tokens_neox': 1049, 'n_words': 361}