PageSourceSearch

https://cdn.cmrad.com/js/5314.1e8a315d6a1fe005.js

js cmrad.com collected 2026-09-24 09:31:36 UTC 16,461 bytes, 3 lines download raw bytes

vendor: 5,828 bytes, lines 1-2
1/*! For license information please see 5314.1e8a315d6a1fe005.js.LICENSE.txt */
2"use strict";(self.webpackChunk_cmrad_cmrad=self.webpackChunk_cmrad_cmrad||[]).push([[5314],{50438:function(t,e,r){var n=r(27897),i=r.n(n),o=r(1519),a=r.n(o)()(i());a.push([t.id,'[data-v-0b4afc46] table td .actions{white-space:nowrap}[data-v-0b4afc46] table td[aria-colindex="7"]{padding:.75rem .3rem}[data-v-0b4afc46] .project-title:hover{color:inherit}',"",{version:3,sources:["webpack://./resources/js/Organisms/Admin/QuizesTableNew.vue"],names:[],mappings:"AAGI,oCACE,kBAFN,CAKI,8CACE,oBAHN,CAOE,uCACE,aALJ",sourcesContent:["\n::v-deep {\n  table td {\n    .actions {\n      white-space: nowrap;\n    }\n\n    &[aria-colindex='7'] {\n      padding: 0.75rem 0.3rem;\n    }\n  }\n\n  .project-title:hover {\n    color: inherit;\n  }\n}\n"],sourceRoot:""}]),e.Z=a},5314:function(t,e,r){r.r(e),r.d(e,{default:function(){return x}});var n=r(20629),i=r(42298),o=r(23855),a=r(96556),s=r(8901),c=r.n(s),u=r(97551);function l(t){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l(t)}function f(){f=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,i){var o=e&&e.prototype instanceof h?e:h,a=Object.create(o.prototype),s=new C(i||[]);return n(a,"_invoke",{value:k(t,r,s)}),a}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var p={};function h(){}function v(){}function m(){}var g={};c(g,o,(function(){return this}));var y=Object.getPrototypeOf,b=y&&y(y(P([])));b&&b!==e&&r.call(b,o)&&(g=b);var w=m.prototype=h.prototype=Object.create(g);function _(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function i(n,o,a,s){var c=d(t[n],t,o);if("throw"!==c.type){var u=c.arg,f=u.value;return f&&"object"==l(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){i("next",t,a,s)}),(function(t){i("throw",t,a,s)})):e.resolve(f).then((function(t){u.value=t,a(u)}),(function(t){return i("throw",t,a,s)}))}s(c.arg)}var o;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){i(t,r,e,n)}))}return o=o?o.then(n,n):n()}})}function k(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return E()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=z(a,r);if(s){if(s===p)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=d(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===p)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function z(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,z(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),p;var i=d(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,p;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,p):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,p)}function j(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}function P(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:E}}function E(){return{value:void 0,done:!0}}return v.prototype=m,n(w,"constructor",{value:m,configurable:!0}),n(m,"constructor",{value:v,configurable:!0}),v.displayName=c(m,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,c(t,s,"GeneratorFunction")),t.prototype=Object.create(w),t},t.awrap=function(t){return{__await:t}},_(x.prototype),c(x.prototype,a,(function(){return this})),t.AsyncIterator=x,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new x(u(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},_(w),c(w,s,"Generator"),c(w,o,(function(){return this})),c(w,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=P,C.prototype={constructor:C,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEac
2h(O),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,p):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),p},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),O(r),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;O(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),p}},t}function d(t,e,r,n,i,o,a){try{var s=t[o](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,i)}function p(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function h(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?p(Object(r),!0).forEach((function(e){v(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function v(t,e,r){return(e=function(t){var e=function(t,e){if("object"!==l(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==l(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===l(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var m={name:"QuizesTableNew",components:{QuizCreateModal:function(){return Promise.all([r.e(24687),r.e(8898),r.e(63230)]).then(r.bind(r,63230))},QuizStateTag:function(){return r.e(60380).then(r.bind(r,60380))},QuizUpdateModal:function(){return Promise.all([r.e(24687),r.e(8898),r.e(93188)]).then(r.bind(r,93188))},LoadingModal:function(){return Promise.all([r.e(8898),r.e(72950)]).then(r.bind(r,72950))},DropDownMenu:function(){return Promise.all([r.e(8898),r.e(2460)]).then(r.bind(r,2460))}},data:function(){return{busy:!1,currentPage:1,total:0,deleting:!1,transitioning:!1}},props:{quizes:Array,filters:{type:Object,default:function(){return{}}}},computed:h(h({},(0,n.Se)(["isDarkThemeEnabled"])),{},{fields:function(){var t=this;return[{key:"title",sortable:!0},{key:"createdAt",sortable:!0,formatter:function(e){return t.formatDate(e)}},{key:"caseCount",sortable:!0,label:"Cases"},{key:"caseGroupsTitle",sortable:!0,label:"Groups",formatter:function(e){return t.formatTitle(e)}},{key:"actions"}]},tableFilters:function(){var t={};for(var e in this.filters)this.filters[e]&&(t=Object.assign({},t,v({},e,this.filters[e])));return t}}),methods:{onQuizUpdated:function(){this.refreshData()}
2,quizesProvider:function(t){var e=this,r=Object.assign({},{limit:10,page:this.currentPage},t);return this.$api("admin.quizzes.index",r).then((function(t){var r=t.data,n=r.data;return e.total=r.meta.total,n||[]})).catch((function(t){return c().error("Unable to fetch data"),console.error(t),[]}))},refreshData:function(){this.$refs.table.refresh()},formatTitle:function(t){return null==t?void 0:t.map((function(t){return t.title})).join(", ")},formatDate:function(t){return(0,i.Z)(this.parseDate(t),"dd/MM/yyyy HH:mm:ss")},parseDate:function(t){return new Date((0,o.Z)(t))},onDelete:function(t,e){var r,n=this;return(r=f().mark((function t(){var r;return f().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r="Are you sure you want to delete the quiz ".concat(e.title,"? This action cannot be undone!"),t.next=3,n.$bvModal.msgBoxConfirm(r,{title:"Please Confirm",okTitle:"Yes, I am sure, proceed",cancelTitle:"No, cancel operation",cancelVariant:"link text-danger",autoFocusButton:"ok",footerClass:"p-2",hideHeaderClose:!1,centered:!0});case 3:if(!t.sent){t.next=9;break}return n.deleting=!0,t.next=8,n.$api("groups.quizzes.delete",{caseGroup:e.caseGroups[0],id:e.id});case 8:n.$nextTick((function(){n.deleting=!1,n.refreshData()}));case 9:case"end":return t.stop()}}),t)})),function(){var t=this,e=arguments;return new Promise((function(n,i){var o=r.apply(t,e);function a(t){d(o,n,i,a,s,"next",t)}function s(t){d(o,n,i,a,s,"throw",t)}a(void 0)}))})()},getModalId:function(t){var e=t.id;return"quiz-modal-".concat(e)},formData:function(t){var e=null,r=null;return t.users&&t.users.length&&(e=t.users.map((function(t){return t.id}))),t.cases&&t.cases.length&&(r=t.cases.map((function(t){return{location:t.location,title:t.title,studies:t.studies.map((function(t){return t.id}))}}))),{id:t.id,slug:t.slug,title:t.title,description:t.description,dates:{starts_at:this.parseDate(t.starts_at),ends_at:this.parseDate(t.ends_at)},cases:r,users:e}},getDurationLength:function(t){return t.ends_at?(0,a.Z)(this.parseDate(t.starts_at),this.parseDate(t.ends_at)):"Undefined length"},convertCaseForTransition:function(t){return(0,u.sentence)(t)}}},g=m,y=r(93379),b=r.n(y),w=r(50438),_={insert:"head",singleton:!1},x=(b()(w.Z,_),w.Z.locals,(0,r(51900).Z)(g,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"quizes-table-wrapper"},[e("div",{staticClass:"d-flex flex-row align-items-center justify-content-between py-3"},[e("small",[t._v(t._s(t.total)+" quizes found")])]),t._v(" "),e("b-table",{ref:"table",attrs:{id:"quizesTable",busy:t.busy,items:t.quizesProvider,"primary-key":"id",responsive:"sm",dark:t.isDarkThemeEnabled,fields:t.fields,filter:t.tableFilters,"per-page":15,"current-page":t.currentPage},on:{"update:busy":function(e){t.busy=e}},scopedSlots:t._u([{key:"cell(title)",fn:function(r){return[e("div",[e("b-link",{staticClass:"project-title"},[e("h6",[t._v(t._s(r.item.title))])])],1),t._v(" "),e("div",[e("quiz-state-tag",{attrs:{state:r.item.state}}),t._v(" "),"open"===r.item.state&&r.item.caseGroups&&r.item.caseGroups[0]?e("btn",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover",modifiers:{hover:!0}}],attrs:{variant:"light",size:"xs","icon-right":"","icon-name":"fa-angle-right","btn-text":t.$t("cmrad.take_quiz"),title:t.$t("cmrad.take_this_quiz"),href:t.$route("group.quizzes.get",{caseGroup:r.item.caseGroups[0],quiz:r.item.id})}}):t._e()],1)]}},{key:"cell(actions)",fn:function(r){return[r.item.caseGroups[0]?e("div",{staticClass:"actions"},[e("btn",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover",modifiers:{hover:!0}}],staticClass:"mr-2",attrs:{fab:"",icon:"","icon-name":"fa-cog",size:"lg",variant:"light",tag:"inertia-link",title:t.$t("cmrad.configure_quiz"),href:t.$route("group.quizzes.configure",{caseGroup:r.item.caseGroups[0],quiz:r.item.id})}},[e("span",{staticClass:"sr-only"},[t._v("Configure")])]),t._v(" "),e("btn",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover",modifiers:{hover:!0}}],staticClass:"mr-2",attrs:{fab:"",icon:"","icon-name":"fa-edit",size:"lg",variant:"light",tag:"inertia-link",title:t.$t("cmrad.rename_quiz"),href:t.$route("group.quizzes.edit",{caseGroup:r.item.caseGroups[0],quiz:r.item.id})}},[e("span",{staticClass:"sr-only"},[t._v("Edit quiz")])]),t._v(" "),e("drop-down-menu",{attrs:{right:"",lazy:"",nocaret:"",boundary:"window"}},[e("btn",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover",modifiers:{hover:!0}}],attrs:{slot:"dropDownIcon",fab:"",icon:"","icon-name":"fa-ellipsis-h",size:"lg",variant:"light",title:t.$t("cmrad.quiz_actions")},slot:"dropDownIcon"}),t._v(" "),e("fragment",{attrs:{slot:"dropDownContent"},slot:"dropDownContent"},[e("b-dropdown-item",{attrs:{href:t.$route("groups.quizzes.results",{caseGroup:r.item.caseGroups[0],id:r.item.id,version:"1.0"})}},[t._v("\n              "+t._s(t.$t("cmrad.download_results"))+"\n            ")]),t._v(" "),e("b-dropdown-divider"),t._v(" "),e("b-dropdown-item",{attrs:{variant:"danger"},on:{click:function(e){return t.onDelete(e,r.item)}}},[t._v("\n              "+t._s(t.$t("cmrad.delete_quiz"))+"\n            ")])],1)],1)],1):t._e()]}},{key:"cell(lifetime)",fn:function(r){return[r.item.starts_at?e("fragment",[e("p",[t._v(t._s(t.getDurationLength(r.item)))]),t._v("\n        Starting at "+t._s(t.formatDate(r.item.starts_at))+"\n      ")]):e("p",{staticClass:"text-muted"},[t._v("Undefined dates")])]}},{key:"cell(completed_pct)",fn:function(t){return[e("b-progress",{attrs:{variant:"success",value:t.item.completed_pct,"show-progress":""}})]}}])}),t._v(" "),e("div",{staticClass:"d-flex flex-row align-items-center justify-content-between"},[e("b-pagination",{staticClass:"my-3",attrs:{"total-rows":t.total,"per-page":10,"aria-controls":"usersTable"},model:{value:t.currentPage,callback:function(e){t.currentPage=e},expression:"currentPage"}})],1),t._v(" "),e("loading-modal",{model:{value:t.deleting,callback:function(e){t.deleting=e},expression:"deleting"}},[t._v("Deleting quiz...")]),t._v(" "),e("loading-modal",{model:{value:t.busy,callback:function(e){t.busy=e},expression:"busy"}}),t._v(" "),e("loading-modal",{model:{value:t.transitioning,callback:function(e){t.transitioning=e},expression:"transitioning"}},[t._v("Applying state transition")])],1)}
2),[],!1,null,"0b4afc46",null).exports)}}]);
3//# sourceMappingURL=5314.1e8a315d6a1fe005.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.