<commit_before><%@ page import="grails.converters.JSON; dk.sdu.tekvideo.FaIcon; dk.danthrane.twbs.GridSize; dk.danthrane.twbs.ButtonStyle; dk.danthrane.twbs.ButtonSize" %>

<!DOCTYPE html>
<html>
<head>
    <meta name="layout" content="main_fluid"/>
    <title>Hjem</title>

    <g:render template="/polymer/includePolymer" />

    <link rel="import" href="${createLink(absolute:true, uri:'/assets/')}/components/exercise-editor/tve-group-renderer.html">
    <style>
    .polymer {
        font-family: 'Roboto', 'Noto', sans-serif;
        line-height: 1.5;
    }
    </style>
</head>

<body class="polymer">

<tve-group-renderer id="renderer"></tve-group-renderer>
<script>
    var renderer = document.getElementById('renderer');
    var exercisePoolObj = {
        <g:each in="${subExercises}" var="item">
        ${item.id}: ${raw(item.exercise)},
        </g:each>
    };

    %{-- Working around the fact that we don't store the assignments in a (server-side) structured format --}%
    var exercisePool = [];
    for (var key in exercisePoolObj) {
        var obj = exercisePoolObj[key];
        obj.identifier = key;
        exercisePool.push(obj);
    }

    renderer.exercisePool = exercisePool;
    renderer.display(0);

    renderer.addEventListener("grade", function(e) {
        console.log(e.detail);
    });

    renderer.addEventListener("backToMenu", function() {
        document.location = "${sdu.createLinkToSubject(subject: exercise.subject)}";
    });
</script><commit_msg>Adds breadcrumbs to written exercises<commit_after><%@ page import="grails.converters.JSON; dk.sdu.tekvideo.FaIcon; dk.danthrane.twbs.GridSize; dk.danthrane.twbs.ButtonStyle; dk.danthrane.twbs.ButtonSize" %>

<!DOCTYPE html>
<html>
<head>
    <meta name="layout" content="main_fluid"/>
    <title>Hjem</title>

    <g:render template="/polymer/includePolymer" />

    <link rel="import" href="${createLink(absolute:true, uri:'/assets/')}/components/exercise-editor/tve-group-renderer.html">
    <style>
    .polymer {
        font-family: 'Roboto', 'Noto', sans-serif;
        line-height: 1.5;
    }
    </style>
</head>

<body class="polymer">

<twbs:row>
    <twbs:column>
        <ol class="breadcrumb">
            <li><g:link uri="/">Hjem</g:link></li>
            <li>
                <sdu:linkToTeacher teacher="${exercise.subject.course.teacher}">
                    ${exercise.subject.course.teacher}
                </sdu:linkToTeacher>
            </li>
            <li>
                <sdu:linkToCourse course="${exercise.subject.course}">
                    ${exercise.subject.course.fullName} (${exercise.subject.course.name})
                </sdu:linkToCourse>
            </li>
            <li>
                <sdu:linkToSubject subject="${exercise.subject}">
                    ${exercise.subject.name}
                </sdu:linkToSubject>
            </li>
            <li class="active">${exercise.name}</li>
        </ol>
    </twbs:column>
</twbs:row>


<tve-group-renderer id="renderer"></tve-group-renderer>
<script>
    var renderer = document.getElementById('renderer');
    var exercisePoolObj = {
        <g:each in="${subExercises}" var="item">
        ${item.id}: ${raw(item.exercise)},
        </g:each>
    };

    %{-- Working around the fact that we don't store the assignments in a (server-side) structured format --}%
    var exercisePool = [];
    for (var key in exercisePoolObj) {
        var obj = exercisePoolObj[key];
        obj.identifier = key;
        exercisePool.push(obj);
    }

    renderer.exercisePool = exercisePool;
    renderer.display(0);

    renderer.addEventListener("grade", function(e) {
        console.log(e.detail);
    });

    renderer.addEventListener("backToMenu", function() {
        document.location = "${sdu.createLinkToSubject(subject: exercise.subject)}";
    });
</script>
{'fraction_non_alphanumeric': 0.16489223578291354, 'fraction_numerical': 0.0015580368735393405, 'mean_word_length': 2.747081712062257, 'pattern_counts': {'":': 0, '<': 65, '<?xml version=': 0, '>': 65, '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': '7236981', 'n_tokens_mistral': 1272, 'n_tokens_neox': 1216, 'n_words': 207}