'use strict';var strings={};strings={months:['January','February','March','April','May','June','July','August','September','October','November','December']};function createDOMResult(e){function i(Z){for(var $=Z.getHours(),_=12<=$?'pm':'am',aa=Z.getMinutes().toString(),ba=strings.months[Z.getMonth()],ca=Z.getDate(),da=Z.getFullYear();2>aa.length;)aa='0'+aa;return 12<$&&($-=12),{date:[ba,' ',ca,', ',da].join(''),time:[$,':',aa,' ',_].join('')}}function n(Z,$,_){for(var aa,ba,ca=document.createElement('tr'),da=document.createElement('td'),ea=document.createElement('th'),fa=0;fa<Z.length;fa++)$?(aa=document.createElement('th'),aa.setAttribute('style','text-align: center; word-break: break-word; border: 1px solid #ddd; padding: 8px;')):(aa=document.createElement('td'),'InCorrect'==Z[fa]&&4==fa?aa.setAttribute('style','text-align: center; word-break: break-word; border: 1px solid #ddd; padding: 8px; color: red;'):'Correct'==Z[fa]&&4==fa?aa.setAttribute('style','text-align: center; word-break: break-word; border: 1px solid #ddd; padding: 8px; color: green;'):'Neutral'==Z[fa]&&4==fa?aa.setAttribute('style','text-align: center; word-break: break-word; border: 1px solid #ddd; padding: 8px; color: blue;'):aa.setAttribute('style','text-align: center; word-break: break-word; border: 1px solid #ddd; padding: 8px;')),_&&aa.setAttribute('width',_[fa]),ba=document.createTextNode(Z[fa]),aa.appendChild(ba),ca.appendChild(aa);return ca}var p=e,I=document.getElementById('contentResult');if(!I.getAttribute('data-index')){I.setAttribute('data-index','1');var J=i(new Date(p.Result.Date)),K=J.date+' '+J.time,L=document.getElementById('contentResult'),M=document.getElementById('contentResult'),N=document.createElement('table'),O=document.createElement('tbody'),P=n(['Date / Time','Student Score','Passing Score','Result'],!0),Q=document.createElement('td');O.appendChild(P);var R=[K,p.Result.StudentScore,p.Result.PassingScore,p.Result.Result],S=n(R,!1);O.appendChild(S),N.appendChild(O),N.setAttribute('style','width: 60%; margin-left: 20%; text-align: center; vertical-align: middle; border-collapse: collapse; border: 1px outset grey;'),L.appendChild(N);var T=document.createElement('p');T.innerHTML='&nbsp',L.appendChild(T);var U=document.createElement('table'),V=n(['#','Question','Correct Answer','Student Answer','Result','Points Awarded'],!0,['25px','23%','23%','23%','15%','12%']);U.appendChild(V),U.setAttribute('id','result-answers'),U.setAttribute('style','border-collapse: collapse; border: 1px outset grey;');for(var W=0;W<p.ResultDetail.length;W++){var X=p.ResultDetail[W],Y=n(Object.keys(X).map(function(Z){return X[Z]}));U.appendChild(Y)}L.appendChild(U)}}window.opener.postMessage('getQuizz','*'),window.addEventListener('message',function(e){createDOMResult(JSON.parse(e.data))},!1);