![]() System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, Directory : /var/www/html/libs/absol-poser/demo/ |
Upload File : |
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Evaluation</title> <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.2.0/styles/default.min.css"> <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.2.0/highlight.min.js"></script> <script> document.write('<scri' + 'pt src="../dist/absol_poser.js?time=' + new Date().getTime() + '"></sc' + 'ript>'); </script> </head> <body> <script> if (location.href.indexOf('readOnly')>=0){ absol._('<a href="./evaluation.html">Mở với readOnly=false</a>').addTo(document.body); } else { absol._('<a href="./evaluation.html?readOnly">Mở với readOnly=true</a>').addTo(document.body); } </script> <div id="demo-ctn"> </div> <script> var demo_data_sync = fetch('../demo/demo_data.js').then(function (res) { return res.text() }).then(function (dataText) { return (new Function('module', dataText + '\n ;return module.exports;'))({ exports: {} }) }); var result_sync = null; try { result_sync = JSON.parse(localStorage.getItem('ap_result_viewer_shuffled')); if (result_sync) result_sync = Promise.resolve(result_sync); } catch (err) { result_sync = null; } if (!result_sync) { result_sync = fetch('../demo/demo_result.js').then(function (res) { return res.text() }).then(function (dataText) { return {result:(new Function('module', dataText + '\n ;return module.exports;'))({ exports: {} }) }; }); } var evaluation_sync = null; try { evaluation_sync = JSON.parse(localStorage.getItem('ap_evaluate_aug_15')); if (evaluation_sync) evaluation_sync = Promise.resolve(evaluation_sync); } catch (err) { evaluation_sync = null; } if (!evaluation_sync) { evaluation_sync = fetch('../demo/demo_evaluation.js').then(function (res) { return res.text() }).then(function (dataText) { return (new Function('module', dataText + '\n ;return module.exports;'))({ exports: {} }); }); } </script> <script class="viewable"> (function () { var PoserEvaluation = absol.poser.PoserEvaluation; var $ = absol.$; var _ = absol._; var SnackBar = absol.require('snackbar'); var ctn = $('#demo-ctn'); var headerElt = _({ style: { padding: '5px', }, child: [ { tag: 'flexiconbutton', style: { height: '30px', marginRight: '10px' }, props: { text: 'data(sections, result)', icon: 'span.mdi.mdi-download' }, on: { click: function () { var jsCode = 'module.exports = ' + absol.generateJSVariable(mEvaluation.getData()); absol.FileSaver.saveTextAs(jsCode, 'demo_evaluation_data.js'); } } }, { tag: 'flexiconbutton', style: { height: '30px' }, props: { text: 'evaluations', icon: 'span.mdi.mdi-download' }, on: { click: function () { var jsCode = 'module.exports = ' + absol.generateJSVariable(mEvaluation.getEvaluation()); absol.FileSaver.saveTextAs(jsCode, 'demo_evaluation.js'); } } } ] }); var opt = { hasScroller: false }; if (location.href.indexOf('readOnly') >= 0) { opt.readOnly = true; } var mEvaluation = new PoserEvaluation(opt); var eView = mEvaluation.getView(); ctn.addChild([headerElt, eView]); Promise.all([demo_data_sync, result_sync, evaluation_sync]).then(function (arr) { var sections = arr[0];//sections chính là data lấy từ editor var result = arr[1]; var evaluationData = arr[2]; mEvaluation.setData({ sections: sections, result: result.result, order: result.order } ); mEvaluation.setEvaluation(evaluationData); // console.log(mEvaluation.getEvaluation()) }); mEvaluation.on('evaluationchange', function () { localStorage.setItem('ap_evaluate_aug_15', JSON.stringify(this.getEvaluation())); SnackBar.show('saved'); }); })(); </script> <script src="https://absol.cf/absol/demo/autohightlighting.js?"></script> </body> </html>