1import{_ as V,d,g as C,x as a,j as v,c as u,a as o,p as f,b as s,l as t,T as y,w,s as x,o as g,n as A,I as _}from"./B09FnFly.js";import{_ as k}from"./cbtop6NC.js";const h={setup(){d().setMeta(C({type:"raw",object:{title:"Create an Assignment",description:"Create an Assignment and invite your students to create and submit their own Collections from Bunk History."}})),d().setPageTitle("Create an Assignment")},data(){return{form:{name:null,email:null,title:null,date_due:null,instructions:null},errors:{email:null},isCreating:!1,timer:null}},computed:{email:{get(){return this.form.email},set(m){this.form.email=m,this.form.email&&this.form.email.length>5&&a(this.form.email)&&(this.errors.email=null),clearTimeout(this.timer),this.timer=setTimeout(()=>{this.form.email&&this.form.email.length>5&&!a(this.form.email)&&(this.errors.email="Please enter a valid email address.")},1500)}},isSubmittable(){return a(this.form.email)}},methods:{async onSubmit(){this.isCreating=!0;try{await v().createAssignment({creator_name:this.form.name,creator_email:this.form.email,title:this.form.title,date_due:this.form.date_due,description:this.form.instructions}),this.$router.push("/assignments/created"),this.isCreating=!1}catch{this.isCreating=!1}}}},S={class:"collection-wrap page-wrap theme--collection theme--dark"},T={class:"page--center"},I={key:0,class:"modal modal--dark modal--saving"},N={class:"collection-form"},U={class:"form-actions"},B=["disabled"];function q(m,e,D,M,l,i){const p=_,b=x,r=k;return g(),u("div",S,[o(b,{to:"/assignments",class:"close-button"},{default:f(()=>[o(p),e[6]||(e[6]=s()),e[7]||(e[7]=t("span",{class:"sr-only"},"Return to âHow Assignments Workâ",-1))]),_:1}),e[21]||(e[21]=s()),t("div",T,[o(y,{name:"fademodalinner"},{default:f(()=>[l.isCreating?(g(),u("div",I,e[8]||(e[8]=[t("div",{class:"modal__vp"},[t("div",{class:"modal__content"},[t("div",{class:"circleloader circleloader--xl","data-is-spinning":"true"}),s(),t("span",null,"Creating your Assignment")])],-1)]))):A("",!0)]),_:1}),e[20]||(e[20]=s()),t("div",N,[e[18]||(e[18]=t("header",{class:"collection-form__header"},[t("h1",{class:"hed--bordered"},"Create an Assignment."),s(),t("p",{class:"form-description"},` 2 Provide your email address, and we will send you an Assignment ID 3 code along with a URL to share with your students. 4 `)],-1)),e[19]||(e[19]=s()),t("form",null,[o(r,{modelValue:l.form.name,"onUpdate:modelValue":e[0]||(e[0]=n=>l.form.name=n),required:!0,name:"assignment-name",label:"Name",theme:"bordered"},null,8,["modelValue"]),e[9]||(e[9]=s()),o(r,{modelValue:i.email,"onUpdate:modelValue":e[1]||(e[1]=n=>i.email=n),required:!0,error:l.errors.email,name:"assignment-email",type:"email",label:"Email Address",theme:"bordered"},null,8,["modelValue","error"]),e[10]||(e[10]=s()),e[11]||(e[11]=t("hr",null,null,-1)),e[12]||(e[12]=s()),o(r,{modelValue:l.form.title,"onUpdate:modelValue":e[2]||(e[2]=n=>l.form.title=n),name:"assignment-title",label:"Assignment Title",theme:"bordered"},null,8,["modelValue"]),e[13]||(e[13]=s()),o(r,{modelValue:l.form.date_due,"onUpdate:modelValue":e[3]||(e[3]=n=>l.form.date_due=n),name:"assignment-date_due",label:"Date Due",theme:"bordered"},null,8,["modelValue"]),e[14]||(e[14]=s()),o(r,{modelValue:l.form.instructions,"onUpdate:modelValue":e[4]||(e[4]=n=>l.form.instructions=n),limit:500,name:"assignment-instructions",type:"textarea",label:"Instructions",theme:"bordered"},null,8,["modelValue"]),e[15]||(e[15]=s()),t("div",U,[t("button",{disabled:!i.isSubmittable,type:"submit",class:"button button--green",onClick:e[5]||(e[5]=w((...n)=>i.onSubmit&&i.onSubmit(...n),["prevent"]))},` 5 Create Assignment 6 `,8,B)]),e[16]||(e[16]=s()),e[17]||(e[17]=t("footer",{class:"collection-form__footer"},[t("small",null," * required field ")],-1))])])])])}const j=V(h,[["render",q]]);export{j as default};
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.