Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <!--[if lte IE 9 ]><html class="ie lt-ie9" lang="it-IT"> <![endif]-->
- <!--[if (gte IE 9)|!(IE)]><!--><html lang="it-IT"> <!--<![endif]-->
- <head>
- <meta charset="UTF-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
- <link rel="profile" href="http://gmpg.org/xfn/11" />
- <link rel="pingback" href="http://eni-learning.com/xmlrpc.php" />
- <link rel="shortcut icon" href="http://eni-learning.com/wp-content/uploads/2016/02/favicon.png " />
- <!-- Retina/iOS favicon -->
- <link rel="apple-touch-icon-precomposed" href="http://eni-learning.com/wp-content/uploads/2016/02/favicon-retina.png " />
- <title>Player – ENI-learning</title>
- <link rel="alternate" type="application/rss+xml" title="ENI-learning » Feed" href="http://eni-learning.com/feed/" />
- <link rel="alternate" type="application/rss+xml" title="ENI-learning » Feed dei commenti" href="http://eni-learning.com/comments/feed/" />
- <script type="text/javascript">
- window._wpemojiSettings = {"baseUrl":"https:\/\/s.w.org\/images\/core\/emoji\/72x72\/","ext":".png","source":{"concatemoji":"http:\/\/eni-learning.com\/wp-includes\/js\/wp-emoji-release.min.js?ver=4.4.2"}};
- !function(a,b,c){function d(a){var c,d=b.createElement("canvas"),e=d.getContext&&d.getContext("2d"),f=String.fromCharCode;return e&&e.fillText?(e.textBaseline="top",e.font="600 32px Arial","flag"===a?(e.fillText(f(55356,56806,55356,56826),0,0),d.toDataURL().length>3e3):"diversity"===a?(e.fillText(f(55356,57221),0,0),c=e.getImageData(16,16,1,1).data.toString(),e.fillText(f(55356,57221,55356,57343),0,0),c!==e.getImageData(16,16,1,1).data.toString()):("simple"===a?e.fillText(f(55357,56835),0,0):e.fillText(f(55356,57135),0,0),0!==e.getImageData(16,16,1,1).data[0])):!1}function e(a){var c=b.createElement("script");c.src=a,c.type="text/javascript",b.getElementsByTagName("head")[0].appendChild(c)}var f,g;c.supports={simple:d("simple"),flag:d("flag"),unicode8:d("unicode8"),diversity:d("diversity")},c.DOMReady=!1,c.readyCallback=function(){c.DOMReady=!0},c.supports.simple&&c.supports.flag&&c.supports.unicode8&&c.supports.diversity||(g=function(){c.readyCallback()},b.addEventListener?(b.addEventListener("DOMContentLoaded",g,!1),a.addEventListener("load",g,!1)):(a.attachEvent("onload",g),b.attachEvent("onreadystatechange",function(){"complete"===b.readyState&&c.readyCallback()})),f=c.source||{},f.concatemoji?e(f.concatemoji):f.wpemoji&&f.twemoji&&(e(f.twemoji),e(f.wpemoji)))}(window,document,window._wpemojiSettings);
- </script>
- <style type="text/css">
- img.wp-smiley,
- img.emoji {
- display: inline !important;
- border: none !important;
- box-shadow: none !important;
- height: 1em !important;
- width: 1em !important;
- margin: 0 .07em !important;
- vertical-align: -0.1em !important;
- background: none !important;
- padding: 0 !important;
- }
- </style>
- <link rel='stylesheet' id='cookielawinfo-style-css' href='http://eni-learning.com/wp-content/plugins/cookie-law-info/css/cli-style.css?ver=1.5.3' type='text/css' media='all' />
- <link rel='stylesheet' id='flatsome-icons-css' href='http://eni-learning.com/wp-content/themes/flatsome/css/fonts.css?ver=2.8.5' type='text/css' media='all' />
- <link rel='stylesheet' id='flatsome-animations-css' href='http://eni-learning.com/wp-content/themes/flatsome/css/animations.css?ver=2.8.5' type='text/css' media='all' />
- <link rel='stylesheet' id='flatsome-main-css-css' href='http://eni-learning.com/wp-content/themes/flatsome/css/foundation.css?ver=2.8.5' type='text/css' media='all' />
- <link rel='stylesheet' id='flatsome-style-css' href='http://eni-learning.com/wp-content/themes/Eni-learning/style.css?ver=2.8.5' type='text/css' media='all' />
- <link rel='stylesheet' id='flatsome-googlefonts-css' href='//fonts.googleapis.com/css?family=Dancing+Script%3A300%2C400%2C700%2C900%7CRaleway%3A300%2C400%2C700%2C900%7COpen+Sans%3A300%2C400%2C700%2C900%7CRaleway%3A300%2C400%2C700%2C900&subset=latin&ver=4.4.2' type='text/css' media='all' />
- <script type='text/javascript' src='http://eni-learning.com/wp-includes/js/jquery/jquery.js?ver=1.11.3'></script>
- <script type='text/javascript' src='http://eni-learning.com/wp-includes/js/jquery/jquery-migrate.min.js?ver=1.2.1'></script>
- <script type='text/javascript' src='http://eni-learning.com/wp-content/plugins/cookie-law-info/js/cookielawinfo.js?ver=1.5.3'></script>
- <link rel='https://api.w.org/' href='http://eni-learning.com/wp-json/' />
- <link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://eni-learning.com/xmlrpc.php?rsd" />
- <link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://eni-learning.com/wp-includes/wlwmanifest.xml" />
- <meta name="generator" content="WordPress 4.4.2" />
- <meta name="generator" content="WooCommerce 2.6.13" />
- <link rel="canonical" href="http://eni-learning.com/player/" />
- <link rel='shortlink' href='http://eni-learning.com/?p=905' />
- <link rel="alternate" type="application/json+oembed" href="http://eni-learning.com/wp-json/oembed/1.0/embed?url=http%3A%2F%2Feni-learning.com%2Fplayer%2F" />
- <link rel="alternate" type="text/xml+oembed" href="http://eni-learning.com/wp-json/oembed/1.0/embed?url=http%3A%2F%2Feni-learning.com%2Fplayer%2F&format=xml" />
- <!--[if lt IE 9]><link rel="stylesheet" type="text/css" href="http://eni-learning.com/wp-content/themes/flatsome/css/ie8.css"><script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script><script>var head = document.getElementsByTagName('head')[0],style = document.createElement('style');style.type = 'text/css';style.styleSheet.cssText = ':before,:after{content:none !important';head.appendChild(style);setTimeout(function(){head.removeChild(style);}, 0);</script><![endif]--> <style type="text/css">.recentcomments a{display:inline !important;padding:0 !important;margin:0 !important;}</style>
- <!-- Custom CSS Codes --><style type="text/css"> .top-bar-nav a.nav-top-link,body,p,#top-bar,.cart-inner .nav-dropdown,.nav-dropdown{font-family:Open Sans,helvetica,arial,sans-serif}.header-nav a.nav-top-link, a.cart-link, .mobile-sidebar a{font-family:Raleway,helvetica,arial,sans-serif}h1,h2,h3,h4,h5,h6{font-family:Raleway,helvetica,arial,sans-serif}.alt-font{font-family:Dancing Script,Georgia,serif!important;} #masthead{ height:109px;}#logo a img{ max-height:79px} .logo-center #masthead #logo{width:19.444444444444%}.logo-center #masthead .left-links, .logo-center #masthead .right-links{width:40.277777777778%}#masthead #logo a{max-width:210px} #masthead.stuck.move_down{height:70px;}.wide-nav.move_down{top:70px;}#masthead.stuck.move_down #logo a img{ max-height:60px } ul.header-nav li a {font-size:80%} #masthead{background-color:#fff; ;} .slider-nav-reveal .flickity-prev-next-button, #main-content{background-color:#FFF!important} .wide-nav {background-color:#ffffff} #top-bar{background-color:#ffffff }.header-nav li.mini-cart.active .cart-icon strong{background-color:#ffd100 } .ux-timer-text.primary span .alt-button.primary,.callout.style3 .inner .inner-text,.add-to-cart-grid .cart-icon strong,.tagcloud a,.navigation-paging a, .navigation-image a ,ul.page-numbers a, ul.page-numbers li > span,#masthead .mobile-menu a,.alt-button, #logo a, li.mini-cart .cart-icon strong,.widget_product_tag_cloud a, .widget_tag_cloud a,.post-date,#masthead .mobile-menu a.mobile-menu a,.checkout-group h3,.order-review h3 {color:#ffd100;}button[disabled], .button[disabled],button[disabled]:hover, .button[disabled]:hover, .ux-timer.primary span, .slider-nav-circle .flickity-prev-next-button:hover svg, .slider-nav-circle .flickity-prev-next-button:hover .arrow, .ux-box.ux-text-badge:hover .ux-box-text, .ux-box.ux-text-overlay .ux-box-image,.ux-header-element a:hover,.featured-table.ux_price_table .title,.scroll-to-bullets a strong,.scroll-to-bullets a.active,.scroll-to-bullets a:hover,.tabbed-content.pos_pills ul.tabs li.active a,.ux_hotspot,ul.page-numbers li > span,.label-new.menu-item a:after,.add-to-cart-grid .cart-icon strong:hover,.text-box-primary, .navigation-paging a:hover, .navigation-image a:hover ,.next-prev-nav .prod-dropdown > a:hover,ul.page-numbers a:hover,.widget_product_tag_cloud a:hover,.widget_tag_cloud a:hover,.custom-cart-count,.iosSlider .sliderNav a:hover span, li.mini-cart.active .cart-icon strong,.product-image .quick-view, .product-image .product-bg, #submit, button, #submit, button, .button, input[type="submit"],li.mini-cart.active .cart-icon strong,.post-item:hover .post-date,.blog_shortcode_item:hover .post-date,.column-slider .sliderNav a:hover,.ux_banner {background-color:#ffd100}button[disabled], .button[disabled],.slider-nav-circle .flickity-prev-next-button:hover svg, .slider-nav-circle .flickity-prev-next-button:hover .arrow, .ux-header-element a:hover,.featured-table.ux_price_table,.text-bordered-primary,.callout.style3 .inner,ul.page-numbers li > span,.add-to-cart-grid .cart-icon strong, .add-to-cart-grid .cart-icon-handle,.add-to-cart-grid.loading .cart-icon strong,.navigation-paging a, .navigation-image a ,ul.page-numbers a ,ul.page-numbers a:hover,.post.sticky,.widget_product_tag_cloud a, .widget_tag_cloud a,.next-prev-nav .prod-dropdown > a:hover,.iosSlider .sliderNav a:hover span,.column-slider .sliderNav a:hover,.woocommerce .order-review, .woocommerce-checkout form.login,.button, button, li.mini-cart .cart-icon strong,li.mini-cart .cart-icon .cart-icon-handle,.post-date{border-color:#ffd100;}.ux-loading{border-left-color:#ffd100;}.primary.alt-button:hover,.button.alt-button:hover{background-color:#ffd100!important}.flickity-prev-next-button:hover svg, .flickity-prev-next-button:hover .arrow, .featured-box:hover svg, .featured-img svg:hover{fill:#ffd100!important;}.slider-nav-circle .flickity-prev-next-button:hover svg, .slider-nav-circle .flickity-prev-next-button:hover .arrow, .featured-box:hover .featured-img-circle svg{fill:#FFF!important;}.featured-box:hover .featured-img-circle{background-color:#ffd100!important; border-color:#ffd100!important;} .star-rating:before, .woocommerce-page .star-rating:before, .star-rating span:before{color:#d26e4b}.secondary.alt-button,li.menu-sale a{color:#d26e4b!important}.secondary-bg.button.alt-button.success:hover,.label-sale.menu-item a:after,.mini-cart:hover .custom-cart-count,.callout .inner,.button.secondary,.button.checkout,#submit.secondary, button.secondary, .button.secondary, input[type="submit"].secondary{background-color:#d26e4b}.button.secondary,.button.secondary{border-color:#d26e4b;}.secondary.alt-button:hover{color:#FFF!important;background-color:#d26e4b!important}ul.page-numbers li > span{color:#FFF;} .callout.style3 .inner.success-bg .inner-text,.woocommerce-message{color:#7a9c59!important}.success-bg,.woocommerce-message:before,.woocommerce-message:after{color:#FFF!important; background-color:#7a9c59}.label-popular.menu-item a:after,.add-to-cart-grid.loading .cart-icon strong,.add-to-cart-grid.added .cart-icon strong{background-color:#7a9c59;border-color:#7a9c59;}.add-to-cart-grid.loading .cart-icon .cart-icon-handle,.add-to-cart-grid.added .cart-icon .cart-icon-handle{border-color:#7a9c59}.label-new.menu-item > a:after{content:"New";}.label-hot.menu-item > a:after{content:"Hot";}.label-sale.menu-item > a:after{content:"Sale";}.label-popular.menu-item > a:after{content:"Popular";}.featured_item_image{max-height:250px}.callout .inner.callout-new-bg{background-color:#7a9c59!important;}.callout.style3 .inner.callout-new-bg{background-color:none!important;border-color:#7a9c59!important} div {}</style></head>
- <body class="page page-id-905 page-template page-template-page-blank-container page-template-page-blank-container-php antialiased logo-center breadcrumb-normal full-width">
- <div id="wrapper">
- <div class="header-wrapper before-sticky">
- <div id="top-bar">
- <div class="row">
- <div class="large-12 columns">
- <!-- left text -->
- <div class="left-text left">
- <div class="html"></div><!-- .html -->
- </div>
- <!-- top bar right -->
- <div class="right-text right">
- <ul id="menu-top-bar-menu" class="top-bar-nav">
- </ul>
- </div><!-- top bar right -->
- </div><!-- .large-12 columns -->
- </div><!-- .row -->
- </div><!-- .#top-bar -->
- <header id="masthead" class="site-header" role="banner">
- <div class="row">
- <div class="large-12 columns header-container">
- <div class="mobile-menu show-for-small">
- <a href="#jPanelMenu" class="off-canvas-overlay" data-pos="left" data-color="light"><span class="icon-menu"></span></a>
- </div><!-- end mobile menu -->
- <div class="left-links">
- <div class="wide-nav-search hide-for-small">
- <div>
- </div>
- </div>
- </div><!-- .left-links -->
- <div id="logo" class="logo-center">
- <a href="http://eni-learning.com/" title="ENI-learning - Alternanza scuola/lavoro" rel="home">
- <img src="http://eni-learning.com/wp-content/uploads/2016/02/logo-enilearning.png" class="header_logo " alt="ENI-learning"/> </a>
- </div><!-- .logo -->
- <div class="right-links">
- <ul class="header-nav">
- <!-- Show mini cart if Woocommerce is activated -->
- </ul><!-- .header-nav -->
- </div><!-- .right-links -->
- </div><!-- .large-12 -->
- </div><!-- .row -->
- </header><!-- .header -->
- <!-- Main navigation - Full width style -->
- <div class="wide-nav light nav-center">
- <div class="row">
- <div class="large-12 columns">
- <div class="nav-wrapper">
- <ul id="site-navigation" class="header-nav">
- <li id="menu-item-714" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-714"><a href="http://eni-learning.com/progetto/" class="nav-top-link">Progetto</a></li>
- <li id="menu-item-733" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-733"><a href="http://eni-learning.com/contenuti/" class="nav-top-link">Contenuti</a></li>
- <li id="menu-item-737" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-737"><a href="http://eni-learning.com/corso/" class="nav-top-link">Corso</a></li>
- <li id="menu-item-959" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-959"><a href="http://eni-learning.com/faq/" class="nav-top-link">Faq</a></li>
- <li id="menu-item-715" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-715"><a href="http://eni-learning.com/contatti/" class="nav-top-link">Contatti</a></li>
- </ul>
- </div><!-- .nav-wrapper -->
- </div><!-- .large-12 -->
- </div><!-- .row -->
- </div><!-- .wide-nav -->
- </div><!-- .header-wrapper -->
- <div id="main-content" class="site-main hfeed light">
- <!-- woocommerce message -->
- <div class="page-header">
- <div style="height:200px;">
- <div style="z-index:999;position:absolute;top:160;left:50%;margin-left:-150px;text-align:center;font-size:36px;color:#fff;line-height:200px;width:300px;font-weight:bold;">Il corso</div>
- <p><img src="http://eni-learning.com//wp-content/uploads/2016/03/corso.jpg" style="height:200px;width:100%">
- </div>
- </div>
- <div class="page-wrapper">
- <div class="row">
- <div id="content" class="large-12 columns" role="main">
- <!DOCTYPE html>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
- <title>SimpleAPI for SCORM 1.2</title>
- <link href='http://fonts.googleapis.com/css?family=Leckerli+One' rel='stylesheet' type='text/css'>
- <script type="text/javascript">
- (function(){
- this._VERSION = "2.2.20130225";
- /*
- pdf SCHEMA A PAG 67
- //API Firma
- LMSInitialize( "" ) : bool – Inizia una sessione di comunicazione con l'LMS.
- LMSFinish( "" ) : bool – Termina una sessione di comunicazione con l'LMS.
- LMSGetValue( elemento : CMIElement ) : stringa – Recupera un valore dalla LMS.
- LMSSetValue( elemento : CMIElement, valore : stringa) : stringa – Salva un valore al LMS.
- LMSCommit( "" ) : bool – Indica al sistema LMS che tutti i dati dovrebbero essere mantenuti (non richiesta).
- LMSGetLastError() : CMIErrorCode – Restituisce il codice di errore che ha portato dalla chiamata API ultima.
- LMSGetErrorString( errorCode : CMIErrorCode ) : stringa – Restituisce una breve stringa che descrive il codice di errore specificato.
- LMSGetDiagnostic( errorCode : CMIErrorCode ) : stringa – Restituisce informazioni dettagliate su l'ultimo errore che si è verificato.
- //Data Model
- cmi.core._children (student_id, student_name, lesson_location, credito, lesson_status, ingresso, punteggio, TOTAL_TIME, lesson_mode, uscita, sessione_idcss, RO) Elenco di elementi di dati supportati modello
- cmi.core.student_id (CMIString (SPM: 255), RO) Identifica lo studente per conto dei quali la SCO è stato lanciato
- cmi.core.student_name (CMIString (SPM: 255), RO) Denominazione prevista per lo studente dalla LMS
- cmi.core.lesson_location (CMIString (SPM: 255), RW) Posizione corrente dello studente nella SCO
- cmi.core.credit ("credito", "no-credito", RO) Indica se lo studente sarà accreditato per le prestazioni nel SCO
- cmi.core.lesson_status ("passato", "completato", "mancato", "incompleto", "naviga", "non tentò", RW) Indica se lo studente ha completato e soddisfatti i requisiti per la SCO
- cmi.core.entry ("ab-initio", "riprendere", "", RO) Asserisce se lo studente ha già accesso al SCO
- cmi.core.score_children (crudo,il mio,max, RO) Elenco di elementi di dati supportati modello
- cmi.core.score.raw (CMIDecimal, RW) Numero che riflette la performance del discente rispetto alla gamma delimitata dai valori minimi e massimi
- cmi.core.score.max (CMIDecimal, RW) Valore massimo nel range per il punteggio grezzo
- cmi.core.score.min (CMIDecimal, RW) Valore minimo della gamma per il punteggio grezzo
- cmi.core.total_time (CMITimespan, RO) Somma di tutti i tempi della sessione lo studente ha accumulato nel tentativo studente corrente
- cmi.core.lesson_mode ("sfogliare", "normale", "recensione", RO) Identifica uno dei tre possibili modi in cui la SCO possono essere presentate al discente
- cmi.core.exit ("time-out", "sospendere", "Logout", "", DOVE) Indica come o perché lo studente ha lasciato il SCO
- cmi.core.session_time (CMITimespan, DOVE) Quantità di tempo che lo studente ha trascorso nella sessione corrente discente per questo SCO
- cmi.suspend_data (CMIString (SPM: 4096), RW) Offre spazio per archiviare e recuperare i dati tra le sessioni studente
- cmi.launch_data (CMIString (SPM: 4096), RO) Dati forniti da uno SCO dopo il lancio, inizializzato dall'elemento manifestano dataFromLMS
- cmi.comments (CMIString (SPM: 4096), RW) Di input testuale da parte dello studente circa la SCO
- cmi.comments_from_lms (CMIString (SPM: 4096), RO) Commenti o annotazioni associate con un SCO
- cmi.objectives._children (id,punteggio,stato, RO) Elenco di elementi di dati supportati modello
- cmi.objectives._count (intero non negativo, RO) Numero attuale di obiettivi essere memorizzati dal LMS
- cmi.objectives.n.id (CMIIdentifier, RW) Un'etichetta univoca per l'obiettivo
- cmi.objectives.n.score._children (crudo,il mio,max, RO) Elenco di elementi di dati supportati modello
- cmi.objectives.n.score.raw (CMIDecimal, RW) Numero che riflette la performance del discente, per l'obiettivo, rispetto alla gamma delimitata dai valori minimi e massimi
- cmi.objectives.n.score.max (CMIDecimal, Rw) Valore massimo, per l'obiettivo, nel range per il punteggio grezzo
- cmi.objectives.n.score.min (CMIDecimal, RW) Valore minimo, per l'obiettivo, nel range per il punteggio grezzo
- cmi.objectives.n.status ("passato", "completato", "mancato", "incompleto", "naviga", "non tentò", RW) Indica se lo studente ha completato o soddisfatto l'obiettivo
- cmi.student_data._children (mastery_score, max_time_allowed, time_limit_action, RO) Elenco di elementi di dati supportati modello
- cmi.student_data.mastery_score (CMIDecimal, RO) Punteggio di passaggio necessario per padroneggiare la SCO
- cmi.student_data.max_time_allowed (CMITimespan, RO) Quantità di tempo accumulato lo studente è autorizzato ad utilizzare uno SCO
- cmi.student_data.time_limit_action (uscita,messaggio," "uscita,nessun messaggio"," continuare,messaggio", "continuare, nessun messaggio", RO) Indica che la SCO dovrebbe fare quando si supera max_time_allowed
- cmi.student_preference._children (audio,lingua,velocità,testo, RO) Elenco di elementi di dati supportati modello
- cmi.student_preference.audio (CMISInteger, RW) Specifica un cambiamento che si intende a livello audio percepita
- cmi.student_preference.language (CMIString (SPM: 255), RW) Lingua preferita dello studente per SCO con funzionalità multilingue
- cmi.student_preference.speed (CMISInteger, RW) Velocità preferita del discente relativa di content delivery
- cmi.student_preference.text (CMISInteger, RW) Specifica se il testo delle didascalie corrispondente audio viene visualizzato
- cmi.interactions._children (id,obiettivi,tempo,tipo,correct_responses,ponderazione,student_response,risultato,latenza, RO) Elenco di elementi di dati supportati modello
- cmi.interactions._count (CMIInteger, RO) Attuale numero di interazioni essere memorizzati dal LMS
- cmi.interactions.n.id (CMIIdentifier, DOVE) Un'etichetta univoca per l'interazione
- cmi.interactions.n.objectives._count (CMIInteger, RO) Numero attuale di obiettivi (i.e., identificatori obiettivo) essere memorizzati dal sistema LMS per questa interazione
- cmi.interactions.n.objectives.n.id (CMIIdentifier, DOVE) Etichetta per obiettivi associati con l'interazione
- cmi.interactions.n.time (CMITime, DOVE) Momento in cui l'interazione è stato messo a disposizione dello studente per l'interazione degli studenti e risposta
- cmi.interactions.n.type ("vero-falso", "scelta", "fill-in", "corrispondenza", "performance", "sequenziamento", "Likert", "numerico", DOVE) Quale tipo di interazione è registrato
- cmi.interactions.n.correct_responses._count (CMIInteger, RO) Attuale numero di risposte corrette essere memorizzati dal sistema LMS per questa interazione
- cmi.interactions.n.correct_responses.n.pattern (formato dipende dal tipo di interazione, DOVE) Un modello di risposta corretta per l'interazione
- cmi.interactions.n.weighting (CMIDecimal, DOVE) Peso dato alla interazione rispetto a altre interazioni
- cmi.interactions.n.student_response (formato dipende dal tipo di interazione, DOVE) I dati generati quando uno studente risponde a una interazione
- cmi.interactions.n.result ("corretto", "sbagliato", "impreviste", "neutrale", "xx [CMIDecimal]", DOVE) Sentenza della correttezza della risposta discente
- cmi.interactions.n.latency (CMITimespan, DOVE) Tempo intercorso tra il momento è stata fatta l'interazione a disposizione del discente per la risposta e il tempo della prima risposta
- //Codici di errore
- Nessun errore (0) Nessun errore, la precedente chiamata API ha avuto successo.
- Eccezione generale (101) Nessun codice di errore specifico esiste per descrivere l'errore. Usa LMSGetDiagnostic per maggiori informazioni.
- Argomento non valido errore (201) Indica che un argomento rappresenta un valido modello di dati o elementi altrimenti non corretta.
- Elemento non può avere figli (202) Indica che LMSGetValue è stato chiamato con un nome di elemento del modello dati che finiscono in "_children" per un elemento del modello di dati che non supporta il "_children" suffisso.
- Elemento non è un array. Non può avere contano. (203) Indica che LMSGetValue è stato chiamato con un nome di elemento del modello dati che finiscono in "_count" per un elemento del modello di dati che non supporta il "_count" suffisso.
- Non inizializzata (301) Indica che una chiamata API è stata fatta prima della chiamata a LMSInitialize.
- Non implementato errore (401) L'elemento di modello di dati indicati in una chiamata a LMSGetValue o LMSSetValue è valido, ma non è stata attuata da questo LMS. SCORM 1.2 definisce un insieme di elementi del modello dati è facoltativo per un LMS per implementare.
- Impostare un valore non valido, elemento è una parola chiave (402) Indica che LMSSetValue è stato chiamato su un elemento del modello di dati che rappresenta una parola chiave (elementi che terminano con "_children" e "_count").
- Elemento è di sola lettura. (403) LMSSetValue è stato chiamato con un elemento di modello di dati che possono essere letti solo.
- Elemento è scrivere solo (404) LMSGetValue è stato chiamato su un elemento del modello dati che possono essere scritti solo per.
- Tipo di dati non corretti (405) LMSSetValue è stato chiamato con un valore che non è compatibile con il formato di dati dell'elemento dati forniti modello.
- */
- /*
- * SimpleAPI for SCORM 1.2
- * --------------------------------------------------
- * Option Defaults
- * --------------------------------------------------
- */
- // Should we skip the automatic manifest check?
- this.skipManifestCheck = false;
- // The SCO's *default* launch file
- this.launchFile = 'default.htm';
- // The *default* name of the cookie to be used within this session
- this.cookieName = 'SimpleAPI_Data_'+_VERSION;
- // Should the *default* cookie name use the name of the parent folder instead?
- this.useParentFolderAsCookieName = true;
- // Shall we close SCO on LMSFinish?
- this.closeOnFinish = true;
- // The width of the SCO window when launched
- this.wWidth = 1024;
- // The height of the SCO window when launched
- this.wHeight = 768;
- // SCO window default features
- this.wToolbar = false;
- this.wTitlebar = false;
- this.wLocation = true;
- this.wStatus = true;
- this.wScrollbars = true;
- this.wResizable = true;
- this.wMenubar = false;
- // Default value for the search string option
- this.defaultSearchString = '?embedded=true';
- // Default values for the custom API key/value pair injection option
- this.defaultCustomApiKey = 'SomeCustomKey';
- this.defaultCustomApiValue = 'SomeCustomValue';
- // Default state of the SCORM API if one cannot be pulled from the
- // data cookie. Change values below if you wish to test a SCO
- // being launched in a specific state. Ensure you reset it back
- // to the defaults already present below when finished testing
- // to avoid the appearance of unexpected behaviors within the SCO
- // in subsequent tests...
- this.initialState = {
- 'cmi.core._children':'student_id,student_name,lesson_status,lesson_location,lesson_mode,score,credit,entry,exit,session_time,total_time',
- 'cmi.core.score._children':'raw',
- 'cmi.core.student_id':'29448',
- 'cmi.core.student_name':'1811-05',
- 'cmi.core.lesson_status':'incomplete',
- 'cmi.core.score.raw':'0',
- 'cmi.core.lesson_location':'0',
- 'cmi.suspend_data':'',
- 'cmi.core.session_time':'00:00:00',
- 'cmi.core.total_time':'0000:00:00',
- 'cmi.core.credit':'credit', /* "credit" or "no-credit" */
- 'cmi.core.entry':'ab-initio', /* "resume" or "ab-initio" */
- 'cmi.core.lesson_mode':'normal', /* "browse", "normal" or "review" */
- 'cmi.core.exit':'' /* "time-out", "suspend" or "logout" */
- };
- /*
- * Do not touch anything below
- * --------------------------------------------------
- */
- this.scoWin;
- this.API;
- this.hasTerminated = false;
- this.hasInitialized = false;
- this.optionsOpen = true;
- this.initTimeoutMax = 20000;
- this.initTimeout = 0;
- this.fullPath = document.location.href.substr(0,document.location.href.lastIndexOf('/'))
- this.parentFolder = fullPath.substr(fullPath.lastIndexOf('/')+1,fullPath.length);
- this.timeoutErrorDisplayed = false;
- this.launchWithEmbeddedParam = false;
- this.launchWithCustomApiProperty = false;
- this.storageObject;
- this.SimpleAPI = function(cookiename,api,initData)
- {
- this.api = api;
- this.initData = initData;
- this.__data = null;
- this.cookiename = cookiename;
- this.initialized = false;
- this.terminated = false;
- this.lastError = "0";
- this.lastCmd = '';
- this.logCommand=function()
- {
- Utils.log(this.lastCmd,'entry');
- var lasterr = this.api.LMSGetLastError();
- if (lasterr != '0')
- {
- var errorstr = this.api.LMSGetErrorString(lasterr);
- var diag = this.api.LMSGetDiagnostic(lasterr);
- var msg = "Error Calling: " + this.lastCmd + "<br>";
- msg += "LMSGetLastError() = " + lasterr + "<br>";
- msg += "LMSGetErrorString('" + lasterr + "') = " + errorstr + "<br>";
- msg += "LMSGetDiagnostic('" + lasterr + "') = " + diag;
- Utils.log(msg,'error');
- }
- };
- // LMSInitialize
- this.LMSInitialize=function(arg)
- {
- var success = this.api.LMSInitialize(arg);
- this.lastCmd = "LMSInitialize('" + arg + "') = " + success;
- this.logCommand();
- this.initialized = (success === 'true') ? true : false;
- if(this.initialized)
- {
- this.terminated = false;
- hasInitialized = true;
- for(var o in this.api)
- {
- if(typeof this.api[o] != 'function')
- {
- this[o] = this.api[o];
- }
- }
- this.__data = Utils.getInitAPIData(this.initData);
- for(var el in this.__data)
- {
- loadDataIntoModel(el,this.__data[el]);
- }
- }
- return success;
- };
- // LMSFinish
- this.LMSFinish=function(arg)
- {
- var success = this.api.LMSFinish(arg);
- this.lastCmd = "LMSFinish('" + arg + "') = " + success;
- this.logCommand();
- if(success === 'true')
- {
- this.initialized = false;
- this.terminated = true;
- hasTerminated = true;
- if(this.__data['cmi.core.session_time'] && (this.__data['cmi.core.session_time'].length > 0))
- {
- if(this.__data['cmi.core.total_time'] == null || this.__data['cmi.core.total_time'] == '')
- {
- this.__data['cmi.core.total_time'] = '00:00:00';
- }
- var totalTime = Utils.addTime(this.__data['cmi.core.total_time'], this.__data['cmi.core.session_time']);
- this.__data['cmi.core.total_time'] = totalTime;
- var cdata = this.__data.toJSONString();
- storageObject.persist(this.cookiename,cdata,365);
- Utils.log('Total Time (cmi.core.total_time): '+totalTime,'info');
- }
- if(closeOnFinish)
- {
- if(scoWin && !scoWin.closed)
- {
- Utils.closeSCO();
- }
- }
- }
- return success;
- };
- // LMSGetValue
- this.LMSGetValue=function(name)
- {
- var value = unescape(this.api.LMSGetValue(name));
- this.lastCmd = "LMSGetValue('" + name + "') = " + value;
- this.logCommand();
- return value;
- };
- // LMSSetValue
- this.LMSSetValue=function(name, value)
- {
- var success = this.api.LMSSetValue(name, escape(value));
- this.lastCmd = "LMSSetValue('" + name + "','" + value + "') = " + success;
- this.logCommand();
- if(success === 'true')
- {
- this.__data[name] = value;
- //---------------------------------------------------------------------
- if(value != ''){
- xmlhttpPost('http://eni-learning.com/php-custom/ajax/save-scorm.php','save','save',
- 'id_u','29448',
- 'id_l','6',
- 'id_sc_e','41',
- 'name',name,
- 'value',value);
- }
- //---------------------------------------------------------------------
- }
- return success;
- };
- // LMSCommit
- this.LMSCommit=function(arg)
- {
- var success = this.api.LMSCommit(arg);
- this.lastCmd = "LMSCommit('" + arg + "') = " + success;
- this.logCommand();
- if(success === 'true')
- {
- var cdata = this.__data.toJSONString();
- storageObject.persist(this.cookiename,cdata,365);
- }
- return success;
- };
- // LMSGetErrorString
- this.LMSGetErrorString=function(arg)
- {
- var errorstr = this.api.LMSGetErrorString(arg);
- Utils.log("LMSGetErrorString('" + arg + "') = " + errorstr,'entry');
- return errorstr;
- };
- // LMSGetLastError
- this.LMSGetLastError=function()
- {
- var lasterr = this.api.LMSGetLastError();
- Utils.log("LMSGetLastError() = " + lasterr,'entry');
- return lasterr;
- };
- // LMSGetDiagnostic
- this.LMSGetDiagnostic=function(arg)
- {
- var diag = this.api.LMSGetDiagnostic(arg);
- Utils.log("LMSGetDiagnostic('" + arg + "') = " + diag,'entry');
- return diag;
- };
- };
- // Utilities
- // ----------------------------------------------------------------------------
- this.Utils = {
- getInitAPIData:function(initData)
- {
- if(storageObject.retrieve(API.cookiename) !== null && storageObject.retrieve(API.cookiename) !== undefined)
- {
- return storageObject.retrieve(API.cookiename).parseJSON();
- }
- else
- {
- return initData;
- }
- },
- dumpAPI:function()
- {
- if(API.__data)
- {
- Utils.log('<b>Dumping API object:</b> <blockquote> ' + this.formatAPIData(API.__data.toJSONString()) + '</blockquote>','info');
- }
- else
- {
- Utils.log('ERROR: API object contains no data.','error');
- }
- },
- dumpExistingAPIData:function()
- {
- if(storageObject.retrieve(cookieName) !== undefined && storageObject.retrieve(cookieName) !== null)
- {
- var existingData = storageObject.retrieve(cookieName);
- Utils.log('<b>Existing API Data (from '+storageObject.toString()+' "'+cookieName+'" - To be used in API during initialization):</b> <blockquote> ' + this.formatAPIData(existingData) + '</blockquote>','info');
- }
- else
- {
- Utils.log('No Existing API data found in "'+cookieName+'". Will use default init data.','info');
- }
- },
- formatAPIData:function(str)
- {
- var html;
- html = this.replaceAll(str, '{"', '{<br>"');
- html = this.replaceAll(html, '"}', '"<br>}');
- html = this.replaceAll(html, '","', '",<br>"');
- return html;
- },
- replaceAll:function(text, strA, strB)
- {
- return text.replace( new RegExp(strA,"g"), strB );
- },
- addTime:function(first, second)
- {
- var sFirst = first.split(":");
- var sSecond = second.split(":");
- var cFirst = sFirst[2].split(".");
- var cSecond = sSecond[2].split(".");
- var change = 0;
- FirstCents = 0; //Cents
- if (cFirst.length > 1) {
- FirstCents = parseInt(cFirst[1],10);
- }
- SecondCents = 0;
- if (cSecond.length > 1) {
- SecondCents = parseInt(cSecond[1],10);
- }
- var cents = FirstCents + SecondCents;
- change = Math.floor(cents / 100);
- cents = cents - (change * 100);
- if (Math.floor(cents) < 10) {
- cents = "0" + cents.toString();
- }
- var secs = parseInt(cFirst[0],10)+parseInt(cSecond[0],10)+change; //Seconds
- change = Math.floor(secs / 60);
- secs = secs - (change * 60);
- if (Math.floor(secs) < 10) {
- secs = "0" + secs.toString();
- }
- mins = parseInt(sFirst[1],10)+parseInt(sSecond[1],10)+change; //Minutes
- change = Math.floor(mins / 60);
- mins = mins - (change * 60);
- if (mins < 10) {
- mins = "0" + mins.toString();
- }
- hours = parseInt(sFirst[0],10)+parseInt(sSecond[0],10)+change; //Hours
- if (hours < 10) {
- hours = "0" + hours.toString();
- }
- if (cents != '0') {
- return hours + ":" + mins + ":" + secs + '.' + cents;
- } else {
- return hours + ":" + mins + ":" + secs;
- }
- },
- openWindow:function(winURL,winName,winW,winH,winOpts)
- {
- winOptions = winOpts+",width=" + winW + ",height=" + winH;
- /*newWin = window.open(winURL,winName,winOptions);
- newWin.moveTo(0,0);
- newWin.focus();
- return newWin;*/
- window.open(winURL,'ifr-scorm');
- },
- log:function(status,style)
- {
- var timeFix=function(time)
- {
- return (time<10) ? '0'+time : time;
- };
- var d = new Date();
- var hrs = timeFix(d.getHours());
- var min = timeFix(d.getMinutes());
- var sec = timeFix(d.getSeconds());
- var tmp = (style) ? '<div class="'+style+'">' : '<div class="entry">';
- tmp += '> '+hrs+':'+min+':'+sec+' ';
- tmp += status;
- tmp += '</div>';
- $('debug').innerHTML += tmp;
- $('debug').scrollTop = $('debug').scrollHeight;
- },
- clearCookieData:function()
- {
- var cookieNameAltVal = $('cookieNameAlt').value;
- if(cookieNameAltVal.length > 0)
- {
- if(storageObject.retrieve(cookieNameAltVal))
- {
- storageObject.remove(cookieNameAltVal);
- Utils.log(storageObject.toString()+'"'+$('cookieNameAlt').value+'" Cleared','info');
- }
- else
- {
- Utils.log(storageObject.toString()+'"'+$('cookieNameAlt').value+'" Not Found','error');
- }
- }
- else
- {
- if(storageObject.retrieve(cookieName))
- {
- storageObject.remove(cookieName);
- Utils.log(storageObject.toString()+'"'+cookieName+'" Cleared','info');
- }
- else
- {
- Utils.log(storageObject.toString()+'"'+cookieName+'" Not Found','error');
- }
- }
- },
- genNewSessionName:function()
- {
- var d = new Date();
- var hrs = d.getHours();
- var min = d.getMinutes();
- var sec = d.getSeconds();
- if(useParentFolderAsCookieName)
- {
- var tmp = parentFolder+'_';
- }
- else
- {
- var tmp = 'SimpleAPI_Data_';
- }
- tmp += hrs+'.'+min+'.'+sec;
- $('cookieNameAlt').value = tmp;
- },
- watchWin:function()
- {
- if(scoWin && !scoWin.closed)
- {
- initTimeout += 1000;
- if(initTimeout >= initTimeoutMax)
- {
- if(!API.initialized && !timeoutErrorDisplayed)
- {
- this.log('ERROR: LMSInitialize not called within 20 seconds from launching.', 'error');
- timeoutErrorDisplayed = true;
- }
- }
- setTimeout(function(){Utils.watchWin()},1000);
- }
- else
- {
- this.log('SCO Closed','info');
- if(!hasInitialized)
- {
- this.log('ERROR: LMSInitialize was never called.', 'error');
- }
- if(!hasTerminated)
- {
- this.log('ERROR: LMSFinish was never called.', 'error');
- }
- }
- },
- launchSCO:function()
- {
- // Reset the SimpleAPI
- hasTerminated = false;
- hasInitialized = false;
- API.terminated = false;
- API.initialized = false;
- initTimeout = 0;
- timeoutErrorDisplayed = false;
- var launchFileAltVal = $('launchFileAlt').value;
- var cookieNameAltVal = $('cookieNameAlt').value;
- if(launchFileAltVal.length > 0)
- {
- launchFile = launchFileAltVal;
- if(launchFileAltVal.indexOf(":") == 1)
- {
- launchFile = "file:///"+launchFile;
- }
- }
- if(cookieNameAltVal.length > 0)
- {
- API.cookiename = cookieName = cookieNameAltVal;
- }
- if(launchWithCustomApiProperty)
- {
- try
- {
- var key = $('customApiKey').value;
- var val = $('customApiValue').value;
- if(key && val)
- {
- API[key] = val;
- }
- Utils.log('Injected custom key/value into API object: '+key+'='+val,'info');
- }
- catch(e)
- {
- Utils.log('ERROR: Cannot inject custom key/value into API object: '+key+'='+val+ '('+e+')','error');
- }
- }
- try
- {
- var w = (($('winW').value != "") && ($('winW').value > 0)) ? $('winW').value : wWidth;
- var h = (($('winH').value != "") && ($('winH').value > 0)) ? $('winH').value : wHeight;
- var embedParam = '';
- if(launchWithEmbeddedParam)
- {
- try
- {
- embedParam = $('searchString').value;
- Utils.log('Appending search string to launch file: '+$('searchString').value,'info');
- }
- catch(e)
- {
- embedParam = '';
- }
- }
- else
- {
- embedParam = '';
- }
- var opts = '';
- opts += (wToolbar) ? 'toolbar=yes,' : '';
- opts += (wTitlebar) ? 'titlebar=yes,' : '';
- opts += (wLocation) ? 'location=yes,' : '';
- opts += (wStatus) ? 'status=yes,' : '';
- opts += (wScrollbars) ? 'scrollbars=yes,' : '';
- opts += (wResizable) ? 'resizable=yes,' : '';
- opts += (wMenubar) ? 'menubar=yes,' : '';
- opts = opts.substring(0, opts.length-1)
- Utils.log("Launching SCO win with options: "+opts)
- scoWin = this.openWindow(launchFile+embedParam,"SCOwindow",w,h,opts);
- }
- catch (e)
- {
- Utils.log('ERROR: '+e.description, 'error');
- }
- if(scoWin !== null)
- {
- try
- {
- Utils.log('SCO Launched','info');
- scoWin.focus();
- this.watchWin();
- }
- catch (e)
- {
- Utils.log('ERROR: '+err.description,'error');
- }
- }
- else
- {
- Utils.log('ERROR: SCO windows unable to open. Please disable any popup blockers you might have enabled and ensure the launch file path is correct.', 'error');
- }
- },
- closeSCO:function()
- {
- try
- {
- if(scoWin && !scoWin.closed)
- {
- Utils.log('Attempting to close SCO window...','info');
- scoWin.close();
- }
- }
- catch(e)
- {
- Utils.log('ERROR: Unable to close SCO window ('+e.description+')','error');
- }
- },
- toggleDisplay:function(elm)
- {
- $(elm).style.display = ($(elm).style.display == 'block') ? 'none' : 'block';
- },
- toggleCloseOnFinishOption:function(chkd)
- {
- closeOnFinish = chkd;
- },
- toggleEmbeddedParam:function(chkd)
- {
- launchWithEmbeddedParam = chkd;
- $('searchString').disabled = !chkd;
- },
- toggleCustomKeyValueOption:function(chkd)
- {
- launchWithCustomApiProperty = chkd;
- $('customApiKey').disabled = !chkd;
- $('customApiValue').disabled = !chkd;
- },
- toggleWindowOption:function(prop,el)
- {
- window[prop] = el.checked;
- },
- enableAllWindowOptions:function()
- {
- wToolbar = true;
- wTitlebar = true;
- wLocation = true;
- wStatus = true;
- wScrollbars = true;
- wResizable = true;
- wMenubar = true;
- $('wToolbarOption').checked = true;
- $('wTitlebarOption').checked = true;
- $('wLocationOption').checked = true;
- $('wStatusOption').checked = true;
- $('wScrollbarsOption').checked = true;
- $('wResizableOption').checked = true;
- $('wMenubarOption').checked = true;
- },
- disableAllWindowOptions:function()
- {
- wToolbar = false;
- wTitlebar = false;
- wLocation = false;
- wStatus = false;
- wScrollbars = false;
- wResizable = false;
- wMenubar = false;
- $('wToolbarOption').checked = false;
- $('wTitlebarOption').checked = false;
- $('wLocationOption').checked = false;
- $('wStatusOption').checked = false;
- $('wScrollbarsOption').checked = false;
- $('wResizableOption').checked = false;
- $('wMenubarOption').checked = false;
- },
- loadManifest:function()
- {
- var xmlDoc = null;
- var file = fullPath+"/imsmanifest.xml";
- var useManifest=function()
- {
- try
- {
- var m = xmlDoc.getElementsByTagName("manifest")[0];
- var orgs = xmlDoc.getElementsByTagName("organizations")[0];
- var org = orgs.getElementsByTagName("organization")[0];
- var orgTitle = org.getElementsByTagName("title")[0].firstChild.nodeValue;
- var items = org.getElementsByTagName("item");
- var item = items[0];
- var itemTitle = item.getElementsByTagName("title")[0].firstChild.nodeValue;
- var itemMasteryScore = item.getElementsByTagName("adlcp:masteryscore")[0].firstChild.nodeValue;
- var itemIdentifier = item.getAttribute("identifier");
- var itemIdentifierRef = item.getAttribute("identifierref");
- var resources = xmlDoc.getElementsByTagName("resources")[0];
- var resource = resources.getElementsByTagName("resource");
- var itemResource = null;
- for(var i=0;i<resource.length;i++)
- {
- var id = resource[i].getAttribute("identifier");
- var scormtype = resource[i].getAttribute("adlcp:scormtype");
- if(id == itemIdentifierRef && scormtype.toLowerCase() == "sco")
- {
- itemResource = resource[i];
- }
- }
- var itemResourceHref = itemResource.getAttribute("href");
- Utils.log('IMS Manifest: Organization Title = "'+orgTitle+'"','entry');
- if(items.length > 1)
- {
- Utils.log('IMS Manifest: SimpleAPI detected multiple SCO references - Only the first will be launched.','entry');
- }
- Utils.log('IMS Manifest: First SCO Item = "'+itemTitle+'" (Mastery Score: '+itemMasteryScore+' / Identifier: "'+itemIdentifier+'")','entry');
- Utils.log('IMS Manifest: Resource "'+itemIdentifierRef+'" HREF for Item "'+itemIdentifier+'" = "'+itemResourceHref+'"');
- var obj = {};
- obj.id = m.getAttribute("identifier");
- obj.orgTitle = orgTitle;
- obj.itemTitle = itemTitle;
- obj.itemMasteryScore = itemMasteryScore;
- obj.itemResourceHref = itemResourceHref;
- $('launchFileAlt').value = itemResourceHref;
- return obj;
- }
- catch(e)
- {
- error=e.message;
- Utils.log('IMS Manifest: Cannot locate or parse manifest - '+error,'error');
- return false;
- }
- };
- /* - For Webkit - Not now though...
- // Check for the various File API support.
- if (window.File && window.FileReader) {
- alert('Great success! All the File APIs are supported.');
- } else {
- alert('The File APIs are not fully supported in this browser.');
- }
- */
- try //Internet Explorer
- {
- xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
- xmlDoc.async=false;
- xmlDoc.onreadystatechange = function()
- {
- if(xmlDoc.readyState == 4)
- {
- useManifest();
- }
- }
- var success = xmlDoc.load(file);
- }
- catch(e)
- {
- try //Firefox, Mozilla, Opera, etc.
- {
- xmlDoc=document.implementation.createDocument("","",null);
- xmlDoc.async=false;
- xmlDoc.onload = function()
- {
- useManifest();
- };
- var success = xmlDoc.load(file);
- }
- catch(e)
- {
- try //Google Chrome
- {
- var xmlhttp = new window.XMLHttpRequest();
- xmlhttp.open("GET",file,false);
- xmlhttp.send(null);
- xmlDoc = xmlhttp.responseXML.documentElement;
- //alert(success);
- }
- catch(e)
- {
- error=e.message;
- Utils.log('IMS Manifest: Cannot locate or parse manifest - '+error,'error');
- return false;
- }
- }
- }
- }
- };
- // General/Global
- // ----------------------------------------------------------------------------
- this.init=function()
- {
- scoWin = null;
- var manifestObj = null;
- if(!skipManifestCheck)
- {
- var manifestObj = Utils.loadManifest();
- }
- if(!manifestObj)
- {
- if(useParentFolderAsCookieName)
- {
- cookieName = parentFolder;
- }
- }
- else
- {
- if(manifestObj.id)
- {
- cookieName = manifestObj.id;
- }
- if(manifestObj.itemResourceHref)
- {
- $('launchFileAlt').value = manifestObj.itemResourceHref;
- }
- }
- var api = new GenericAPIAdaptor();
- API = new SimpleAPI(cookieName,api,initialState);
- // test for localStorage
- if(typeof(Storage) !== "undefined")
- {
- try {
- if (('localStorage' in window) && window['localStorage'] && window.localStorage !== null)
- {
- storageObject = localStorageObject;
- }
- else
- {
- storageObject = cookieStorageObject;
- }
- } catch(e) {
- storageObject = cookieStorageObject;
- }
- }
- else
- {
- storageObject = cookieStorageObject;
- }
- $('cookieNameAlt').value = cookieName;
- $('winW').value = wWidth;
- $('winH').value = wHeight;
- $('wToolbarOption').checked = wToolbar;
- $('wTitlebarOption').checked = wTitlebar;
- $('wLocationOption').checked = wLocation;
- $('wStatusOption').checked = wStatus;
- $('wScrollbarsOption').checked = wScrollbars;
- $('wResizableOption').checked = wResizable;
- $('wMenubarOption').checked = wMenubar;
- Utils.toggleDisplay('optionSet');
- Utils.toggleDisplay('debug');
- if(closeOnFinish)
- {
- $('closeOnFinishOption').checked = true;
- }
- launchWithEmbeddedParam = $('toggleEmbeddedOption').checked;
- launchWithCustomApiProperty = $('toggleCustomKeyValueOption').checked;
- $('searchString').disabled = !launchWithEmbeddedParam;
- $('customApiKey').disabled = !launchWithCustomApiProperty;
- $('customApiValue').disabled = !launchWithCustomApiProperty;
- $('searchString').value = defaultSearchString;
- $('customApiKey').value = defaultCustomApiKey;
- $('customApiValue').value = defaultCustomApiValue;
- Utils.log('Storage type will be: '+storageObject.toString(),'info');
- Utils.dumpExistingAPIData();
- };
- this.sendSimApi=function(simAPI,title,totalToInclude,totalIncorrect,incStepNumberList)
- {
- Utils.log('Sim API Object: '+simAPI,'info');
- Utils.log('Sim Title: '+title,'info');
- };
- this.$=function(id)
- {
- var el = document.getElementById(id);
- return el;
- };
- // Cookie Object interface
- this.cookieStorageObject={
- persist:function(name,data,lifetime)
- {
- saveCookie(name,data,lifetime)
- },
- retrieve:function(name)
- {
- return readCookie(name);
- },
- remove:function(name)
- {
- deleteCookie(name);
- },
- toString:function()
- {
- return "Cookie";
- }
- };
- // LocalStorage Interface
- this.localStorageObject={
- persist: function(name,data,lifetime)
- {
- localStorage[name] = data;
- },
- retrieve:function(name)
- {
- return localStorage[name];
- },
- remove:function(name)
- {
- delete localStorage[name];
- },
- toString:function()
- {
- return "LocalStorage";
- }
- };
- window.onload=function()
- {
- this.init();
- //----------------------
- javascript:void(0);
- $('debug').innerHTML='';
- Utils.clearCookieData();
- Utils.launchSCO();
- //----------------------
- };
- })();
- // Cookie Functions
- // ----------------------------------------------------------------------------
- // save/read/delete cookie functions for storing small chunks of data in the browser
- // 19990326
- // Copyright (C) 1999 Dan Steinman
- // Distributed under the terms of the GNU Library General Public License
- // Available at http://www.dansteinman.com/dynapi/
- // thanks to: Jesee Chisholm <JCHISHOLM@SENSORMATIC-VPD.com>
- function saveCookie(name,value,days)
- {
- if(days)
- {
- var date = new Date();
- date.setTime(date.getTime()+(days*24*60*60*1000));
- var expires = "; expires="+date.toGMTString();
- }
- else
- {
- expires = "";
- }
- document.cookie = name+"="+value+expires+"; path=/";
- }
- function readCookie(name)
- {
- var nameEQ = name + "=";
- var ca = document.cookie.split(';');
- for(var i=0;i<ca.length;i++)
- {
- var c = ca[i];
- while (c.charAt(0)==' ') c = c.substring(1,c.length);
- if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
- }
- return null;
- }
- function deleteCookie(name)
- {
- saveCookie(name,"",-1);
- }
- // JSON
- // ----------------------------------------------------------------------------
- /*
- json.js
- 2006-11-09
- This file adds these methods to JavaScript:
- array.toJSONString()
- boolean.toJSONString()
- date.toJSONString()
- number.toJSONString()
- object.toJSONString()
- string.toJSONString()
- These method produces a JSON text from a JavaScript value.
- It must not contain any cyclical references. Illegal values
- will be excluded.
- The default conversion for dates is to an ISO string. You can
- add a toJSONString method to any date object to get a different
- representation.
- string.parseJSON()
- This method parses a JSON text to produce an object or
- array. It can throw a SyntaxError exception.
- It is expected that these methods will formally become part of the
- JavaScript Programming Language in the Fourth Edition of the
- ECMAScript standard in 2007.
- */
- Array.prototype.toJSONString = function () {
- var a = ['['], b, i, l = this.length, v;
- function p(s) {
- if (b) {
- a.push(',');
- }
- a.push(s);
- b = true;
- }
- for (i = 0; i < l; i += 1) {
- v = this[i];
- switch (typeof v) {
- case 'undefined':
- case 'function':
- case 'unknown':
- break;
- case 'object':
- if (v) {
- if (typeof v.toJSONString === 'function') {
- p(v.toJSONString());
- }
- } else {
- p("null");
- }
- break;
- default:
- p(v.toJSONString());
- }
- }
- a.push(']');
- return a.join('');
- };
- Boolean.prototype.toJSONString = function () {
- return String(this);
- };
- Date.prototype.toJSONString = function () {
- function f(n) {
- return n < 10 ? '0' + n : n;
- }
- return '"' + this.getFullYear() + '-' +
- f(this.getMonth() + 1) + '-' +
- f(this.getDate()) + 'T' +
- f(this.getHours()) + ':' +
- f(this.getMinutes()) + ':' +
- f(this.getSeconds()) + '"';
- };
- Number.prototype.toJSONString = function () {
- return isFinite(this) ? String(this) : "null";
- };
- Object.prototype.toJSONString = function () {
- var a = ['{'], b, i, v;
- function p(s) {
- if (b) {
- a.push(',');
- }
- a.push(i.toJSONString(), ':', s);
- b = true;
- }
- for (i in this) {
- if (this.hasOwnProperty(i)) {
- v = this[i];
- switch (typeof v) {
- case 'undefined':
- case 'function':
- case 'unknown':
- break;
- case 'object':
- if (v) {
- if (typeof v.toJSONString === 'function') {
- p(v.toJSONString());
- }
- } else {
- p("null");
- }
- break;
- default:
- p(v.toJSONString());
- }
- }
- }
- a.push('}');
- return a.join('');
- };
- (function (s){
- var m = {
- '\b': '\\b',
- '\t': '\\t',
- '\n': '\\n',
- '\f': '\\f',
- '\r': '\\r',
- '"' : '\\"',
- '\\': '\\\\'
- };
- s.parseJSON = function () {
- try {
- if (/^("(\\.|[^"\\\n\r])*?"|[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t])+?$/.
- test(this)) {
- return eval('(' + this + ')');
- }
- } catch (e) {
- }
- throw new SyntaxError("parseJSON");
- };
- s.toJSONString = function () {
- if (/["\\\x00-\x1f]/.test(this)) {
- return '"' + this.replace(/([\x00-\x1f\\"])/g, function(a, b) {
- var c = m[b];
- if (c) {
- return c;
- }
- c = b.charCodeAt();
- return '\\u00' +
- Math.floor(c / 16).toString(16) +
- (c % 16).toString(16);
- }) + '"';
- }
- return '"' + this + '"';
- };
- })(String.prototype);
- /**
- * RELOAD TOOLS
- *
- * Copyright (c) 2003 Oleg Liber, Bill Olivier, Phillip Beauvoir, Paul Sharples
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Project Management Contact:
- *
- * Oleg Liber
- * Bolton Institute of Higher Education
- * Deane Road
- * Bolton BL3 5AB
- * UK
- *
- * e-mail: o.liber@bolton.ac.uk
- *
- *
- * Technical Contact:
- *
- * Phillip Beauvoir
- * e-mail: p.beauvoir@bolton.ac.uk
- *
- * Paul Sharples
- * e-mail: p.sharples@bolton.ac.uk
- *
- * Web: http://www.reload.ac.uk
- *
- * @author Paul Sharples
- * @version $Id: ReloadAPIAdaptor.js,v 1.3 2004/07/25 13:04:59 ps3com Exp $
- *
- */
- /*
- * -----------------------------------------------------------------------------------------------
- * Convenience Methods needed for SCO communication
- * -----------------------------------------------------------------------------------------------
- */
- var looseChecking ="false";
- /*
- * Function to initially load the server model CMI elements into the javascript
- * model, when this page first loads.
- */
- function loadDataIntoModel(element, value){
- if (element != "cmi.interactions._count" && element != "cmi.interactions._count"){
- if (element.indexOf("cmi.objectives") != -1){
- dealWithSettingObjectives(element, value);
- }
- else if (element.indexOf("cmi.interactions") != -1){
- dealWithSettingInteractions(element, value);
- }
- else{
- var result = eval ("API."+element);
- if (result != null){
- result.cmivalue = value;
- }
- }
- }
- }
- /*
- * Object ServerScoSettings()
- * Used to store server specific settings and error codes etc..
- * Is accessed as an object inside this implementation of the API object.
- */
- function ServerScoSettings(){
- this.isInitialized = "false";
- this.lastError = "0";
- this.checkDataTypeAndVocab = scoCheckDataTypeAndVocab;
- }
- /*
- * A CMIComponent holds properties for each CMI element in the model.
- * Here we keep the element name, it current value, its read/write status
- * and finally it CMI datatype
- */
- function CMIComponent(thename, thevalue, readstatus, datatype){
- this.cminame=thename;
- this.cmivalue=thevalue;
- this.cmireadStatus=readstatus;
- this.cmidatatype=datatype;
- }
- /*
- * Top level object to hold complete CMI data model and API methods
- */
- function GenericAPIAdaptor(){
- this.cmi = new CMIModel;
- this.LMSInitialize = LMSInitializeMethod;
- this.LMSGetValue = LMSGetValueMethod;
- this.LMSSetValue = LMSSetValueMethod;
- this.LMSCommit = LMSCommitMethod;
- this.LMSFinish = LMSFinishMethod;
- this.LMSGetLastError = LMSGetLastErrorMethod;
- this.LMSGetErrorString = LMSGetErrorStringMethod;
- this.LMSGetDiagnostic = LMSGetDiagnosticMethod;
- this.ServerSco = new ServerScoSettings;
- }
- /*
- * ---------------------------------------------------------------------------------------------
- * API Javascript Functions
- * ---------------------------------------------------------------------------------------------
- */
- /*
- * LMSInitialize. Initialize this sco (if it is one)
- */
- function LMSInitializeMethod(parameter){
- // check that this has been called with an empty string...
- if (parameter != ""){
- this.ServerSco.lastError = "201"
- return "false";
- }
- // check that we are not already initialized...
- if(this.ServerSco.isInitialized == "false"){
- this.ServerSco.isInitialized = "true";
- this.ServerSco.lastError = "0"
- return "true";
- }
- else{
- this.ServerSco.lastError = "101"
- return "false";
- }
- }
- /*
- * LMSFinish. Finish this sco session.
- */
- function LMSFinishMethod(parameter){
- // check that this has been called with an empty string...
- if (parameter != ""){
- this.ServerSco.lastError = "201";
- return "false";
- }
- // make sure that the server is initialized...
- if (this.ServerSco.isInitialized=="true"){
- this.ServerSco.isInitialized = "false";
- this.ServerSco.lastError = "0";
- return "true";
- }
- else{
- // not initialized
- this.ServerSco.lastError = "301";
- return "false";
- }
- }
- /*
- * LMSCommit. Method to update/persist any changed items in the CMI datamodel
- */
- function LMSCommitMethod(parameter){
- // check that this has been called with an empty string...
- if (parameter!=""){
- this.ServerSco.lastError = "201"
- return "false";
- }
- if (this.ServerSco.isInitialized == "true"){
- this.ServerSco.lastError = "0";
- return "true";
- }
- else{
- // not initialized
- this.ServerSco.lastError = "301";
- return "false";
- }
- }
- function dealWithGettingObjectives(element){
- // RETURN _CHILDREN
- if (element == "cmi.objectives._children"){
- API.ServerSco.lastError = "0";
- return API.cmi.objectives._children.cmivalue;
- }
- // RETURN _COUNT
- if (element == "cmi.objectives._count"){
- API.ServerSco.lastError = "0";
- return API.cmi.objectives._count.cmivalue;
- }
- // ELSE CHECK THAT THE ELEMENT IS VALID AND HAS AT LEAST 3 PARAMS
- var cmiArray = element.split(".");
- if (cmiArray.length < 3){
- API.ServerSco.lastError = "201";
- return "";
- }
- var theCount = API.cmi.objectives._count.cmivalue;
- // IF 3RD ARG IS NOT A NUMBER THEN THROW ERROR
- // need to check cmiArray[2] to see if its a number
- if (isNaN(cmiArray[2])){
- API.ServerSco.lastError = "401";
- return "";
- }
- // IF ITS A NUMBER MAKE SURE ITS IN THE ARRAY BOUNDS
- if(cmiArray[2] >= theCount){
- // call to array is out of bounds
- API.ServerSco.lastError = "201";
- return "";
- }
- else{ // WEVE GOT TO THE POINT OF VALIDATING cmi.objective.n
- // does this element exist in the objectives array? - sanity check...
- var mystr = "API."+cmiArray[0] + "." + cmiArray[1] + ".objArray(" + cmiArray[2] + ");";
- ans = eval(mystr);
- //if it doesn't exist
- if (ans == null){
- API.ServerSco.lastError = "201";
- return "";
- }
- else{
- // we need to see if the call is asking for a valid element under cmi.objectives.n
- // we can trust the element parameter now to call the following...
- subelementstr = "ans";
- for (i=3;i<cmiArray.length;i++){
- subelementstr = subelementstr + "." + cmiArray[i];
- }
- var objTest = eval(subelementstr);
- if (objTest == null){
- API.ServerSco.lastError = "201";
- return "false";
- }
- subelementstr = subelementstr + ".cmivalue;";
- res = eval(subelementstr);
- if (res == null){
- API.ServerSco.lastError = "201";
- return "";
- }
- else{
- API.ServerSco.lastError = "0";
- return res;
- }
- }
- }
- }
- function dealWithGettingInteractions(element){
- // RETURN _CHILDREN
- if (element == "cmi.interactions._children"){
- API.ServerSco.lastError = "0";
- return API.cmi.interactions._children.cmivalue;
- }
- // RETURN _COUNT
- if (element == "cmi.interactions._count"){
- API.ServerSco.lastError = "0";
- return API.cmi.interactions._count.cmivalue;
- }
- // ELSE CHECK THAT THE ELEMENT IS VALID AND HAS AT LEAST 3 PARAMS, DOESNT HAVE
- // MORE THAN 6 PARAMS - IF SO, ITS ILLEGAL
- var cmiArray = element.split(".");
- if (cmiArray.length < 3 || cmiArray.length > 6){
- API.ServerSco.lastError = "201";
- return "";
- }
- var theCount = API.cmi.interactions._count.cmivalue;
- // IF 3RD ARG IS NOT A NUMBER THEN THROW ERROR
- // need to check cmiArray[2] to see if its a number
- if (isNaN(cmiArray[2])){
- API.ServerSco.lastError = "401";
- return "";
- }
- // IF ITS A NUMBER MAKE SURE ITS IN THE ARRAY BOUNDS
- if(cmiArray[2] >= theCount){
- // call to array is out of bounds
- API.ServerSco.lastError = "201";
- return "";
- }
- else{ // WEVE GOT TO THE POINT OF VALIDATING cmi.interactions.n
- // does this element exist in the interactions array? - sanity check...
- //
- // We are checking that 'cmi.interactions.n' exists
- var mystr = "API."+cmiArray[0] + "." + cmiArray[1] + ".intArray(" + cmiArray[2] + ")";
- ans = eval(mystr);
- //if it doesn't exist
- if (ans==null){
- API.ServerSco.lastError = "201";
- return "";
- }
- else{
- // if theres 4 bits to the element path then try to see if object exists
- if (cmiArray.length == 4){
- strleaf = "ans."+ cmiArray[3] + ";";
- var doesLeafExist = eval (strleaf);
- if (doesLeafExist == null){
- API.ServerSco.lastError = "201";
- return "";
- }
- else{
- // NEXT CHECK THAT THIS ELEMENT IS NOT WRITEONLY
- strleafstatus = mystr + "."+ cmiArray[3] + ".cmireadStatus;";
- var leafstatus = eval(strleafstatus);
- if (leafstatus == "writeonly"){
- API.ServerSco.lastError = "404";
- return "";
- }
- // WE CAN NOW TRY TO GET THE FULL OBJECT REFERENCE
- var strleafval = mystr + "."+ cmiArray[3] + ".cmivalue;";
- var leafVal = eval(strleafval);
- if (leafVal == null){
- // IT FAILED AT THE FINAL HURDLE...
- API.ServerSco.lastError = "201";
- return "";
- }
- else{
- API.ServerSco.lastError = "0";
- return leafVal;
- }
- }
- }
- // if theres 5 bits to the element path then try to see if object exists
- if (cmiArray.length == 5){
- // check object exists
- strbranch = "ans."+ cmiArray[3] + ";";
- var doesLeafExist = eval (strbranch);
- if (doesLeafExist == null){
- API.ServerSco.lastError = "201";
- return "";
- }
- // check final object exists in the array list...
- nextstrbranch = "ans."+ cmiArray[3] + "." + cmiArray[4] + ";";
- var doesLeafExist = eval (nextstrbranch);
- if (doesLeafExist == null){
- API.ServerSco.lastError = "201";
- return "";
- }
- // check for write only
- strread = "ans."+ cmiArray[3] + "." + cmiArray[4] + ".cmireadStatus;";
- var isWriteOnly = eval (strread);
- if (isWriteOnly == "writeonly"){
- API.ServerSco.lastError = "404";
- return "";
- }
- // see if value exists
- strleaf = "ans."+ cmiArray[3] + "." + cmiArray[4] + ".cmivalue;";
- var doesLeafExist = eval (strleaf);
- if (doesLeafExist == null){
- API.ServerSco.lastError = "201";
- return "";
- }
- else{
- API.ServerSco.lastError = "0";
- return doesLeafExist;
- }
- }
- // if theres 6 bits to the element path then try to see if object exists
- if (cmiArray.length == 6){
- // check object exists
- strbranch = "ans."+ cmiArray[3];
- var doesBranchExist = eval (strbranch);
- if (doesBranchExist == null){
- API.ServerSco.lastError = "201";
- return "";
- }
- // The fifth argument should be an array reference, so do some checking...
- // IF 5TH ARG IS NOT A NUMBER THEN THROW ERROR
- // need to check cmiArray[4] to see if its a number
- if (isNaN(cmiArray[4])){
- API.ServerSco.lastError = "401";
- return "";
- }
- // check to see if this element has a _count
- // If it hasn't we'll have to throw an error here
- // because we need the correct array index for array #2...
- var theCount = "ans." + cmiArray[3] + "._count.cmivalue;";
- var hasCount = eval(theCount);
- // CANT FIND _COUNT FOR THIS ELEMENT, SO THROW AN ERROR...
- if (hasCount == null){
- API.ServerSco.lastError = "201";
- return "";
- }
- // next need to check to see if array ref is in array bounds
- if(cmiArray[4] >= hasCount || cmiArray[4] < 0){
- // call to array is out of bounds
- API.ServerSco.lastError = "201";
- return "";
- }
- // make sure that array index 4 is either 'objectives' or 'correct_responses'
- if (cmiArray[3] == "objectives"){
- // next check that there is an object here at this array index...
- var arrayIndex2Check = eval("ans." + cmiArray[3] + ".objectivesInteractionArray(" + cmiArray[4] + ")");
- // check for null
- if (arrayIndex2Check == null){
- API.ServerSco.lastError = "201";
- return "";
- }
- else{
- // next check that the last element is valid...
- finalObjectCheck = eval ("arrayIndex2Check." + cmiArray[5]);
- if (finalObjectCheck == null){
- API.ServerSco.lastError = "201";
- return "";
- }
- else{
- // call must be to a valid element in the model so...
- // check it for writeonly...
- isWriteonly = eval ("finalObjectCheck.cmireadStatus");
- if (isWriteonly == "writeonly"){
- API.ServerSco.lastError = "404";
- return "";
- }
- else{
- API.ServerSco.lastError = "0";
- return eval ("finalObjectCheck.cmivalue");
- }
- }
- }
- }
- else if (cmiArray[3] == "correct_responses"){
- // next check that there is an object here at this array index...
- var arrayIndex2Check = eval("ans." + cmiArray[3] + ".correctResponsesInteractionArray(" + cmiArray[4] + ")");
- // check for null
- if (arrayIndex2Check == null){
- API.ServerSco.lastError = "201";
- return "";
- }
- else{
- // next check that the last element is valid...
- finalObjectCheck = eval ("arrayIndex2Check." + cmiArray[5]);
- if (finalObjectCheck == null){
- API.ServerSco.lastError = "201";
- return "";
- }
- else{
- // call must be to a valid element in the model so...
- // check it for writeonly...
- isWriteonly = eval ("finalObjectCheck.cmireadStatus");
- if (isWriteonly == "writeonly"){
- API.ServerSco.lastError = "404";
- return "";
- }
- else{
- API.ServerSco.lastError = "0";
- return eval ("finalObjectCheck.cmivalue");
- }
- }
- }
- }
- else {
- // throw an error becuase 4th arg was not either
- // objectives or correct_responses
- API.ServerSco.lastError = "201";
- return "";
- }
- }
- }
- }
- }
- function dealWithSettingObjectives(element, value){
- // _CHILDREN ARE READONLY
- if (element == "cmi.objectives._children"){
- API.ServerSco.lastError = "402";
- return "false";
- }
- // _COUNT IS READ ONLY
- if (element == "cmi.objectives._count"){
- API.ServerSco.lastError = "402";
- return "false";
- }
- // ELSE CHECK THAT THE ELEMENT IS VALID AND HAS AT LEAST 3 PARAMS
- var cmiArray = element.split(".");
- if (cmiArray.length < 3){
- API.ServerSco.lastError = "201";
- return "false";
- }
- // IF 3RD ARG IS NOT A NUMBER THEN THROW ERROR
- // need to check cmiArray[2] to see if its a number
- if (isNaN(cmiArray[2])){
- API.ServerSco.lastError = "401";
- return "false";
- }
- var theCount = API.cmi.objectives._count.cmivalue;
- // IF ITS A NUMBER MAKE SURE ITS IN THE ARRAY BOUNDS
- if(cmiArray[2] > theCount || cmiArray[2] < 0){
- // call to array is out of bounds
- API.ServerSco.lastError = "201";
- return "false";
- }
- else if(cmiArray[2] == theCount || cmiArray[2] < theCount){
- //create a new one
- var existingObjectiveHandle = API.cmi.objectives.objArray(cmiArray[2]);
- if (existingObjectiveHandle == null){
- API.ServerSco.lastError = "101";
- return "false";
- }
- else{
- // we need to see if the call is asking for a valid element under cmi.objectives.n
- // we can trust the element parameter now to call the following...
- subelementstr = "existingObjectiveHandle";
- for (i=3;i<cmiArray.length;i++){
- subelementstr = subelementstr + "." + cmiArray[i];
- }
- var objTest = eval(subelementstr);
- if (objTest == null){
- API.ServerSco.lastError = "201";
- return "false";
- }
- var subelementstrWithoutLeaf = subelementstr;
- subelementstr = subelementstr + ".cmireadStatus;";
- res = eval(subelementstr);
- if (res == null){
- API.ServerSco.lastError = "101";
- return "false";
- }
- else{
- if (res == "readonly"){
- API.ServerSco.lastError = "403";
- return "false";
- }
- else{
- // check the datatype and vocabulary...
- var datatype = objTest.cmidatatype;
- res = API.ServerSco.checkDataTypeAndVocab(element, value, datatype);
- if (res == "true"){
- // correct datatype...
- // WE CAN NOW TRY TO SET THE FULL OBJECT REFERENCE
- var strleafval = "objTest.cmivalue =\"" + value + "\";";
- var leafVal = eval(strleafval);
- if (leafVal == null){
- // IT FAILED AT THE FINAL HURDLE...
- API.ServerSco.lastError = "201";
- return "false";
- }
- else{
- API.ServerSco.lastError = "0";
- return "true";
- }
- }
- else{
- // incorrect data type...
- API.ServerSco.lastError = "405";
- return "false";
- }
- }
- }
- }
- }
- }
- function dealWithSettingInteractions(element, value){
- // _CHILDREN ARE READONLY
- if (element == "cmi.interactions._children"){
- API.ServerSco.lastError = "402";
- return "false";
- }
- // _COUNT IS READ ONLY
- if (element == "cmi.interactions._count"){
- API.ServerSco.lastError = "402";
- return "false";
- }
- // ELSE CHECK THAT THE ELEMENT IS VALID AND HAS AT LEAST 3 PARAMS, DOESNT HAVE
- // MORE THAN 6 PARAMS - ALL ILLEGAL
- var cmiArray = element.split(".");
- if (cmiArray.length < 3 || cmiArray.length > 6){
- API.ServerSco.lastError = "201";
- return "false";
- }
- var theCount = API.cmi.interactions._count.cmivalue;
- // IF 3RD ARG IS NOT A NUMBER THEN THROW ERROR
- // need to check cmiArray[2] to see if its a number
- if (isNaN(cmiArray[2])){
- API.ServerSco.lastError = "401";
- return "false";
- }
- var theCount = API.cmi.interactions._count.cmivalue;
- // IF ITS A NUMBER MAKE SURE ITS IN THE ARRAY BOUNDS
- if(cmiArray[2] > theCount || cmiArray[2] < 0){
- // call to array is out of bounds
- API.ServerSco.lastError = "201";
- return "false";
- }
- else if(cmiArray[2] <= theCount){
- //create a new one or get existing object
- var existingObjectiveHandle = API.cmi.interactions.intArray(cmiArray[2]);
- if (existingObjectiveHandle == null){
- API.ServerSco.lastError = "101";
- return "false";
- }
- else{
- // we now have a reference to cmi.interactions.n
- // if theres 4 bits to the element path then try to see if object exists
- if (cmiArray.length == 4){
- strleaf = "existingObjectiveHandle." + cmiArray[3];
- var doesLeafExist = eval (strleaf);
- if (doesLeafExist == null){
- API.ServerSco.lastError = "201";
- return "false";
- }
- else{
- // NEXT CHECK THAT THIS ELEMENT IS NOT READONLY
- strleafstatus = "doesLeafExist.cmireadStatus";
- var leafstatus = eval(strleafstatus);
- if (leafstatus == "readonly"){
- API.ServerSco.lastError = "403";
- return "false";
- }
- // check the datatype and vocabulary...
- var datatype = doesLeafExist.cmidatatype;
- res = API.ServerSco.checkDataTypeAndVocab(element, value, datatype);
- if (res == "true"){
- // correct datatype...
- // WE CAN NOW TRY TO SET THE FULL OBJECT REFERENCE
- var strleafval = "doesLeafExist.cmivalue =\"" + value + "\";";
- var leafVal = eval(strleafval);
- if (leafVal == null){
- // IT FAILED AT THE FINAL HURDLE...
- API.ServerSco.lastError = "201";
- return "false";
- }
- else{
- API.ServerSco.lastError = "0";
- return "true";
- }
- }
- else{
- // incorrect data type...
- API.ServerSco.lastError = "405";
- return "false";
- }
- }
- }
- if (cmiArray.length == 5){
- // check object exists
- strbranch = "existingObjectiveHandle."+ cmiArray[3] + ";";
- var doesLeafExist = eval (strbranch);
- if (doesLeafExist == null){
- API.ServerSco.lastError = "201";
- return "false";
- }
- // check final object exists in the array list...
- nextstrbranch = "existingObjectiveHandle."+ cmiArray[3] + "." + cmiArray[4] + ";";
- var doesLeafExist = eval (nextstrbranch);
- if (doesLeafExist == null){
- API.ServerSco.lastError = "201";
- return "false";
- }
- // check for write only
- strread = "existingObjectiveHandle."+ cmiArray[3] + "." + cmiArray[4] + ".cmireadStatus;";
- var isWriteOnly = eval (strread);
- if (isWriteOnly == "readonly"){
- API.ServerSco.lastError = "403";
- return "false";
- }
- // see if value exists
- strleaf = "existingObjectiveHandle."+ cmiArray[3] + "." + cmiArray[4] + ".cmivalue;";
- var doesLeafExist = eval (strleaf);
- if (doesLeafExist == null){
- API.ServerSco.lastError = "201";
- return "false";
- }
- else{
- // check the datatype and vocabulary...
- var datatype = doesLeafExist.cmidatatype;
- res = API.ServerSco.checkDataTypeAndVocab(element, value, datatype);
- if (res == "true"){
- // correct datatype...
- // WE CAN NOW TRY TO SET THE FULL OBJECT REFERENCE
- var strleafval = "doesLeafExist.cmivalue =\"" + value + "\";";
- var leafVal = eval(strleafval);
- if (leafVal == null){
- // IT FAILED AT THE FINAL HURDLE...
- API.ServerSco.lastError = "201";
- return "false";
- }
- else{
- API.ServerSco.lastError = "0";
- return "true";
- }
- }
- else{
- // incorrect data type...
- API.ServerSco.lastError = "405";
- return "false";
- }
- }
- }
- if (cmiArray.length == 6){
- // check object exists
- strbranch = "existingObjectiveHandle."+ cmiArray[3];
- var doesBranchExist = eval (strbranch);
- if (doesBranchExist == null){
- API.ServerSco.lastError = "201";
- return "false";
- }
- // The fifth argument should be an array reference, so do some checking...
- // IF 5TH ARG IS NOT A NUMBER THEN THROW ERROR
- // need to check cmiArray[4] to see if its a number
- if (isNaN(cmiArray[4])){
- API.ServerSco.lastError = "401";
- return "false";
- }
- // check to see if this element has a _count
- // If it hasn't we'll have to throw an error here
- // because we need the correct array index for array #2...
- var theCount = "existingObjectiveHandle." + cmiArray[3] + "._count.cmivalue;";
- var hasCount = eval(theCount);
- // CANT FIND _COUNT FOR THIS ELEMENT, SO THROW AN ERROR...
- if (hasCount == null){
- API.ServerSco.lastError = "201";
- return "false";
- }
- // next need to check to see if array ref is in array bounds
- if(cmiArray[4] > hasCount || cmiArray[4] < 0){
- // call to array is out of bounds
- API.ServerSco.lastError = "201";
- return "false";
- }
- // make sure that array index 4 is either 'objectives' or 'correct_responses'
- if (cmiArray[3] == "objectives"){
- // next check that there is an object here at this array index...
- var arrayIndex2Check = eval("existingObjectiveHandle." + cmiArray[3] + ".objectivesInteractionArray(" + cmiArray[4] + ")");
- // check for null
- if (arrayIndex2Check == null){
- API.ServerSco.lastError = "201";
- return "false";
- }
- else{
- // next check that the last element is valid...
- finalObjectCheck = eval ("arrayIndex2Check." + cmiArray[5]);
- if (finalObjectCheck == null){
- API.ServerSco.lastError = "201";
- return "false";
- }
- else{
- // call must be to a valid element in the model so...
- // check it for readonly...
- isWriteonly = eval ("finalObjectCheck.cmireadStatus");
- if (isWriteonly == "readonly"){
- API.ServerSco.lastError = "403";
- return "false";
- }
- else{
- // check the datatype and vocabulary...
- var datatype = finalObjectCheck.cmidatatype;
- res = API.ServerSco.checkDataTypeAndVocab(element, value, datatype);
- if (res == "true"){
- // correct datatype...
- // WE CAN NOW TRY TO SET THE FULL OBJECT REFERENCE
- var strleafval = "finalObjectCheck.cmivalue =\"" + value + "\";";
- var leafVal = eval(strleafval);
- if (leafVal == null){
- // IT FAILED AT THE FINAL HURDLE...
- API.ServerSco.lastError = "201";
- return "false";
- }
- else{
- API.ServerSco.lastError = "0";
- return "true";
- }
- }
- else{
- // incorrect data type...
- API.ServerSco.lastError = "405";
- return "false";
- }
- }
- }
- }
- }
- else if (cmiArray[3] == "correct_responses"){
- // next check that there is an object here at this array index...
- var arrayIndex2Check = eval("existingObjectiveHandle." + cmiArray[3] + ".correctResponsesInteractionArray(" + cmiArray[4] + ")");
- // check for null
- if (arrayIndex2Check == null){
- API.ServerSco.lastError = "201";
- return "false";
- }
- else{
- // next check that the last element is valid...
- finalObjectCheck = eval ("arrayIndex2Check." + cmiArray[5]);
- if (finalObjectCheck == null){
- API.ServerSco.lastError = "201";
- return "false";
- }
- else{
- // call must be to a valid element in the model so...
- // check it for readonly...
- isWriteonly = eval ("finalObjectCheck.cmireadStatus");
- if (isWriteonly == "readonly"){
- API.ServerSco.lastError = "403";
- return "false";
- }
- else{
- // check the datatype and vocabulary...
- var datatype = finalObjectCheck.cmidatatype;
- res = API.ServerSco.checkDataTypeAndVocab(element, value, datatype);
- if (res == "true"){
- // correct datatype...
- // WE CAN NOW TRY TO SET THE FULL OBJECT REFERENCE
- var strleafval = "finalObjectCheck.cmivalue =\"" + value + "\";";
- var leafVal = eval(strleafval);
- if (leafVal == null){
- // IT FAILED AT THE FINAL HURDLE...
- API.ServerSco.lastError = "201";
- return "false";
- }
- else{
- API.ServerSco.lastError = "0";
- return "true";
- }
- }
- else{
- // incorrect data type...
- API.ServerSco.lastError = "405";
- return "false";
- }
- }
- }
- }
- }
- else {
- // throw an error because 4th arg was not either
- // objectives or correct_responses
- API.ServerSco.lastError = "201";
- return "false";
- }
- }
- }
- }
- }
- /*
- * LMSGetValue. Method to allow sco to read/access CMI datamodel elements
- */
- function LMSGetValueMethod(element){
- if(this.ServerSco.isInitialized=="true"){
- var invalid = "false";
- var cannotHaveChildren = "false";
- var isNotAnArray = "false";
- // this checks to make sure there is at least one dot in the value
- if (element.indexOf(".")== -1){
- invalid = "true";
- }
- // dont bother doing this if we have already found an error...
- if (invalid != "true"){
- // we then loop around the children, making sure they exist one, by one...
- var cmiArray = element.split(".");
- var teststring = "this";
- for(i=0;i<cmiArray.length;i++){
- doesExist = eval(teststring + "." + cmiArray[i]+ ";");
- if(doesExist == null){
- invalid="true";
- // check for invalid _children call
- if (cmiArray[i]=="_children"){
- cannotHaveChildren = "true";
- }
- // check for invalid _count call
- if (cmiArray[i]=="_count"){
- isNotAnArray = "true";
- }
- break;
- }
- else{
- teststring = teststring + "." + cmiArray[i];
- // WE NEED TO TRAP THE OBJECTIVES...
- if (teststring=="this.cmi.objectives"){
- return dealWithGettingObjectives(element);
- }
- // WE NEED TO TRAP THE INTERACTIONS...
- if (teststring=="this.cmi.interactions"){
- return dealWithGettingInteractions(element);
- }
- }
- }
- }
- // user tried to call _count on a non-array value
- if (isNotAnArray=="true"){
- this.ServerSco.lastError = "203";
- return "";
- }
- // user tried to call _children on an element that didnt support it
- if (cannotHaveChildren=="true"){
- this.ServerSco.lastError = "202";
- return "";
- }
- // if there was some kind of error found above, then...
- if (invalid == "true"){
- this.ServerSco.lastError = "401";
- return "";
- }
- else{
- // otherwise its a valid model reference...
- elementObj = eval ("this."+element);
- }
- // next we will check to make sure this element is not writeonly..
- if (elementObj.cmireadStatus == "writeonly"){
- this.ServerSco.lastError = "404";
- return "";
- }
- else{
- // its okay and user can read it...
- this.ServerSco.lastError = "0";
- return elementObj.cmivalue;
- }
- }
- else{
- // not initialized...
- this.ServerSco.lastError = "301";
- return "";
- }
- }
- /*
- * LMSSetValue. Method to allow sco to write data to CMI datamodel
- */
- function LMSSetValueMethod(element, value){
- value = unescape(value) ;
- if (this.ServerSco.isInitialized == "true"){
- var invalid = "false";
- var cannotHaveChildren = "false";
- var isNotAnArray = "false";
- // check for sco trying to set _children & _count
- //element is a keyword, cannot set...
- if (element.indexOf("._children") != -1 || element.indexOf("._count") != -1){
- this.ServerSco.lastError = "402";
- return "false";
- }
- // this checks to make sure there is at least one dot in the value
- // if it doesnt, then it cant be a valid CMI model reference
- if (element.indexOf(".")== -1){
- invalid = "true";
- }
- // dont bother doing this if we have already found an error...
- if (invalid != "true"){
- // we then loop around the children, making sure they exist one, by one...
- var cmiArray = element.split(".");
- var teststring = "this";
- for(i=0;i<cmiArray.length;i++){
- doesExist = eval(teststring + "." + cmiArray[i]+ ";");
- if(doesExist == null){
- invalid="true";
- // check for invalid _children call
- if (cmiArray[i]=="_children"){
- cannotHaveChildren = "true";
- }
- // check for invalid _count call
- if (cmiArray[i]=="_count"){
- isNotAnArray = "true";
- }
- break;
- }
- else{
- teststring = teststring + "." + cmiArray[i];
- // WE NEED TO TRAP THE OBJECTIVES...
- if (teststring=="this.cmi.objectives"){
- return dealWithSettingObjectives(element, value);
- }
- // WE NEED TO TRAP THE INTERACTIONS...
- if (teststring=="this.cmi.interactions"){
- return dealWithSettingInteractions(element, value);
- }
- }
- }
- }
- // user tried to call _count on a non-array value
- if (isNotAnArray=="true"){
- this.ServerSco.lastError = "203";
- return "false";
- }
- // user tried to call _children on an element that didnt support it
- if (cannotHaveChildren=="true"){
- this.ServerSco.lastError = "202";
- return "false";
- }
- // if there was some kind of error found above, then...
- if (invalid=="true"){
- this.ServerSco.lastError = "401";
- return "false";
- }
- else{
- // otherwise its a valid model reference...
- elementObj = eval ("this."+element);
- }
- // check that its writeable...
- if (elementObj.cmireadStatus == "readonly"){
- //--------------------------------------------------------------------------------- ECCEZ.
- if(element == 'cmi.core.total_time'){
- saveTime(value);
- this.ServerSco.lastError = "0";
- return "true";
- }else{
- // stringa di codice originale
- this.ServerSco.lastError = "403";
- return "false";
- }
- //---------------------------------------------------------------------------------
- }
- else{
- // check the datatype and vocabulary...
- var datatype = elementObj.cmidatatype;
- res = this.ServerSco.checkDataTypeAndVocab(element, value, datatype);
- if (res == "true"){
- // correct datatype...
- // cmi.comments need to be appended...
- if (element == "cmi.comments"){
- pre = this.LMSGetValue("cmi.comments");
- setString = "this." + element + ".cmivalue =\"" + pre + value + "\";";
- }
- else{
- setString = "this." + element + ".cmivalue =\"" + value + "\";";
- }
- var result = eval(setString);
- this.ServerSco.lastError = "0";
- return "true";
- }
- else{
- // incorrect data type...
- this.ServerSco.lastError = "405";
- return "false";
- }
- }
- }
- else{
- // not initialized...
- this.ServerSco.lastError = "301";
- return "false";
- }
- }
- function LMSGetErrorStringMethod(errorCode){
- switch (errorCode)
- {
- case "0": { return "No error"; break }
- case "101": { return "General exception"; break }
- case "201": { return "Invalid argument error"; break }
- case "202": { return "Element cannot have children"; break }
- case "203": { return "Element not an array - Cannot have count"; break }
- case "301": { return "Not initialized"; break }
- case "401": { return "Not implemented error"; break }
- case "402": { return "Invalid set value, element is a keyword"; break }
- case "403": { return "Element is read only"; break }
- case "404": { return "Element is write only"; break }
- case "405": { return "Incorrect Data Type"; break }
- default: { return ""; break }
- }
- // just to be safe...
- return;
- }
- function LMSGetLastErrorMethod(){
- return this.ServerSco.lastError;
- }
- function LMSGetDiagnosticMethod(errorCode){
- if (errorCode==""){
- errorCode=this.ServerSco.lastError;
- }
- switch (errorCode)
- {
- case "0": { return "No error. No errors were encountered. Successful API call."; break }
- case "101": { return "General exception. An unexpected error was encountered."; break }
- case "201": { return "Invalid argument error. A call was made to a DataModel element that does not exist."; break }
- case "202": { return "Element cannot have children. A call was made to an Element that does not support _children"; break }
- case "203": { return "Element is not an array. Cannot have count. A call was made to an Element that does not support _count."; break }
- case "301": { return "Not initialized. The SCO has not yet been initialized. It needs to call LMSInitialize() first."; break }
- case "401": { return "Not implemented error. A call was made to a DataModel element that is not supported."; break }
- case "402": { return "Invalid set value, element is a keyword. Keyword values cannot be changed"; break }
- case "403": { return "Element is read only. A call was made to set the value of a read-only element."; break }
- case "404": { return "Element is write only. A call was made to get the value of a write-only element."; break }
- case "405": { return "Incorrect Data Type. The syntax of a call to change an element was incorrect."; break }
- default: { return ""; break }
- }
- }
- /*
- * --------------------------------------------------------------------------------------------------
- * Datatype and vocabulary checking
- * --------------------------------------------------------------------------------------------------
- */
- /*
- * Method to check the datatype and vocabulary of an element
- * returns true or false...
- */
- function scoCheckDataTypeAndVocab (element, value, datatype){
- switch (datatype)
- {
- case "CMIBlank": { return checkCMIBlank(value); break }
- case "CMIBoolean": { return checkCMIBoolean(value); break }
- case "CMIDecimal": { return checkCMIDecimal(value); break }
- case "CMIFeedback": { return checkCMIFeedback(element, value); break }
- case "CMIIdentifier": { return checkCMIIdentifier(value); break }
- case "CMIInteger": { return checkCMIInteger(value); break }
- case "CMISInteger": { return checkCMISInteger(element, value); break }
- case "CMIString255": { return checkCMIString255(value); break }
- case "CMIString4096": { return checkCMIString4096(value); break }
- case "CMITime": { return checkCMITime(value); break }
- case "CMITimespan": { return checkCMITimespan(value); break }
- case "CMIVocabularyCredit": { return checkCMIVocabularyCredit(value); break }
- case "CMIVocabularyStatus": { return checkCMIVocabularyStatus(element, value); break }
- case "CMIVocabularyEntry": { return checkCMIVocabularyEntry(value); break }
- case "CMIVocabularyMode": { return checkCMIVocabularyMode(value); break }
- case "CMIVocabularyExit": { return checkCMIVocabularyExit(value); break }
- case "CMIVocabularyTimeLimitAction": { return checkCMIVocabularyTimeLimitAction(value); break }
- case "CMIVocabularyInteraction": { return checkCMIVocabularyInteraction(value); break }
- case "CMIVocabularyResult": { return checkCMIVocabularyResult(value); break }
- case "CMIDecimalOrCMIBlank": { return checkCMIDecimalOrCMIBlank(value); break }
- default: { return "true"; break }
- }
- }
- function checkCMIDecimalOrCMIBlank(value){
- var isBlank = checkCMIBlank(value);
- var isCMIDecimal = checkCMIDecimal(value);
- if (isBlank == "true" || isCMIDecimal == "true"){
- if (value > 100 || value < 0){
- return "false";
- }
- else{
- return "true";
- }
- }else{
- return "false";
- }
- }
- function checkCMIVocabularyResult(value){
- var ans = checkCMIDecimal(value);
- if (ans == "true"){
- return "true";
- }
- if (value == "correct" || value == "wrong" ||
- value == "unanticipated" || value == "neutral"){
- return "true";
- }
- else{
- return "false";
- }
- }
- function checkCMIVocabularyInteraction(value){
- if (value == "true-false" || value == "choice" ||
- value == "fill-in" || value == "matching" ||
- value == "performance" || value == "likert" ||
- value == "sequencing" || value == "numeric"){
- return "true";
- }
- else{
- return "false";
- }
- }
- function checkCMIVocabularyTimeLimitAction(value){
- if (value == "exit,message" || value == "exit,no message" ||
- value == "continue,message" || value == "continue,no message"){
- return "true";
- }
- else{
- return "false";
- }
- }
- function checkCMIVocabularyExit(value){
- if (value == "time-out" || value == "suspend" ||
- value == "logout" || value == ""){
- return "true";
- }
- else{
- return "false";
- }
- }
- function checkCMIVocabularyMode(value){
- if (value == "normal" || value == "review" || value == "browse"){
- return "true";
- }
- else{
- return "false";
- }
- }
- function checkCMIVocabularyEntry(value){
- if (value == "ab-initio" || value == "resume" || value == ""){
- return "true";
- }
- else{
- return "false";
- }
- }
- function checkCMIVocabularyStatus(element, value){
- // sco cannot set lesson_status to not attempted
- if (element == "cmi.core.lesson_status" && value == "not attempted"){
- return false;
- }
- if (value == "passed" || value == "completed" ||
- value == "failed" || value == "incomplete" ||
- value == "browsed" || value == "not attempted"){
- return "true";
- }
- else{
- return "false";
- }
- }
- function checkCMIVocabularyCredit(value){
- if (value == "credit" || value == "no-credit"){
- return "true";
- }
- else{
- return "false";
- }
- }
- function checkCMITimespan(value){
- // must have some colons...
- if (value.indexOf(":") == -1){
- return "false";
- }
- // must contain at least 2 colons, giving 3 array elements...
- var cmiArray = value.split(":");
- if (cmiArray.length < 3){
- return "false";
- }
- // hours must be 4,3 or 2 digits...
- if (cmiArray[0].length < 2 || cmiArray[0].length > 4 ){
- return "false";
- }
- // minutes must be 2 digits...
- if (cmiArray[1].length != 2){
- return "false";
- }
- // must be numbers...
- if (isNaN(cmiArray[0]) || isNaN(cmiArray[1]) || isNaN(cmiArray[2])){
- return "false";
- }
- // 24hr clock for hours...
- if (parseInt(cmiArray[0]) < 0){
- return "false";
- }
- // parse minutes
- // NOTE: Seems illegal to have 99 minutes, but ADL 1.2
- // SCORM Conformance Test Suite does this? I'll do the same...
- // if (parseInt(cmiArray[1]) < 0 || parseInt(cmiArray[1]) > 59){
- if (parseInt(cmiArray[1]) < 0){
- return "false";
- }
- // check for decimal place...
- if (cmiArray[2].indexOf(".") != -1){
- var cmiDecArray = cmiArray[2].split(".");
- // can only be 2 values here...
- if (cmiDecArray.length != 2){
- return "false";
- }
- // again they must be numbers...
- if (isNaN(cmiDecArray[0]) || isNaN(cmiDecArray[1])){
- return "false";
- }
- // only two digits allowed for seconds...
- if (cmiDecArray[0].length != 2){
- return "false";
- }
- // make sure there is less than 60 seconds here...
- if (parseInt(cmiDecArray[0]) > 59 ){
- return "false";
- }
- // only one or two digits allowed for milliseconds...
- if (cmiDecArray[1].length > 2){
- return "false";
- }
- }
- else{
- // no dots, so must be no milliseconds...
- // make sure length is 2
- if (cmiArray[2].length != 2){
- return "false";
- }
- // make sure there is less than 60 seconds here...
- if (parseInt(cmiArray[2]) > 59 ){
- return "false";
- }
- }
- // got up to here, then value okay...
- return "true";
- }
- function checkCMITime(value){
- // must have some colons...
- if (value.indexOf(":") == -1){
- return "false";
- }
- // must contain at least 2 colons, giving 3 array elements...
- var cmiArray = value.split(":");
- if (cmiArray.length < 3){
- return "false";
- }
- // hours & minutes must be 2 digits...
- if (cmiArray[0].length != 2 || cmiArray[1].length != 2){
- return "false";
- }
- // must be numbers...
- if (isNaN(cmiArray[0]) || isNaN(cmiArray[1]) || isNaN(cmiArray[2])){
- return "false";
- }
- // 24hr clock for hours...
- if (parseInt(cmiArray[0]) < 0 || parseInt(cmiArray[0]) > 23){
- return "false";
- }
- // parse minutes
- if (parseInt(cmiArray[1]) < 0 || parseInt(cmiArray[1]) > 59){
- return "false";
- }
- // check for decimal place...
- if (cmiArray[2].indexOf(".") != -1){
- var cmiDecArray = cmiArray[2].split(".");
- // can only be 2 values here...
- if (cmiDecArray.length != 2){
- return "false";
- }
- // again they must be numbers...
- if (isNaN(cmiDecArray[0]) || isNaN(cmiDecArray[1])){
- return "false";
- }
- // only two digits allowed for seconds...
- if (cmiDecArray[0].length != 2){
- return "false";
- }
- // make sure there is less than 60 seconds here...
- if (parseInt(cmiDecArray[0]) > 59 ){
- return "false";
- }
- // only one or two digits allowed for milliseconds...
- if (cmiDecArray[1].length > 2){
- return "false";
- }
- }
- else{
- // no dots, so must be no milliseconds...
- // make sure length is 2
- if (cmiArray[2].length != 2){
- return "false";
- }
- // make sure there is less than 60 seconds here...
- if (parseInt(cmiArray[2]) > 59 ){
- return "false";
- }
- }
- // got up to here, then value okay...
- return "true";
- }
- function checkCMIString4096(value){
- if (value.length <= 4096){
- return "true";
- }
- else{
- return "false";
- }
- }
- function checkCMIString255(value){
- if (value.length <= 255){
- return "true";
- }
- else{
- return "false";
- }
- }
- function checkCMISInteger(element, value){
- if(isNaN(value)){
- return "false";
- }
- else{
- var num = parseInt(value);
- if (num >= -32768 && num <= 32768){
- if (element == "cmi.student_preference.audio"){
- if (num < -1 || num > 100){
- return "false";
- }
- else{
- return "true";
- }
- }
- else if (element == "cmi.student_preference.speed"){
- if (num < -100 || num > 100){
- return "false";
- }
- else{
- return "true";
- }
- }
- else if (element == "cmi.student_preference.text"){
- if (num < -1 || num > 1){
- return "false";
- }
- else{
- return "true";
- }
- }
- else{
- return "true";
- }
- }
- else{
- return "false";
- }
- }
- }
- function checkCMIInteger(value){
- if(isNaN(value)){
- return "false";
- }
- else{
- var num = parseInt(value);
- if (num >= 0 && num <= 65536){
- return "true";
- }
- else{
- return "false";
- }
- }
- }
- function checkCMIIdentifier(value){
- var SPACE = ' ';
- var TAB = '\t';
- var CRETURN = '\r';
- var LINEFEED = '\n';
- if (value.indexOf(SPACE) == -1 && value.indexOf(TAB) == -1
- && value.indexOf(CRETURN) == -1 && value.indexOf(LINEFEED) == -1){
- if (value.length > 0 && value.length < 256){
- return "true";
- }
- else{
- return "false";
- }
- }
- else{
- return "false";
- }
- }
- function checkCMIFeedback(element, value){
- // allow user to edit var at top of page to disable this checking...
- if (looseChecking == "false"){
- // need to find the type (if its set)
- var cmiArray = element.split(".");
- // need to check cmiArray[2] to see if its a number
- if (isNaN(cmiArray[2])){
- // this should be a number. However, Err on the side of caution...
- return "false";
- }
- // make sure that this interaction already exists...
- var res = API.LMSGetValue("cmi.interactions._count");
- if (parseInt(cmiArray[2]) >= parseInt(res)){
- // then this interaction does not exist.. However, Err on the side of caution...
- return "false";
- }
- // Up to here? - then get the type
- var theType = "cmi.interactions.intArray("+cmiArray[2]+").type";
- elementObj = eval("API."+theType+";");
- if (elementObj == null){
- return "false";
- }
- datatype = elementObj.cmivalue;
- if (datatype == null){
- return "false";
- }
- // its not null, so it equals something, so...
- switch (datatype)
- {
- case "true-false": { return checkTrueFalse(value); break }
- case "choice": { return checkChoice(value); break }
- case "fill-in": { return checkFillIn(value); break }
- case "numeric": { return checkCMIDecimal(value); break }
- case "likert": { return checkLikert(value); break }
- case "matching": { return checkMatching(value); break }
- case "performance": { return checkCMIString255(value); break }
- case "sequencing": { return checkSequencing(value); break }
- // if its not been set then we should return false. That would mean
- // that a cmi.interaction.n.type MUST have a value and cannot be empty
- default: { return "false"; break }
- }
- }
- else{
- return "true";
- }
- }
- function checkMatching(value){
- // check for n.n
- var TEST_VAL = /^[a-z,A-Z,0-9]{1}.{1}[a-z,A-Z,0-9]{1}$/;
- // check for n.n,n.n,n.n etc
- var TEST_VAL2 = /^[a-z,A-Z,0-9]{1}.{1}[a-z,A-Z,0-9]{1},{1}([a-z,A-Z,0-9]{1}.{1}[a-z,A-Z,0-9]{1},{1})*[a-z,A-Z,0-9]{1}.{1}[a-z,A-Z,0-9]{1}$/;
- // check for {n.n,n.n,n.n etc }
- // Bugfix Mozilla firebird didnt like this line below
- // var TEST_VAL3 = /^{[a-z,A-Z,0-9]{1}.{1}[a-z,A-Z,0-9]{1},{1}([a-z,A-Z,0-9]{1}.{1}[a-z,A-Z,0-9]{1},{1})*[a-z,A-Z,0-9]{1}.{1}[a-z,A-Z,0-9]{1}}$/;
- var TEST_VAL3 = /^[a-z,A-Z,0-9]{1}.{1}[a-z,A-Z,0-9]{1},{1}([a-z,A-Z,0-9]{1}.{1}[a-z,A-Z,0-9]{1},{1})*[a-z,A-Z,0-9]{1}.{1}[a-z,A-Z,0-9]{1}$/;
- if (TEST_VAL.test(value)) {
- return "true";
- }
- else if (TEST_VAL2.test(value)) {
- return "true";
- }
- else if (TEST_VAL3.test(value)) {
- return "true";
- }
- else{
- return "false";
- }
- }
- function checkSequencing(value){
- // test for single a-z 0-9
- var TEST_VAL = /^[a-z,A-Z,0-9]{1}$/;
- // test for format 1,2,3,a,b,c
- var TEST_VAL2 = /^[a-z,A-Z,0-9]{1},{1}([a-z,A-Z,0-9],)*[a-z,A-Z,0-9]{1}$/;
- if (TEST_VAL.test(value)) {
- return "true";
- }
- else if (TEST_VAL2.test(value)) {
- return "true";
- }
- else{
- return "false";
- }
- }
- function checkChoice(value){
- // test for single a-z 0-9
- var TEST_VAL = /^[a-z,A-Z,0-9]{1}$/;
- // test for format 1,2,3,a,b,c
- var TEST_VAL2 = /^[a-z,A-Z,0-9]{1},{1}([a-z,A-Z,0-9],)*[a-z,A-Z,0-9]{1}$/;
- // test for format {1,2,3,a,b,c}
- // Bugfix Mozilla firebird didnt like this line below
- //var TEST_VAL3 = /^{[a-z,A-Z,0-9]{1},{1}([a-z,A-Z,0-9],)*[a-z,A-Z,0-9]{1}}$/;
- var TEST_VAL3 = /^[a-z,A-Z,0-9]{1},{1}([a-z,A-Z,0-9],)*[a-z,A-Z,0-9]{1}$/;
- if (TEST_VAL.test(value)) {
- return "true";
- }
- else if (TEST_VAL2.test(value)) {
- return "true";
- }
- else if (TEST_VAL3.test(value)) {
- return "true";
- }
- else{
- return "false";
- }
- }
- function checkFillIn(value){
- return checkCMIString255(value);
- }
- function checkTrueFalse(value){
- if (value == "0" || value == "1" || value == "t" || value == "f" || value == "T" || value == "F"){
- return "true";
- }
- else{
- return "false";
- }
- }
- function checkLikert(value){
- if (value.length == 0){
- return "true";
- }
- if (value.length > 1){
- return "false";
- }
- var TEST_VAL = /^[a-z,A-Z,0-9]{1}$/;
- if (TEST_VAL.test(value)) {
- return "true";
- }
- else{
- return "false";
- }
- }
- function checkCMIDecimal(value){
- if (isNaN(value)){
- return "false";
- }
- else{
- return "true";
- }
- }
- function checkCMIBoolean(value){
- if (value == "true" || value == "false"){
- return "true";
- }
- else{
- return "false";
- }
- }
- function checkCMIBlank(value){
- if (value != ""){
- return "false";
- }
- else{
- return "true";
- }
- }
- /*
- * ----------------------------------------------------------------------------------------------------
- *
- * The CMI Client side data models
- *
- * ----------------------------------------------------------------------------------------------------
- */
- function CMIModel (){
- this._version = new CMIComponent("_version", "3.4", "readonly", "");
- this.core = new CMICoreModel;
- this.suspend_data = new CMIComponent("suspend_data", "", "both", "CMIString4096");
- this.launch_data = new CMIComponent("launch_data","","readonly", "CMIString4096");
- this.comments = new CMIComponent("comments","","both", "CMIString4096");
- this.comments_from_lms = new CMIComponent("comments_from_lms","","readonly", "CMIString4096");
- this.objectives = new ObjectivesModel;
- this.student_data = new StudentDataModel;
- this.student_preference = new StudentPreferenceModel;
- this.interactions = new InteractionsModel;
- }
- function CMICoreModel(){
- this._children = new CMIComponent("_children", "student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time", "readonly", "CMIString255");
- this.student_id = new CMIComponent("student_id", "", "readonly", "CMIIdentifier");
- this.student_name = new CMIComponent("student_name", "", "readonly", "CMIString255");
- this.lesson_location = new CMIComponent("lesson_location", "", "both", "CMIString255");
- this.credit = new CMIComponent("credit", "", "readonly", "CMIVocabularyCredit");
- this.lesson_status = new CMIComponent("lesson_status", "", "both", "CMIVocabularyStatus");
- this.entry = new CMIComponent("entry","","readonly", "CMIVocabularyEntry");
- this.score = new CMIScore;
- this.total_time = new CMIComponent("total_time", "", "readonly", "CMITimespan");
- this.lesson_mode = new CMIComponent("lesson_mode", "", "readonly", "CMIVocabularyMode");
- this.exit = new CMIComponent("exit", "", "writeonly", "CMIVocabularyExit");
- this.session_time = new CMIComponent("session_time", "", "writeonly", "CMITimespan");
- }
- function CMIScore(){
- this._children = new CMIComponent("_children", "raw,min,max", "readonly", "CMIString255");
- this.raw = new CMIComponent("raw", "", "both", "CMIDecimalOrCMIBlank");
- this.max = new CMIComponent("max", "", "both", "CMIDecimalOrCMIBlank");
- this.min = new CMIComponent("min", "", "both", "CMIDecimalOrCMIBlank");
- }
- function StudentPreferenceModel(){
- this._children = new CMIComponent("_children", "audio,language,speed,text", "readonly", "CMIString255");
- this.audio = new CMIComponent("audio", "0", "both", "CMISInteger");
- this.language = new CMIComponent("language", "", "both", "CMIString255");
- this.speed = new CMIComponent("speed", "0", "both", "CMISInteger");
- this.text = new CMIComponent("text", "0", "both", "CMISInteger");
- }
- function StudentDataModel(){
- this._children = new CMIComponent("_count", "mastery_score,max_time_allowed,time_limit_action", "readonly", "CMIString255");
- this.mastery_score = new CMIComponent("mastery_score", "", "readonly", "CMIDecimal");
- this.max_time_allowed = new CMIComponent("max_time_allowed", "", "readonly", "CMITimespan");
- this.time_limit_action = new CMIComponent("time_limit_action", "", "readonly", "CMIVocabularyTimeLimitAction");
- }
- /*
- * The CMI objectives model
- */
- function ObjectivesModel(){
- this._children = new CMIComponent("_children", "id,score,status", "readonly", "CMIString255");
- this._count = new CMIComponent("_count", 0, "readonly", "CMIInteger");
- this.objArray = ObjectiveArrayModel;
- this.objArr = new Array();
- }
- function ObjectiveArrayModel(index){
- if(index>this._count.cmivalue-1){
- if (index == this._count.cmivalue){
- // then create new one...
- this.objArr[index] = new singleObjectiveModel();
- this._count.cmivalue = this._count.cmivalue + 1;
- return this.objArr[index];
- }
- else{
- return "false";
- }
- }
- else{
- // we must be talking about this one so return object..
- return this.objArr[index];
- }
- }
- function singleObjectiveModel(){
- this.id = new CMIComponent("id", "", "both", "CMIIdentifier");
- this.score = new objectiveScoreModel;
- this.status = new CMIComponent("status", "", "both", "CMIVocabularyStatus");
- }
- function objectiveScoreModel(){
- this._children = new CMIComponent("_children", "raw,min,max", "readonly", "CMIString255");
- this.raw = new CMIComponent("raw", "", "both", "CMIDecimalOrCMIBlank");
- this.min = new CMIComponent("min", "", "both", "CMIDecimalOrCMIBlank");
- this.max = new CMIComponent("max", "", "both", "CMIDecimalOrCMIBlank");
- }
- /*
- * The CMI interactions model
- */
- function InteractionsModel(){
- this._children = new CMIComponent("_children", "id,objectives,time,type,correct_responses,weighting,student_response,result,latency", "readonly", "CMIString255");
- this._count = new CMIComponent("_count", 0, "readonly", "CMIInteger");
- this.intArray = InteractionsArrayModel;
- this.intArr = new Array();
- }
- function InteractionsArrayModel(index){
- if(index>this._count.cmivalue-1){
- if (index == this._count.cmivalue){
- // then create new one...
- this.intArr[index] = new singleInteractionModel();
- this._count.cmivalue = this._count.cmivalue + 1;
- return this.intArr[index];
- }
- else{
- return "false";
- }
- }
- else{
- // we must be talking about this one so return object..
- return this.intArr[index];
- }
- }
- function singleInteractionModel(){
- this.id = new CMIComponent("id", "", "writeonly", "CMIIdentifier");
- this.objectives = new ObjectivesInteractionModel;
- this.time = new CMIComponent("time", "", "writeonly", "CMITime");
- this.type = new CMIComponent("type", "", "writeonly", "CMIVocabularyInteraction");
- this.correct_responses = new CorrectResponsesInteractionModel;
- this.weighting = new CMIComponent("weighting", "", "writeonly", "CMIDecimal");
- this.student_response = new CMIComponent("student_response", "", "writeonly", "CMIFeedback");
- this.result = new CMIComponent("result", "", "writeonly", "CMIVocabularyResult");
- this.latency = new CMIComponent("latency", "", "writeonly", "CMITimespan");
- }
- function ObjectivesInteractionModel(){
- this._count = new CMIComponent("_count", 0, "readonly", "CMIInteger");
- this.objectivesInteractionArray = SingleObjectivesInteractionModel;
- this.objectivesInteractionArr = new Array();
- }
- function SingleObjectivesInteractionModel(index){
- if(index>this._count.cmivalue-1){
- if (index == this._count.cmivalue){
- // then create new one...
- this.objectivesInteractionArr[index] = new SingleItemObjectivesInteractionModel();
- this._count.cmivalue = this._count.cmivalue + 1;
- return this.objectivesInteractionArr[index];
- }
- else{
- return "false";
- }
- }
- else{
- // we must be talking about this one so return object..
- return this.objectivesInteractionArr[index];
- }
- }
- function SingleItemObjectivesInteractionModel(){
- this.id = new CMIComponent("id", "", "writeonly", "CMIIdentifier");
- }
- function CorrectResponsesInteractionModel(){
- this._count = new CMIComponent("_count", 0, "readonly", "CMIInteger");
- this.correctResponsesInteractionArray = SingleCorrectResponsesInteractionModel;
- this.correctResponsesInteractionArr = new Array();
- }
- function SingleCorrectResponsesInteractionModel(index){
- if(index>this._count.cmivalue-1){
- if (index == this._count.cmivalue){
- // then create new one...
- this.correctResponsesInteractionArr[index] = new SingleItemCorrectResponsesInteractionModel();
- this._count.cmivalue = this._count.cmivalue + 1;
- return this.correctResponsesInteractionArr[index];
- }
- else{
- return "false";
- }
- }
- else{
- // we must be talking about this one so return object..
- return this.correctResponsesInteractionArr[index];
- }
- }
- function SingleItemCorrectResponsesInteractionModel(){
- this.pattern = new CMIComponent("pattern", "", "writeonly", "CMIFeedback");
- }
- /*
- *
- *
- */
- function showCurrentModelState(infoOrForm){
- var divider = "";
- var titles = "";
- if (infoOrForm == "info"){
- divider = "\n";
- equals = "=";
- titles = "Current client CMI Datamodel\n\n";
- }
- else{
- equals = "~r@l@ad~";
- divider = "^r@l@ad^";
- titles = "";
- }
- a = "cmi.core.student_id" + equals + API.cmi.core.student_id.cmivalue + divider;
- b = "cmi.core.student_name" + equals + API.cmi.core.student_name.cmivalue + divider;
- c = "cmi.core.lesson_location" + equals + API.cmi.core.lesson_location.cmivalue + divider;
- d = "cmi.core.credit" + equals + API.cmi.core.credit.cmivalue + divider;
- e = "cmi.core.lesson_status" + equals + API.cmi.core.lesson_status.cmivalue + divider;
- f = "cmi.core.entry" + equals + API.cmi.core.entry.cmivalue + divider;
- g = "cmi.core.score.raw" + equals + API.cmi.core.score.raw.cmivalue + divider;
- h = "cmi.core.score.max" + equals + API.cmi.core.score.max.cmivalue + divider;
- i = "cmi.core.score.min" + equals + API.cmi.core.score.min.cmivalue + divider;
- j = "cmi.core.total_time" + equals + API.cmi.core.total_time.cmivalue + divider;
- k = "cmi.core.lesson_mode" + equals + API.cmi.core.lesson_mode.cmivalue + divider;
- l = "cmi.core.exit" + equals + API.cmi.core.exit.cmivalue + divider;
- m = "cmi.core.session_time" + equals + API.cmi.core.session_time.cmivalue + divider;
- n = "cmi.suspend_data" + equals + API.cmi.suspend_data.cmivalue + divider;
- o = "cmi.launch_data" + equals + API.cmi.launch_data.cmivalue + divider;
- p = "cmi.comments" + equals + API.cmi.comments.cmivalue + divider;
- q = "cmi.comments_from_lms" + equals + API.cmi.comments_from_lms.cmivalue + divider;
- r = "cmi.objectives._count" + equals + API.cmi.objectives._count.cmivalue + divider;
- var s = "";
- var objectivesCount = API.cmi.objectives._count.cmivalue;
- for (count=0; count < objectivesCount; count++){
- objHandle = API.cmi.objectives.objArray(count);
- idval = objHandle.id.cmivalue;
- scoreRaw = objHandle.score.raw.cmivalue;
- scoreMax = objHandle.score.max.cmivalue;
- scoreMin = objHandle.score.min.cmivalue;
- statval = objHandle.status.cmivalue;
- s = s + "cmi.objectives." + count + ".id" + equals + idval + divider;
- s = s + "cmi.objectives." + count + ".score.raw" + equals + scoreRaw + divider;
- s = s + "cmi.objectives." + count + ".score.max" + equals + scoreMax + divider;
- s = s + "cmi.objectives." + count + ".score.min" + equals + scoreMin + divider;
- s = s + "cmi.objectives." + count + ".status" + equals + statval + divider;
- }
- v = "cmi.student_data.mastery_score" + equals + API.cmi.student_data.mastery_score.cmivalue + divider;
- w = "cmi.student_data.max_time_allowed" + equals + API.cmi.student_data.max_time_allowed.cmivalue + divider;
- x = "cmi.student_data.time_limit_action" + equals + API.cmi.student_data.time_limit_action.cmivalue + divider;
- y = "cmi.student_preference.audio" + equals + API.cmi.student_preference.audio.cmivalue + divider;
- z = "cmi.student_preference.language" + equals + API.cmi.student_preference.language.cmivalue + divider;
- zz = "cmi.student_preference.speed" + equals + API.cmi.student_preference.speed.cmivalue + divider;
- zzz = "cmi.student_preference.text" + equals + API.cmi.student_preference.text.cmivalue + divider;
- t = "cmi.interactions._count" + equals + API.cmi.interactions._count.cmivalue + divider;
- var u = "";
- var interactionsCount = API.cmi.interactions._count.cmivalue
- for (intcount=0; intcount < interactionsCount; intcount++){
- intHandle = API.cmi.interactions.intArray(intcount);
- idval = intHandle.id.cmivalue;
- u = u + "cmi.interactions." + intcount + ".id" + equals + idval + divider;
- interObjCount = intHandle.objectives._count.cmivalue;
- u = u + "cmi.interactions." + intcount + ".objectives._count" + equals + interObjCount + divider;
- for (objcount=0; objcount < interObjCount; objcount++){
- interactionObjectiveHandle = intHandle.objectives.objectivesInteractionArray(objcount);
- objid = interactionObjectiveHandle.id.cmivalue;
- u = u + "cmi.interactions." + intcount + ".objectives." + objcount + ".id" + equals + objid + divider;
- }
- srCount = intHandle.correct_responses._count.cmivalue;
- u = u + "cmi.interactions." + intcount + ".correct_responses._count" + equals + srCount + divider;
- for (objcount=0; objcount < srCount; objcount++){
- interactionSRHandle = intHandle.correct_responses.correctResponsesInteractionArray(objcount);
- patternid = interactionSRHandle.pattern.cmivalue;
- u = u + "cmi.interactions." + intcount + ".correct_responses." + objcount + ".pattern" + equals + patternid + divider;
- }
- timeval = intHandle.time.cmivalue;
- u = u + "cmi.interactions." + intcount + ".time" + equals + timeval + divider;
- typeval = intHandle.type.cmivalue;
- u = u + "cmi.interactions." + intcount + ".type" + equals + typeval + divider;
- weightingval = intHandle.weighting.cmivalue;
- u = u + "cmi.interactions." + intcount + ".weighting" + equals + weightingval + divider;
- student_responseval = intHandle.student_response.cmivalue;
- u = u + "cmi.interactions." + intcount + ".student_response" + equals + student_responseval + divider;
- resultval = intHandle.result.cmivalue;
- u = u + "cmi.interactions." + intcount + ".result" + equals + resultval + divider;
- latencyval = intHandle.latency.cmivalue;
- u = u + "cmi.interactions." + intcount + ".latency" + equals + latencyval + divider;
- }
- var alertString = titles+a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p+q+r+s+v+w+x+y+z+zz+zzz+t+u;
- return alertString;
- }
- /*
- * a function used in debug mode to see the current cmi model
- */
- function viewModel(){
- return showCurrentModelState("info");
- }
- function xmlhttpPost(strURL,oggetto,valore,
- oggetto2,valore2,
- oggetto3,valore3,
- oggetto4,valore4,
- oggetto5,valore5,
- oggetto6,valore6,
- oggetto7,valore7,
- oggetto8,valore8,
- oggetto9,valore9,
- oggetto10,valore10)
- {
- if(oggetto == 'save'){
- document.getElementById('saving-load').innerHTML = 'LOADING...';
- }
- //Inizializzo l'oggetto xmlHttpReq
- var xmlHttpReq = false;
- var self = this;
- // qui valutiamo la tipologia di browser utilizzato per selezionare la tipologia di oggetto da creare.
- // Se sono in un browser Mozilla/Safari, utilizzo l'oggetto XMLHttpRequest per lo scambio di dati tra browser e server.
- if (window.XMLHttpRequest) {
- self.xmlHttpReq = new XMLHttpRequest();
- }
- // Se sono in un Browser di Microsoft (IE), utilizzo Microsoft.XMLHTTP
- //che rappresenta la classe di riferimento per questo browser
- else if (window.ActiveXObject) {
- self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
- }
- //Apro il canale di connessione per regolare il tipo di richiesta.
- //Passo come parametri il tipo di richiesta, url e se è o meno un operazione asincrona (isAsync)
- self.xmlHttpReq.open('POST', strURL+'?'
- +oggetto+'='+valore
- +'&'+oggetto2+'='+valore2
- +'&'+oggetto3+'='+valore3
- +'&'+oggetto4+'='+valore4
- +'&'+oggetto5+'='+valore5
- +'&'+oggetto6+'='+valore6
- +'&'+oggetto7+'='+valore7
- +'&'+oggetto8+'='+valore8
- +'&'+oggetto9+'='+valore9
- +'&'+oggetto10+'='+valore10
- , true);
- //setto l'header dell'oggetto
- self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
- //Passo alla richiesta i valori del form in modo da generare l'output desiderato
- self.xmlHttpReq.send();
- //Valuto lo stato della richiesta
- self.xmlHttpReq.onreadystatechange = function()
- {
- //Gli stai di una richiesta possono essere 5 * 0 - UNINITIALIZED * 1 - LOADING * 2 - LOADED * 3 - INTERACTIVE * 4 - COMPLETE
- //Se lo stato è completo
- if (self.xmlHttpReq.readyState == 4) {
- //Aggiorno la pagina con la risposta ritornata dalla precendete richiesta dal web server.Quando la richiesta è terminata il responso della richiesta è disponibie come responseText.
- var stringa = self.xmlHttpReq.responseText;
- var str = stringa.split('|*|');
- //alert(stringa);
- if(oggetto == 'save'){
- if(stringa == ''|| stringa == 'OK'){
- document.getElementById('saving-load').innerHTML = 'SAVED';
- }else{
- alert(stringa);
- alert('Errore di salvataggio per temporanea interruzione di rete.\nQuesto passaggio non verrà memorizzato');
- }
- }
- }
- }
- }
- //---------------------------------
- var ore = 0;
- var minuti = 0;
- var secondi = 0;
- var stop = true;
- function startCrono()
- {
- if(stop == true)
- {
- stop = false;
- setInterval("crono()", 1000);
- }
- }
- function crono()
- {
- if(stop == false)
- {
- if(secondi > 59)
- {
- secondi = 0;
- minuti++;
- }
- if(minuti > 59)
- {
- minuti = 0;
- ore++;
- }
- secondi++;
- showCrono();
- }
- }
- function showCrono()
- {
- var hh = '';
- var mm = '';
- var ss = '';
- if(ore < 10){
- hh = "0"+ore;
- }else{
- hh = ""+ore;
- }
- if(minuti < 10){
- mm = "0"+minuti;
- }else{
- mm = ""+minuti;
- }
- if(secondi < 10){
- ss = "0"+secondi;
- }else{
- ss = ""+secondi;
- }
- var time = ''+hh+':'+mm+':'+ss;
- document.getElementById("cronometro").innerHTML = time;
- //saveTime(time);
- }
- function saveTime(time)
- {
- xmlhttpPost('http://eni-learning.com/php-custom/ajax/save-scorm.php','save','save',
- 'id_u','29448',
- 'id_l','6',
- 'id_sc_e','41',
- 'name','cmi.core.session_time_custom',
- 'value',time);
- }
- function stopCrono()
- {
- stop = true;
- }
- function azzeraCrono()
- {
- if(stop == false)
- {
- stop = true;
- }
- ore = minuti = secondi;
- showCrono();
- }
- </script>
- </head>
- <body>
- <!--<p style="text-align:center;margin:0;margin-top:-20px;margin-bottom:0;padding:0">
- <input type="button" class="button medium alt-button primary" value="< TORNA AL MENU DEL CORSO" onclick="window.open('player','_self');">
- </p>-->
- <div id="container" style="margin:0;padding:0;">
- <!--<div class="align-right version">v<script>document.write(_VERSION);</script></div>-->
- <div id="links" style="display:none;">
- <b><a href="javascript:void(0);" onclick="$('debug').innerHTML=''; Utils.clearCookieData();Utils.launchSCO(); return false;">Launch SCO</a></b> |
- <a href="javascript:void(0);" onclick="Utils.clearCookieData(); return false;">Clear Storage</a> |
- <a href="javascript:void(0);" onclick="$('debug').innerHTML=''; return false;">Clear Event Log</a> |
- <a href="javascript:void(0);" onclick="document.location=document.location.href;return false;">Refresh Page</a>
- </div>
- <div style="position:relative;left:5%;width:90%;">
- <!--<fieldset>
- <legend>Options <b>( <a href="javascript:void(0);" onclick="Utils.toggleDisplay('optionSet'); return false;">Toggle</a> )</b></legend>-->
- <div id="optionSet">
- <div style="display:none;">
- <div class="tblRowInstructions">Enter the name of the storage to use for this session (or to clear using the option above):</div>
- <div class="tblRow">
- <div class="tblRowHeader">Storage Name:</div>
- <input type="text" id="cookieNameAlt" size="50">
- <a href="javascript:void(0);" onclick="Utils.genNewSessionName(); return false;" class="actionLink">Generate New Name</a>
- </div>
- <div class="tblRowInstructions">Enter the full/relative path/filename for the SCO's launch file. The default is currently "<script>document.write(launchFile);</script>". Populated automatically if IMS manifest is present:</div>
- </div>
- <div class="tblRow" style="display:none;">
- <select style="background-color:#ccc" onChange="window.open('http://eni-learning.com/player/?id_sc='+this.value,'_self')">
- <option value="">seleziona...</option>
- <option value="93"
- >
- "S-drammatizziamo il colloquio di lavoro" </option>
- <option value="94"
- >
- "S-drammatizziamo il colloquio di lavoro" </option>
- <option value="112"
- >
- Artisti a confronto sui problemi della conservazione </option>
- <option value="65"
- >
- “Eni in a day”: un lungo ed emozionante viaggio in Eni </option>
- <option value="48"
- >
- Come si misura la sicurezza </option>
- <option value="10"
- >
- Come siamo organizzati </option>
- <option value="45"
- >
- Concetti di sicurezza: rischio, pericolo e conseguenza </option>
- <option value="54"
- >
- Conclusioni </option>
- <option value="58"
- >
- Congo - Progetto Integrato Hinda. Dallo sviluppo infrastrutturale allo sviluppo umano </option>
- <option value="71"
- >
- Cos'è l'energia </option>
- <option value="87"
- >
- Energia e geopolitica </option>
- <option value="72"
- >
- Energie rinnovabili </option>
- <option value="84"
- >
- Energy supply: OIL. An introduction to the Oil and Gas Industry </option>
- <option value="69"
- >
- Energy: what is it? </option>
- <option value="43"
- >
- Eni strategy </option>
- <option value="73"
- >
- Gli idrocarburi </option>
- <option value="96"
- >
- I cambiamenti climatici </option>
- <option value="53"
- >
- I dispositivi di protezione individuali </option>
- <option value="64"
- >
- I mestieri della sicurezza </option>
- <option value="41"
- selected >
- Il Codice Etico </option>
- <option value="74"
- >
- Il prezzo del greggio </option>
- <option value="95"
- >
- Il processo di selezione e il colloquio di lavoro </option>
- <option value="111"
- >
- Il restauro dell'arte contemporanea: tra la materia e la metodologia </option>
- <option value="75"
- >
- Il trasporto dell'energia </option>
- <option value="83"
- >
- Introduction to Energy Sources and Energy Balances </option>
- <option value="44"
- >
- Introduzione alla sicurezza </option>
- <option value="89"
- >
- La divulgazione dell'informazione scientifica </option>
- <option value="88"
- >
- La formazione continua e le competenze trasversali </option>
- <option value="47"
- >
- La normativa vigente in materia di salute e sicurezza sul lavoro </option>
- <option value="86"
- >
- La normativa vigente in materia di salute e sicurezza sul lavoro </option>
- <option value="51"
- >
- La nostra storia </option>
- <option value="113"
- >
- La Quadriennale di arte contemporanea 2016 </option>
- <option value="56"
- >
- La ricerca in Eni </option>
- <option value="40"
- >
- La sicurezza in Eni </option>
- <option value="57"
- >
- La sostenibilità in Eni </option>
- <option value="59"
- >
- La storia di Amran </option>
- <option value="37"
- >
- Le attività di approvvigionamento, fornitura, compravendita e trasporto di olio, gas e altri prodotti petroliferi </option>
- <option value="32"
- >
- Le attività di ricerca, perforazione e produzione </option>
- <option value="36"
- >
- Le attività legate alla raffinazione, distribuzione e commercializzazione dei prodotti petroliferi </option>
- <option value="9"
- >
- Le attività legate alla vendita di gas, luce e servizi </option>
- <option value="16"
- >
- Le nostre professionalità </option>
- <option value="79"
- >
- Le strategie della ricerca </option>
- <option value="76"
- >
- Motivazione intrinseca: l'utilizzo delle competenze per il raggiungimento dei risultati </option>
- <option value="66"
- >
- Nigeria - Green River Project. Sviluppo socio-economico sostenibile </option>
- <option value="97"
- >
- nuova 1 </option>
- <option value="98"
- >
- nuova 2 </option>
- <option value="102"
- >
- nuova 2 </option>
- <option value="99"
- >
- nuova 3 </option>
- <option value="103"
- >
- nuova 3 </option>
- <option value="104"
- >
- nuova 3 </option>
- <option value="105"
- >
- nuova 3 </option>
- <option value="106"
- >
- nuova 3 </option>
- <option value="107"
- >
- nuova 3 </option>
- <option value="70"
- >
- Oduroh </option>
- <option value="110"
- >
- Progettare un evento culturale: Eni Q16 </option>
- <option value="67"
- >
- Scenari energetici </option>
- <option value="100"
- >
- Sulla teoria del restauro: tra arte antica e arte contemporanea </option>
- <option value="101"
- >
- Sulla teoria del restauro: tra arte antica e arte contemporanea </option>
- <option value="82"
- >
- Test Finale </option>
- <option value="92"
- >
- Test Finale </option>
- <option value="39"
- >
- Test valutativo di fine modulo </option>
- <option value="68"
- >
- Test valutativo di fine modulo </option>
- <option value="80"
- >
- Test valutativo di fine modulo </option>
- <option value="91"
- >
- Test valutativo di fine modulo </option>
- <option value="77"
- >
- The quest: energy, security and the remaking of the modern world </option>
- <option value="90"
- >
- Vitamine per le idee </option>
- <option value="20"
- >
- x </option>
- <option value="21"
- >
- x </option>
- <option value="23"
- >
- x </option>
- </select>
- <input type="hidden" id="launchFileAlt" value="http://eni-learning.com/php-custom/upload/files/---6---01-02-il-codice-etico/index.html">
- <select style="background-color:#ccc" onChange="window.open('http://eni-learning.com/player/?id_sc=41&id_sc_e='+this.value,'_self')">
- <option value="">seleziona...</option>
- <option value="41"
- selected >
- </option>
- </select>
- <script>//$('debug').innerHTML='';Utils.clearCookieData();</script>
- <b><a href="javascript:void(0);" onclick="Utils.launchSCO(); return false;">Launch SCO</a></b>
- </div>
- <!-- ------------------------------------------------------------------ -->
- <div >
- <a name="init"></a>
- <div style="clear:both;width:100%">
- <div style="float:left;width:70%;">
- <h2>Il Codice Etico</h2>
- </div>
- <div style="float:right;">
- <input type="button" class="button medium alt-button primary" value="< TORNA AL MENU DEL CORSO" onclick="window.open('http://eni-learning.com/corso','_self');">
- </div>
- <iframe id="ifr-scorm" name="ifr-scorm" src="" width="100%" height="650" style="background:url(http://eni-learning.com/php-custom/img/preloader_transparent.gif) center 32px no-repeat;background-size:64px;border:1px solid #fc0;" frameborder="0"></iframe>
- </div>
- <div id="saving-load" style="padding:10px;background-color:#ccc;display:none;">...</div>
- <!-- ------------------------------------------------------------------ -->
- <div style="display:none;">
- <div class="tblRowInstructions">Override the default window options (Default values can be changed in the source):</div>
- <div class="tblRow"><div class="tblRowHeader">Width:</div><input type="text" id="winW" size="10"></div>
- <div class="tblRow"><div class="tblRowHeader">Height:</div><input type="text" id="winH" size="10"></div>
- <div class="tblRow">
- <div class="tblRowHeader">Features:</div>
- <div class="inlineOption">
- <label for="wToolbarOption">Toolbar</label>
- <input type="checkbox" id="wToolbarOption" onclick="Utils.toggleWindowOption('wToolbar',this);">
- </div>
- <div class="inlineOption">
- <label for="wTitlebarOption">Titlebar</label>
- <input type="checkbox" id="wTitlebarOption" onclick="Utils.toggleWindowOption('wTitlebar',this);">
- </div>
- <div class="inlineOption">
- <label for="wLocationOption">Location</label>
- <input type="checkbox" id="wLocationOption" onclick="Utils.toggleWindowOption('wLocation',this);">
- </div>
- <div class="inlineOption">
- <label for="wStatusOption">Statusbar</label>
- <input type="checkbox" id="wStatusOption" onclick="Utils.toggleWindowOption('wStatus',this);">
- </div>
- <div class="inlineOption">
- <label for="wScrollbarsOption">Scrollbars</label>
- <input type="checkbox" id="wScrollbarsOption" onclick="Utils.toggleWindowOption('wScrollbars',this);">
- </div>
- <div class="inlineOption">
- <label for="wMenubarOption">Menubar</label>
- <input type="checkbox" id="wMenubarOption" onclick="Utils.toggleWindowOption('wMenubar',this);">
- </div>
- <div class="inlineOption">
- <label for="wResizableOption">Resizable</label>
- <input type="checkbox" id="wResizableOption" onclick="Utils.toggleWindowOption('wResizable',this);">
- </div>
- <div class="optionGroup">
- <a href="#" onclick="Utils.enableAllWindowOptions();return false;">Select All</a> | <a href="#" onclick="Utils.disableAllWindowOptions();return false;">Deselect All</a>
- </div>
- </div>
- <div class="tblRowInstructions">SimpleAPI behavioral settings:</div>
- <div class="tblRow">
- <input type="checkbox" id="closeOnFinishOption" onclick="Utils.toggleCloseOnFinishOption(this.checked);">
- <label for="closeOnFinishOption">Close SCO on LMSFinish</label>
- </div>
- <div class="tblRow">
- <input type="checkbox" id="toggleEmbeddedOption" onclick="Utils.toggleEmbeddedParam(this.checked);">
- <label for="toggleEmbeddedOption">Launch with custom search string appended to launch file: </label>
- <input type="text" id="searchString" size="50">
- </div>
- <div class="tblRow">
- <input type="checkbox" id="toggleCustomKeyValueOption" onclick="Utils.toggleCustomKeyValueOption(this.checked);">
- <label for="toggleCustomKeyValueOption">Launch with custom key/value pair injected into API object: </label>
- <input type="text" id="customApiKey" size="30"> = <input type="text" id="customApiValue" size="30">
- </div>
- </div>
- </div>
- <!--</fieldset>-->
- </div>
- <div style="display:none;" >
- <fieldset>
- <legend>CONTENUTI</legend>
- <div id="manifest" style="font-size:10px;overflow:scroll;width:100%;height:300px;">
- <br>/var/www/html/php-custom/upload/files/---6---01-02-il-codice-etico/imsmanifest.xml<br>il file /var/www/html/php-custom/upload/files/---6---01-02-il-codice-etico/imsmanifest.xml esiste<strong>metadata (1)</strong><ul><li><a href="http://eni-learning.com/php-custom/upload/files/---6---01-02-il-codice-etico/">ADL SCORM</a></li></ul><strong>organizations (1)</strong><ul><li><a href="http://eni-learning.com/php-custom/upload/files/---6---01-02-il-codice-etico/">
- </a><ul><li><a href="http://eni-learning.com/php-custom/upload/files/---6---01-02-il-codice-etico/">ENI</a><ul><li><a href="#">Lezione Video</a><a href="#">sco-1</a></li></ul></li></ul></li></ul><strong>resources (1)</strong><ul><li><a href="http://eni-learning.com/php-custom/upload/files/---6---01-02-il-codice-etico/">
- </a><ul><li>sco-1 - - <a href="javascript:void(0);" onclick="document.getElementById('launchFileAlt').value = 'http://eni-learning.com/php-custom/upload/files/---6---01-02-il-codice-etico/index.html'; Utils.launchSCO(); return false;"><strong>index.html</strong></a></li></ul></li></ul> </div>
- </fieldset>
- <fieldset>
- <legend>Event Log <b>( <a href="javascript:void(0);" onclick="Utils.toggleDisplay('debug'); return false;">Toggle</a> | <a href="javascript:void(0);" onclick="Utils.dumpAPI(); return false;">Dump Current API Object</a> )</b></legend>
- <div id="debug" style="font-size:10px;overflow:scroll;width:100%;height:300px;"></div>
- </fieldset>
- </div>
- </div>
- <div id="cronometro" style="text-align:center;display:none;">00:00:00</div>
- <script>
- startCrono();
- </script>
- </body>
- </html>
- <div id="login" class="mfp-hide mfp-content-inner lightbox-white" style="max-width:400px;padding:20px">
- <!doctype html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>Documento senza titolo</title>
- <script src="http://eni-learning.com/php-custom/language/it.js" type="text/javascript"></script>
- <script>
- var path_principale = 'http://eni-learning.com/';
- var path_totale = 'http://eni-learning.com/php-custom/';
- </script>
- <script src="http://eni-learning.com/php-custom/js/actions-login.js"></script>
- </head>
- <body>
- <div style="margin-top:25%;padding:50px;width:100%;height:50%;background-color:rgba(255,255,255,0.5);font-size:24px;">
- <!--<img src="img/icon-community.png" height="64" alt=""/>-->
- <p style="color:#000;">Ciao <strong>1811-05</strong> | <a style="color:#fff;font-weight:bold;" href="http://eni-learning.com/php-custom/logout.php?url=eni-learning.com/player/?id_l=6&id_sc=41">Esci</a><br>
- <input type="submit" class="" style="height:50px;font-size:18px;width:100%;color:#000;font-weight:bold;" value="VAI AL CORSO" onClick="window.open('http://eni-learning.com/corso','_self')"/>
- </p>
- </div>
- <script>
- var html = '<img id="avatar-img" class="img-big" src="http://eni-learning.com/php-custom/img/icon-community.png" style="height:16px;">';
- html += ' <strong style="font-size:14px;">1811-05</strong> ';
- html += '| <a href="http://eni-learning.com/php-custom/logout.php?url=eni-learning.com/player/?id_l=6&id_sc=41"><u>esci</u></a>';
- document.getElementById('menu-top-bar-menu').innerHTML = html;
- </script>
- </body>
- </html>
- </div><!-- Lightbox-login -->
- <script>
- jQuery(document).ready(function($) {
- $('a[href="#login"]').click(function(e){
- // Close openend lightboxes
- var delay = 0;
- if($.magnificPopup.open){
- $.magnificPopup.close();
- delay = 300;
- }
- // Start lightbox
- setTimeout(function(){
- $.magnificPopup.open({
- midClick: true,
- removalDelay: 300,
- items: {
- src: '#login',
- type: 'inline'
- }
- });
- }, delay);
- e.preventDefault();
- });
- });
- </script>
- <div id="login-guest" class="mfp-hide mfp-content-inner lightbox-white" style="max-width:400px;padding:20px">
- <!doctype html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>Documento senza titolo</title>
- <script src="http://eni-learning.com/php-custom/language/it.js" type="text/javascript"></script>
- <script>
- var path_principale = 'http://eni-learning.com/';
- var path_totale = 'http://eni-learning.com/php-custom/';
- </script>
- <script src="http://eni-learning.com/php-custom/js/actions-login.js"></script>
- </head>
- <body>
- <div style="padding:20px;width:100%;height:100%;background-color:rgba(255,255,255,0.5);">
- <form name="form_login" method="post" onSubmit="login('eni-learning.com/player/?id_l=6&id_sc=41'); return false; return false; ">
- <p span style="font-size:36px;font-weight:bold;color:#000">INIZIA IL CORSO</p>
- <p style="font-size:22px;color:#000">Accedi subito alle tue lezioni</p>
- <input id="user" name="user" type="text" placeholder="username" value="" style="height:50px;font-size:18px;"/><br />
- <input id="pass" name="pass" type="password" placeholder="password" value="" style="height:50px;font-size:18px;"/><br />
- <input type="submit" class="" style="height:50px;font-size:18px;width:100%;color:#000;font-weight:bold;" name="invia" value="ACCEDI ALLE LEZIONI"/>
- </form>
- <div id="mess"></div>
- </div>
- <!--<a href="</a>-->
- <script src="http://eni-learning.com/php-custom/js/placeholders.min.js"></script>
- </body>
- </html>
- </div><!-- Lightbox-login-guest -->
- <script>
- jQuery(document).ready(function($) {
- $('a[href="#login-guest"]').click(function(e){
- // Close openend lightboxes
- var delay = 0;
- if($.magnificPopup.open){
- $.magnificPopup.close();
- delay = 300;
- }
- // Start lightbox
- setTimeout(function(){
- $.magnificPopup.open({
- midClick: true,
- removalDelay: 300,
- items: {
- src: '#login-guest',
- type: 'inline'
- }
- });
- }, delay);
- e.preventDefault();
- });
- });
- </script>
- </div><!-- #content -->
- </div><!-- .row -->
- </div><!-- .page-wrapper -->
- </div><!-- #main-content -->
- <footer class="footer-wrapper" role="contentinfo">
- <!-- FOOTER 1 -->
- <!-- FOOTER 2 -->
- <div class="absolute-footer dark" style="background-color:#535151">
- <div class="row">
- <div class="large-12 columns">
- <div class="center">
- <div class="copyright-footer">Copyright<sup>©</sup>2016 - </strong>Eni S.p.A. - P.IVA 00905811006 </strong>| <a href='http://eni-learning.com/termini-e-condizioni/'>Termini e Condizioni</a> | <a href='http://eni-learning.com/privacy-policy/'>Privacy policy</a> | <a href='http://eni-learning.com/cookie-policy/'>Cookie policy</a></div>
- </div><!-- .left -->
- <div class="right">
- </div>
- </div><!-- .large-12 -->
- </div><!-- .row-->
- </div><!-- .absolute-footer -->
- </footer><!-- .footer-wrapper -->
- </div><!-- #wrapper -->
- <!-- back to top -->
- <a href="#top" id="top-link"><span class="icon-angle-up"></span></a>
- <div id="cookie-law-info-bar"><span>Questo sito utilizza i cookie per migliorare la tua esperienza di navigazione e i nostri servizi. Continuando ad utilizzare questo sito si acconsente all'utilizzo dei cookie.<a href="#" id="cookie_action_close_header" class="medium cli-plugin-button cli-plugin-main-button" >Accetto</a> <a href="http://eni-learning.com/cookie-policy/" id="CONSTANT_OPEN_URL" target="_blank" class="cli-plugin-main-link" >Privacy policy</a></span></div><div id="cookie-law-info-again"><span id="cookie_hdr_showagain">Privacy & Cookies Policy</span></div>
- <script type="text/javascript">
- //<![CDATA[
- jQuery(document).ready(function() {
- cli_show_cookiebar({
- settings: '{"animate_speed_hide":"500","animate_speed_show":"500","background":"#000000","border":"#444","border_on":false,"button_1_button_colour":"#f2d100","button_1_button_hover":"#c2a700","button_1_link_colour":"#000000","button_1_as_button":true,"button_2_button_colour":"#000000","button_2_button_hover":"#000000","button_2_link_colour":"#f2d100","button_2_as_button":false,"font_family":"Trebuchet MS, sans-serif","header_fix":false,"notify_animate_hide":true,"notify_animate_show":false,"notify_div_id":"#cookie-law-info-bar","notify_position_horizontal":"right","notify_position_vertical":"bottom","scroll_close":false,"scroll_close_reload":false,"showagain_tab":true,"showagain_background":"#fff","showagain_border":"#000","showagain_div_id":"#cookie-law-info-again","showagain_x_position":"100px","text":"#ffffff","show_once_yn":false,"show_once":"10000"}'
- });
- });
- //]]>
- </script>
- <!-- Mobile Popup -->
- <div id="jPanelMenu" class="mfp-hide">
- <div class="mobile-sidebar">
- <ul class="mobile-main-menu">
- <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-714"><a href="http://eni-learning.com/progetto/">Progetto</a></li>
- <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-733"><a href="http://eni-learning.com/contenuti/">Contenuti</a></li>
- <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-737"><a href="http://eni-learning.com/corso/">Corso</a></li>
- <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-959"><a href="http://eni-learning.com/faq/">Faq</a></li>
- <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-715"><a href="http://eni-learning.com/contatti/">Contatti</a></li>
- </ul>
- <ul class="top-bar-mob">
- </ul>
- <ul class="html-blocks">
- <li class="html-block">
- </li>
- </ul>
- </div><!-- inner -->
- </div><!-- #mobile-menu -->
- <script type='text/javascript'>
- /* <![CDATA[ */
- var wc_add_to_cart_params = {"ajax_url":"\/wp-admin\/admin-ajax.php","wc_ajax_url":"\/player\/?id_l=6&id_sc=41&wc-ajax=%%endpoint%%","i18n_view_cart":"Vedi il carrello","cart_url":"http:\/\/eni-learning.com","is_cart":"","cart_redirect_after_add":"no"};
- /* ]]> */
- </script>
- <script type='text/javascript' src='//eni-learning.com/wp-content/plugins/woocommerce/assets/js/frontend/add-to-cart.min.js?ver=2.6.13'></script>
- <script type='text/javascript' src='//eni-learning.com/wp-content/plugins/woocommerce/assets/js/jquery-blockui/jquery.blockUI.min.js?ver=2.70'></script>
- <script type='text/javascript'>
- /* <![CDATA[ */
- var woocommerce_params = {"ajax_url":"\/wp-admin\/admin-ajax.php","wc_ajax_url":"\/player\/?id_l=6&id_sc=41&wc-ajax=%%endpoint%%"};
- /* ]]> */
- </script>
- <script type='text/javascript' src='//eni-learning.com/wp-content/plugins/woocommerce/assets/js/frontend/woocommerce.min.js?ver=2.6.13'></script>
- <script type='text/javascript' src='//eni-learning.com/wp-content/plugins/woocommerce/assets/js/jquery-cookie/jquery.cookie.min.js?ver=1.4.1'></script>
- <script type='text/javascript'>
- /* <![CDATA[ */
- var wc_cart_fragments_params = {"ajax_url":"\/wp-admin\/admin-ajax.php","wc_ajax_url":"\/player\/?id_l=6&id_sc=41&wc-ajax=%%endpoint%%","fragment_name":"wc_fragments"};
- /* ]]> */
- </script>
- <script type='text/javascript' src='//eni-learning.com/wp-content/plugins/woocommerce/assets/js/frontend/cart-fragments.min.js?ver=2.6.13'></script>
- <script type='text/javascript' src='http://eni-learning.com/wp-content/themes/flatsome/js/modernizr.js?ver=2.8.5'></script>
- <script type='text/javascript' src='http://eni-learning.com/wp-content/themes/flatsome/js/flatsome-plugins.js?ver=2.8.5'></script>
- <script type='text/javascript'>
- /* <![CDATA[ */
- var ajaxURL = {"ajaxurl":"http:\/\/eni-learning.com\/wp-admin\/admin-ajax.php"};
- /* ]]> */
- </script>
- <script type='text/javascript' src='http://eni-learning.com/wp-content/themes/flatsome/js/flatsome-theme.js?ver=2.8.5'></script>
- <script type='text/javascript' src='http://eni-learning.com/wp-content/themes/flatsome/js/flatsome-woocommerce.js?ver=2.8.5'></script>
- <script type='text/javascript' src='http://eni-learning.com/wp-includes/js/wp-embed.min.js?ver=4.4.2'></script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement