<commit_before><?php

use Illuminate\Database\Seeder;

class QuestionTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        
    }
}<commit_msg>first attempt at QuestionTableSeeder with test output to console only<commit_after><?php

use Illuminate\Database\Seeder;

class QuestionTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        // string is a JSON that contains ALL of the questions we want to add to the database
        
        /** Question object has the following attributes: 
                subject_id
                prompt
                difficulty
                type
                image
                total_score
            
            We also want to associate the Question object with 5 Answer objects
            Answer objects contain: 
                text
                image
        
            Each Question will have 5 answer options total
        
            
        
        */ 
        
        // for consistency, everything is listed in the JSON in the order from diagram
        
        $string = '{
            "questions":[{
                "prompt" : "Which of the following operations are NOT part of the Abstract Data Type Stack? ",
                "difficulty": "easy", 
                "type": "multiple", 
                "total_score" : "1",
                "subject_id": "2",
                "image": "stack picture", 
                
                "answers":[
                {
                    "text": "push()", 
                    "image": "push image", 
                    "is_correct" : "false"
                },
                {
                    "text": "reverse()", 
                    "image": "reverse operation picture", 
                    "is_correct" : "true"
                },
                {
                    "text": "getFirstElement()", 
                    "image": "image of first element", 
                    "is_correct" : "true"
                },
                {
                    "text": "pop()", 
                    "image": "image of popping!!!", 
                    "is_correct" : "false"
                },
                {
                    "text": "rotate", 
                    "image": "image of rotation", 
                    "is_correct" : "true"
                }

                ]
            },
            
            {
                "prompt" : "What is the storage policy for a Stack?",
                "difficulty": "easy", 
                "type": "single", 
                "total_score" : "1",
                "subject_id": "2",
                "image": "stack picture", 
                
                "answers":[
                {
                    "text": "LIFO", 
                    "image": "LIFO image", 
                    "is_correct" : "true"
                },
                {
                    "text": "FIFO", 
                    "image": "FIFO image", 
                    "is_correct" : "false"
                },
                {
                    "text": "NEMO", 
                    "image": "NEMO image", 
                    "is_correct" : "false"
                },
                {
                    "text": "NOMO", 
                    "image": "NOMO image", 
                    "is_correct" : "false"
                },
                {
                    "text": "LIMO", 
                    "image": "Vroooooooom!!!!", 
                    "is_correct" : "false"
                }

                ]
            }
            
            
            
            ]
}';
            
            
            $questions = json_decode($string, true);
            // $questions is a array of questions
            // iterate through array
            // print out all information to test
            // $this->command->info('Course Created!');
            
            foreach($questions['questions'] as $i => $v)
            {
                $this->command->info($v); // prints out all stuff to screen
            }
            
            
            
            
        /*
            $area = json_decode($string, true);

            foreach($area['area'] as $i => $v)
            {
                echo $v['area'].'<br/>';
            }
        */
    }
}
{'fraction_non_alphanumeric': 0.10432224485177642, 'fraction_numerical': 0.0013577732518669382, 'mean_word_length': 0.8478260869565217, 'pattern_counts': {'":': 31, '<': 6, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 1, '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': '6430968', 'n_tokens_mistral': 1121, 'n_tokens_neox': 999, 'n_words': 272}