当前位置: 首页>>代码示例>>PHP>>正文


PHP Quiz::create方法代码示例

本文整理汇总了PHP中Quiz::create方法的典型用法代码示例。如果您正苦于以下问题:PHP Quiz::create方法的具体用法?PHP Quiz::create怎么用?PHP Quiz::create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Quiz的用法示例。


在下文中一共展示了Quiz::create方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: addQuiz

 public function addQuiz()
 {
     $in = Input::all();
     $rules = ['name' => 'required', 'topic' => 'required'];
     $validation = Validator::make($in, $rules);
     if ($validation->passes()) {
         $quiz = Quiz::create(['name' => $in['name'], 'OwnerID' => Auth::user()->StudentID, 'quizTopic' => $in['topic']])->id;
         return Redirect::to('/')->with('message', 'Quiz successfully created')->with('url', '/quiz/view/' . $quiz);
     }
     return Redirect::to('/')->with('message', 'Error quiz creation. Click view to create again')->with('url', '/quiz/create/');
 }
开发者ID:NoName1771,项目名称:QCPU-Social-Web-App,代码行数:11,代码来源:QuizController.php

示例2: Quiz

     break;
 case 1:
     // save the quiz information
     // get the unikey from the form
     $key = $_POST['unikey'];
     $type = $_GET['type'];
     $mode = $_GET['mode'];
     // save the data from step 1
     $quiz_picture = $_POST['result_picture_0'] != "" ? $_POST['result_picture_0'] : "none.gif";
     if (isset($_POST['id'])) {
         $quiz = new Quiz($_POST['id']);
         $quiz_id = $quiz->update($_POST['quiz_title'], $_POST['quiz_description'], $_POST['quiz_cat'], $quiz_picture, $member->id);
     } else {
         $quiz = new Quiz();
         //function createQuiz($title, $description, $cat, $picture, $member_id, $key, $display_mode) from quiz.php
         $quiz_id = $quiz->create($_POST['quiz_title'], $_POST['quiz_description'], $_POST['quiz_cat'], $quiz_picture, $member->id, $key, $mode);
     }
     // direct them to step 2
     //if($_POST['save'] == "Previous Step"){
     //header("Location: ../webroot/createQuiz.php?step=0");
     //}else{
     header("Location: ../webroot/createQuiz.php?step=2&id=" . $quiz_id);
     //}
     break;
 case 2:
     // save the quiz results
     // get the id from the form
     $quiz_id = $_POST['id'];
     //***********************************************ADD BY LIEN************************************************//
     $queryMode = sprintf("SELECT display_mode FROM q_quizzes WHERE quiz_id = %d", $quiz->quiz_id);
     $resultMode = mysql_query($queryMode, $quizroo) or die(mysql_error());
开发者ID:Jessicasoon,项目名称:ProjectKentRidgeV2,代码行数:31,代码来源:modifyQuizEngine.php


注:本文中的Quiz::create方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。